News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: The Guardian Legend Bank Switching UNROM  (Read 1831 times)

Dracula X

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
    • My YouTube Page for ROM hacking
The Guardian Legend Bank Switching UNROM
« on: July 24, 2015, 02:10:29 pm »
While I was practicing on placing bank 0 to bank 7, I was able to bank switch the whole thing into a new bank.

Code: [Select]
__d705:     sta $04            ; $d705: 85 04
            tya                ; $d707: 98       
            pha                ; $d708: 48       
            ldy $04            ; $d709: a4 04     
            lda __fff2,y       ; $d70b: b9 f2 ff 
            sta __fff2,y       ; $d70e: 99 f2 ff 
            pla                ; $d711: 68       
            tay                ; $d712: a8       
            rts                ; $d713: 60       

;-------------------------------------------------------------------------------
__d714:     pha                ; $d714: 48        Bank0
            lda #$00           ; $d715: a9 00     
            sta $04            ; $d717: 85 04     
            lda __fff2         ; $d719: ad f2 ff 
            sta __fff2         ; $d71c: 8d f2 ff 
            pla                ; $d71f: 68       
            rts                ; $d720: 60       

;-------------------------------------------------------------------------------
            pha                ; $d721: 48        Bank1
            lda #$01           ; $d722: a9 01     
            sta $04            ; $d724: 85 04     
            lda __fff3         ; $d726: ad f3 ff 
            sta __fff3         ; $d729: 8d f3 ff 
            pla                ; $d72c: 68       
            rts                ; $d72d: 60       

;-------------------------------------------------------------------------------
            pha                ; $d72e: 48        Bank2
            lda #$02           ; $d72f: a9 02     
            sta $04            ; $d731: 85 04     
            lda __fff4         ; $d733: ad f4 ff 
            sta __fff4         ; $d736: 8d f4 ff 
            pla                ; $d739: 68       
            rts                ; $d73a: 60       

;-------------------------------------------------------------------------------
__d73b:     pha                ; $d73b: 48        Bank3
            lda #$03           ; $d73c: a9 03     
            sta $04            ; $d73e: 85 04     
            lda __fff5         ; $d740: ad f5 ff 
            sta __fff5         ; $d743: 8d f5 ff 
            pla                ; $d746: 68       
            rts                ; $d747: 60       

;-------------------------------------------------------------------------------
__d748:     pha                ; $d748: 48        Bank4
            lda #$04           ; $d749: a9 04     
            sta $04            ; $d74b: 85 04     
            lda __fff6         ; $d74d: ad f6 ff 
            sta __fff6         ; $d750: 8d f6 ff 
            pla                ; $d753: 68       
            rts                ; $d754: 60       

;-------------------------------------------------------------------------------
__d755:     pha                ; $d755: 48        Bank5
            lda #$05           ; $d756: a9 05     
            sta $04            ; $d758: 85 04     
            lda __fff7         ; $d75a: ad f7 ff 
            sta __fff7         ; $d75d: 8d f7 ff 
            pla                ; $d760: 68       
            rts                ; $d761: 60       

;-------------------------------------------------------------------------------
__d762:     pha                ; $d762: 48        Bank6
            lda #$06           ; $d763: a9 06     
            sta $04            ; $d765: 85 04     
            lda __fff8         ; $d767: ad f8 ff 
            sta __fff8         ; $d76a: 8d f8 ff 
            pla                ; $d76d: 68       
            rts                ; $d76e: 60

When I was doing something at this code $d714, I changed:

Code: [Select]
lda #$00to
Code: [Select]
lda #$07
It will load the whole bank to bank 7. At the end of each bank file except for the fixed bank, you will see a bank number. In the first bank at $bfff I changed 00 to 07 in the new bank.

Now I'm trying to figure out how to use this code in bank 3 to bank 7?
Code: [Select]
__923e:     ldy $51            ; $923e: a4 51     
            lda __9168,y       ; $9240: b9 68 91

Code: [Select]
__9168:     .hex 03 03 03 06   ; $9168: 03 03 03 06   Data
            .hex 06 03 03 06   ; $916c: 06 03 03 06   Data
            .hex 03 06 03 16   ; $9170: 03 06 03 16   Data
            .hex 03 06 06 16   ; $9174: 03 06 06 16   Data
            .hex 03 16 03 16   ; $9178: 03 16 03 16   Data
            .hex 03 06 06      ; $917c: 03 06 06      Data
That's the corridor boss music.
Thanks!
I do not do other games that have already been done.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6928
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: The Guardian Legend Bank Switching UNROM
« Reply #1 on: July 24, 2015, 02:52:41 pm »
You know UNROM (possibly? I might be mixing up UN and UO) has "bus-conflicts" which means you need to bankswap by writing to a ROM address that has the same value as the value you wish to write.
Which is why most games store a series of bank numbers (0, 1,2, 3, etc.) cosecutively (at say $C000)
so then swap with
Code: [Select]
;assume a is the bank to swap in
tax
sta $C000,x
"My watch says 30 chickens" Google, 2018

Dracula X

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
    • My YouTube Page for ROM hacking
Re: The Guardian Legend Bank Switching UNROM
« Reply #2 on: July 25, 2015, 12:56:18 pm »
Thanks! I saw that code in DuckTales and the on on Castlevania is different.
I do not do other games that have already been done.

mrrichard999

  • Hero Member
  • *****
  • Posts: 686
  • So Goooood! :D
    • View Profile
    • GameFAQS Profile
Re: The Guardian Legend Bank Switching UNROM
« Reply #3 on: July 25, 2015, 06:07:28 pm »
Not sure if this would be helpful but RetroRain released a UNROM to MMC3 mapper conversion hack. You can get it here.


http://acmlm.kafuka.org/board/thread.php?id=7843

Dracula X

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
    • My YouTube Page for ROM hacking
Re: The Guardian Legend Bank Switching UNROM
« Reply #4 on: July 26, 2015, 03:53:25 pm »
I knew about that one. Thanks for the info! I guess I'll give it a try one more time on this one. It does have some bugs in it. Most monsters won't show up.

I think I got this bankswitching working a little now I'm trying to test it out.
« Last Edit: July 26, 2015, 06:17:26 pm by Dracula X »
I do not do other games that have already been done.