Super Mario Bros Mapper Conversion Help

Started by Dracula X, April 19, 2021, 09:30:37 PM

Previous topic - Next topic

Dracula X

I think I'm almost finished converting the game to another mapper, but I think something is wrong. Might be the bankswitch code or something.

C065:
Bankswitch:
PHP
ASL A
ORA #$80
STA $5115
PLP
RTS


And I put this code in bank 4
ExecGameLoopback2:
      lda Player_PageLoc        ;send player back four pages
      sec
      sbc #$04
      sta Player_PageLoc
      lda CurrentPageLoc        ;send current page back four pages
      sec
      sbc #$04
      sta CurrentPageLoc
      lda ScreenLeft_PageLoc    ;subtract four from page location
      sec                       ;of screen's left border
      sbc #$04
      sta ScreenLeft_PageLoc
      lda ScreenRight_PageLoc   ;do the same for the page location
      sec                       ;of screen's right border
      sbc #$04
      sta ScreenRight_PageLoc
      lda AreaObjectPageLoc     ;subtract four from page control
      sec                       ;for area objects
      sbc #$04
      sta AreaObjectPageLoc
      lda #$00                  ;initialize page select for both
      sta EnemyObjectPageSel    ;area and enemy objects
      sta AreaObjectPageSel
      sta EnemyDataOffset       ;initialize enemy object data offset
      sta EnemyObjectPageLoc    ;and enemy object page control
      lda AreaDataOfsLoopback,y ;adjust area object offset based on
      sta AreaDataOffset        ;which loop command we encountered
      rts


When the code bankswitch to another bank, the game freezes or reset the game.
Back to Thunder Force II hacking again.

frantik

what mapper are you using?

are you changing the bank where the program counter is currently pointing to?  if so you need to make sure the code in the new bank picks up exactly where it left off in the old bank

Dracula X

#2
MMC5! This hack will be release soon! Just need to test some things out and then release it.
Back to Thunder Force II hacking again.