Advertisement
mattcurrie

Adventure Island save state patch

Apr 29th, 2023
2,061
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; md5 d67e58bf5f39d5fb073fed85c3d9bede
  2.  
  3. .INCLUDE "includes/init.s"
  4. .ROMBANKS 8
  5. .BACKGROUND "Adventure Island (U) [!].gb"
  6. .INCLUDE "includes/header.s"
  7.  
  8.  
  9. ;**********
  10. ;* config *
  11. ;**********
  12.  
  13. .DEFINE joypad $FF8C
  14. .DEFINE joypad_2 $FF8D
  15. .DEFINE current_rom_bank $02ec
  16.  
  17.  
  18. ;*************************
  19. ;* relocated joypad read *
  20. ;*************************
  21.  
  22. .BANK $00 SLOT 0
  23. .ORG $0080
  24. .SECTION "relocated read from joypad" SIZE $70 OVERWRITE
  25.     .INCLUDE "includes/relocated_read_from_joypad.s"
  26.     ;.INCLUDE "includes/reset_ram.s"
  27.  
  28. halt_fix:
  29.     ei          ; enable interrupts to avoid halt bug
  30. halt_fix_loop:
  31.     halt
  32.     ld a, ($ff00+$94)
  33.     and a
  34.     jr nz, halt_fix_loop
  35.     ret
  36. .ENDS
  37.  
  38. .ORG $02DA
  39. .SECTION "halt fix jump" SIZE $3 OVERWRITE
  40.     jp halt_fix
  41. .ENDS
  42.  
  43. ;*************
  44. ;* reset ram *
  45. ;*************
  46.  
  47. ;.DEFINE RESET_RAM_DONE $0150
  48. ;.BANK $00 SLOT 0
  49. ;.ORG $0101
  50. ;.SECTION "reset ram jump" SIZE 3 OVERWRITE
  51. ;    jp RESET_RAM
  52. ;.ENDS
  53.  
  54.  
  55. ;***************
  56. ;* joypad read *
  57. ;***************
  58.  
  59. .BANK $05 SLOT 0
  60. .ORG $3E32
  61. .SECTION "joypad read" SIZE 4 OVERWRITE  
  62.     call relocated_read_from_joypad
  63.     nop
  64. .ENDS
  65.  
  66.  
  67. ;*******************
  68. ;* save/load state *
  69. ;*******************
  70.  
  71. .BANK $07 SLOT 1
  72. .ORG $28E0
  73. .SECTION "save/load state" SIZE $0220 OVERWRITE
  74.     .DB "--- XXXXX Save Patch ---"
  75.     .INCLUDE "includes/save_state_includes.s"
  76. .ENDS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement