Site Map | Contact Info | Home  
  
 Home
 Products
 ROMHACK Toolbox
 Ordering Info
 Code Disassembly
  Bega's Battle
  Cliffhanger
  Thayer's Quest
 My Gameroom
 Links

 

 

Page1

Page2

Page3

Page4

Page5

Page6

;----------------------------------------------------
;       Convert Window Move Time into decimal
;----------------------------------------------------
;       Input  A:   Hex      00 = Easy, 0F = Hard
;       Return A:   Decimal  00 = Easy, 15 = Hard 
;----------------------------------------------------
L22AA:  PUSH    BC              ; Save BC Register
        LD      B,0FFh          ; Initialize B (Quotient)
L22AD:  INC     B               ; Add 1 to B every time we subtract 10 from A 
        SUB     00Ah            ; Subtract 10 from A
        JR      NC,L22AD        ; Result positive so keep subtracting       
        ADD     A,00Ah          ; Put 10 back onto A
        LD      C,A             ; C = Remainder after division
        LD      A,B             ; A = Quotient 
        RLC     A               ; Move Quotient to upper nibble
        RLC     A               ; Move Quotient to upper nibble
        RLC     A               ; Move Quotient to upper nibble
        RLC     A               ; Move Quotient to upper nibble
        AND     0F0h            ; Isolate upper nibble
        OR      C               ; Add Remainder to lower nibble

        POP     BC              ; Restore BC Register
        RET                     ; Return






;----------------------------------------------------
;        Jump to Set Cursor and Print Text
;----------------------------------------------------
L22C3:  JP      L2212           ; Set Cursor and Print Text






;----------------------------------------------------
;                    unknown
;----------------------------------------------------
        EX      DE,HL           ;
        CALL    L2334           ; Set Text Cursor Position
        EX      DE,HL           ;
L22CB:  PUSH    HL              ; Save HL Register         
        LD      C,008h          ; Loop = 8
L22CE:  LD      A,(HL)          ;
        INC     HL              ;
        OUT     (044h),A        ;
        DEC     C               ;
        JR      NZ,L22CE        ;       
        POP     HL              ; Restore HL Register
        DJNZ    L22CB           ;       
        RET                     ; Return 







;----------------------------------------------------
;     Write Block of Data to Graphics Address 
;----------------------------------------------------
;      HL = Data Location
;      DE = Graphics Address
;      BC = Number of bytes to output
;----------------------------------------------------
L22D9:  EX      DE,HL           ; Graphics Address
        CALL    L2334           ; Set Graphics Address
        EX      DE,HL           ; Restore variables
L22DE:  LD      A,(HL)          ; Get Data byte
        OUT     (044h),A        ; Write data byte
        INC     HL              ; Point to next data byte
        DEC     BC              ; Decrement counter
        LD      A,B             ; Get counter
        OR      C               ; Check if counter at zero
        JR      NZ,L22DE        ; Continue until all bytes written
        RET                     ; Return








;----------------------------------------------------
;                Copy Graphics Memory
;       HL = Memory Position 0 - 960 (0000-03C0h)
;       DE = Destination to copy to
;       BC = Number of Bytes
;----------------------------------------------------
L22E8:  CALL    L2343           ; Setup Memory Position
L22EB:  IN      A,(045h)        ;
        LD      (DE),A          ;
        INC     DE              ;
        DEC     BC              ;
        LD      A,B             ;
        OR      C               ;
        JR      NZ,L22EB        ;       
        RET                     ; Return








;----------------------------------------------------
;             Program Graphics Chip 
;----------------------------------------------------
L22F5:  PUSH    HL              ; Save HL Register
        PUSH    BC              ; Save BC Register
        LD      HL,0E115h       ; HL = Graphics Chip Status
L22FA:  LD      A,(HL)          ; Check Graphics Chip Status
        OR      A               ; Is Graphics Chip available?
        JR      NZ,L22FA        ; No, so loop here and wait       
        LD      (HL),04Ch       ; Request Graphics Chip write
        LD      BC,00700h       ; Set timeout = 700h
