tepples wrote:Do you know the value of the B register at any given moment
I imagine the initialization routine sets it to 0, but how do you interact with the B register again? is it "tab", kind of like "tcd" with the d register? (there's only 24 bits of addressable space, so B would only be 8 bits)
tepples wrote:A general strategy of B=K is more viable in LoROM than in HiROM.
What's "K"?
tepples wrote:you can prove out "appears to crash before it even gets here" by using debug breakpoints and the emulator's memory viewer/hex editor.
Do you know how to place a breakpoint in the bsnes debugger? I don't know what all these fields mean. The options other than "Exec" are Read, and Write.

- Breakpoint Editor.png (4.22 KiB) Viewed 2433 times
Really though, I don't know how it's doing this, and I even put an stp before and then moved it to after the initialization routine and it's till messed up. I think my configuration file must be messed up or something, considering I made it.
This is the HiROM configuration file I made using your advice. There's probably an error somewhere.
Code: Select all
# ca65 linker config for 256 KiB (2 Mbit) sfc file
# Physical areas of memory
MEMORY {
ZEROPAGE: start = $000000, size = $0100; # $0000-00ff -- zero page
# $0100-01ff -- stack
BSS: start = $000200, size = $1e00; # $0200-1fff -- RAM
BSS7E: start = $7e2000, size = $e000; # SNES work RAM, $7e2000-7effff
BSS7F: start = $7f0000, size = $10000; # SNES work RAM, $7f0000-$7ffff
ROM0: start = $C00000, size = $10000, fill = yes;
ROM1: start = $C00000, size = $10000, fill = yes;
ROM2: start = $C00000, size = $10000, fill = yes;
ROM3: start = $C00000, size = $10000, fill = yes;
ROM4: start = $C00000, size = $10000, fill = yes;
ROM5: start = $C00000, size = $10000, fill = yes;
ROM6: start = $C00000, size = $10000, fill = yes;
ROM7: start = $C00000, size = $10000, fill = yes;
}
# Logical areas code/data can be put into.
SEGMENTS {
CODE: load = ROM0, align = $100;
RODATA: load = ROM0, align = $100;
SNESHEADER: load = ROM0, start = $C0FFC0;
CODE1: load = ROM1, align = $100, optional = yes;
RODATA1: load = ROM1, align = $100, optional = yes;
CODE2: load = ROM2, align = $100, optional = yes;
RODATA2: load = ROM2, align = $100, optional = yes;
CODE3: load = ROM3, align = $100, optional = yes;
RODATA3: load = ROM3, align = $100, optional = yes;
CODE4: load = ROM4, align = $100, optional = yes;
RODATA4: load = ROM4, align = $100, optional = yes;
CODE5: load = ROM5, align = $100, optional = yes;
RODATA5: load = ROM5, align = $100, optional = yes;
CODE6: load = ROM6, align = $100, optional = yes;
RODATA6: load = ROM6, align = $100, optional = yes;
CODE7: load = ROM7, align = $100, optional = yes;
RODATA7: load = ROM7, align = $100, optional = yes;
ZEROPAGE: load = ZEROPAGE, type = zp;
BSS: load = BSS, type = bss, align = $100, optional = yes;
BSS7E: load = BSS7E, type = bss, align = $100, optional = yes;
BSS7F: load = BSS7F, type = bss, align = $100, optional = yes;
}
And also, here's the header. I edited it slightly too.
Code: Select all
MAPPER_LOROM = $20
MAPPER_HIROM = $21
ROMSPEED_200NS = $00
ROMSPEED_120NS = $10
;ROM and backup RAM sizes are expressed as log2(size in bytes) - 10
MEMSIZE_NONE = $00
MEMSIZE_2KB = $01
MEMSIZE_4KB = $02
MEMSIZE_8KB = $03
MEMSIZE_16KB = $04
MEMSIZE_32KB = $05
MEMSIZE_64KB = $06
MEMSIZE_128KB = $07
MEMSIZE_256KB = $08
MEMSIZE_512KB = $09
MEMSIZE_1MB = $0A
MEMSIZE_2MB = $0B
MEMSIZE_4MB = $0C
REGION_JAPAN = $00
REGION_AMERICA = $01
REGION_PAL = $02
;======================================================================
.segment "SNESHEADER"
;======================================================================
romname:
.byte "SNES Splatoon"
.assert * - romname <= 21, error, "ROM name too long"
.if * - romname < 21
.res romname + 21 - *, $20 ; space padding
.endif
.byte MAPPER_HIROM|ROMSPEED_120NS
.byte $00 ; 00: no extra RAM; 02: RAM with battery
.byte MEMSIZE_256KB ; ROM size (08-0C typical)
.byte MEMSIZE_NONE ; backup RAM size (01,03,05 typical; Dezaemon has 07)
.byte REGION_AMERICA ; region code
.byte $33 ; publisher id, or $33 for "see 16 bytes before header"
.byte $00 ; ROM revision number
.word $0000 ; Checksum of all bytes will be poked here after linking
.word $0000 ; $FFFF minus above sum will also be poked here
.res 4 ; Unused vector space
;Native 65816 vectors
;NOTE: Reset vector set to $FFFF because it doesn't serve a purpose here;
;the 65816 starts up in emulation mode (even on soft reset).
.addr EmptyHandler ; 65816 COP vector
.addr EmptyHandler ; 65816 BRK vector
.addr EmptyHandler ; 65816 ABORT vector
.addr VBlank ; 65816 NMI vector
.addr $0000 ; 65816 RESET vector -- see above
.addr EmptyHandler ; 65816 IRQ vector
.res 4 ; Unused vector space
;6502/65c02 vectors
;NOTE: BRK vector set to $FFFF because 6502/65c02 doesn't have an actual
;BRK vector, it only has an IRQ vector.
.addr EmptyHandler ; 6502/65c02 COP vector
.addr $0000 ; 6502/65c02 BRK vector -- see above
.addr EmptyHandler ; 6502/65c02 ABORT vector
.addr EmptyHandler ; 6502/65c02 NMI vector
.addr Main ; 6502/65c02 RESET vector
.addr EmptyHandler ; 6502/65c02 IRQ vector
;These are vectors which are essentially unused on the SNES, i.e.
;defined to meet ca65 design requirements.
;
;The only ones which could be used are cop_handler, brk_handler,
;abort_handler, and irq_handler, but at present those do not serve
;a purpose for this game.
;======================================================================
.segment "CODE"
;======================================================================
.proc EmptyHandler
rti
.endproc
.proc EmptyVBlank
rep #30
pha
php
sep #$20
lda $4210 ;clear NMI Flag
plp
pla
rti
.endproc