The Little Mermaid/ROM map: Difference between revisions

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


==Page 07 (0xC000-0xFFFF)==
==Page 07 (0xC000-0xFFFF)==
Location in ROM: 0x1C010-0x2000F
Location in ROM: 0x1C010-0x2000F
===Function 0xC250===
Advance random number generator each frame


0xC250
Advance random number generator each frame
  07:C250:A2 00    LDX #$00
  07:C250:A2 00    LDX #$00
  07:C252:A0 04    LDY #$04
  07:C252:A0 04    LDY #$04

Revision as of 22:47, 27 December 2018

Chip tiny.png The following article is a ROM map for The Little Mermaid.

Page 06 (0x8000-0xBFFF)

Address in ROM: 0x18010-0x1C00F

Function 0x8000

Runs the action scripts of every object slot from lowest to highest and checks for collisions each frame.

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
06:801E:B9 80 85  LDA $8580,Y ; 
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 -----------------------------------------

Data Table 0x8520

Jump table for object action functions

Action # Address Description
0x00 0x85E0 Blank
0x01 0x85E1 Thrown objects
0x02 0x888F Enemy in bubble
0x03 0x8A14 Fish, Type 1
0x04 0x867A
0x05 0x8A65 Seahorse
0x06 0x8A9B
0x07 0x8BDC
0x08 0x8BE2 Spitting fish
0x09 0x8CA3
0x0A 0x8CBA Octopus
0x0B 0x8DC5 Octopus' rock
0x0C 0x9BA7 Stage 1 Boss (Shark): Sending Fish
0x0D 0x9CC4 Stage 1 Boss (Shark): Dashing
0x0E 0x9D37 Fish (Stage 1 Boss fight)
0x0F 0xA3B3 Cannon (Stage 4 Boss fight)
0x10 0x8F89
0x11 0x8FC7
0x12 0x9046 Fish, Type 2
0x13 0xAF50
0x14 0xAF50
0x15 0x908F Crab (Stage 2 Boss fight)
0x16 0x91D9 Tiny fish (following Ariel)
0x17 0x913F
0x18 0x913F
0x19 0x913F
0x1A 0x913F
0x1B 0x913F
0x1C 0x92A9 Sleeper fish
0x1D 0x9229 Tiny fish (default action)
0x1E 0x9367
0x1F 0x9274 Tiny fish (quad pattern)
0x20 0x940C Shrimp
0x21 0x9460 Poor Unfortunate Soul (Stage 5)
0x22 0x9461 Starfish spawner
0x23 0x954F Starfish (shooting upward)
0x24 0x9604 Frozen fish
0x25 0x908F Helmet crab
0x26 0x869D Crab (walking)
0x27 0x86C1 Crab (ducking/falling)
0x28 0x86F1
0x29 0x8715
0x2A 0x9D3A Stage 3 Boss (Walrus): Default
0x2B 0x9EC7 Stage 3 Boss (Walrus): Dropping item
0x2C 0x9F60 Stage 2 Boss (Eel) #1
0x2D 0x9F60 Stage 2 Boss (Eel) #2
0x2E 0xA1CF Stage 4 Boss (Seahorse)
0x2F 0xA324 Fish (Stage 4 Boss fight)
0x30 0x986D Carried item
0x31 0x97D5
0x32 0x97D5
0x33 0x97D5
0x34 0x9A36
0x35 0x9A36
0x36 0x9A11
0x37 0x87EE
0x38 0x998B Red Orb
0x39 0x998B Green Orb
0x3A 0x9A69
0x3B 0x9A69
0x3C 0x8DCB Volcano
0x3D 0x878B
0x3E 0xA63D
0x3F 0x888E
0x40 0x888E Water splash
0x41 0x8EE3
0x42 0x877D End-of-stage jar
0x43 0x8DCB Upside-down volcano
0x44 0x8E8C Volcanic rock
0x45 0x9654
0x46 0x96E1
0x47 0xA3D9 Stage 5 Boss (Ursula 1)
0x48 0xA54F Enemy Spawn 1 (Stage 5 Boss fight)
0x49 0xA5F0 Enemy Spawn 2 (Stage 5 Boss fight)
0x4A 0xA5F6 Orb (Stage 5 Boss fight)
0x4B 0x8F6E
0x4C 0x876B
0x4D 0x9AA1 Hidden item (?)
0x4E 0x9AA1 Hidden item (?)
0x4F 0x9AA1 Hidden item (?)
0x50 0x9AA1 Hidden item (?)
0x51 0x9AA1 Hidden item (?)
0x52 0x9B0A Flounder
0x53 0x9B0A
0x54 0x9B0A
0x55 0x9B0A
0x56 0x9B0A
0x57 0xA692 Stage 6 Boss (Ursula 2)
0x58 0xA83E Fish (Stage 6 Boss fight)
0x59 0xA879
0x5A 0xA0D8 Crab spawner (Stage 2 Boss fight)
0x5B 0xA324
0x5C 0x8821
0x5D 0x8872
0x5E 0x887F
0x5F 0x888E Urchin (Stage 4 Boss fight)

Page 07 (0xC000-0xFFFF)

Location in ROM: 0x1C010-0x2000F

Function 0xC250

Advance random number generator each frame

07:C250:A2 00     LDX #$00
07:C252:A0 04     LDY #$04
07:C254:B5 E4     LDA $E4,X
07:C256:29 02     AND #$02
07:C258:85 00     STA $0000
07:C25A:B5 E5     LDA $E5,X
07:C25C:29 02     AND #$02
07:C25E:45 00     EOR $0000 ; If 0x02 bits of 0xE4 and 0xE5
07:C260:18        CLC       ;  are the same, highest bit of
07:C261:F0 01     BEQ $C264 ;   new RNG value will be zero.
07:C263:38        SEC       ;    Otherwise, it will be one.
07:C264:76 E4     ROR $E4,X ;     Then shift all previous bits right.
07:C266:E8        INX
07:C267:88        DEY
07:C268:D0 FA     BNE $C264
07:C26A:60        RTS -----------------------------------------