L2303:  DEC     BC              ; Decrement timeout
        LD      A,B             ; Get timeout
        OR      C               ; Check timeout
        JR      Z,L230F         ; Timeout expired, now write to Chip  
        LD      A,(HL)          ; Get Graphics Chip Status
        OR      A               ; Is Graphics Chip available?
        JR      NZ,L2303        ; Not available so continue waiting       

L230C:  POP     BC              ; Restore BC Register
        POP     HL              ; Restore HL Register
        RET                     ; Return

L230F:  PUSH    DE              ; Save DE Register
        CALL    L2316           ; Write Graphics Registers 
        POP     DE              ; Restore DE Register
        JR      L230C           ; Jump back and return     








;---------------------------------------------------- 
;            Write Graphics Registers
;----------------------------------------------------
;   Write the following address to the graphics chip
;   Reg   RAM      Description
;   00    E12F  .0    External video input (0=input disable, 1=enable)
;               .1    Mode M3
;               .2    Mode M4 
;               .3    Mode M5 (Always 0)
;               .4    Horizontal Retrace Interrupt Enable
;               .5    Vertical Retrace Interrupt Enable
;               .6    Digitize mode
;               .7    (Always 0)Mode?
;   01    E130
;   02    E131
;   03    E132
;   04    E133
;   05    E134
;   06    E135
;   07    E136
;---------------------------------------------------- 
L2316:  IN      A,(055h)        ; Read Graphics Byte
        LD      DE,0E12Fh       ; Pointer to Graphics Registers
        LD      C,080h          ; C = Register Location + WRITE_BIT
        LD      B,008h          ; 8 Registers to write
L231F:  LD      A,(DE)          ; Get register byte
        INC     DE              ; Point to next byte
        OUT     (054h),A        ; Write Data Byte FIRST
        PUSH    AF              ; Small pause
        POP     AF              ; Small pause
        LD      A,C             ; Get Register Address
        OUT     (054h),A        ; Write Register SECOND
        PUSH    AF              ; Small pause
        POP     AF              ; Small pause
        IN      A,(055h)        ; Read Graphics Byte
        INC     C               ; Point to next Register Address
        DJNZ    L231F           ; Loop until all registers are writen       
        XOR     A               ; A = 0
        LD      (0E115h),A      ; Clear Write Request
        RET                     ; Return








;----------------------------------------------------
;     Set Text Cursor Position (with Display Bit)
;----------------------------------------------------
;       HL = Cursor Position 0 - 960 (0000-03C0h)
;----------------------------------------------------
;    DISPLAY MATRIX SETUP 24 ROWS, 40 COLUMNS
;            Row 1      0 - 39
;            Row 2     40 - 79
;            Row 3     80 - 119
;                  ...
;            Row 24   920 - 959
;---------------------------------------------------- 
L2334:  IN      A,(055h)        ; Read Graphics Byte
        LD      A,L             ; A = LSB Cursor Position
        OUT     (054h),A        ; Set LSB Cursor Position
        LD      A,H             ; A = MSB Cursor Position
        AND     03Fh            ;
        OR      040h            ; Set Display Bit
        OUT     (054h),A        ; Set MSB Cursor Position
        JP      L234D           ; Goto Delay
;----------------------------------------------------
;    Set Text Cursor Position (without Display Bit)
;----------------------------------------------------
L2343:  IN      A,(055h)        ; Read Graphics Byte
        LD      A,L             ; A = LSB Cursor Position
        OUT     (054h),A        ; Set LSB Cursor Position
        LD      A,H             ; A = MSB Cursor Position
        AND     03Fh            ;
        OUT     (054h),A        ; Set MSB Cursor Position
;---------------------------------------------------- 
;                   Short Delay 
;---------------------------------------------------- 
L234D:  LD      A,008h          ; Delay = 8
L234F:  DEC     A               ; Decrement Delay
        JR      NZ,L234F        ; Loop until Delay is zero       
        RET                     ; Return







;----------------------------------------------------
;    Wait for Comm to be ready, Timeout = 700h
;----------------------------------------------------
L2353:  PUSH    HL              ; Save HL Register
        PUSH    BC              ; Save BC Register
        PUSH    DE              ; Save DE Register
        PUSH    AF              ; Save AF Register
        LD      HL,0E111h       ; Point to Comm
        LD      BC,00700h       ; Set timeout = 700h
        LD      E,(HL)          ; Save Comm previous state
L235E:  DEC     BC              ; Decrement timeout
        LD      A,B             ; Check timeout
        OR      C               ; Compare timeout
        JR      Z,L2367         ; Timeout expired, so leave       
        LD      A,E             ; Get Comm previous state
        CP      (HL)            ; Compare to Comm current state
        JR      Z,L235E         ; Comm not clear so wait       
L2367:  POP     AF              ; Restore AF Register
        POP     DE              ; Restore DE Register
        POP     BC              ; Restore BC Register
        POP     HL              ; Restore HL Register
        RET                     ; Return







;----------------------------------------------------
;      graphics, program hardware, unknown?
;----------------------------------------------------
L236C:  LD      HL,0E12Fh       ; Get Graphics Registers
        SET     0,(HL)          ; Enable External Video Input 
        XOR     A               ; Text = TRANSPARENT, Bkgnd = TRANSPARENT
        LD      (0E136h),A      ; Set Color
        CALL    L22F5           ; Program Graphics Chip
        LD      HL,0E114h       ;
        SET     4,(HL)          ;
        LD      A,(HL)          ;
        OUT     (046h),A        ;
        RET                     ; Return





;----------------------------------------------------
;                  Unknown 
;----------------------------------------------------
L2381:  LD      HL,0E12Fh       ;
        SET     0,(HL)          ;
        CALL    L22F5           ; Program Graphics Chip   
        LD      HL,0E114h       ;
        SET     4,(HL)          ;
        LD      A,(HL)          ;
        OUT     (046h),A        ;
        RET                     ; Return




;----------------------------------------------------
;               Graphics Chip?? 
;----------------------------------------------------
L2392:  LD      HL,0E12Fh       ; Get Graphics Registers
        RES     0,(HL)          ; Disable External Video Input
        LD      HL,0E114h       
        RES     4,(HL)          ;
        LD      A,(HL)          ;
        OUT     (046h),A        ;
        RET                     ; Return



;----------------------------------------------------
L23A0:   .DB   080h080h080h080h080h080h080h080h080h, 080h080h080h, 080h, 080h
         .DB   080h080h, 080h, 080h, 080h, 080h, 080h, 080h, 080h, 080h, 080h, 080h, 080h, 080h
         .DB 080h080h080h080h080h080h080h080h, 080h, 080h, 080h, 080h, 020h, 020h
         .DB   020h020h020h020h020h020h020h020h, 020h, 020h, 020h, 020h020h, 020h
         .DB   020h020h020h020h020h020h020h, 020h, 020h, 020h, 020h, 020h020h, 020h
         .DB   020h020h020h020h020h020h020h020h020h020h
;----------------------------------------------------
       





;----------------------------------------------------
;                 Loop BC = 1
;----------------------------------------------------
L23F0:  PUSH    BC              ; Save BC Register
        LD      BC,00001h       ; Loop = 1
L23F4:  PUSH    AF              ; Save AF Register
L23F5:  LD      A,000h          ; A = 0
        DEC     BC              ; Decrement loop
L23F8:  LD      A,B             ; Get loop
        OR      C               ; Check if loop is zero
L23FA:  JR      NZ,L23F5        ; Loop until delay complete                   
L23FC:  POP     AF              ; Restore AF Regisrer
        POP     BC              ; Restore BC Register
L23FE:  RET                     ; Return




;----------------------------------------------------
;             Time Delay Routine = 14h
;----------------------------------------------------
        PUSH    BC              ; Save BC Register
L2400:  LD      BC,00014h       ; Load Time Delay = 14h
        JR      L23F4           ; Jump to Delay Routine         


;----------------------------------------------------
;             Time Delay Routine = 19h
;----------------------------------------------------
        PUSH    BC              ; Save BC Register
L2406:  LD      BC,00019h       ; Load Time Delay = 19h
        JR      L23F4           ; Jump to Delay Routine               


;----------------------------------------------------
;             Time Delay Routine = 3Ch
;---------------------------------------------------- 
L240B:  PUSH    BC              ; Save BC Register
L240C:  LD      BC,0003Ch       ; Load Time Delay = 3Ch
        JR      L23F4           ; Jump to Delay Routine

               
;----------------------------------------------------
;             Time Delay Routine = 41h
;---------------------------------------------------- 
        PUSH    BC              ; Save BC Register
        LD      BC,00041h       ; Load Time Delay = 41h
        JR      L23F4           ; Jump to Delay Routine


;----------------------------------------------------
;             Time Delay Routine = 4Bh
;---------------------------------------------------- 
        PUSH    BC              ; Save BC Register
        LD      BC,0004Bh       ; Load Time Delay = 4Bh
        JR      L23F4           ; Jump to Delay Routine


;----------------------------------------------------
;             Time Delay Routine = 64h
;---------------------------------------------------- 
L241D:  PUSH    BC              ; Save BC Register
        LD      BC,00064h       ; Load Time Delay = 64h
        JR      L23F4           ; Jump to Delay Routine


;----------------------------------------------------
;             Time Delay Routine = C8h
;----------------------------------------------------
        PUSH    BC              ; Save BC Register
        LD      BC,000C8h       ; Load Time Delay = C8h
        JR      L23F4           ; Jump to Delay Routine
       

;----------------------------------------------------
;             Time Delay Routine = 320h
;----------------------------------------------------         
        PUSH    BC              ; Save BC Register
        LD      BC,00320h       ; Load Time Delay = 320h
        JR      L23F4           ; Jump to Delay Routine


;----------------------------------------------------
;             Time Delay Routine = 1000
;----------------------------------------------------   
L242F:  PUSH    BC              ; Save BC Register
        LD      BC,003E8h       ; Load Time Delay = 3E8h
        JR      L23F4           ; Jump to Delay Routine


;----------------------------------------------------
;             Time Delay Routine = 10000
;----------------------------------------------------   
Delay10000:
L2435:  PUSH    BC              ; Save BC Register
        LD      BC,02710h       ; Load Time Delay = 10000
        JR      L23F4           ; Jump to Delay Routine


;----------------------------------------------------
;             Time Delay Routine = C350h
;----------------------------------------------------   
        PUSH    BC              ; Save BC Register
        LD      BC,0C350h       ; Load Time Delay
        JR      L23F4           ; Jump to Delay Routine





;----------------------------------------------------
;        Time Delay Routine = (10 * 10000)
;----------------------------------------------------   
Delay100000:
L2441:  PUSH    AF              ; Save AF Register
        LD      A,00Ah          ; Loop = 10
L2444:  CALL    Delay10000      ; Call Delay 10,000
        DEC     A               ; Decrement Loop
        JR      NZ,L2444        ; Jump back until all delays complete
        POP     AF              ; Restore AF Register
        RET                     ; Return



;----------------------------------------------------
;        Time Delay Routine = (20 * 10000)
;---------------------------------------------------- 
L244C:  PUSH    AF              ; Save AF Register
        LD      A,014h          ; Loop = 20
        JR      L2444           ; Go to Delay Loop       



;----------------------------------------------------
;        Time Delay Routine = (50 * 10000)
;---------------------------------------------------- 
Delay500000:
L2451:  PUSH    AF              ; Save AF Register
        LD      A,032h          ; Loop = 50
        JR      L2444           ; Go to Delay Loop
       
     
     
;----------------------------------------------------
;        Time Delay Routine = (100 * 10000)
;----------------------------------------------------                           
        PUSH    AF              ; Save AF Register
        LD      A,064h          ; Loop = 100
        JR      L2444           ; Go to Delay Loop       









;----------------------------------------------------
;                  Get ALL Input Data
;----------------------------------------------------
L245B:  LD      HL,0E1A0h       ; Input Data Buffer
        LD      B,00Ah          ; Read all 10 BANKs
        LD      D,009h          ; Read BANKs 0-9
        JP      L247E           ; Debounce Input


;----------------------------------------------------
;            Get Joystick and Button Data
;----------------------------------------------------
L2465:  LD      A,I             ; Get Interrupt Page Register
        JP      PO,L2474        ; If set then only read Buttons
        LD      HL,0E197h       ; Joystick Data Buffer
        LD      B,002h          ; Read 2 BANKs
        LD      D,006h          ; Read BANK 5,6
        JP      L247E           ; Debounce Input


;----------------------------------------------------
;                   Get Button Data
;----------------------------------------------------
L2474:  LD      HL,0E194h       ; Button Data Buffer
        LD      B,001h          ; Read 1 BANK
        LD      D,005h          ; Read BANK 5
        JP      L247E           ; Debounce Input Data










;----------------------------------------------------
;              Debounce Input Data
;----------------------------------------------------
;        HL = End of Debounce Data Buffer
;        B  = Number of BANKs to read
;        D  = Ending Input BANK where
;
;               Bank 0  DIP Switches  1,2
;               Bank 1  DIP Switches 28-35
;               Bank 2  DIP Switches 20-27
;               Bank 3  DIP Switches 12-19
;               Bank 4  DIP Switches  4-11 
;               Bank 5  Button Data
;               Bank 6  Joystick Data
;               Bank 7  unknown
;               Bank 8  unknown
;               Bank 9  unknown
;
;----------------------------------------------------
L247E:  LD      A,00Fh          ; Turn off all Input BANKs
        OUT     (060h),A        ; Select Input BANK
        CALL    L23F0           ; Call Delay1

L2485:  LD      A,D             ; Get BANK Number
        OUT     (060h),A        ; Select Input BANK 
        CALL    L23F0           ; Call Delay1

        IN      A,(062h)        ; Read Input Data 
        CPL                     ; Reverse all bits
        EX      AF,AF'          ; Save Input Data
        LD      A,00Fh          ; Turn off all Input BANKs
        OUT     (060),A         ; Select Input BANK
;----------------------------------------------------
;     Each time we enter this routine we save the
;     Data into a debounce buffer.  The new value
;     is shifted into the buffer and the oldest 
;     value is discarded.
;      New Data -> State1 -> State2 -> (discard)
;----------------------------------------------------
        LD      A,(HL)          ; A = Input State2 (HL)
        DEC     HL              ; Point to State1
        LD      C,(HL)          ; C = Input State1 (HL-1)
        INC     HL              ; Point to State2
        LD      (HL),C          ; Move State1 (HL-1) into State2 (HL)
        DEC     HL              ; Point to State1
        XOR     C               ; Note bits that changed state
        AND     C               ; Check state
        LD      C,A             ; Save changed bits
        EX      AF,AF'          ; Recall current Input Data
        LD      (HL),A          ; Put Input Data into State1 (HL-1)
        DEC     HL              ; Point to Debounced Data
;----------------------------------------------------
; Examine debounce buffer to determine state of input
;----------------------------------------------------
        AND     C               ; AND New data with Changed bits
        OR      (HL)            ; Update any new bits
        LD      (HL),A          ; Store the debounced Data in its place
        DEC     HL              ; Point to next buffer
        DEC     D               ; Read another BANK
        DJNZ    L2485           ; Loop until all BANKs read
        RET                     ; Return









