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.

The Little Mermaid/ROM map

From Data Crystal
< The Little Mermaid
Revision as of 22:06, 27 December 2018 by Dugongue (talk | contribs) (Created page with "Page 06 (0x8000-0xBFFF) Address in ROM: 0x18010-0x1C00F 0x8000 Runs the action scripts of every object slot (other than Ariel) from lowest to highest. 06:8000:A5 B1 LD...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Page 06 (0x8000-0xBFFF) Address in ROM: 0x18010-0x1C00F

0x8000
Runs the action scripts of every object slot (other than Ariel) from lowest to highest.
06:8000:A5 B1     LDA $00B1   ; Check Ariel's health
06:8002:F0 3A     BEQ $803E   ; Exit if zero 
06:8004:A2 01     LDX #$01
06:8006:86 EF     STX $00EF   ; Current slot #
06:8008:A9 06     LDA #$06
06:800A:85 99     STA $0099   ; ?

06:800C:BD 00 03  LDA $0300,X 
06:800F:10 25     BPL $8036   ; Skip ahead if slot is empty
06:8011:BD A0 04  LDA $04A0,X ; Check if object is stunned
06:8014:D0 16     BNE $802C   ;  If so, skip action script

06:8016:BC 10 03  LDY $0310,X
06:8019:B9 20 85  LDA $8520,Y ; Obtain address of action script
06:801C:85 00     STA $0000   ;  from jump table located
06:801E:B9 80 85  LDA $8580,Y ;   at 0x8520,0x8580
06:8021:85 01     STA $0001
06:8023:A9 80     LDA #$80    ; Set return address
06:8025:48        PHA
06:8026:A9 2B     LDA #$2B
06:8028:48        PHA
06:8029:6C 00 00  JMP ($0000) ; Run object's action script

06:802C:E0 03     CPX #$03    ; Check if object is a bubble
06:802E:90 06     BCC $8036   ; Jump ahead if so
06:8030:20 3F 80  JSR $803F   ; Run action if object is colliding with Ariel
06:8033:20 FF 80  JSR $80FF   ; Run action if object is colliding with a bubble 

06:8036:E6 EF     INC $00EF   ; Tick up to next object slot
06:8038:A6 EF     LDX $00EF   
06:803A:E0 10     CPX #$10    ; Loop until all slots examined
06:803C:D0 CA     BNE $8008
06:803E:60        RTS -----------------------------------------