It is currently Mon Sep 16, 2019 1:54 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed Sep 11, 2019 11:09 am 
Offline

Joined: Mon Jul 03, 2017 4:37 pm
Posts: 137
Hey guys,

A few months ago, I had asked about ways to do a bitmap mode on the NES, and the responses were quite good.

As it happens, I ran across the 8-bit-workshop's NES environment he had just added, and one of the examples was for a mono-bitmap.

After talking with sehugg, I managed to get the neslib2 fork he did, and cobble together enough screen logic for PLATOTERM to work (I had to replace the line draw routine with a proper bresenham that can take care of a few edge cases), and so...here it is!

Image

Code is here:
http://github.com/tschak909/platotermnes

Rom is attached.

This begs the question, how to implement I/O?

It needs at the very least, a keyboard, and a way to shift ascii bytes coming to and from the host, either over serial link or via ethernet.

I was thinking something like a Raspberry Pi Zero embedded on the cartridge?

What do you think? (also yeah, need some help making the rendering faster, naively only one vram change is happening per frame to avoid overruns)

-Thom


Attachments:
plato.nes [40.02 KiB]
Downloaded 11 times
Top
 Profile  
 
PostPosted: Thu Sep 12, 2019 4:37 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 1187
Location: Hokkaido, Japan
Looks great!
But plato.nes does not work properly on any emulator I tried it with (Mesen, Nintendulator and FCEux). It looks like you are not clearing the screen before you draw to it. Any uninitialized RAM will have undefined content and should be initialized to known values.


As for I/O there is already a keyboard which is commonly recommended for this kind of thing. It already has a cult following, is quite cheap and it's in pretty good quantity.
There are various attempts to adapt PS/2 keyboards to the Family BASIC keyboard's protocol. One is here.

For a pointing device there is a poorly supported trackball (Hori Track) and some computer style Famiclones like Subor has their own mouse protocol. But for homebrew it's more popular to use the SNES mouse. It's quite cheap and in good quantity. Emerson's adapter that I linked above also seems to include PS/2 mouse support.


Top
 Profile  
 
PostPosted: Thu Sep 12, 2019 6:43 am 
Offline

Joined: Mon Jul 03, 2017 4:37 pm
Posts: 137
Noted. :)

The reason I suggested the Raspberry Pi Zero is because:

(1) low power
(2) cheap
(3) it's everywhere
(4) it has network, and usb for keyboard and mouse.

-Thom

Pokun wrote:
Looks great!
But plato.nes does not work properly on any emulator I tried it with (Mesen, Nintendulator and FCEux). It looks like you are not clearing the screen before you draw to it. Any uninitialized RAM will have undefined content and should be initialized to known values.


As for I/O there is already a keyboard which is commonly recommended for this kind of thing. It already has a cult following, is quite cheap and it's in pretty good quantity.
There are various attempts to adapt PS/2 keyboards to the Family BASIC keyboard's protocol. One is here.

For a pointing device there is a poorly supported trackball (Hori Track) and some computer style Famiclones like Subor has their own mouse protocol. But for homebrew it's more popular to use the SNES mouse. It's quite cheap and in good quantity. Emerson's adapter that I linked above also seems to include PS/2 mouse support.


Top
 Profile  
 
PostPosted: Fri Sep 13, 2019 2:42 am 
Offline
Site Admin
User avatar

Joined: Mon Sep 20, 2004 6:04 am
Posts: 3722
Location: Indianapolis
Pretty neat. It's broken in Mesen and Nintendulator, though. I can probably test it on an NES tomorrow, but when something fails on Nintendulator it's extremely likely to be the same on NES. I noticed the .NES file has CHR-ROM attached, though in the header it's set to CHR-RAM. Removing it didn't affect the emulator problems, but now I'm curious if that situation will break my GTROM bootloader.

A USB-to-UART adapter connected to the controller port is enough to turn it into a software problem. It's not an ideal setup since the NES no UART, but they're simple and cheap, I've built at least 30 of them that are out in the wild. I could get one to you, if it would help. Doing the UART in software means the communication has to be totally driven by the NES, the NES can send data at any time, but to receive data NES will have to request it, then wait for it.

Haven't worked on it recently, but I have done some work on making a custom adapter based on a PIC161454. That would provide buffering, USB interface (CDC), and a synchronous interface for the NES controller port, so data would be ready anytime for the NES to read. Needs a board rev and for the firmware to be finished though..
https://twitter.com/JoeParsell/status/984317904098349057

Either of those USB interfaces like that could connect to a Raspberri Pi, or a PC, or Android phone. That kind of been a goal of mine to make host software that supports a lot of this stuff, after a long time I haven't focused on it often enough to get it all done. Should be possible to do remote file loading, mouse, keyboard, it has some internet access using libcurl. I figure I could make this open source, just haven't had it in a usable enough state. I'm writing it in C and tries to be non-OS-specific (using libraries like SDL for keyboard and mouse). Having some ready-made applications like this around makes it potentially more interesting to work on, for sure.


Top
 Profile  
 
PostPosted: Fri Sep 13, 2019 12:11 pm 
Offline

Joined: Mon Jul 03, 2017 4:37 pm
Posts: 137
Memblers wrote:
Pretty neat. It's broken in Mesen and Nintendulator, though. I can probably test it on an NES tomorrow, but when something fails on Nintendulator it's extremely likely to be the same on NES. I noticed the .NES file has CHR-ROM attached, though in the header it's set to CHR-RAM. Removing it didn't affect the emulator problems, but now I'm curious if that situation will break my GTROM bootloader.

A USB-to-UART adapter connected to the controller port is enough to turn it into a software problem. It's not an ideal setup since the NES no UART, but they're simple and cheap, I've built at least 30 of them that are out in the wild. I could get one to you, if it would help. Doing the UART in software means the communication has to be totally driven by the NES, the NES can send data at any time, but to receive data NES will have to request it, then wait for it.

Haven't worked on it recently, but I have done some work on making a custom adapter based on a PIC161454. That would provide buffering, USB interface (CDC), and a synchronous interface for the NES controller port, so data would be ready anytime for the NES to read. Needs a board rev and for the firmware to be finished though..
https://twitter.com/JoeParsell/status/984317904098349057

Either of those USB interfaces like that could connect to a Raspberri Pi, or a PC, or Android phone. That kind of been a goal of mine to make host software that supports a lot of this stuff, after a long time I haven't focused on it often enough to get it all done. Should be possible to do remote file loading, mouse, keyboard, it has some internet access using libcurl. I figure I could make this open source, just haven't had it in a usable enough state. I'm writing it in C and tries to be non-OS-specific (using libraries like SDL for keyboard and mouse). Having some ready-made applications like this around makes it potentially more interesting to work on, for sure.



The terminal code is complete, and fits into the ROM space (and the standard RAM space, just barely), it just needs I/O to work...and a faster output routine, right now the dots are being drawn one per frame (to avoid overrun)....

The core of the terminal literally lives in protocol.c and terminal.c, with screen, touch, keyboard etc being the system specific parts. Careful separation and rigid use of lowest common denominator C really made this code portable (currently at almost 24 platforms, even javascript in web browser)

To see what's possible, you can literally go to: http://www.irata.online/ and click on the orange login button, or download one of the terminals for vintage or modern systems.

I would _REALLY_ like to see PLATOTERM running on the NES.

-Thom


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group