;----------------------------------------------------
;        Get DIP Switch Inputs from BANKs 0-4
;----------------------------------------------------
;  Start by clearing Switch Input Data  E183-E19Eh
;----------------------------------------------------
L24A7:  DI                      ; Disable Interrupts
        XOR     A               ; A = 0
        LD      B,00Ah          ; B = 10
        LD      DE,0E19Eh       ; Set Addresses to clear out
L24AE:  LD      (DE),A          ; Clear location
        DEC     DE              ; Decrement location pointer
        LD      (DE),A          ; Clear location
        DEC     DE              ; Decrement location pointer
        LD      (DE),A          ; Clear location
        DEC     DE              ; Decrement location pointer
        DJNZ    L24AE           ; Loop until all Input cleared out
               
;----------------------------------------------------
;    Loop through BANKs 0-4 and read in variables
;----------------------------------------------------
        LD      B,004h          ; Read BANKs 0-4
        LD      HL,0E18Fh       ; HL = Variable location
L24BB:  LD      A,00Fh          ; Turn off all BANKs
        OUT     (060h),A        ; Select Input BANK
        CALL    L23F0           ; Call Delay1
        CALL    L23F0           ; Call Delay1
        LD      A,B             ; Get BANK Number
        OUT     (060h),A        ; Select Input BANK
        CALL    L23F0           ; Call Delay1
        CALL    L23F0           ; Call Delay1
        IN      A,(062h)        ; Read Input Data
        CPL                     ; Reverse all bits 
        LD      (HL),A          ; Save DIP Switch Data
        DEC     HL              ; Skip debounce
        DEC     HL              ; Skip debounce
        DEC     HL              ; Skip debounce
        DJNZ    L24BB           ; Loop until all BANKs checked       
        EI                      ; Enable Interrupts
        RET                     ; Return







        EXX     
        PUSH    AF
        LD      HL,0E12Eh
        LD      A,(HL)
        DEC     HL
        ADD     A,(HL)
        LD      (HL),A
        DEC     HL
        ADC     A,(HL)
        LD      (HL),A
        DEC     HL
        ADC     A,(HL)
        LD      (HL),A
        LD      HL,0E12Eh
        INC     (HL)
        JR      NZ,L24F8               
        DEC     HL
        INC     (HL)
        JR      NZ,L24F8               
        DEC     HL
        INC     (HL)
        JR      NZ,L24F8               
        DEC     HL
        INC     (HL)

L24F8:  LD      L,A
        LD      H,000
        POP     DE
        LD      B,008

L24FE:  ADD     HL,HL
        LD      A,H
        SUB     D
        JR      C,L2504                 
        LD      H,A

L2504:  DJNZ    L24FE                 
        LD      A,H
        EXX     
        RET     







;----------------------------------------------------
;                   Tilt Routine
;----------------------------------------------------
L2509:  LD      A,(0E15Ah)      ; Get Tilted latch
        OR      A               ; Has game been tilted before?
        RET     NZ              ; Yes, so return
        LD      A,(0E126h)      ; Get Control Register
        BIT     0,A             ;
        JR      Z,L2521         ;       
        LD      SP,0F000h       ; Stack Pointer = F000h
        LD      HL,L0604        ; HL = Start of Begin game
        PUSH    HL              ; Push address onto stack
        IN      A,(055h)        ; Read Graphics Byte
        EI                      ; Enable Interrupts
        RETN                    ; Exit NMI Routine


L2521:  LD      A,001h          ; A = 1
        LD      (0E15Ah),A      ; Set Tilted Latch
        LD      A,(0E126h)      ; Get Control Register
        SET     2,A             ;
        LD      (0E126h),A      ; Save Control Register
        CALL    L2532           ; Display "TILT"
        RET                     ; Return






;----------------------------------------------------
;                 Display "TILT"
;----------------------------------------------------
L2532:  CALL    L21FF           ; Clear Text Display
        LD      A,041h          ; Text = BLUE, Bgnd = BLACK
        CALL    L20CA           ; Setup Graphics Chip for Text
        PUSH    HL              ; Save HL Register
        LD      HL,000CFh       ; Cursor Location
        CALL    L2212           ; Set Cursor and Print Text
