diff --git a/tb_snes/snes-hirom.cfg b/tb_snes/snes-hirom.cfg index 5a20506..147d5c6 100644 --- a/tb_snes/snes-hirom.cfg +++ b/tb_snes/snes-hirom.cfg @@ -1,6 +1,6 @@ # # Attempts a proper layout for a SNES HiROM image -# +# This one is a 512kB (4Mbit) image #------------------------------------------------------------------------------ # @@ -13,7 +13,7 @@ MEMORY { RAM: start = $7e2000, size = $e000, type = rw, define = yes; STACK: start = $000000, size = $2000, type = rw, define = yes; SRAM: start = $006000, size = $2000, type = rw, define = yes; - MOREROM: start = $410000, size = $10000, type = ro, file = %O, fill = yes, define = yes; + MOREROM: start = $410000, size = $70000, type = ro, file = %O, fill = yes, define = yes; } #------------------------------------------------------------------------------ # diff --git a/tb_snes/tb1_snes.s b/tb_snes/tb1_snes.s index facb73d..6bf9195 100644 --- a/tb_snes/tb1_snes.s +++ b/tb_snes/tb1_snes.s @@ -293,8 +293,10 @@ output: .byte $01 ; Country Code (1=NTSC,2=PAL) .byte $00 ; License Code (0=unassigned) .byte $00 ; Version - .byte $7f, $73, $80, $8c ; Unsigned 16-bit sum of ROM - .byte $ff, $ff, $ff, $ff ; Complement of checksum + .word $37f8 ; Unsigned 16-bit sum of ROM + .word $c807 ; Complement of checksum + + .word $0,$0 ; unknown? ; Interrupt Vectors! diff --git a/tb_snes/tools/Makefile b/tb_snes/tools/Makefile index fffe4da..8d223c3 100644 --- a/tb_snes/tools/Makefile +++ b/tb_snes/tools/Makefile @@ -5,7 +5,8 @@ LFLAGS = all: bin2byte color_convert convert_font convert_font_bin \ dump_font make_pal pcx_to_sprite \ pcx_to_tiles_4bpp pcx_to_tiles_8bpp \ - ansi_to_tile string_to_bytes convert_font_4bpp + ansi_to_tile string_to_bytes convert_font_4bpp \ + snes_checksum ansi_to_tile: ansi_to_tile.o @@ -94,11 +95,18 @@ string_to_bytes.o: string_to_bytes.c $(CC) $(CFLAGS) -c string_to_bytes.c +snes_checksum: snes_checksum.o + $(CC) $(LFLAGS) -o snes_checksum snes_checksum.o + +snes_checksum.o: snes_checksum.c + $(CC) $(CFLAGS) -c snes_checksum.c + + clean: rm -f *.o *~ bin2byte color_convert convert_font \ convert_font_bin dump_font make_pal pcx_to_sprite \ pcx_to_tiles_4bpp pcx_to_tiles_8bpp \ ansi_to_tile string_to_bytes \ - convert_font_4bpp + convert_font_4bpp snes_checksum diff --git a/tb_snes/tools/snes_checksum.c b/tb_snes/tools/snes_checksum.c new file mode 100644 index 0000000..af58b8f --- /dev/null +++ b/tb_snes/tools/snes_checksum.c @@ -0,0 +1,27 @@ +#include + +int main(int argc, char **argv) { + + int byte; + unsigned int total=0; + unsigned short checksum; + + while(1) { + byte=fgetc(stdin); + if (byte<0) break; + + total+=byte; + + } + + checksum=total&0xffff; + + printf("Checksum: %hx\n",checksum); + printf("Complement: %hx\n",~checksum); + + return 0; + + +} + + \ No newline at end of file