Neat! Another Z-machine to poke at!
I've got my environment almost set up. I'm going with a SXROM but having issues getting an emulator to take my header.
I'm going with a 512K PRG-ROM with 32K PRG-RAM and an 8K CHR-ROM
My header looks like this
Code: Select all
.byte "NES",$1A ; "NES"^Z
.byte $20 ; 4 - ines prg - Specifies the number of 16k prg banks.
.byte $01 ; 5 - ines chr - Specifies the number of 8k chr banks.
.byte %00010001 ; 6 - MMC1 and vert mirror
.byte %00001000 ; 7 - nes2.0 header
.byte $00 ; 8 - ines map - Specifies the NES mapper used.
.byte $00 ; flags 9
.byte $00 ; flags 10
.byte $00 ; flags 11
.byte $00 ; flags 12
.byte $00 ; flags 13
.byte $00 ; flags 14
.byte $00 ; flags 15
and my nes.ini config file I'm feeding into ld65 with -c looks like this.
Code: Select all
MEMORY {
ZP: start = $0, size = $ff, type = rw;
HEADER: start = 0, size = $0010, type = ro, file = %O, fill=yes;
RAM: start = $0300, size = $0500, type = rw;
ROM00: start = $8000, size = $4000, type = ro, file = %O, fill=yes, fillval=$FF;
ROM01: start = $8000, size = $4000, type = ro, file = %O, fill=yes, fillval=$FF;
ROM02: start = $8000, size = $4000, type = ro, file = %O, fill=yes, fillval=$FF;
(They repeat here... you get the picture)
ROM31: start = $C000, size = $4000, type = ro, file = %O, fill=yes, fillval=$FF;
}
SEGMENTS {
INESHDR: load = HEADER, type = ro;
ZEROPAGE: load = ZP, type = zp;
BSS: load = RAM, type = bss, define = yes, align = $100;
DMC: load = ROM31, type = ro, align = 64, optional = yes;
CODE: load = ROM31, type = ro, align = $100;
RODATA: load = ROM31, type = ro, align = $100;
VECTORS: load = ROM31, type = ro, start = $FFFA;
}
FILES {
%O: format = bin;
}
I also have a 8k char file (It has the text) I append to the end of the .NES file with a copy /b command
Both NO$NES and FECUX are telloing my header is invalid
What's the proper format?
Also is there a way to "include" my char rom at compile time so I don't need to append it with a copy command afterwards?