Welcome to Data Crystal's new home! Data Crystal is now part of the TCRF family (sort of).
The wiki has recently moved; please report any issues in Discord. Pardon the dust.

Castlevania II: Belmont's Revenge/ROM map: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:


(r:symbol) marks the start of a callable subroutine.
(r:symbol) marks the start of a callable subroutine.
During entity update routines, register d stores the high byte of the entity data. Belmont's data begins at c0, so d is always c0 during belmont's update routine.


  X:7FFF all swappable banks store list their bank number as the last byte of the bank.
  X:7FFF all swappable banks store list their bank number as the last byte of the bank.
  0:0038 (RST 38) get Y position of current entity.
  0:0038 (RST 38) get Y position of current entity.
  0:01D9 (r:mbc_bankswap_call) stores current bank (read from $7FFF) on stack, calls some (?) routine, then returns to caller bank.
  0:01D9 (r:mbc_bankswap_call) stores current bank (read from $7FFF) on stack, calls some (?) routine, then returns to caller bank.
0:0D23 (r:write_word_bc) (hl):(hl+1) <- bc
  0:3DAF (r) Entity x velocity <- cb.
  0:3DAF (r) Entity x velocity <- cb.
  0:35A9 (r:mbc_bankswap_1) loads swappable bank 1.
  0:35A9 (r:mbc_bankswap_1) loads swappable bank 1.
Line 16: Line 15:
  0:35BB (r:mbc_bankswap_7) loads swappable bank 7.
  0:35BB (r:mbc_bankswap_7) loads swappable bank 7.
  0:35C1 (r:mbc_bankswap_3) loads swappable bank 3.
  0:35C1 (r:mbc_bankswap_3) loads swappable bank 3.
  6:421D (r:belmont_update) Belmont frame update routine. Called from 0:05FA.
0:38E0 (r:) Set animation (prop 0C,0B,0A) to (bc):0:(bc+1) (bc):0:(bc+1)
  6:421D (r:entity_update) Belmont frame update routine. Called from 0:05FA.
  6:461B (r:input_A_pressed) A gets zero or 10 depending on if the A button was pressed this frame. Status flags set
  6:461B (r:input_A_pressed) A gets zero or 10 depending on if the A button was pressed this frame. Status flags set
  6:4621 (r:input_up_down_held) A and status flags
  6:4621 (r:input_up_down_held) A and status flags
Line 25: Line 25:
  6:464B (r:input_up_held) A and status flags
  6:464B (r:input_up_held) A and status flags
  6:4651 (r:input_any_held) A and status flags
  6:4651 (r:input_any_held) A and status flags
6:4817 (r:entity_move_face_right) Entity moves and faces right at velocity  0x90
6:4817 (r:entity_move_face_left)  Entity moves and faces left at velocity -0x90


Bank swap routines:
Bank swap routines:
  - All are in bank 0, and all write to $2180 to change the bank. For some reason, bank 5 is always swapped inline rather than by function call.
  - All are in bank 0, and all write to $2180 to change the bank. For some reason, bank 5 is always swapped inline rather than by function call.

Revision as of 22:07, 11 July 2022

Chip tiny.png The following article is a ROM map for Castlevania II: Belmont's Revenge.

Format for PRG-ROM is Bank:RAM address.

(r:symbol) marks the start of a callable subroutine.

X:7FFF all swappable banks store list their bank number as the last byte of the bank.
0:0038 (RST 38) get Y position of current entity.
0:01D9 (r:mbc_bankswap_call) stores current bank (read from $7FFF) on stack, calls some (?) routine, then returns to caller bank.
0:0D23 (r:write_word_bc) (hl):(hl+1) <- bc
0:3DAF (r) Entity x velocity <- cb.
0:35A9 (r:mbc_bankswap_1) loads swappable bank 1.
0:35AF (r:mbc_bankswap_2) loads swappable bank 2.
0:35B5 (r:mbc_bankswap_6) loads swappable bank 6.
0:35BB (r:mbc_bankswap_7) loads swappable bank 7.
0:35C1 (r:mbc_bankswap_3) loads swappable bank 3.
0:38E0 (r:) Set animation (prop 0C,0B,0A) to (bc):0:(bc+1) (bc):0:(bc+1)
6:421D (r:entity_update) Belmont frame update routine. Called from 0:05FA.
6:461B (r:input_A_pressed) A gets zero or 10 depending on if the A button was pressed this frame. Status flags set
6:4621 (r:input_up_down_held) A and status flags
6:4627 (r:input_left_right_held) A and status flags
6:462D (r:input_B_pressed) A and status flags
6:4633 (r:input_B_held) A and status flags
6:4639 (r:input_down_held) A and status flags
6:464B (r:input_up_held) A and status flags
6:4651 (r:input_any_held) A and status flags
6:4817 (r:entity_move_face_right) Entity moves and faces right at velocity  0x90
6:4817 (r:entity_move_face_left)  Entity moves and faces left at velocity -0x90

Bank swap routines:

- All are in bank 0, and all write to $2180 to change the bank. For some reason, bank 5 is always swapped inline rather than by function call.