;----------------------------------------------------
        .DB   07Fh07Fh07Fh07Fh07Fh07Fh07Fh020h
        .DB   020h07Fh020h020h020h07Fh020h020h
        .DB   020h020h07Fh07Fh07Fh07Fh07Fh07Fh07Fh         
        .DB   000h
;----------------------------------------------------
        POP     HL              ; Restore HL Register
        PUSH    HL              ; Save HL Register
        LD      HL,000F7h       ; Cursor Position
        CALL    L2212           ; Set Cursor and Print Text
;----------------------------------------------------
        JR      NZ,L2585             
        JR      NZ,L25E6               
        JR      NZ,L2589             
        JR      NZ,L258B             
        JR      NZ,L25EC               

L256D:  JR      NZ,L258F             
        JR      NZ,L25F0               

L2571:  JR      NZ,L2593             

L2573:  JR      NZ,L2595             
        JR      NZ,L2597             
        JR      NZ,L25F8               
        JR      NZ,L259B             
        JR      NZ,L257D               
        .DB     000h
;----------------------------------------------------
L257D:  POP     HL              ; Restore HL Register
        PUSH    HL              ; Save HL Register
        LD      HL,0011Fh       ; Cursor Location
        CALL    L2212           ; Set Cursor and Print Text
;----------------------------------------------------
L2585:  JR      NZ,L25A7             
        JR      NZ,L2608               
L2589:  JR      NZ,L25AB             
L258B:  JR      NZ,L25AD             
        JR      NZ,L260E               
L258F:  JR      NZ,L25B1             
        JR      NZ,L2612               
L2593:  JR      NZ,L25B5             
L2595:  JR      NZ,L25B7             
L2597:  JR      NZ,L25B9             
        JR      NZ,L261A               
L259B:  JR      NZ,L25BD             
        JR      NZ,L259F               
;----------------------------------------------------
L259F:  POP     HL              ; Restore HL Register
        PUSH    HL              ; Save HL Register
        LD      HL,00147h       ; Cursor Position
        CALL    L2212           ; Set Cursor and Print Text
;----------------------------------------------------
L25A7:  JR      NZ,L25C9             
        JR      NZ,L262A               
L25AB:  JR      NZ,L25CD             
L25AD:  JR      NZ,L25CF             
        JR      NZ,L2630               
L25B1:  JR      NZ,L25D3             
        JR      NZ,L2634               
L25B5:  JR      NZ,L25D7             
L25B7:  JR      NZ,L25D9             
L25B9:  JR      NZ,L25DB             
        JR      NZ,L263C               
L25BD:  JR      NZ,L25DF             
        JR      NZ,L25C1               
;----------------------------------------------------
L25C1:  POP     HL              ; Restore HL Register
        PUSH    HL              ; Save HL Register
        LD      HL,0016Fh       ; Cursor Position
        CALL    L2212           ; Set Cursor and Print Text
;----------------------------------------------------
L25C9:  JR      NZ,L25EB             
        JR      NZ,L264C               
L25CD:  JR      NZ,L25EF             
L25CF:  JR      NZ,L25F1             
        JR      NZ,L2652               
L25D3:  JR      NZ,L25F5             
        JR      NZ,L2656               
L25D7:  JR      NZ,L25F9             
L25D9:  JR      NZ,L25FB             
L25DB:  JR      NZ,L25FD             
        JR      NZ,L265E               
L25DF:  JR      NZ,L2601             
        JR      NZ,L25E3               
;----------------------------------------------------
L25E3:  POP     HL              ; Restore HL Register
        PUSH    HL              ; Save HL Register
        LD      HL,00197h       ; Cursor Position
        CALL    L2212           ; Set Cursor and Print Text
;----------------------------------------------------
L25EB:  JR      NZ,L260D             
        JR      NZ,L266E               
