Page 2 of 5
Re: Thinking about making an NES Z-Machine
Posted: Tue Jan 29, 2019 9:10 am
by FrankenGraphics
btw, not that this is unique to the NES, but one of the design problems with keeping lots of text in a tile graphics game is that reading monospaced glyphs is fatiguing. But there's plenty of space to add adjusted small letters. This example only has a few common adjustments - i had another more worked-through proof of concept but it i can't find it for the time being. At least this shows that you can have a fairly detailed font and symbol set and still have room for decorative graphics, even without chr banking tricks.
Re: Thinking about making an NES Z-Machine
Posted: Tue Jan 29, 2019 10:26 am
by tepples
Years back, when tpw_rules was trying to make a Z-machine interpreter, I wrote a terminal library that uses interrupts and palette trickery to make a full-screen VWF plane. (See
previous topic.) But if you're using one of the low-cost boards (UNROM 512 or GTROM), this won't work unless you're willing to do some deep DMC magic.
Re: Thinking about making an NES Z-Machine
Posted: Tue Jan 29, 2019 11:36 am
by zeroone
Will this require the Subor keyboard?
Re: Thinking about making an NES Z-Machine
Posted: Tue Jan 29, 2019 12:23 pm
by cpow
halkun wrote:Nesicide looks cool, but there isn't a Windows version. The download link is broken. Shame as that looks really promising!
Thanks for pointing that out!
I've been trying to get a Travis Windows CI deployment set up but it's new for them so isn't working just yet. In the excitement of it all I accidentally blew away the images I'd put up manually. I'm resurrecting my Windows VM now and should have a manual Windows build back online from that in a few hours.
Re: Thinking about making an NES Z-Machine
Posted: Tue Jan 29, 2019 7:20 pm
by halkun
As a wait on the windows Nesticide upload, I'm still looking at the different mappers. MMC5 has banked switched RAM, but what other ones have that ability?
So looking around it appears I need a mapper that can.
1) Bank out one half of the ROM. One fixed bank for the Z-Machine Kernel and one bank for the story file.
2) The ability to bank out the 8K RAM - I need at least 16K, but I guess 32K would be great
3) The mapper needs to be supported by an emulator with a debugger
From the looks of it SXROM would be my best bet as it seems I can buy repo boards from infiniteneslives.com and it allows for 512KB of ROM and 32KB of RAM I'm checking the MMC1 page and it appears that actually doing the bank switching is a little strange, but I'm sure with a few experiments I'll figure it out.
Now I need to figure out how to make ld65 spit out a generic, empty SXROM image.
Re: Thinking about making an NES Z-Machine
Posted: Tue Jan 29, 2019 7:29 pm
by lidnariq
halkun wrote:MMC5 has banked switched RAM, but what other ones have that ability?
Commercially, it's only MMC5 and some MMC1 variants (SXROM , SOROM, SZROM ).
Recently we observed that FME-7 is physically capable of it, but emulator support isn't particularly widespread.
When/if you get as far as making hardware, we could design inexpensive things that would support multiple banks of PRG RAM.
Re: Thinking about making an NES Z-Machine
Posted: Tue Jan 29, 2019 7:34 pm
by tokumaru
Using an MMC5 for text games seems like overkill to me...
Re: Thinking about making an NES Z-Machine
Posted: Tue Jan 29, 2019 9:06 pm
by tepples
halkun wrote:Now I need to figure out how to make ld65 spit out a generic, empty SXROM image.
snrom-template gets you halfway there; you just have to change the header to NES 2.0.
Re: Thinking about making an NES Z-Machine
Posted: Wed Jan 30, 2019 3:25 am
by calima
dougeff wrote:The default is c64
No. The default is NULL, which indexes in the target enum to TGT_NONE, which sets target as "none" and target CPU as CPU_6502.... and sets the character map to "CTNone" which is the same character map that is set if NES is target.
https://github.com/cc65/cc65/blob/maste ... in.c#L1434
Apparently cl65 and cc65 have different defaults.
Re: Thinking about making an NES Z-Machine
Posted: Wed Jan 30, 2019 7:01 am
by dougeff
That, I didn't know.
This inconsistency seems like a bad idea, maybe someone should do a pull request?
Re: Thinking about making an NES Z-Machine
Posted: Wed Jan 30, 2019 7:57 am
by halkun
tepples wrote:halkun wrote:Now I need to figure out how to make ld65 spit out a generic, empty SXROM image.
snrom-template gets you halfway there; you just have to change the header to NES 2.0.
I wasn't able to get this to compile under Windows. I'll give it another shot and tell you the error I'm getting.
Re: Thinking about making an NES Z-Machine
Posted: Wed Jan 30, 2019 9:57 am
by nocash
Good luck with the template. That looks huge. I've always manually defined the 16 header bytes.
Banked RAM might be required, especially if a game requires more than one bank for the current game state (without even thinking about save states). Using FLASH for savestates would be also fine - but you could think about that later.
Which mapper to use isn't so important, you could probably easily change it later once when the game is working. As long as you stick with a central bank switching function/macro, or at least use some symbolic constant for the mapper I/O registers.
MMC1 requires five writes to change a 5bit register. MMC5 needs only one write, so that would be faster. And MMC5 might be more common & more widely supported for large memory. But either one should be fine for getting started.
Re: Thinking about making an NES Z-Machine
Posted: Wed Jan 30, 2019 10:05 am
by cpow
halkun wrote:As a wait on the windows Nesticide upload, I'm still...

I haven't had someone call it nesticide since a former coworker decided that was what I was saying.
I had some troubles with my Windows VM yesterday. So I'm currently attempting to build on a native Windows laptop.
WRT the SNROM template, I had put a
nesicide project based on it up on my google site *long ago*.
I will try compiling that once I get a Windows build and report back.
Re: Thinking about making an NES Z-Machine
Posted: Wed Jan 30, 2019 10:25 am
by tepples
Looking at the makefile, I think I know what's wrong under Windows: the Python executable on the PATH is called
py.exe, not
python3.exe. When I discovered this, I changed the makefiles of a lot of my other projects to compensate for this using an
ifdef COMSPEC clause to detect the host OS, but I had missed snrom-template. Commit
4f11fad should fix it.
Re: Thinking about making an NES Z-Machine
Posted: Wed Jan 30, 2019 11:44 am
by cpow
tepples wrote:Looking at the makefile, I think I know what's wrong under Windows: the Python executable on the PATH is called
py.exe, not
python3.exe. When I discovered this, I changed the makefiles of a lot of my other projects to compensate for this using an
ifdef COMSPEC clause to detect the host OS, but I had missed snrom-template. Commit
4f11fad should fix it.
I just googled for something equivalent to this and found:
Code: Select all
OSTYPE=`wmic os get osarchitecture`
if [[ $OSTYPE =~ .*64*. ]]; then
...
fi