Give me some hours, maybe I can come up with something for the LEVEL text.
September 20, 2020, 12:19:16 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Okay this is what I found so far.
The PPU transfer for the "LEVEL-0" string is located at 0x19D14 in the ROM, or $19D04 in NES address.
Here's what's in there:
// LEVEL-X text
org $9D04 // $19D14
db $20,$42,$07
db "LEVEL-0"
db $FF
The first 3 bytes specify the PPU address where to start printing it, and then comes the actual letters, then the end command "FF" for PPU transfers. Changing this to say DUNGEON-0 would be like this:
// LEVEL-X text
org $9D04 // $19D14
db $20,$42,$09
db "DUNGEON-0"
db $FF
However, trouble arises when we try to make the room for the 2 additional bytes we require.
The LEVEL text and its PPU transfer don't seem to have any direct pointer that I can track down. I tried debugging it a little bit, and I came to the same routine you guys hit, with no direct reference to $9D04 that I could tell.
The whole routine for this I will post next, however I am unfamiliar with most of the opcodes here, so I'm at a bit of a loss here.
Once the PPU transfer is dealt with, there's still the numeral that gets placed depending on the Dungeon number, which always gets sent to PPU $205C, so we would also need to locate the code that handles that.
1A0A2: 48 PHA
1A0A3: 8D 0620 STA $2006
1A0A6: C8 INY
1A0A7: B1 00 LDA ($00),Y
1A0A9: 8D 0620 STA $2006
1A0AC: C8 INY
1A0AD: B1 00 LDA ($00),Y
1A0AF: 0A ASL
1A0B0: 48 PHA
1A0B1: A5 FF LDA $FF
1A0B3: 09 04 ORA #$04 ; set bits .... .x..
1A0B5: B0 02 BCS $1A0B9
1A0B7: 29 FB AND #$FB ; keep bits xxxx x.xx
1A0B9: 8D 0020 STA $2000
1A0BC: 85 FF STA $FF
1A0BE: 68 PLA
1A0BF: 0A ASL
1A0C0: 08 PHP
1A0C1: 90 03 BCC $1A0C6
1A0C3: 09 02 ORA #$02 ; set bits .... ..x.
1A0C5: C8 INY
1A0C6: 28 PLP
1A0C7: 18 CLC
1A0C8: D0 01 BNE $1A0CB
1A0CA: 38 SEC
1A0CB: 6A ROR
1A0CC: 4A LSR
1A0CD: AA TAX
1A0CE: B0 01 BCS $1A0D1
1A0D0: C8 INY
1A0D1: B1 00 LDA ($00),Y
1A0D3: 8D 0720 STA $2007
1A0D6: CA DEX
1A0D7: D0 F5 BNE $1A0CE
1A0D9: 68 PLA
1A0DA: C9 3F CMP #$3F
1A0DC: D0 0C BNE $1A0EA
1A0DE: 8D 0620 STA $2006
1A0E1: 8E 0620 STX $2006
1A0E4: 8E 0620 STX $2006
1A0E7: 8E 0620 STX $2006
1A0EA: 38 SEC
1A0EB: 98 TYA
1A0EC: 65 00 ADC $00
1A0EE: 85 00 STA $00
1A0F0: A9 00 LDA #$00 ; A = 00
1A0F2: 65 01 ADC $01
1A0F4: 85 01 STA $01
1A0F6: AE 0220 LDX $2002
1A0F9: A0 00 LDY #$00 ; Y = 00
1A0FB: B1 00 LDA ($00),Y
1A0FD: 10 A3 BPL $1A0A2
1A0FF: 60 RTS