L25EF:  JR      NZ,L2611             
L25F1:  JR      NZ,L2613             
        JR      NZ,L2674               
L25F5:  JR      NZ,L2617             
        JR      NZ,L2678               
L25F9:  JR      NZ,L261B             
L25FB:  JR      NZ,L261D             
L25FD:  JR      NZ,L261F             
        JR      NZ,L2680               
L2601:  JR      NZ,L2623             
        JR      NZ,L2605               
;----------------------------------------------------
L2605:  POP     HL              ; Restore HL Register
        PUSH    HL              ; Save HL Register
        LD      HL,001BFh       ; Cursor Position
        CALL    L2212           ; Set Cursor and Print Text
;----------------------------------------------------
L260D:  JR      NZ,L262F             
        JR      NZ,L2690               
L2611:  JR      NZ,L2633             
L2613:  JR      NZ,L2635             
        JR      NZ,L2696               
L2617:  JR      NZ,L2639             
        JR      NZ,L269A               
L261B:  LD      A,A
        LD      A,A
L261D:  LD      A,A
        LD      A,A
L261F:  JR      NZ,L2641             
        JR      NZ,L26A2               
L2623:  JR      NZ,L2645             
        JR      NZ,L2627               
;----------------------------------------------------
L2627:  POP     HL              ; Restore HL Register
        RET                     ; Return









;----------------------------------------------------
;                 Begin Scene Data
;----------------------------------------------------
;              Scene One - Bank Heist
;   1 left, 2 down, 4 right, 8 up
;----------------------------------------------------
L2629:   .DB  000h015h047h ; Frame 001547
L262C:   .DB  000h031h060h ; Frame 003160 
L262F:   .DB  000h000h000h ;
L2632:   .DB  000h000h000h ;
L2635:   .DB  00Ch             ; 12 Moves in scene

;----------------------------------------------------
;   Difficulty 1:Scene 1:Move 1
;----------------------------------------------------
L2636:   .DB  000h             ;
L2637:   .DB  000h             ; Correct Move   = NONE
L2638:   .DB  000h             ; Incorrect Move = NONE
L2639:   .DB  000h018h000h ; Move Start Frame:  001800
L263C:   .DB  000h000h000h ; Move End Frame:    000000 
L263F:   .DB  000h000h000h ; Death Start Frame: 000000
L2642:   .DB  000h000h000h ; Death End Frame:   000000
L2645:   .DB  000h             ; Restart 
L2646:   .DB  00000h           ; Restart

;----------------------------------------------------
;   Difficulty 1:Scene 1:Move 2
;----------------------------------------------------
L2648:   .DB  000h             ;
L2649:   .DB  090h             ; Correct Move   = FEET
L264A:   .DB  060h             ; Incorrect Move = HANDS
L264B:   .DB  000h019h028h ; Move Start Frame:  001928 
L264E:   .DB  000h019h087h ; Move End Frame:    001987
L2651:   .DB  000h039h030h ; Death Start Frame: 003930 
L2654:   .DB  000h042h034h ; Death End Frame:   004234 
L2657:   .DB  00Ch             ; Restart 12 moves
L2658:   .DW  02636h           ; Restart:  Move 1


;----------------------------------------------------
;   Difficulty 1:Scene 1:Move 3
;----------------------------------------------------
L265A:   .DB  000h             ;
L265B:   .DB  090h             ; Correct Move   = FEET
L265C:   .DB  060h             ; Incorrect Move = HANDS
L265D:   .DB  000h019h090h ; Move Start Frame:  001990 
L2660:   .DB  000h020h040h ; Move End Frame:    002040 
L2663:   .DB  000h039h030h ; Death Start Frame: 003930 
L2666:   .DB  000h042h034h ; Death End Frame:   004234 
L2669:   .DB  00Ch             ; Restart 12 moves
L266A:   .DW  02636h           ; Restart: Move 1
 

;----------------------------------------------------
;   Difficulty 1:Scene 1:Move 4
;----------------------------------------------------
L266C:   .DB  000h&n