 |
 |
;----------------------------------------------------
; Disassembly of the file Cliffhanger ROMs
; by Jeff Kulczycki and Robert Dinapoli
; Apr 12, 2000
;----------------------------------------------------
;
;----------------------------------------------------
; RAM VARIABLES
;----------------------------------------------------
; Address Description
;----------------------------------------------------
; E000 - E007 High Score 1
; E008 - E00F High Score 2
; E010 - E017 High Score 3
; E018 - E01F High Score 4
; E020 - E027 High Score 5
; E028 - E02F High Score 6
; E030 - E037 High Score 7
; E038 - E03F High Score 8
; E040 - E047 High Score 9
; E048 - E04F High Score 10
; E050 - E052 High Score 1 Initials
; E053 - E057 High Score 1
; E058 - E05A High Score 2 Initials
; E05B - E05F High Score 2
; E060 - E062 High Score 3 Initials
; E063 - E067 High Score 3
; E068 - E06A High Score 4 Initials
; E06B - E06F High Score 4
; E070 - E072 High Score 5 Initials
; E073 - E077 High Score 5
; E078 - E07A High Score 6 Initials
; E07B - E07F High Score 6
; E080 - E082 High Score 7 Initials
; E083 - E087 High Score 7
; E088 - E08A High Score 8 Initials
; E08B - E08F High Score 8
; E090 - E092 High Score 9 Initials
; E093 - E097 High Score 9
; E098 - E09A High Score 10 Initials
; E09B - E09F High Score 10
; E0A0 - E0A2 Total Plays
; E0A3 - E0A4 Left Coin Slot Total
; E0A5 - E0A6 Right Coin Slot Total
; E0A7 Bookkeeping Counter (Coins)
; E0A8 - E0AA Total Play Time Seconds
; E0AB - E0AD Longest Game Seconds
; E0AE Shortest Game Seconds
; E0AF Highest Scene
; E0B0 Bookkeeping Counter (Times)
; E0B1 - E0B2 Range of Scores: 0 - 100K
; E0B3 - E0B4 Range of Scores: 100K - 200K
; E0B5 - E0B6 Range of Scores: 200K - 300K
; E0B7 - E0B8 Range of Scores: 300K - 400K
; E0B9 - E0BA Range of Scores: 400K - 500K
; E0BB - E0BC Range of Scores: 500K - 600K
; E0BD - E0BE Range of Scores: 600K - 700K
; E0BF - E0C0 Range of Scores: 700K - 800K
; E0C1 - E0C2 Range of Scores: 800K - 900K
; E0C3 - E0C4 Range of Scores: 900K - 1000K
; E0C5 - E0C6 Range of Scores: 1000K - 1100K
; E0C7 - E0C8 Range of Scores: 1100K - 1200K
; E0C9 - E0CA Range of Scores: 1200K - 1300K
; E0CB - E0CC Range of Scores: 1300K - 1400K
; E0CD - E0CE Range of Scores: 1400K+
; E0CF Bookkeeping Counter (Range of Score)
; E0D0 - E0D1 Times 0 - 1 minutes
; E0D2 - E0D3 Times 1 - 2 minutes
; E0D4 - E0D5 Times 2 - 3 minutes
; E0D6 - E0D7 Times 3 - 4 minutes
; E0D8 - E0D9 Times 4 - 5 minutes
; E0DA - E0DB Times 5 - 6 minutes
; E0DC - E0DD Times 6 - 7 minutes
; E0DE - E0DF Times 7 - 8 minutes
; E0E0 - E0E1 Times 8 - 9 minutes
; E0E2 - E0E3 Times 9 - 10 minutes
; E0E4 - E0E5 Times 10 - 11 minutes
; E0E6 - E0E7 Times 11 - 12 minutes
; E0E8 - E0E9 Times 12 - 13 minutes
; E0EA - E0EB Times 13 - 14 minutes
; E0EC - E0ED Times 14+ minutes
; E0EE Bookkeeping Counter (Range of Times)
; E0EF - E0F0 Scene 1 Totals
; E0F1 - E0F2 Scene 2 Totals
; E0F3 - E0F4 Scene 3 Totals
; E0F5 - E0F6 Scene 4 Totals
; E0F7 - E0F8 Scene 5 Totals
; E0F9 - E0FA Scene 6 Totals
; E0FB - E0FC Scene 7 Totals
; E0FD - E0FE Scene 8 Totals
; E0FF Bookkeeping Counter (Scene Totals)
; E100 - E10B ?
; E10D Bookkeeping Counter <--?
; E112 LDPlayer Pulse, kick when frame count is received
; E113 unknown
; E114 unknown
; E115 Graphics Status (00h = Available, 4Ch = Write Requested)
; E116 - E118 Odd Frame Count Target
; E119 - E11B Even Frame Count Target
; E11C - E11E Frame Count Even
; E11F - E121 Frame Count Odd
; E122 errors?
; E123 errors?
; E126 .0 unknown
; .1 LDPlayer Status 0=Not BUSY, 1=BUSY
; .2 unknown
; .3 unknown
; .4 PAUSE Status 0=Not PAUSED, 1=PAUSED
; .5 Audio Channel Right 0=ON, 1=OFF
; .6 Audio Channel Left 0=ON, 1=OFF
; E127 - E12A Temporary Aritmetic Location E127:MSB...E12A:LSB
; E12F - E136 Graphics Chip Control Registers
; E137 Graphics index
; E138 Graphics index
; E13B - E13C
; E13E - E13F Hardware Errors
; E140 - E145 Timer?
; E15A unknown
; E15B unknown
; E15E unknown
; E16E - E16F LaserDisc Errors
; E170 - E172 Frame Count Slop Error
; E174 unknown
; E17A Seconds Timer
; E180 - E182 Frame Number compare
; E183 BANK 0: ZPU Switches 1,2
; E184 - E185 BANK 0: ZPU Switches 1,2 Debounce
; E186 BANK 1: DIP Switches 28-35
; E187 - E188 BANK 1: DIP Switches 28-35 Debounce
; E189 BANK 2: DIP Switches 20-27
; E18A - E18B BANK 2: DIP Switches 20-27 Debounce
; E18C BANK 3: DIP Switches 12-19
; E18D - E18E BANK 3: DIP Switches 12-19 Debounce
; E18F BANK 4: DIP Switches 4-11
; E190 - E191 BANK 4: DIP Switches 4-11 Debounce
; E192 BANK 5: Button Data
; E193 - E194 BANK 5: Button Data Debounce Buffer
; E195 BANK 6: Joystick Data
; E196 - E197 BANK 6: Joystick Data Debounce Buffer
; E198 BANK 7: unknown
; E199 - E19A BANK 7: unknown Debounce
; E19B BANK 8: unknown
; E19C - E19D BANK 8: unknown Debounce
; E19E BANK 9: unknown
; E19F - E1A0 BANK 9: unknown Debounce
; E1A1 Coins Inserted Left
; E1A2 Coins Inserted Right
; E1A3 Coins?
; E1A6
; E1A8 Number of Credits
; E1A9 Player Number
; E1AA - E1AD Score
; E1AE Lives remaining
; E1B1 unknown - frame?
; E1B6 Current Scene Number
; E1BB - E1BC Scene Pointer
; E1C4 - E1C6 Minutes (BCD) Real-time Game Play Timer
; E1C7 - E1E4 Swap with E1A7-E1C6
; E1E5 ?
; E1E6 Service Mode selection
;----------------------------------------------------
; E000 - E800 Bookkeeping RAM ?
; E800- Scratch RAM ?
;----------------------------------------------------
;
;----------------------------------------------------
; BEGIN FIRST ROM 0000-1FFF
;----------------------------------------------------
org 0000h
CPU = Z180
globals on
;----------------------------------------------------
; Definitions
;----------------------------------------------------
; Pixel Byte Colors
; 0h TRANSPARENT
; 1h BLACK
; 2h MED GREEN
; 3h LT GREEN
; 4h BLUE
; 5h LT BLUE
; 6h DK RED
; 7h CYAN
; 8h MED RED
; 9h PINK
; Ah DK YELLOW
; Bh LT YELLOW
; Ch DK GREEN
; Dh PURPLE
; Eh GRAY
; Fh WHITE
;----------------------------------------------------
; Reset
;----------------------------------------------------
L0000: IN A,(055h) ; Read Graphics Byte
LD SP,0F000h ; Set Stack Pointer
DI ; Disable Interrupts
IM 1 ; Interrupt Mode 1
JP L0300 ; Start Initialization
L000B: JP L0128 ; Begin Game
;----------------------------------------------------
; ROM 0 - Copyright location
;----------------------------------------------------
L000E: TEXT "COPYRIGHT STERN ELECTRONICS, INC."
DB 0FFh, 0FFh, 0FFh, 0FFh, 0FFh
DB 0FFh, 0FFh, 0FFh, 0FFh
;----------------------------------------------------
; IM 1 INTERRUPT JUMP POINT
;----------------------------------------------------
; Read in Frame Counter from LDPlayer Interface
; E11C-E11E = Even Frame Count
; E11F-E121 = Odd Frame Count
;----------------------------------------------------
L0038: OUT (057h),A ;
PUSH AF ; Save AF Register
PUSH HL ; Save HL Register
LD HL,0E112h ; LDPlayer Pulse
INC (HL) ; Kick the LDPlayer Pulse
BIT 0,(HL) ; Check if Pulse even or odd
LD HL,0E11Ch ; Load Frame Count Spot for Even
JP Z,L004B ; Skip Odd Count
LD HL,0E11Fh ; Load Frame Count Spot for Odd
L004B: IN A,(052h) ; Retrieve MSB Frame Count byte
LD (HL),A ; Store in Frame Count Spot
CPL ; Reverse all bits
AND 0F8h ; Is LDPlayer BUSY?
JP NZ,L005C ; Yes, LDPlayer BUSY so skip
INC HL ; Point to next location
IN A,(051h) ; Retrieve next Frame Count byte
LD (HL),A ; Store in Frame Count Spot
INC HL ; Point to next location
IN A,(050h) ; Retrieve LSB Frame Count byte
LD (HL),A ; Store in Frame Count Spot
L005C: EI ; Enable Interrupts
IN A,(053h) ;
EX (SP),IX ;
EX (SP),IX ;
POP HL ; Restore HL Register
L0064: POP AF ; Restore AF Register
RET ; Return
;----------------------------------------------------
; NMI Non-Maskable Interrupt Routine
; Occurs every 1 second
;----------------------------------------------------
L0066: PUSH AF ; Save AF Register
EX AF,AF' ; Get AF' Register
PUSH AF ; Save AF' Register
PUSH BC ; Save BC Register
PUSH DE ; Save DE Register
PUSH HL ; Save HL Register
L006C: PUSH IX ; Save IX Reigster
LD A,I ; Are interrupts disabled?
JP PO,L0076 ; Yes, so skip Frame Count Retrieval
CALL L6631 ; Retrieve Frame Count
L0076: CALL L2465 ; Read Joystick and Button Data
CALL L1162 ; Check Coin Slots
CALL L0103 ; Update Real-time Game Play Tiemr
LD A,(0E125h) ;
L0082: OR A ;
LD A,(0E113h) ;
RES 1,A ;
LD B,A ;
LD A,(0E114h) ;
RES 0,A ;
JR Z,L0098 ;
LD HL,0E125h ;
DEC (HL) ;
SET 0,A ;
SET 1,B
L0098: OUT (046h),A
LD (0E114h),A
LD A,B
OUT (064h),A
LD (0E113h),A
LD A,(0E110h)
OR A
LD A,(0E113h)
RES 2,A
LD B,A
LD A,(0E114h)
RES 1,A
JR Z,L00BC
LD HL,0E110h
DEC (HL)
SET 1,A
SET 2,B
L00BC: OUT (046h),A
LD (0E114h),A
LD A,B
OUT (064h),A
LD (0E113h),A
;----------------------------------------------------
; Flash LED to show board is operational
;----------------------------------------------------
LD HL,0E111h
INC (HL)
BIT 0,(HL) ; Test odd/even
JR Z,L00D3 ; Even so skip ahead
OUT (06Fh),A ; Turn LED on
JR L00D5 ; Skip ahead
L00D3: OUT (06Eh),A ; Turn LED off
;----------------------------------------------------
; Check for Game Tilted
;----------------------------------------------------
L00D5: LD A,(0E193h) ; Get Button Data
BIT 7,A ; Is game Tilted?
CALL NZ,L2509 ; Yes, do Tilt scene
;----------------------------------------------------
; Process Graphics Chip Write Requests
;----------------------------------------------------
IN A,(055h) ; Read Graphics Byte
LD A,(0E115h) ; Get Graphics Status
CP 04Ch ; Is there a Write Request?
CALL Z,L2316 ; Yes, so Write Graphics Registers
LD A,(0E126h) ; Get Control Register
BIT 0,A ;
JP Z,L00F4 ;
LD A,I ;
CALL PE,L1DFA ;
L00F4: POP IX ; Restore IX Register
POP HL ; Restore HL Register
POP DE ; Restore DE Register
POP BC ; Restore BC Register
POP AF ; Restore AF' Register
EX AF,AF' ; Save AF'
POP AF ; Restore AF Register
RETN ; Return from NMI
;----------------------------------------------------
; Get ?
;----------------------------------------------------
L00FE: IN A,(055h) ; Read Graphics Byte
POP AF ;
RETN ; Return
;----------------------------------------------------
; Update Real-time Game Play Timer
;----------------------------------------------------
; E17A Seconds Counter
; E1C4-E1C6 Minutes (BCD)
;----------------------------------------------------
L0103: LD A,(0E126h) ; Get Control Register
BIT 0,A ; Check if game is playing
RET NZ ; Game not playing so leave
LD HL,0E17Ah ; Get Number of seconds
DEC (HL) ; Count down seconds
RET NZ ; Not zero so return
LD A,03Ch ; A = 60 seconds
LD (HL),A ; Reset second counter
LD HL,0E1C6h ; Point to Timer
LD A,(HL) ; Get minutes (ones)
ADD A,001h ; Add one minute
DAA ; Make BCD
LD (HL),A ; Store minute (ones)
RET NZ ; Return if not rolled
DEC HL ; Point to minutes (tens)
LD A,(HL) ; Get minutes (tens)
ADD A,001h ; Increment tens spot
DAA ; Make BCD
LD (HL),A ; Store minutes (tens)
RET NZ ; Return if not rolled
DEC HL ; Point to minutes (hundreds)
LD A,(HL) ; Get minutes (hundreds)
ADD A,001h ; Increment hundreds spot
DAA ; Make BCD
LD (HL),A ; Store minutes (hundreds)
RET ; Return
;----------------------------------------------------
; Game Power up and Initialization
;----------------------------------------------------
; Set Stack Pointer, Clear out Scratch RAM E800-EFFF
;----------------------------------------------------
L0128: LD SP,0F000h ; Set Stack Pointer
;----------------------------------------------------
; Clear out RAM E800-EFFF
;----------------------------------------------------
XOR A ; A = 0
LD BC,007FFh ; RAM length 7FFh
LD DE,0E801h ; Setup Loop
LD HL,0E800h ; Start of RAM
LD (HL),A ; Clear out RAM spot
LDIR ; Loop until all RAM cleared
;----------------------------------------------------
; Clear out RAM E10E-E7FF
;----------------------------------------------------
XOR A ; A = 0
LD BC,007FFh ; RAM length 7FFh
LD DE,0E10Fh ; Setup Loop
LD HL,0E10Eh ; Start of RAM
LD (HL),A ; Clear out RAM spot
LDIR ; Loop until all RAM cleared
;----------------------------------------------------
; Clear out variables
;----------------------------------------------------
LD (0E1A8h),A ; Zero out Number of Credits
LD (0E113h),A ;
OUT (06Eh),A ;
LD (0E12Eh),A ;
;----------------------------------------------------
; Set Game Register settings
;----------------------------------------------------
SET 5,A ; Start with Audio Right Disabled
SET 6,A ; Start with Audio Left Disabled
SET 0,A ;
SET 3,A ;
LD (0E126h),A ; Save Control Register
LD A,014h ; A = 20
LD (0E121h),A ;
CALL L24A7 ; Read DIP Switches
CALL L1F05 ; Clear out Player Data
LD A,(0E18Ch) ; Get DIP Switches 12-19
BIT 0,A ; Check if Service Mode Enable
JP NZ,L40FE ; Service Mode enabled, jump ahead
EI ; Enable Interrupts
JP L053D ; Goto PLEASE STAND BY startup
;----------------------------------------------------
; Garbage
;----------------------------------------------------
DB 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh
DB 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh
DB 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh
DB 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh
DB 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh
DB 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh
DB 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh
DB 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh
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FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh
.DB 0FFh, 0FFh, 0FFh, 0FFh, 0FFh, 0FFh
;----------------------------------------------------
; Start of initialization - Z80 Test
;----------------------------------------------------
L0300: XOR A ; A = 0
OUT (06Eh),A ; Turn LED off
OUT (046h),A ; Turn BEEP off
;----------------------------------------------------
; Verify Stack Register
;----------------------------------------------------
LD SP,055AAh ; Set Stack = 55AAh
LD HL,0AA56h ; HL = AA56h
ADD HL,SP ; Add together to get zero
LD A,H ; Get result
OR L ; Check if zero
L030E: JR NZ,L030E ; Not zero, so don't continue
;----------------------------------------------------
; Set all Registers to the same value and
; check register accuracy (BC,DE,HL).
;----------------------------------------------------
; Verify Register ODD bits
;----------------------------------------------------
LD A,055h ; A = 55h
LD BC,05555h ; B = 55h, C = 55h
LD DE,05555h ; D = 55h, E = 55h
LD HL,05555h ; H = 55h, L = 55h
CP B ; Is B Register correct?
L031C: JR NZ,L031C ; No, so don't continue
CP C ; Is C Register correct?
L031F: JR NZ,L031F ; No, so don't continue
CP D ; Is D Register correct?
L0322: JR NZ,L0322 ; No, so don't continue
CP E ; Is E Register correct?
L0325: JR NZ,L0325 ; No, so don't continue
CP H ; Is H Register correct?
L0328: JR NZ,L0328 ; No, so don't continue
CP L ; Is L Register correct?
L032B: JR NZ,L032B ; No, so don't continue
;----------------------------------------------------
; Verify Register EVEN bits
;----------------------------------------------------
LD A,0AAh ; A = AAh Check EVEN bits
LD BC,0AAAAh ; B = AAh, C = AAh
LD DE,0AAAAh ; D = AAh, E = AAh
LD HL,0AAAAh ; H = AAh, L = AAh
CP B ; Is B Register correct?
L0339: JR NZ,L0339 ; No, so don't continue
CP C ; Is C Register correct?
L033C: JR NZ,L033C ; No, so don't continue
CP D ; Is D Register correct?
L033F: JR NZ,L033F ; No, so don't continue
CP E ; Is E Register correct?
L0342: JR NZ,L0342 ; No, so don't continue
CP H ; Is H Register correct?
L0345: JR NZ,L0345 ; No, so don't continue
CP L ; Is L Register correct?
L0348: JR NZ,L0348 ; No, so don't continue
;----------------------------------------------------
; Verify Prime Register ODD bits
;----------------------------------------------------
EX AF,AF' ; Exchange Registers
EXX ; Exchange Register
LD A,055h ; A = 55h
LD BC,05555h ; B = 55h, C = 55h
LD DE,05555h ; D = 55h, E = 55h
LD HL,05555h ; H = 55h, L = 55h
CP B ; Is B Register correct?
L0358: JR NZ,L0358 ; No, so don't continue
CP C ; Is C Register correct?
L035B: JR NZ,L035B ; No, so don't continue
CP D ; Is D Register correct?
L035E: JR NZ,L035E ; No, so don't continue
CP E ; Is E Register correct?
L0361: JR NZ,L0361 ; No, so don't continue
CP H ; Is H Register correct?
L0364: JR NZ,L0364 ; No, so don't continue
CP L ; Is L Register correct?
L0367: JR NZ,L0367 ; No, so don't continue
;----------------------------------------------------
; Verify Prime Register EVEN bits
;----------------------------------------------------
LD A,0AAh ; A = AAh Check EVEN bits
LD BC,0AAAAh ; B = AAh, C = AAh
LD DE,0AAAAh ; D = AAh, E = AAh
LD HL,0AAAAh ; H = AAh, L = AAh
CP B ; Is B Register correct?
L0375: JR NZ,L0375 ; No, so don't continue
CP C ; Is C Register correct?
L0378: JR NZ,L0378 ; No, so don't continue
CP D | |