; ~AssemblyBandit~ http://briandm82.com ;Frogger v1.0 ;created using Assembly Studio 8x v4.0 ;Program size: 16,302 bytes ;This code is public and can be used by anyone ;Not fully commented, not easy to follow, slightly rushed to make deadline ;Email any bugs, questions, comments, suggestions to briandm82@briandm82.com ;Next version will feature more graphics and use at least 32k bytes ;Macro definitions #define bcall(xxxx) rst 28h \ .dw xxxx #define bjump(xxxx) call 50h \ .dw xxxx ;Ports LinkPort equ $00 ;bit 0=tip, bit 1=ring. KeypadPort equ $01 StatusPort equ $02 ;Batt/Calc Type: bit 0 set if batteries good IntPort equ $03 ;Ack/Enable int: bit 0=On, bit 1=HW1, bit 2=HW2, bit 3=low power, bit 4=link IntStatusPort equ $04 ;use to determine int device/ map memory/ set timer speeds/ check if on pressed MemoryCPort equ $05 ;maps ram page to c ($c000-$ffff) ram only, bit 7 set MemoryAPort equ $06 ;maps memory bank a ($4000-$7fff) rom bits 0-6 ram if bit 7 is set MemoryBPort equ $07 ;maps memory bank b ($8000-$bfff) LinkAssist equ $08 ;sets up link assist interrupts LinkStatus equ $09 ;read link assist status LinkInBuffer equ $0a ;link assist input buffer LinkOutBuffer equ $0d ;link assist output buffer MemoryAHPort equ $0e ;sets bit 7 for rom page in a MemoryBHPort equ $0f ;sets bit 7 for rom page in b LCDInstPort equ $10 ;set register LCDDataPort equ $11 ;set value ;/--LCD Registers and Bits------------------\ LCDOutput equ $01 ;scan mode LCDHSM equ 2 ;0=progressive (def) 1=interlace LCDEntry equ $03 ;max colors,color format,origin,GRAM update LCDHTRI equ 7 ;TRI-DFM 00=2 transfer (def) 11=3 transfer LCDHDFM equ 6 ;TRI-DFM 00=2 transfer (def) 11=3 transfer LCDHBGR equ 4 ;0=BGR 1=RGB (def) LCDLORG equ 7 ;0=absolute (def) 1=window LCDLID1 equ 5 ;ID1-ID0 00=Hdec,Vdec 01=Hdec,Vinc 10=Hinc,Vdec 11=Hinc,Vinc (def) LCDLID0 equ 4 ;ID1-ID0 00=Hdec,Vdec 01=Hdec,Vinc 10=Hinc,Vdec 11=Hinc,Vinc (def) LCDLAM equ 3 ;0=Vertical 1=Horizontal (def) LCDControl equ $07 ;partial image enable, base image enable, 8 color mode LCDHPTDE1 equ 5 ;0=partial image 2 off (def) 1=partial image 2 displayed (clear BASEE) LCDHPTDE0 equ 4 ;0=partial image 1 off (def) 1=partial image 1 displayed (clear BASEE) LCDHBASEE equ 0 ;0=base image off 1=base image displayed (def) LCDLCL equ 3 ;0=full color (def) 1=8 color mode LCDCursorY equ $20 ;cursor Y LCDCursorX equ $21 ;cursor X LCDGRAM equ $22 ;write data to the graphics ram LCDWinYStart equ $50 ;window y top LCDWinYEnd equ $51 ;window y bottom LCDWinXStart equ $52 ;window x left LCDWinXEnd equ $53 ;window x right LCDBaseCtrl equ $61 ;horizontal scrolling, color reverse LCDLVLE equ 1 ;0=disable horizontal scrolling (def) 1=enable horizontal scrolling LCDLREV equ 0 ;0=invert colors 1=normal colors (def) LCDScrollCtrl equ $6a ;0-8 horizontal scroll offset (0-319) LCDP1Display equ $80 ;0-8 partial image 1 display LCDP1Start equ $81 ;0-8 partial image 1 start LCDP1End equ $82 ;0-8 partial image 1 end LCDP2Display equ $83 ;0-8 partial image 2 display LCDP2Start equ $84 ;0-8 partial image 2 start LCDP2End equ $85 ;0-8 partial image 2 end ;\--LCD Registers and Bits------------------/ SpeedPort equ $20 ;write 0=6 Mhz, write 1=15 Mhz Timer1Port equ $30 ;set clock and divisor Timer1Loop equ $31 ;set up loop Timer1Count equ $32 ;set up counter Timer2Port equ $33 ;set clock and divisor Timer2Loop equ $34 ;set up loop Timer2Count equ $35 ;set up counter Timer3Port equ $36 ;set clock and divisor Timer3Loop equ $37 ;set up loop Timer3Count equ $38 ;set up counter LightPort equ $3a ;bit 5 controls backlight ClockPort equ $40 ;turns on clock, $41-$44 set clock, $45-$48 read clock USBOut equ $4a ;controls D+ USBInit1 equ $4c ;used to init usb USBRead equ $4d ;read to check lines USBInit2 equ $54 ;used to init usb USBIntStat equ $55 ;read to check for usb int USBLineStat equ $56 ;read to check line ints USBLineInt equ $57 ;Ack/Enable line ints USBProtocol equ $5b ;enable usb protocol ints USBInit3 equ $8f ;used to init usb ;App EXT_APP = 1 ;ROM Routines _Arc_Unarc equ $4fbd _Mov9ToOP1 equ $4177 _ChkFindSym equ $42e8 _DelVarArc equ $4fab _CreateAppVar equ $4e4f _JForceCmdNoChar equ $4027 ;RAM Addresses tempSwapArea equ $8b8c ;Addresses Stack equ $ffff #include "Ram.inc" ;Keys KDown equ $00 KLeft equ $01 KRight equ $02 KUp equ $03 KF5 equ $04 KF4 equ $05 KF2 equ $06 KF1 equ $07 .org $4000 ;Header (128 bytes) .db 080h, 00Fh .db 000h, 000h, 000h, 000h .db 080h, 012h .db 001h, 00Fh .db 080h, 021h .db 001h .db 080h, 031h .db 0A1h .db 080h, 048h .db "Frogger",0 ;make sure this is 8 bytes .db 080h, 081h .db 001h .db 080h, 090h .db 003h, 026h, 009h, 004h .db 01Eh, 0FFh, 02Bh, 057h .db 002h, 00Dh, 040h, 0A1h, 06Bh, 099h, 0F6h, 059h, 0BCh, 067h .db 0F5h, 085h, 09Ch, 009h, 06Ch, 00Fh, 0B4h, 003h, 09Bh, 0C9h .db 003h, 032h, 02Ch, 0E0h, 003h;, 020h, 0E3h, 02Ch IntJump: ;4040 ;fit the jump right in here jp Interrupt .db 0F4h, 02Dh .db 073h, 0B4h, 027h, 0C4h, 0A0h, 072h, 054h, 0B9h, 0EAh, 07Ch .db 03Bh, 0AAh, 016h, 0F6h, 077h, 083h, 07Ah, 0EEh, 01Ah, 0D4h .db 042h, 04Ch, 06Bh, 08Bh, 013h, 01Fh, 0BBh, 093h, 08Bh, 0FCh .db 019h, 01Ch, 03Ch, 0ECh, 04Dh, 0E5h, 075h .db 080h, 07Fh .db 000h, 000h, 000h, 000h .db 000h, 000h, 000h, 000h .db 000h, 000h, 000h, 000h .db 000h, 000h, 000h, 000h .db 000h, 000h, 000h, 000h AppStart: ;$4080 jp AppContinue ;*Interrupt* Interrupt: ;$4083 ;125 bytes max or run over int table! ex af,af' exx ;--- UpdateKeys --- ;Stores pressed keys to KeyFlag ;doesnt allow repeating keypresses ld a,$fe ; a=(||||,up,right,left,down) out (KeypadPort),a nop nop nop nop nop nop nop nop in a,(KeypadPort) and $0f ; a=(||||,up,right,left,down) ld b,a ld a,$ff out (KeypadPort),a nop nop nop nop nop nop nop nop ld a,$bf ; a=(|||,f1,f2,f3,f4,f5) out (KeypadPort),a nop nop nop nop nop nop nop nop in a,(KeypadPort) rra rr c rra rr c rra ; lose f3 rra rr c rra rr c ld a,c and $f0 or b ; a=(f1,f2,f4,f5,up,right,left,down) ld b,a ld a,$ff out (KeypadPort),a ld a,(OldKey) xor 255 ; and $f6 ;allows up down repeating or b ;ignore key while held down ld c,a ld a,(KeyFlag) and c ;keep key clear if not acknowledged but add any new presses ld (KeyFlag),a ;reset bit = button pressed ld a,b ld (OldKey),a EndInt: ld a,$08 out (IntPort),a ;clear ld a,$0a out (IntPort),a ;acknowledge ld a,$0a out (IntPort),a ;enable ex af,af' exx ei reti .pad $4100 IntTable: ;257 bytes .db $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40 .db $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40 .db $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40 .db $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40 .db $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40 .db $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40 .db $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40 .db $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40 .db $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40 .db $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40 .db $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40 .db $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40 .db $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40 .db $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40 .db $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40 .db $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40, $40 .db $40 AppContinue: ;$4201 ;*Load High Scores* Load: ld hl,VarName ;find or create high score appvar bcall(_Mov9ToOP1) bcall(_ChkFindSym) jp nc,VarFound CreateVar: ld hl,VarName bcall(_Mov9ToOP1) ld hl,70 ;high score app var is 70 bytes long bcall(_CreateAppVar) ;expecting os to handle a memory error push de inc de inc de ld hl,InitHighScoreData ld bc,70 ldir pop de jp VarInRam VarFound: ld a,b or a jp z,VarInRam ld hl,VarName bcall(_Mov9ToOP1) bcall(_Arc_Unarc) ;expecting os to handle a memory error jp Load ;find again in ram VarInRam: inc de ;skip over size inc de ex de,hl ld de,tempSwapArea ;copy score data ld bc,70 ldir ;*Set Up Hardware* di ld a,1 out (SpeedPort),a ;set speed to 15Mhz ;Clear timers xor a out (Timer1Port),a ; turn off timers out (Timer2Port),a out (Timer3Port),a ;Set up fast int only enabling hw1 out ($04),a ;fast ints out ($5b),a ;disable usb ints (XXXXXXX doesnt disable upon disconnecting and pressing on) ld a,$41 ld i,a im 2 ld a,$08 out (IntPort),a ;clear in a,(IntStatusPort) and $07 or $08 out (IntPort),a ;acknowledge any pending ints ld a,$0a out (IntPort),a ;enable only HW1 Timer ints ld a,LCDEntry ;save entry call DisplayReadHL push hl ld a,LCDControl ;save control call DisplayReadHL push hl ld a,LCDBaseCtrl ;save base control call DisplayReadHL push hl call SetOrigin ld a,$82 ;change second memory bank $c000-$ffff out (MemoryCPort),a ld hl,$c000 ;initialize $c000 ram page xor a ld (hl),a ld de,$c001 ld bc,$3fff ;16383 ldir ld hl,0 add hl,sp ;get stack ld sp,Stack ;set stack push hl ;save stack ld hl,tempSwapArea ;copy score data ld de,HighScoreTable ld bc,70 ldir ld hl,Rand ;Initialize random ld a,r and $3f ld d,0 ld e,a add hl,de ld (RandIndex),hl ;*Display Title Screen* Title: call ClearScreen call HighRes call HideImage ld bc,$0d00 call Pause ld hl,BlogStr call ShowString ld hl,CreditStr call ShowString call DisplayTitle ld hl,StartStr call ShowString call WriteHighScores call ShowImage call Wait call HideImage ld a,3 ld (Lives),a xor a ld (Score),a ld (Score+1),a ld (Score+2),a ld (Level),a GameInit: call SetScreen ld bc,$0d00 call Pause ld hl,BackgroundImage call DrawScreen call CopyLivesBG call DrawLives call SetUpLevel call DFInit call UpdateScreen call ShowScreen ld hl,KeyStart MainKeyLoop: ei halt di ld a,(FrameCounter) or a jp z,KeyStart dec a ld (FrameCounter),a jp nz,KeyDone jp (hl) KeyStart: ld a,(KeyFlag) bit KUp,a jp z,UpPress ;use calls to read simultaneous presses must save a! bit KDown,a jp z,DownPress bit KLeft,a jp z,LeftPress ;use calls to read simultaneous presses must save a! bit KRight,a jp z,RightPress ld hl,KeyStart KeyDone: in a,(IntStatusPort) ;have on button exit immediately out of program bit 3,a jp z,Exit push hl call UpdateScreen pop hl jp MainKeyLoop UpPress: set KUp,a ld (KeyFlag),a ;acknowledge key press ld a,(FrogY) cp 97 jp c,UpWater ld a,30 ld (FrameCounter),a ld (FrogMoving),a ld a,(FrogY) ld b,8 sub b ld (FrogY),a xor a ld (FrogDir),a ld hl,FrogJumpImage ld (FrogFrame),hl call DrawFrog ld hl,UpFinish jp KeyDone UpFinish: ld a,20 ld (FrameCounter),a ld a,(FrogY) ld b,8 sub b ld (FrogY),a ld hl,FrogSitImage ld (FrogFrame),hl call DrawFrog xor a ld (FrogMoving),a ld hl,KeyStart jp KeyDone UpWater: cp 24 jp nz,NoUpAlign ld a,(FrogX) sub 16 and $f8 add a,20 cp 20 jp nc,CheckUpRight ld a,20 jp UpXGood CheckUpRight cp 165 jp c,UpXGood ld a,164 UpXGood: ld (FrogX),a NoUpAlign: ld a,30 ld (FrameCounter),a ld (FrogMoving),a ld a,(FrogY) ld b,12 sub b ld (FrogY),a xor a ld (FrogDir),a ld hl,FrogJumpImage ld (FrogFrame),hl call DrawFrog ld hl,UpWaterFinish jp KeyDone UpWaterFinish: ld a,20 ld (FrameCounter),a ld a,(FrogY) ld b,12 sub b ld (FrogY),a ld hl,FrogSitImage ld (FrogFrame),hl call DrawFrog xor a ld (FrogMoving),a ld hl,KeyStart jp KeyDone DownPress: set KDown,a ld (KeyFlag),a ;acknowledge key press ld a,(FrogY) cp 224 jp z,KeyDone cp 96 jp c,DownWater ld a,30 ld (FrameCounter),a ld (FrogMoving),a ld a,(FrogY) ld b,8 add a,b ld (FrogY),a ld a,2 ld (FrogDir),a ld hl,FrogJumpImage ld (FrogFrame),hl call DrawFrog ld hl,DownFinish jp KeyDone DownFinish: ld a,20 ld (FrameCounter),a ld a,(FrogY) ld b,8 add a,b ld (FrogY),a ld hl,FrogSitImage ld (FrogFrame),hl call DrawFrog xor a ld (FrogMoving),a ld hl,KeyStart jp KeyDone DownWater: cp 72 jp nz,NoDownAlign ld a,(FrogX) sub 16 and $f8 add a,20 cp 20 jp nc,CheckDownRight ld a,20 jp DownXGood CheckDownRight cp 165 jp c,DownXGood ld a,164 DownXGood: ld (FrogX),a NoDownAlign: ld a,30 ld (FrameCounter),a ld (FrogMoving),a ld a,(FrogY) ld b,12 add a,b ld (FrogY),a ld a,2 ld (FrogDir),a ld hl,FrogJumpImage ld (FrogFrame),hl call DrawFrog ld hl,DownWaterFinish jp KeyDone DownWaterFinish: ld a,20 ld (FrameCounter),a ld a,(FrogY) ld b,12 add a,b ld (FrogY),a ld hl,FrogSitImage ld (FrogFrame),hl call DrawFrog xor a ld (FrogMoving),a ld hl,KeyStart jp KeyDone LeftPress: set KLeft,a ld (KeyFlag),a ;acknowledge key press ld a,(FrogX) cp 21 jp c,KeyDone ld a,30 ld (FrameCounter),a ld (FrogMoving),a ld a,(FrogX) ld b,4 sub b ld (FrogX),a ld a,3 ld (FrogDir),a ld hl,FrogJumpImage ld (FrogFrame),hl call DrawFrog ld hl,LeftFinish jp KeyDone LeftFinish: ld a,20 ld (FrameCounter),a ld a,(FrogX) ld b,4 sub b ld (FrogX),a ld hl,FrogSitImage ld (FrogFrame),hl call DrawFrog xor a ld (FrogMoving),a ld hl,KeyStart jp KeyDone RightPress: set KRight,a ld (KeyFlag),a ;acknowledge key press ld a,(FrogX) cp 164 jp nc,KeyDone ld a,30 ld (FrameCounter),a ld (FrogMoving),a ld a,(FrogX) ld b,4 add a,b ld (FrogX),a ld a,1 ld (FrogDir),a ld hl,FrogJumpImage ld (FrogFrame),hl call DrawFrog ld hl,RightFinish jp KeyDone RightFinish: ld a,20 ld (FrameCounter),a ld a,(FrogX) ld b,4 add a,b ld (FrogX),a ld hl,FrogSitImage ld (FrogFrame),hl call DrawFrog xor a ld (FrogMoving),a ld hl,KeyStart jp KeyDone UpdateScreen: ;moves sprites on screen ld hl,(FlyTimer) dec hl ld (FlyTimer),hl ld a,h or l jp nz,CheckAlligator ld a,(FrogMoving) or a jp z,UpdateFly inc hl ld (FlyTimer),hl jp CheckAlligator UpdateFly: call FlyTimerExpire CheckAlligator: ld hl,(AlligatorTimer) dec hl ld (AlligatorTimer),hl ld a,h or l jp nz,SkipSmallUpdate ld a,(FrogMoving) or a jp z,UpdateAlligator inc hl ld (AlligatorTimer),hl jp SkipSmallUpdate UpdateAlligator: call AlligatorTimerExpire SkipSmallUpdate: ld a,(Lane1Count) ;get number of vehicles for lane or a jp z,Lane2Update ;if none, skip ld b,a ld a,(Lane1Timer) inc a ld (Lane1Timer),a jp nz,Lane2Update ;skip if timer hasn't expired ld a,(Lane1Speed) ld (Lane1Timer),a ;reset timer with speed push bc ld hl,Lane1Car1X ;inc/dec each vehicles x location ld a,(Lane1Dir) cp 3 ;left jp z,Lane1DecXLoop Lane1IncXLoop: ld a,(hl) inc a ld (hl),a inc hl djnz Lane1IncXLoop jp L1XDone Lane1DecXLoop: ld a,(hl) dec a ld (hl),a inc hl djnz Lane1DecXLoop L1XDone: pop bc ld ix,Lane1Car1X ld hl,Lane1Car1Sprite ;draw vehicle if on screen L1DrawLoop: push bc push hl ld a,(hl) inc hl ld h,(hl) ld l,a ld a,(ix) cp 177 jp nc,SkipL1Draw ld b,a ld a,(Lane1Y) ld c,a ld a,(Lane1Dir) call DrawVehicle SkipL1Draw: pop hl inc hl inc hl inc ix pop bc djnz L1DrawLoop ld a,(CollisionOccured) or a jp nz, Collision Lane2Update: ld a,(Lane2Count) or a jp z,Lane3Update ld b,a ld a,(Lane2Timer) inc a ld (Lane2Timer),a jp nz,Lane3Update ;skip if timer hasn't expired ld a,(Lane2Speed) ld (Lane2Timer),a ;reset timer with speed push bc ld hl,Lane2Car1X ;inc/dec each vehicles x location ld a,(Lane2Dir) cp 3 ;left jp z,Lane2DecXLoop Lane2IncXLoop: ld a,(hl) inc a ld (hl),a inc hl djnz Lane2IncXLoop jp L2XDone Lane2DecXLoop: ld a,(hl) dec a ld (hl),a inc hl djnz Lane2DecXLoop L2XDone: pop bc ld ix,Lane2Car1X ld hl,Lane2Car1Sprite ;draw vehicle if on screen L2DrawLoop: push bc push hl ld a,(hl) inc hl ld h,(hl) ld l,a ld a,(ix) cp 177 jp nc,SkipL2Draw ld b,a ld a,(Lane2Y) ld c,a ld a,(Lane2Dir) call DrawVehicle SkipL2Draw: pop hl inc hl inc hl inc ix pop bc djnz L2DrawLoop ld a,(CollisionOccured) or a jp nz, Collision Lane3Update: ld a,(Lane3Count) or a jp z,Stream1Update ld b,a ld a,(Lane3Timer) inc a ld (Lane3Timer),a jp nz,Stream1Update ;skip if timer hasn't expired ld a,(Lane3Speed) ld (Lane3Timer),a ;reset timer with speed push bc ld hl,Lane3Car1X ;inc/dec each vehicles x location ld a,(Lane3Dir) cp 3 ;left jp z,Lane3DecXLoop Lane3IncXLoop: ld a,(hl) inc a ld (hl),a inc hl djnz Lane3IncXLoop jp L3XDone Lane3DecXLoop: ld a,(hl) dec a ld (hl),a inc hl djnz Lane3DecXLoop L3XDone: pop bc ld ix,Lane3Car1X ld hl,Lane3Car1Sprite ;draw vehicle if on screen L3DrawLoop: push bc push hl ld a,(hl) inc hl ld h,(hl) ld l,a ld a,(ix) cp 177 jp nc,SkipL3Draw ld b,a ld a,(Lane3Y) ld c,a ld a,(Lane3Dir) call DrawVehicle SkipL3Draw: pop hl inc hl inc hl inc ix pop bc djnz L3DrawLoop ld a,(CollisionOccured) or a jp nz, Collision Stream1Update: ld a,(Stream1Count) ;get number of objects for stream ld b,a ld de,1 ld hl,(Stream1AnimTimer) add hl,de ld (Stream1AnimTimer),hl jp nc,SkipS1AnimUpdate ld a,(FrogMoving) or a jp z,S1AnimFNM ld a,(FrogY) cp 84 jp z,S1AnimFM cp 72 jp z,S1AnimFM cp 60 jp z,S1AnimFM jp S1AnimFNM S1AnimFM: ;frog is moving so dont update now, but set to update after move dec hl ld (Stream1AnimTimer),hl jp SkipS1AnimUpdate S1AnimFNM: ld hl,(Stream1AnimSpeed) ld (Stream1AnimTimer),hl ld a,(Stream1Anim) inc a ld (Stream1Anim),a call S1AnimRedraw ;redraw turtles and frog if necessary SkipS1AnimUpdate: ld a,(Stream1Timer) inc a ld (Stream1Timer),a jp nz,Stream2Update ;skip if no timer expiration ld a,(FrogMoving) or a jp z,S1FNM ld a,(FrogY) cp 84 jp z,S1FM cp 72 jp z,S1FM cp 60 jp z,S1FM jp S1FNM S1FM: ;frog is moving so dont update ld a,(Stream1Timer) dec a ld (Stream1Timer),a jp Stream2Update S1FNM: ld a,(Stream1Speed) ld (Stream1Timer),a ;reset timer with speed ld a,(Stream1Count) ;get number of objects for stream ld b,a ld hl,Stream1Object1X ;inc/dec each objects x location ld a,(Stream1Dir) cp 3 ;left jp z,Stream1DecXLoop Stream1IncXLoop: ld a,(hl) inc a ld (hl),a inc hl djnz Stream1IncXLoop jp S1XDone Stream1DecXLoop: ld a,(hl) dec a ld (hl),a inc hl djnz Stream1DecXLoop S1XDone: ld a,(FrogY) cp 72 jp nz,SkipFC1 call WaterFrog SkipFC1: ld a,(Stream1Count) ;get number of objects for stream ld b,a ld ix,Stream1Object1X ld hl,Stream1Object1Sprite ;draw object if on screen S1DrawLoop: push bc push hl ld a,(hl) ld hl,LogImage or a jp z,S1Log ld hl,TurtleAnim ld a,(Stream1Anim) and $07 rla ld d,0 ld e,a add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a S1Log: ld a,(ix) cp 177 jp nc,SkipS1Draw ld b,a ld a,(Stream1Y) ld c,a ld a,(Stream1Dir) call DrawFloat SkipS1Draw: pop hl inc hl inc ix pop bc djnz S1DrawLoop ld a,(FrogY) cp 72 jp nz,Stream2Update ld a,(Stream1Dir) cp 3 ;left ld a,(FrogX) jp z,S1FrogDec inc a jp S1FrogDone S1FrogDec: dec a S1FrogDone: ld hl,FrogSitImage ld (FrogFrame),hl ld (FrogX),a call DFInit jp Stream2Update S1AnimRedraw: ld a,(FrogY) cp 72 jp nz,SkipFCAR1 push bc call WaterFrog pop bc SkipFCAR1: ld ix,Stream1Object1X ld hl,Stream1Object1Sprite ;draw object if on screen S1ARDrawLoop: push bc push hl ld a,(hl) ld hl,LogImage or a jp z,S1ARLog ld hl,TurtleAnim ld a,(Stream1Anim) and $07 rla ld d,0 ld e,a add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a S1ARLog: ld a,(ix) cp 177 jp nc,SkipS1ARDraw ld b,a ld a,(Stream1Y) ld c,a ld a,(Stream1Dir) call DrawFloat SkipS1ARDraw: pop hl inc hl inc ix pop bc djnz S1ARDrawLoop ld a,(FrogY) cp 72 ret nz jp DFInit Stream2Update: ld a,(Stream2Count) ;get number of objects for stream ld b,a ld de,1 ld hl,(Stream2AnimTimer) add hl,de ld (Stream2AnimTimer),hl jp nc,SkipS2AnimUpdate ld a,(FrogMoving) or a jp z,S2AnimFNM ld a,(FrogY) cp 36 jp z,S2AnimFM cp 48 jp z,S2AnimFM cp 60 jp z,S2AnimFM jp S2AnimFNM S2AnimFM: ;frog is moving so dont update dec hl ld (Stream2AnimTimer),hl jp SkipS2AnimUpdate S2AnimFNM: ld hl,(Stream2AnimSpeed) ld (Stream2AnimTimer),hl ld a,(Stream2Anim) inc a ld (Stream2Anim),a call S2AnimRedraw ;redraw turtles SkipS2AnimUpdate: ld a,(Stream2Timer) inc a ld (Stream2Timer),a jp nz,Stream3Update ;skip if no timer expiration ld a,(FrogMoving) or a jp z,S2FNM ld a,(FrogY) cp 36 jp z,S2FM cp 48 jp z,S2FM cp 60 jp z,S2FM jp S2FNM S2FM: ;frog is moving so dont update ld a,(Stream2Timer) dec a ld (Stream2Timer),a jp Stream3Update S2FNM: ld a,(Stream2Speed) ld (Stream2Timer),a ;reset timer with speed ld a,(Stream2Count) ;get number of objects for stream ld b,a ld hl,Stream2Object1X ;inc/dec each objects x location ld a,(Stream2Dir) cp 3 ;left jp z,Stream2DecXLoop Stream2IncXLoop: ld a,(hl) inc a ld (hl),a inc hl djnz Stream2IncXLoop jp S2XDone Stream2DecXLoop: ld a,(hl) dec a ld (hl),a inc hl djnz Stream2DecXLoop S2XDone: ld a,(FrogY) cp 48 jp nz,SkipFC2 call WaterFrog SkipFC2: ld a,(Stream2Count) ;get number of objects for stream ld b,a ld ix,Stream2Object1X ld hl,Stream2Object1Sprite ;draw object if on screen S2DrawLoop: push bc push hl ld a,(hl) ld hl,LogImage or a jp z,S2Log ld hl,TurtleAnim ld a,(Stream2Anim) and $07 rla ld d,0 ld e,a add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a S2Log: ld a,(ix) cp 177 jp nc,SkipS2Draw ld b,a ld a,(Stream2Y) ld c,a ld a,(Stream2Dir) call DrawFloat SkipS2Draw: pop hl inc hl inc ix pop bc djnz S2DrawLoop ld a,(FrogY) cp 48 jp nz,Stream3Update ld a,(Stream2Dir) cp 3 ;left ld a,(FrogX) jp z,S2FrogDec inc a jp S2FrogDone S2FrogDec: dec a S2FrogDone: ld hl,FrogSitImage ld (FrogFrame),hl ld (FrogX),a call DFInit jp Stream3Update S2AnimRedraw: ld a,(FrogY) cp 48 jp nz,SkipFCAR2 push bc call WaterFrog pop bc SkipFCAR2: ld ix,Stream2Object1X ld hl,Stream2Object1Sprite ;draw object if on screen S2ARDrawLoop: push bc push hl ld a,(hl) ld hl,LogImage or a jp z,S2ARLog ld hl,TurtleAnim ld a,(Stream2Anim) and $07 rla ld d,0 ld e,a add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a S2ARLog: ld a,(ix) cp 177 jp nc,SkipS2ARDraw ld b,a ld a,(Stream2Y) ld c,a ld a,(Stream2Dir) call DrawFloat SkipS2ARDraw: pop hl inc hl inc ix pop bc djnz S2ARDrawLoop ld a,(FrogY) cp 48 ret nz jp DFInit Stream3Update: ld a,(Stream3Count) ;get number of objects for stream ld b,a ld de,1 ld hl,(Stream3AnimTimer) add hl,de ld (Stream3AnimTimer),hl jp nc,SkipS3AnimUpdate ld a,(FrogMoving) or a jp z,S3AnimFNM ld a,(FrogY) cp 36 jp z,S3AnimFM cp 24 jp z,S3AnimFM cp 12 jp z,S3AnimFM jp S3AnimFNM S3AnimFM: ;frog is moving so dont update dec hl ld (Stream3AnimTimer),hl jp SkipS3AnimUpdate S3AnimFNM: ld hl,(Stream3AnimSpeed) ld (Stream3AnimTimer),hl ld a,(Stream3Anim) inc a ld (Stream3Anim),a call S3AnimRedraw ;redraw turtles SkipS3AnimUpdate: ld a,(Stream3Timer) inc a ld (Stream3Timer),a ret nz ;return if no timer expiration ld a,(FrogMoving) or a jp z,S3FNM ld a,(FrogY) cp 36 jp z,S3FM cp 24 jp z,S3FM cp 12 jp z,S3FM jp S3FNM S3FM: ;frog is moving so dont update ld a,(Stream3Timer) dec a ld (Stream3Timer),a ret S3FNM: ld a,(Stream3Speed) ld (Stream3Timer),a ;reset timer with speed ld a,(Stream3Count) ;get number of objects for stream ld b,a ld hl,Stream3Object1X ;inc/dec each objects x location ld a,(Stream3Dir) cp 3 ;left jp z,Stream3DecXLoop Stream3IncXLoop: ld a,(hl) inc a ld (hl),a inc hl djnz Stream3IncXLoop jp S3XDone Stream3DecXLoop: ld a,(hl) dec a ld (hl),a inc hl djnz Stream3DecXLoop S3XDone: ld a,(FrogY) cp 24 jp nz,SkipFC3 call WaterFrog SkipFC3: ld a,(Stream3Count) ;get number of objects for stream ld b,a ld ix,Stream3Object1X ld hl,Stream3Object1Sprite ;draw object if on screen S3DrawLoop: push bc push hl ld a,(hl) ld hl,LogImage or a jp z,S3Log ld hl,TurtleAnim ld a,(Stream3Anim) and $07 rla ld d,0 ld e,a add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a S3Log: ld a,(ix) cp 177 jp nc,SkipS3Draw ld b,a ld a,(Stream3Y) ld c,a ld a,(Stream3Dir) call DrawFloat SkipS3Draw: pop hl inc hl inc ix pop bc djnz S3DrawLoop ld a,(FrogY) cp 24 ret nz ld a,(Stream3Dir) cp 3 ;left ld a,(FrogX) jp z,S3FrogDec inc a jp S3FrogDone S3FrogDec: dec a S3FrogDone: ld hl,FrogSitImage ld (FrogFrame),hl ld (FrogX),a jp DFInit S3AnimRedraw: ld a,(FrogY) cp 24 jp nz,SkipFCAR3 push bc call WaterFrog pop bc SkipFCAR3: ld ix,Stream3Object1X ld hl,Stream3Object1Sprite ;draw object if on screen S3ARDrawLoop: push bc push hl ld a,(hl) ld hl,LogImage or a jp z,S3ARLog ld hl,TurtleAnim ld a,(Stream3Anim) and $07 rla ld d,0 ld e,a add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a S3ARLog: ld a,(ix) cp 177 jp nc,SkipS3ARDraw ld b,a ld a,(Stream3Y) ld c,a ld a,(Stream3Dir) call DrawFloat SkipS3ARDraw: pop hl inc hl inc ix pop bc djnz S3ARDrawLoop ld a,(FrogY) cp 24 ret nz jp DFInit SetScreen: ;sets up 160 mode ld a,LCDOutput call DisplayReadHL set LCDHSM,h ;set interlace call DisplayWriteHL ld hl,0 ld a,LCDP1Display call DisplayWriteHL ;set display 1 ld hl,16 ld de,175 ld a,LCDP1Start call DisplayWriteHLDE ;set start and end 1 ld hl,160 ld a,LCDP2Display call DisplayWriteHL ;set display 2 ld hl,16 ld de,175 ld a,LCDP2Start call DisplayWriteHLDE ;set start and end 2 ld a,LCDControl call DisplayReadHL res LCDHBASEE,h jp DisplayWriteHL DrawScreen: ;draws full screen double size h=l image push hl ld hl,0 ld (DrawRowIndex),hl ;reset drawrowindex call SetFullLowResWindow call SetCursor xor a ;set ir out (LCDInstPort),a ld a,LCDGRAM out (LCDInstPort),a pop hl push hl pop ix inc hl ;first byte points to signal which has been copied CD: ld a,(hl) inc hl cp (ix) ;if not signal, drawcolor jp z,DecompressDS ;if signal wait for other 2 bytes then loop draw push hl call DrawColor pop hl jp CD DecompressDS: ;gets next two bytes to loop draw ld a,(hl) or a ret z ;finished drawing image inc hl ld b,a ;save loop count ld a,(hl) ld c,a inc hl push hl ;save hl for main loop DCDSLoop: ld a,c push bc call DrawColor ;draw color b times pop bc djnz DCDSLoop pop hl jp CD DrawColor: ;a= byte of data ld hl,DrawRowData ld de,(DrawRowIndex) add hl,de ld (hl),a inc de ld (DrawRowIndex),de out (LCDDataPort),a out (LCDDataPort),a ld a,(DrawRowIndex) cp 160 ret nz ld hl,0 ld (DrawRowIndex),hl ;reset drawrowindex ld b,160 ld hl,DrawRowData DRLoop: ld a,(hl) inc hl ld e,a out (LCDDataPort),a out (LCDDataPort),a djnz DRLoop ret DrawFrog: ;8x8, transparent ;FrogX, FrogY, FrogDir, FrogFrame should be set call DrawBackground DFInit: ld h,0 ;set frog window ld de,15 ld a,(FrogY) ld l,a add a,e ld e,a ld a,LCDWinYStart call DisplayWriteHLDE ;set y ld h,0 ld de,7 ld a,(FrogX) ld l,a add a,e ld e,a ld a,LCDWinXStart call DisplayWriteHLDE ;set x ;if x>=104 and <201 check for collision in road ld a,(CollisionOccured) or a jp nz,OutOfRoad ; if collision has occured don't check else infinite loop ld a,(FrogY) cp 73 jp nc,CheckRoad cp 72 jp z,CheckWater cp 48 jp z,CheckWater cp 24 jp z,CheckWater cp 0 jp z,CheckWin jp OutOfRoad CheckRoad: cp 104 jp c,OutOfRoad cp 201 jp nc,OutOfRoad call CopyBackgroundCheckCollision jp DFSC CheckWater: call CopyBackgroundCheckWaterCollision jp DFSC OutOfRoad: call CopyBackground ;get erase data for frog DFSC: call SetCursor ld a,(FrogDir) or a jp z,DFVertical cp 1 jp nz,CheckDown call SetID01 call ResetAM jp DFHorizontal CheckDown: cp 2 jp nz,FFaceLeft call SetID10 jp DFVertical FFaceLeft: call SetID10 call ResetAM jp DFHorizontal DFVertical: xor a ;set ir out (LCDInstPort),a ld a,LCDGRAM out (LCDInstPort),a ld hl,(FrogFrame) ld de,8 ld b,8 DFLoop: ld c,b ld b,e DFRowLoop: ld a,(hl) ;draw row inc hl or a jp nz,NotTransparent1 in a,(LCDDataPort) in a,(LCDDataPort) ;dummy reads in a,(LCDDataPort) NotTransparent1: out (LCDDataPort),a out (LCDDataPort),a djnz DFRowLoop or a sbc hl,de ld b,e DFDupRowLoop: ld a,(hl) ;draw dup row inc hl or a jp nz,NotTransparent2 in a,(LCDDataPort) in a,(LCDDataPort) ;dummy reads in a,(LCDDataPort) NotTransparent2: out (LCDDataPort),a out (LCDDataPort),a djnz DFDupRowLoop ld b,c djnz DFLoop jp SetID11 DFHorizontal: xor a ;set ir out (LCDInstPort),a ld a,LCDGRAM out (LCDInstPort),a ld hl,(FrogFrame) ld b,64 DFColLoop: ld a,(hl) ;draw col inc hl or a jp nz,NotTransparent3 in a,(LCDDataPort) in a,(LCDDataPort) ;dummy reads in a,(LCDDataPort) NotTransparent3: out (LCDDataPort),a out (LCDDataPort),a out (LCDDataPort),a out (LCDDataPort),a djnz DFColLoop call SetAM jp SetID11 WaterFrog: ;clears frog over water ld h,0 ;set frog window ld de,15 ld a,(FrogY) ld l,a add a,e ld e,a ld a,LCDWinYStart call DisplayWriteHLDE ;set y ld h,0 ld de,7 ld a,(FrogX) ld l,a add a,e ld e,a ld a,LCDWinXStart call DisplayWriteHLDE ;set x call SetCursor xor a ;set ir out (LCDInstPort),a ld a,LCDGRAM out (LCDInstPort),a ld b,128 WFLoop: ld a,$1a out (LCDDataPort),a out (LCDDataPort),a djnz WFLoop ret DrawSmall: ;8x8 small sprite at a,2 ;a=x ;hl points to sprite push hl ld h,0 ld de,7 ld l,a add a,e ld e,a ld a,LCDWinXStart call DisplayWriteHLDE ;set x ld hl,2 ;set window ld de,17 ld a,LCDWinYStart call DisplayWriteHLDE ;set y call SetCursor xor a ;set ir out (LCDInstPort),a ld a,LCDGRAM out (LCDInstPort),a pop hl ld de,8 ld b,8 DSLoop: ld c,b ld b,e DSRowLoop: ld a,(hl) ;draw row inc hl out (LCDDataPort),a out (LCDDataPort),a djnz DSRowLoop or a sbc hl,de ld b,e DSDupRowLoop: ld a,(hl) ;draw dup row inc hl out (LCDDataPort),a out (LCDDataPort),a djnz DSDupRowLoop ld b,c djnz DSLoop ret CheckWin: ;0=nothing, 1=occupied, 2=fly, 3=alligator ld a,(FrogX) ld e,0 cp 28 jp z,CheckHole inc e cp 60 jp z,CheckHole inc e cp 92 jp z,CheckHole inc e cp 124 jp z,CheckHole inc e cp 156 jp z,CheckHole Dead: ld a,1 ld (CollisionOccured),a call CopyBackground jp Collision CheckHole: ld d,0 ld hl,Hole1 add hl,de push af push hl ld a,(hl) or a jp z,Occupy cp 2 jp z,Bonus pop hl pop af jp Dead Bonus: ;flash screen, give extra points ld a,(Score) ld hl,(Score+1) ld de,200 ;+200 points for catching the fly add hl,de adc a,0 ld (Score),a ld (Score+1),hl call FlashScreen ld bc,$0600 call Pause call FlashScreen Occupy: ;restart frog, place small frog in location pop hl ld a,1 ld (hl),a ld a,(Score) ld hl,(Score+1) ld de,500 ;+500 points for landing in hole add hl,de adc a,0 ld (Score),a ld (Score+1),hl ld hl,Hole1 ld b,5 OccupyLoop: ld a,(hl) cp 1 jp nz,NotFull inc hl djnz OccupyLoop pop af ld hl,SmallFrogImage call DrawSmall pop hl ;pop return from draw frog ld bc,0 call Pause call Pause call Pause jp EndLevel NotFull: ld a,92 ld (FrogX),a ld a,224 ld (FrogY),a xor a ld (FrogDir),a ld hl,FrogSitImage ld (FrogFrame),hl call DFInit pop af ld hl,SmallFrogImage call DrawSmall xor a ld (FrogMoving),a ld hl,KeyStart pop hl ;pop return from draw frog jp KeyDone FlyTimerExpire: ;check if fly exists, if so delete ;if not, add fly to random open spot ;reset timer ld hl,Hole1 ld b,5 FlyLoop: ld a,(hl) cp 2 jp z,DeleteFly inc hl djnz FlyLoop ld a,r and $07 cp 5 jp nc,ResetFlyTimer ld d,0 ld e,a ld hl,Hole1 add hl,de ld a,(hl) or a jp nz,ResetFlyTimer ld a,2 ld (hl),a ld hl,HoleLocation add hl,de ld a,(hl) ld hl,SmallFlyImage call DrawSmall jp ResetFlyTimer DeleteFly: xor a ld (hl),a ld a,b sub 5 neg ld d,0 ld e,a ld hl,HoleLocation add hl,de ld a,(hl) ld hl,SmallWaterImage call DrawSmall ResetFlyTimer: call RandomHL ld (FlyTimer),hl ret AlligatorTimerExpire: ld hl,Hole1 ld b,5 AlligatorLoop: ld a,(hl) cp 3 jp z,DeleteAlligator inc hl djnz AlligatorLoop ld a,r and $07 cp 5 jp nc,ResetAlligatorTimer ld d,0 ld e,a ld hl,Hole1 add hl,de ld a,(hl) or a jp nz,ResetAlligatorTimer ld a,3 ld (hl),a ld hl,HoleLocation add hl,de ld a,(hl) ld hl,SmallAlligatorImage call DrawSmall jp ResetAlligatorTimer DeleteAlligator: xor a ld (hl),a ld a,b sub 5 neg ld d,0 ld e,a ld hl,HoleLocation add hl,de ld a,(hl) ld hl,SmallWaterImage call DrawSmall ResetAlligatorTimer: call RandomHL ld (AlligatorTimer),hl ret RandomHL: ld a,r rla ld b,a ld a,r rra rr b ld l,b ld a,r rla ld b,a ld a,r rra rr b ld a,b and $1f ld h,a or l ret nz inc hl ret CopyLivesBG: ld hl,224 ;set window ld de,224+15 ld a,LCDWinYStart call DisplayWriteHLDE ;set y ld hl,20 ld de,20+7 ld a,LCDWinXStart call DisplayWriteHLDE ;set x call SetCursor ld hl,Life1BG call CLBG ld hl,28 ld de,28+7 ld a,LCDWinXStart call DisplayWriteHLDE ;set x call SetCursor ld hl,Life2BG call CLBG ld hl,36 ld de,36+7 ld a,LCDWinXStart call DisplayWriteHLDE ;set x call SetCursor ld hl,Life3BG CLBG: xor a ;set ir out (LCDInstPort),a ld a,LCDGRAM out (LCDInstPort),a ld e,8 ld b,8 CL1Loop: ld c,b ld b,e CL1RowLoop: in a,(LCDDataPort) in a,(LCDDataPort) ;dummy reads in a,(LCDDataPort) ld (hl),a inc hl out (LCDDataPort),a out (LCDDataPort),a djnz CL1RowLoop ld b,e CL1DupRowLoop: in a,(LCDDataPort) in a,(LCDDataPort) ;dummy reads in a,(LCDDataPort) out (LCDDataPort),a out (LCDDataPort),a djnz CL1DupRowLoop ld b,c djnz CL1Loop ret DrawLives: ld a,(Lives) or a ret z push af ld hl,SmallFrogImage ld a,20 call EditLives pop af dec a ret z push af ld hl,SmallFrogImage ld a,28 call EditLives pop af dec a ret z ld hl,SmallFrogImage ld a,36 EditLives: ;a=x ;hl points to sprite push hl ld h,0 ld de,7 ld l,a add a,e ld e,a ld a,LCDWinXStart call DisplayWriteHLDE ;set x ld hl,224 ;set window ld de,224+15 ld a,LCDWinYStart call DisplayWriteHLDE ;set y call SetCursor xor a ;set ir out (LCDInstPort),a ld a,LCDGRAM out (LCDInstPort),a pop hl ld de,8 ld b,8 ELLoop: ld c,b ld b,e ELRowLoop: ld a,(hl) ;draw row inc hl out (LCDDataPort),a out (LCDDataPort),a djnz ELRowLoop or a sbc hl,de ld b,e ELDupRowLoop: ld a,(hl) ;draw dup row inc hl out (LCDDataPort),a out (LCDDataPort),a djnz ELDupRowLoop ld b,c djnz ELLoop ret EraseLives: ld hl,Life1BG ld a,20 call EditLives ld hl,Life2BG ld a,28 call EditLives ld hl,Life3BG ld a,36 jp EditLives CopyBackground: ;every other line to erase frog call SetCursor ld hl,(FrogY) ld (BackgroundData),hl ld hl,BackgroundData+2 xor a ;set ir out (LCDInstPort),a ld a,LCDGRAM out (LCDInstPort),a ld e,8 ld b,8 CBLoop: ld c,b ld b,e CBRowLoop: in a,(LCDDataPort) in a,(LCDDataPort) ;dummy reads in a,(LCDDataPort) ld (hl),a inc hl out (LCDDataPort),a out (LCDDataPort),a djnz CBRowLoop ld b,e CBDupRowLoop: in a,(LCDDataPort) in a,(LCDDataPort) ;dummy reads in a,(LCDDataPort) out (LCDDataPort),a out (LCDDataPort),a djnz CBDupRowLoop ld b,c djnz CBLoop ret CopyBackgroundCheckCollision: ;check for collision in road; every other line to erase frog call SetCursor ld hl,(FrogY) ld (BackgroundData),hl ld hl,BackgroundData+2 xor a ;set ir out (LCDInstPort),a ld a,LCDGRAM out (LCDInstPort),a ld e,8 ld b,8 CBCCLoop: ld c,b ld b,e CBCCRowLoop: in a,(LCDDataPort) in a,(LCDDataPort) ;dummy reads in a,(LCDDataPort) cp $93 jp z,CBCCGood cp $ff jp z,CBCCGood inc a ;in case the color is black ld (CollisionOccured),a CBCCGood: ld (hl),a inc hl out (LCDDataPort),a out (LCDDataPort),a djnz CBCCRowLoop ld b,e CBCCDupRowLoop: in a,(LCDDataPort) in a,(LCDDataPort) ;dummy reads in a,(LCDDataPort) out (LCDDataPort),a out (LCDDataPort),a djnz CBCCDupRowLoop ld b,c djnz CBCCLoop ld a,(CollisionOccured) or a ret z jp Collision CopyBackgroundCheckWaterCollision: ld a,(FrogX) cp 12 jp c,FrogOutbounds cp 173 jp nc,FrogOutbounds jp FrogInbounds FrogOutbounds: ld a,1 ld (CollisionOccured),a FrogInbounds: call SetCursor ld hl,(FrogY) ld (BackgroundData),hl ld hl,BackgroundData+2 xor a ;set ir out (LCDInstPort),a ld a,LCDGRAM out (LCDInstPort),a ld e,8 ld b,3 CBCWCLoop1: ld c,b ld b,e CBCWCRowLoop1: in a,(LCDDataPort) in a,(LCDDataPort) ;dummy reads in a,(LCDDataPort) ld (hl),a inc hl out (LCDDataPort),a out (LCDDataPort),a djnz CBCWCRowLoop1 ld b,e CBCWCDupRowLoop1: in a,(LCDDataPort) in a,(LCDDataPort) ;dummy reads in a,(LCDDataPort) out (LCDDataPort),a out (LCDDataPort),a djnz CBCWCDupRowLoop1 ld b,c djnz CBCWCLoop1 ld d,$ff ld b,2 CBCWCLoop2: ld c,b ld b,8 CBCWCRowLoop2: in a,(LCDDataPort) in a,(LCDDataPort) ;dummy reads in a,(LCDDataPort) ld e,a ld a,b cp 6 jp nc,NotPixel ;check middle 4 pixels of frog to see if landed on something and $04 jp z,NotPixel ld a,e and d ld d,a NotPixel: ld a,e ld (hl),a inc hl out (LCDDataPort),a out (LCDDataPort),a djnz CBCWCRowLoop2 ld b,8 CBCWCDupRowLoop2: in a,(LCDDataPort) in a,(LCDDataPort) ;dummy reads in a,(LCDDataPort) out (LCDDataPort),a out (LCDDataPort),a djnz CBCWCDupRowLoop2 ld b,c djnz CBCWCLoop2 ld a,d and $18 ;check for all water pixel or water ripple pixel cp $18 jp nz,Landed ld (CollisionOccured),a Landed: ld e,8 ld b,3 CBCWCLoop3: ld c,b ld b,e CBCWCRowLoop3: in a,(LCDDataPort) in a,(LCDDataPort) ;dummy reads in a,(LCDDataPort) ld (hl),a inc hl out (LCDDataPort),a out (LCDDataPort),a djnz CBCWCRowLoop3 ld b,e CBCWCDupRowLoop3: in a,(LCDDataPort) in a,(LCDDataPort) ;dummy reads in a,(LCDDataPort) out (LCDDataPort),a out (LCDDataPort),a djnz CBCWCDupRowLoop3 ld b,c djnz CBCWCLoop3 ld a,(CollisionOccured) or a ret z jp Collision DrawBackground: ld h,0 ;set window ld de,15 ld a,(BackgroundData) ld l,a add a,e ld e,a ld a,LCDWinYStart call DisplayWriteHLDE ;set y ld h,0 ld de,7 ld a,(BackgroundData+1) ld l,a add a,e ld e,a ld a,LCDWinXStart call DisplayWriteHLDE ;set x call SetCursor xor a ;set ir out (LCDInstPort),a ld a,LCDGRAM out (LCDInstPort),a ld hl,BackgroundData+2 ;erase old frog ld de,8 ld b,8 DBLoop: ld c,b ld b,e DBRowLoop: ld a,(hl) ;draw row inc hl out (LCDDataPort),a out (LCDDataPort),a djnz DBRowLoop or a sbc hl,de ld b,e DBDupRowLoop: ld a,(hl) ;draw dup row inc hl out (LCDDataPort),a out (LCDDataPort),a djnz DBDupRowLoop ld b,c djnz DBLoop ret DrawVehicle: ;a=dir ;hl points to sprite ;bc = x,y push hl push bc ld (VehicleDir),a cp 1 ;check if facing right jp nz,VFaceLeft ;default sprite direction call SetID01 VFaceLeft: pop bc ld h,0 ;set window ld de,19 ld a,c ld l,a add a,e ld e,a ld a,LCDWinYStart push bc call DisplayWriteHLDE ;set y ld h,0 ld de,15 pop af ld (VehicleX),a ld l,a push hl add hl,de ex de,hl pop hl ld a,LCDWinXStart call DisplayWriteHLDE ;set x call SetCursor xor a ;set ir out (LCDInstPort),a ld a,LCDGRAM out (LCDInstPort),a pop hl ld de,16 ld b,10 DVLoop: ld c,b ld b,e in a,(LCDDataPort) in a,(LCDDataPort) ;dummy reads in a,(LCDDataPort) ;check for collision cp $93 ;if not the road then collision check jp z,DVRowLoop ld a,(VehicleDir) cp 1 ;check if facing right ld a,(VehicleX) jp nz,VFL ;default sprite direction cp 1 jp c,DVRowLoop cp 160 jp nc,DVRowLoop jp VCDone VFL: cp 16 jp c,DVRowLoop cp 175 jp nc,DVRowLoop VCDone: ld (CollisionOccured),a DVRowLoop: ld a,(hl) ;draw row inc hl out (LCDDataPort),a out (LCDDataPort),a djnz DVRowLoop or a ;djnz does not clear carry flag! sbc hl,de ld b,e DVDupRowLoop: ld a,(hl) ;draw dup row inc hl out (LCDDataPort),a out (LCDDataPort),a djnz DVDupRowLoop ld b,c djnz DVLoop jp SetID11 DrawFloat: ;a=dir ;hl points to sprite ;bc = x,y push hl push bc cp 1 ;check if facing right jp nz,FloatFaceLeft ;default sprite direction call SetID01 FloatFaceLeft: pop bc ld h,0 ;set window ld de,19 ld a,c ld l,a add a,e ld e,a ld a,LCDWinYStart push bc call DisplayWriteHLDE ;set y ld h,0 ld de,15 pop af ld l,a add a,e ld e,a ld a,LCDWinXStart call DisplayWriteHLDE ;set x call SetCursor xor a ;set ir out (LCDInstPort),a ld a,LCDGRAM out (LCDInstPort),a pop hl ld de,16 ld b,10 DFloatLoop: ld c,b ld b,e DFloatRowLoop: ld a,(hl) ;draw row inc hl out (LCDDataPort),a out (LCDDataPort),a djnz DFloatRowLoop or a sbc hl,de ld b,e DFloatDupRowLoop: ld a,(hl) ;draw dup row inc hl out (LCDDataPort),a out (LCDDataPort),a djnz DFloatDupRowLoop ld b,c djnz DFloatLoop jp SetID11 Collision: ;draw blood over frog ld sp,Stack-2 ;reset stack call SetID11 ld hl,FrogDeadImage ld (FrogFrame),hl ld h,0 ;set frog window ld de,15 ld a,(FrogY) ld l,a add a,e ld e,a ld a,LCDWinYStart call DisplayWriteHLDE ;set y ld h,0 ld de,7 ld a,(FrogX) ld l,a add a,e ld e,a ld a,LCDWinXStart call DisplayWriteHLDE ;set x call DFSC ld bc,0 call Pause call Pause call Pause ld a,(Lives) or a jp z,GameOver dec a ld (Lives),a call EraseLives call DrawLives ld a,92 ld (FrogX),a ld a,224 ld (FrogY),a xor a ld (FrogDir),a ld (CollisionOccured),a ld hl,FrogSitImage ld (FrogFrame),hl ld a,$ff ld (KeyFlag),a call DrawFrog ld hl,KeyStart jp MainKeyLoop GameOver: call ClearScreen call HighRes ld bc,$0d00 call Pause ld hl,GameOverStr call ShowString call WriteScore call WriteLevel ld hl,PressStr call ShowString ;check for high score ld hl,HighScoreTable ld de,10 add hl,de ld de,14 ld b,5 CheckScoreLoop: ;loop through high scores ld a,(hl) ld c,a ld a,(Score) cp c jp nc,CheckScore add hl,de djnz CheckScoreLoop jp NoHighScore CheckScore: jp nz,NewHighScore push hl inc hl ld e,(hl) inc hl ld d,(hl) ;de= current high score ld hl,(Score+1) or a sbc hl,de ;cp hl de pop hl jp nc,NewHighScore ld de,14 add hl,de dec b jp z,NoHighScore jp CheckScoreLoop NewHighScore: ld a,b sub 5 neg ld c,a ;save high score position push bc ld hl,NewHSStr call ShowString pop bc call Wait ;shouldn't have anything pushed when calling wait ld a,c jp HighScore NoHighScore: call Wait jp Title EndLevel: call ClearScreen call HighRes ld bc,$0d00 call Pause ld a,(Level) inc a ld (Level),a ld hl,WinStr call ShowString call WriteLives call WriteScore call WriteNext ld hl,PressStr call ShowString call Wait jp GameInit HighRes: ld a,LCDOutput call DisplayReadHL res LCDHSM,h ;set progressive call DisplayWriteHL ld a,LCDControl call DisplayReadHL res LCDHPTDE0,h ;disable partial image 1 res LCDHPTDE1,h ;disable partial image 2 set LCDHBASEE,h ;enable base image jp DisplayWriteHL FlashScreen: ld a,LCDBaseCtrl call DisplayReadHL res LCDLREV,l call DisplayWriteHL ld bc,$0d00 call Pause ld a,LCDBaseCtrl call DisplayReadHL set LCDLREV,l jp DisplayWriteHL Pause: push hl pop hl push hl pop hl push hl pop hl push hl pop hl dec bc ld a,b or c jp nz,Pause ret ;--- DisplayWriteHLDE --- ;Writes hl to a, de to consecutive address ;inputs: ;a=start address ;hl,de DisplayWriteHLDE: ld c,LCDInstPort ld b,$00 out (c),b out (c),a inc c out (c),h out (c),l dec c inc a out (c),b out (c),a inc c out (c),d out (c),e ret ;--- DisplayWriteHL --- ;Writes hl to a ;inputs: ;a=address ;hl DisplayWriteHL: ld c,LCDDataPort ld b,a xor a out (LCDInstPort),a ld a,b out (LCDInstPort),a out (c),h out (c),l ret ;--- DisplayReadHL --- ;read hl at a ;inputs: ;a=address DisplayReadHL: ld c,LCDDataPort ld b,a xor a out (LCDInstPort),a ld a,b out (LCDInstPort),a in h,(c) in l,(c) ret SetOrigin: ld a,LCDEntry call DisplayReadHL set LCDLORG,l ;set origin jp DisplayWriteHL ResetOrigin: ld a,LCDEntry call DisplayReadHL res LCDLORG,l ;reset origin jp DisplayWriteHL SetCursor: ld hl,0 ld de,0 ld a,LCDCursorY jp DisplayWriteHLDE SetID10: ; ld a,LCDEntry call DisplayReadHL res LCDLID0,l set LCDLID1,l jp DisplayWriteHL SetID01: ;am=1 for horiz flip ld a,LCDEntry call DisplayReadHL set LCDLID0,l res LCDLID1,l jp DisplayWriteHL SetID11: ;def ld a,LCDEntry call DisplayReadHL set LCDLID0,l set LCDLID1,l jp DisplayWriteHL SetAM: ;def ld a,LCDEntry call DisplayReadHL set LCDLAM,l jp DisplayWriteHL ResetAM: ; ld a,LCDEntry call DisplayReadHL res LCDLAM,l jp DisplayWriteHL SetFullWindow: ;set full window ld hl,0 ld de,239 ld a,LCDWinYStart call DisplayWriteHLDE ;set y ld hl,0 ld de,319 ld a,LCDWinXStart jp DisplayWriteHLDE ;set x SetFullLowResWindow: ld hl,0 ld de,239 ld a,LCDWinYStart call DisplayWriteHLDE ;set y ld hl,16 ld de,175 ld a,LCDWinXStart jp DisplayWriteHLDE ;set x ;--- Exit --- ;Exits program with everything intact Exit: ;jp to exit, make sure nothing is left on stack! di call ClearScreen ld hl,HighScoreTable ld de,tempSwapArea ld bc,70 ldir pop hl ;restore stack ld sp,hl ld a,$80 out (MemoryCPort),a ;save scores ld hl,VarName ;find or create high score appvar bcall(_Mov9ToOP1) bcall(_ChkFindSym) inc de inc de ld hl,tempSwapArea ld bc,70 ldir ld hl,VarName bcall(_Mov9ToOP1) bcall(_Arc_Unarc) ;archive high scores pop hl ld a,LCDBaseCtrl call DisplayWriteHL pop hl ld a,LCDControl call DisplayWriteHL pop hl ld a,LCDEntry call DisplayWriteHL call SetFullWindow call SetCursor call HighRes ld a,0 out (SpeedPort),a im 1 ld a,$06 ;set slow ints out ($04),a ld a,$08 out (IntPort),a ;clear in a,(IntStatusPort) and $04 or $08 out (IntPort),a ;acknowledge pending int if necessary ld a,$0b bit 0,(iy+$16) ;is this necessary??? jp z,OnlyHW1 add a,$04 OnlyHW1: out (IntPort),a ;enable hw1, on, maybe hw2 ld a,1 out ($5B),a ;turn usb ints back on ei bjump(_JForceCmdNoChar) ClearScreen: call SetFullWindow call SetCursor ;draw screen xor a out (LCDInstPort),a ld a,LCDGRAM out (LCDInstPort),a ld de,38400 DLoCLoop1: ld a,$ff out (LCDDataPort),a out (LCDDataPort),a out (LCDDataPort),a out (LCDDataPort),a dec de ld a,d or e jp nz,DLoCLoop1 ret SetUpLevel: call RandomHL ld (FlyTimer),hl call RandomHL ld (AlligatorTimer),hl ld a,92 ld (FrogX),a ld a,224 ld (FrogY),a xor a ld (FrogMoving),a ld (CollisionOccured),a ld (FrogDir),a ld (Hole1),a ld (Hole2),a ld (Hole3),a ld (Hole4),a ld (Hole5),a ld (FrameCounter),a ld hl,FrogSitImage ld (FrogFrame),hl ld a,$ff ld (KeyFlag),a ld a,182 ld (Lane1Y),a ld a,150 ld (Lane2Y),a ld a,118 ld (Lane3Y),a ld a,255 ld (Lane1Timer),a ld (Lane2Timer),a ld (Lane3Timer),a ld (Stream1Timer),a ld (Stream2Timer),a ld (Stream3Timer),a ld (Stream1Anim),a ld (Stream2Anim),a ld (Stream3Anim),a ld a,6 ld (Stream1Count),a ld (Stream2Count),a ld (Stream3Count),a ld a,70 ld (Stream1Y),a ld a,46 ld (Stream2Y),a ld a,22 ld (Stream3Y),a ld hl,$ffff ld (Stream1AnimTimer),hl ld (Stream2AnimTimer),hl ld (Stream3AnimTimer),hl call RandomizeLanes jp RandomizeStreams ;fill out 3 lanes RandomizeLanes: ld ix,Lane1Count ld b,3 RLLoop: push bc call GetRand5 ;returns rand number 1-5 ld (ix),a inc ix call GetRand1 ;returns rand number 0-1 or a jp z,RLLeft ld (ix),1 jp RLDirDone RLLeft: ld (ix),3 RLDirDone: inc ix ;speed should be 248-253 call GetRand5 dec a ld b,a call GetRand1 add a,b add a,248 ld (ix),a inc ix ld b,5 RLLoop1: call GetRandCarSprite ;returns random sprite pointer 1-8 in hl ld a,l ld (ix),a inc ix ld a,h ld (ix),a inc ix djnz RLLoop1 call GetRand5 dec a ld b,a or a rla rla add a,b ld d,0 ld e,a ld hl,CarLayout add hl,de call GetRand255 ;returns rand number 0-255 ld c,a ld b,5 RLLoop2: ld a,(hl) add a,c ld (ix),a inc hl inc ix djnz RLLoop2 pop bc djnz RLLoop ld a,(Lane1Dir) ;force alternate directions reduce odds of impossible level xor 2 ld (Lane2Dir),a xor 2 ld (Lane3Dir),a ret RandomizeStreams: ld ix,Stream1Dir ld b,3 RSLoop: push bc call GetRand1 ;returns rand number 0-1 or a jr z,RSLeft ld (ix),1 jr RSDirDone RSLeft: ld (ix),3 RSDirDone: inc ix call GetRand255 or $7f cp 201 jp c,RSSpeedGood ld a,200 RSSpeedGood: ld (ix),a inc ix call GetRand255 and $07 add a,$07 or $f0 ld (ix),$ff inc ix ld (ix),a inc ix call GetRand255 and 7 ld b,a or a rla rla add a,b add a,b ld d,0 ld e,a ld hl,FloatLayout add hl,de ld b,6 RSLoop2: ld a,(hl) ld (ix),a inc ix inc hl djnz RSLoop2 call GetRand5 sub 3 jp nc,FLGood ld a,1 FLGood: ld b,a or a rla rla add a,b add a,b ld d,0 ld e,a ld hl,FloatLocation add hl,de call GetRand255 ;returns rand number 0-255 ld c,a ld b,6 RSLoop3: ld a,(hl) add a,c ld (ix),a inc hl inc ix djnz RSLoop3 pop bc djnz RSLoop ld a,(Stream1Dir) ;force alternate directions reduce odds of impossible level xor 2 ld (Stream2Dir),a xor 2 ld (Stream3Dir),a ret GetRand1: ;returns rand number 0-1 call GetRand cp 128 jp nc,Ret1 xor a ret Ret1: ld a,1 ret GetRand5: ;returns rand number 1-5 call GetRand and $03 ld b,a call GetRand1 add a,b inc a ret GetRand255: ;returns rand number 0-255 push hl call GetRand pop hl ret GetRandCarSprite:;returns random sprite pointer 1-8 in hl call GetRand and $07 or a rla ld hl,CarList ld d,0 ld e,a add hl,de ld a,(hl) inc hl ld h,(hl) ld l,a ret GetRand: ld hl,(RandIndex) ld a,r or a rla ld e,a ld a,(hl) add a,e ld e,a ld a,(RandOld) add a,e ld (RandOld),a inc hl ld de,RandEnd or a sbc hl,de jp nz,RandGood ld hl,Rand RandGood: ld (RandIndex),hl ret ;*Enter High Score* HighScore: ;a = position ;save 10 char name, 3 byte score, and 1 byte level to appropriate position (0-4) push af call HideImage ld bc,$0d00 call Pause call ClearScreen ld hl,CongratsStr call ShowString ld hl,EnterStr call ShowString ld hl,112 ld (TextCol),hl ld hl,136 ld (TextRow),hl ld hl,StringRam+9 ld a,':' ld (hl),a dec hl pop af push af inc a add a,$30 ld (hl),a call DisplayString ;display 1: ld hl,128 ld (TextCol),hl ld hl,138 ld (TextRow),hl ld hl,StringRam+9 ld a,'_' ld b,10 USLoop: ld (hl),a dec hl djnz USLoop inc hl call DisplayString ;display 10 '_' call ResetCursor call ShowImage pop ix ;save position in ix for now HighScoreKeyLoop: ;check for character,left,right,del,enter ld bc,$1000 call Pause ;slow it down some in a,(IntStatusPort) ;have on button exit immediately out of program bit 3,a jp z,Exit Row1: ld a,$ff out (KeypadPort),a push ix pop ix ld a,$bf ld c,a ;save to wait for release out (KeypadPort),a push ix pop ix in a,(KeypadPort) ;a=(del,|||||||) ld b,'0' bit 7,a jp z,HandleChar Row2: ld a,$ff out (KeypadPort),a push ix pop ix ld a,$df ld c,a ;save to wait for release out (KeypadPort),a push ix pop ix in a,(KeypadPort) ;a=(|,A,D,I,N,S,X,|) ld b,'A' bit 6,a jp z,HandleChar ld b,'D' bit 5,a jp z,HandleChar ld b,'I' bit 4,a jp z,HandleChar ld b,'N' bit 3,a jp z,HandleChar ld b,'S' bit 2,a jp z,HandleChar ld b,'X' bit 1,a jp z,HandleChar Row3: ld a,$ff out (KeypadPort),a push ix pop ix ld a,$ef ld c,a ;save to wait for release out (KeypadPort),a push ix pop ix in a,(KeypadPort) ;a=(|,B,E,J,O,T,Y, ) ld b,'B' bit 6,a jp z,HandleChar ld b,'E' bit 5,a jp z,HandleChar ld b,'J' bit 4,a jp z,HandleChar ld b,'O' bit 3,a jp z,HandleChar ld b,'T' bit 2,a jp z,HandleChar ld b,'Y' bit 1,a jp z,HandleChar ld b,' ' bit 0,a jp z,HandleChar Row4: ld a,$ff out (KeypadPort),a push ix pop ix ld a,$f7 ld c,a ;save to wait for release out (KeypadPort),a push ix pop ix in a,(KeypadPort) ;a=(|,C,F,K,P,U,Z,|) ld b,'C' bit 6,a jp z,HandleChar ld b,'F' bit 5,a jp z,HandleChar ld b,'K' bit 4,a jp z,HandleChar ld b,'P' bit 3,a jp z,HandleChar ld b,'U' bit 2,a jp z,HandleChar ld b,'Z' bit 1,a jp z,HandleChar Row5: ld a,$ff out (KeypadPort),a push ix pop ix ld a,$fb ld c,a ;save to wait for release out (KeypadPort),a push ix pop ix in a,(KeypadPort) ;a=(||,G,L,Q,V,||) ld b,'G' bit 5,a jp z,HandleChar ld b,'L' bit 4,a jp z,HandleChar ld b,'Q' bit 3,a jp z,HandleChar ld b,'V' bit 2,a jp z,HandleChar Row6: ld a,$ff out (KeypadPort),a push ix pop ix ld a,$fd ld c,a ;save to wait for release out (KeypadPort),a push ix pop ix in a,(KeypadPort) ;a=(|,clear,H,M,R,W,|,Enter) ld b,'1' bit 6,a jp z,HandleChar ld b,'H' bit 5,a jp z,HandleChar ld b,'M' bit 4,a jp z,HandleChar ld b,'R' bit 3,a jp z,HandleChar ld b,'W' bit 2,a jp z,HandleChar ld b,'2' bit 0,a jp z,HandleChar Row7: ld a,$ff out (KeypadPort),a push ix pop ix ld a,$fe ld c,a ;save to wait for release out (KeypadPort),a push ix pop ix in a,(KeypadPort) ;a=(|||||,right,left,|) ld b,'3' bit 2,a jp z,HandleChar ld b,'4' bit 1,a jp z,HandleChar jp HighScoreKeyLoop HandleChar: ;handle char or function in b ;wait for key release ld a,$ff out (KeypadPort),a push ix pop ix ld a,c out (KeypadPort),a push ix pop ix in a,(KeypadPort) inc a jp nz,HandleChar ld a,b cp '2' jp z,HighScoreContinue cp '0' jp z,DeleteChar cp '1' jp z,ClearChar cp '3' jp z,RightChar cp '4' jp z,LeftChar ;set value at cursor to char and inc cursor ld hl,StringRam ld d,0 ld a,(CharCursor) ld e,a add hl,de ld a,b ld (hl),a ;set StringRam to value jp RightChar ;display char,inc cursor, display cursor DeleteChar: ;set the cursor position value to ' ' w/o moving cursor ld hl,StringRam ld d,0 ld a,(CharCursor) ld e,a add hl,de ld a,' ' ld (hl),a jp HighScoreKeyLoop ClearChar: ;set all chars to ' ' and move cursor to start call ResetCursor jp HighScoreKeyLoop RightChar: ;move cursor to right call DisplayHiddenChar ld a,(CharCursor) inc a cp 10 jp c,CharRGood xor a CharRGood: ld (CharCursor),a call DisplayCursor jp HighScoreKeyLoop LeftChar: ;move cursor to left call DisplayHiddenChar ld a,(CharCursor) dec a jp p,CharLGood ld a,9 CharLGood: ld (CharCursor),a call DisplayCursor jp HighScoreKeyLoop HighScoreContinue: push ix pop af or a ld c,a ld e,a ld d,0 rla rla rla add a,e add a,e add a,e add a,e add a,e add a,e ;mult by 14 ld e,a ld hl,HighScoreTable add hl,de ;hl now points to spot in table to overwrite push hl ;move current entries down to fit in new score ld a,c ;a = 0-4 location sub 4 neg ld b,a ;b = move count jp z,SkipMove ld hl,HighScoreTable ld de,69 add hl,de push hl ld hl,HighScoreTable ld de,55 add hl,de pop de ld c,a ld b,0 rla rla rla add a,c add a,c add a,c add a,c add a,c add a,c ld c,a ;bc=14*count lddr SkipMove: ld hl,StringRam pop de ld bc,10 ldir ld a,(Score) ld (de),a inc de ld a,(Score+1) ld (de),a inc de ld a,(Score+2) ld (de),a inc de ld a,(Level) ld (de),a jp Title ResetCursor: xor a ld (CharCursor),a ld hl,StringRam ld b,10 ld a,' ' HSInitLoop: ld (hl),a inc hl djnz HSInitLoop ;initialize name with all spaces ld hl,128 ld (TextCol),hl ld hl,136 ld (TextRow),hl ld hl,StringRam call DisplayString ld hl,128 ld (TextCol),hl ld hl,136 ld (TextRow),hl ld a,$7f jp DisplayChar ;display cursor DisplayHiddenChar: ld a,(CharCursor) ld hl,StringRam ld d,0 ld a,(CharCursor) ld e,a add hl,de ld a,(CharCursor) rla rla rla add a,128 ;set text col ld (TextCol),a ld a,(hl) ;get character at cursor jp DisplayChar ;display char cursor was hiding DisplayCursor: ld a,(CharCursor) or a rla rla rla add a,128 ;set text col for cursor ld (TextCol),a ld a,$7f ;character= cursor jp DisplayChar WriteHighScores: ld hl,HighScoreStr call ShowString ld ix,HighScoreTable ;1 ld hl,80-16 ld (TextCol),hl ld hl,172 ld (TextRow),hl call WriteColon ld a,'1' ld (hl),a call DisplayString ld hl,HighScoreTable call DisplayName call WriteSpace ld a,(ix+10) ld l,(ix+11) ld h,(ix+12) call DisplayDecAHL call WriteSpace ld a,(ix+13) call DisplayDecA ;2 ld hl,80-16 ld (TextCol),hl ld hl,184 ld (TextRow),hl call WriteColon ld a,'2' ld (hl),a call DisplayString ld hl,HighScoreTable ld de,14 add hl,de call DisplayName call WriteSpace ld a,(ix+24) ld l,(ix+25) ld h,(ix+26) call DisplayDecAHL call WriteSpace ld a,(ix+27) call DisplayDecA ;3 ld hl,80-16 ld (TextCol),hl ld hl,196 ld (TextRow),hl call WriteColon ld a,'3' ld (hl),a call DisplayString ld hl,HighScoreTable ld de,28 add hl,de call DisplayName call WriteSpace ld a,(ix+38) ld l,(ix+39) ld h,(ix+40) call DisplayDecAHL call WriteSpace ld a,(ix+41) call DisplayDecA ;4 ld hl,80-16 ld (TextCol),hl ld hl,208 ld (TextRow),hl call WriteColon ld a,'4' ld (hl),a call DisplayString ld hl,HighScoreTable ld de,42 add hl,de call DisplayName call WriteSpace ld a,(ix+52) ld l,(ix+53) ld h,(ix+54) call DisplayDecAHL call WriteSpace ld a,(ix+55) call DisplayDecA ;5 ld hl,80-16 ld (TextCol),hl ld hl,220 ld (TextRow),hl call WriteColon ld a,'5' ld (hl),a call DisplayString ld hl,HighScoreTable ld de,56 add hl,de call DisplayName call WriteSpace ld a,(ix+66) ld l,(ix+67) ld h,(ix+68) call DisplayDecAHL call WriteSpace ld a,(ix+69) jp DisplayDecA WriteColon: ld hl,StringRam+9 ld a,':' ld (hl),a dec hl ret WriteSpace: ld a,' ' call DisplayChar ld de,8 ld hl,(TextCol) add hl,de ld (TextCol),hl ret WriteLives: ld hl,LivesStr call ShowString call WriteSpace ld a,(Lives) jp DisplayDecA WriteScore: ;draw 3 byte 7 (9,999,999 max) digit score in decimal ld hl,ScoreStr call ShowString call WriteSpace ld a,(Score) ld hl,(Score+1) DisplayDecAHL: ld de,StringRam+9 ld b,7 LoopDDAHL: push bc push de call DivAHLby10 ld c,a ld a,e add a,$30 pop de ld (de),a dec de ld a,c pop bc djnz LoopDDAHL inc de ex de,hl jp DisplayString WriteLevel: ld hl,LevelStr call ShowString call WriteSpace jp WL WriteNext: ld hl,NextStr call ShowString call WriteSpace WL: ld a,(Level) DisplayDecA: call DivAby10 ld hl,StringRam+9 add a,$30 ld (hl),a dec hl ld a,c add a,$30 ld (hl),a jp DisplayString ;Waits for any key press then returns (except on) Wait: ld a,$00 ld (WaitKey),a Waiting: in a,(IntStatusPort) ;have on button exit immediately out of program bit 3,a jp z,WaitExit ld a,$00 ;check all out (KeypadPort),a push ix pop ix in a,(KeypadPort) ;get keys ld b,a ld a,$ff out (KeypadPort),a ;clear key port ld a,(WaitKey) xor $ff; ignore any key being held down upon routine entrance and its release or b cp $ff ld a,b ld (WaitKey),a jp z,Waiting ;loop if no new keys have been pressed ret WaitExit: pop hl ;get rid of return jp Exit ;--- HideImage --- ;Hides the base image during ;decompression/drawing HideImage: ld a,LCDControl call DisplayReadHL res LCDHBASEE,h jp DisplayWriteHL ;--- ShowImage --- ;Displays the base image after drawing ShowImage: ld a,LCDControl call DisplayReadHL set LCDHBASEE,h jp DisplayWriteHL ShowScreen: ld a,LCDControl call DisplayReadHL set LCDHPTDE0,h ;enable partial image 1 set LCDHPTDE1,h ;enable partial image 2 jp DisplayWriteHL ;mega divide ;ahl = value ;e = decimal value remainder ;used for getting decimal ahl up to 9,999,999 ;original verified by jacobly of omnimaga.org ;optimized by Xeda112358 of omnimaga.org DivAHLby10: ld d,a ld bc,$180a sub a DAHLLoop1: add hl,hl rl d rla cp c jr c,DAHLLoop2 sub c inc l DAHLLoop2: djnz DAHLLoop1 ld e,a ld a,d ret ; Divides a by 10 / converts a to decimal (0-99) DivAby10: ;c=tens digit a=ones digit (a=$11 -> c=$01 a=$07) ld c,a ld b,8 sub a DA101: sla c rla cp $0a jr c,DA102 sub $0a inc c DA102: djnz DA101 ret DisplayTitle: ;call to display title ;set window ld hl,42 ld de,42+51 ld a,$50 call DisplayWriteHLDE ;set y ld hl,2 ld de,2+315 ld a,$52 call DisplayWriteHLDE ;set x call SetCursor ld hl,TitlePalette ld (ImagePalette),hl ld hl,157 ld (ImageWidth),hl ld hl,TitleData+1 ld ix,TitleData ld de,0 ld (XIndex),de ld (DrawRowIndex),de jp DrawImage ;call to draw a double size 4 color rle image on screen ;window,cursor,gram,ImagePalette must be set ;hl points to data, ix points to signal DrawImage: xor a out ($10),a ld a,$22 out ($10),a ld a,(hl) inc hl cp (ix) ;if not signal, drawcolor jp z,Decompress ;if signal wait for other 2 bytes then loop draw push hl call DrawPixels pop hl jp DrawImage Decompress: ;gets next two bytes to loop draw ld a,(hl) or a ret z inc hl ld b,a ; save loop count ld a,(hl) ld c,a inc hl push hl ;save hl for main loop DCLoop: ld a,c push bc call DrawPixels ;draw color b times pop bc djnz DCLoop pop hl jp DrawImage ;--- DrawPixels --- ;Switches image depth and draws pixels DrawPixels: ;a=data byte ld c,a ld b,4 B4Loop: xor a rl c rla rl c rla rla ld hl,DrawRowData ld de,(DrawRowIndex) add hl,de ld (hl),a inc de ld (DrawRowIndex),de call OutLCDData ld hl,(XIndex) inc hl ld (XIndex),hl ld de,(ImageWidth) inc de or a sbc hl,de call z,DPDrawRow djnz B4Loop ret ;--- DPDrawRow --- ;Duplicates the previously drawn row for doublesize DPDrawRow: push bc ld hl,0 ld (DrawRowIndex),hl ;reset drawrowindex ld hl,(ImageWidth) inc l ld b,l ;loop width times DPDRLoop: ld hl,DrawRowData ld de,(DrawRowIndex) add hl,de ld a,(hl) inc de ld (DrawRowIndex),de call OutLCDData djnz DPDRLoop ld hl,0 ld (DrawRowIndex),hl ;reset drawrowindex ld hl,0 ld (XIndex),hl ;reset xindex pop bc ret OutLCDData: ld hl,(ImagePalette) ld d,0 ld e,a add hl,de ;add color offset to palette ld a,(hl) out (LCDDataPort),a inc hl ld a,(hl) out (LCDDataPort),a ;draw color dec hl ld a,(hl) out (LCDDataPort),a inc hl ld a,(hl) out (LCDDataPort),a ;draw color again ret ;displays 10 character name DisplayName: ld b,10 DName: ld a,(hl) push bc push hl call DisplayChar ld hl,(TextCol) ld de,8 add hl,de ld (TextCol),hl pop hl pop bc inc hl djnz DName ret ;Text routines to display text and chars ;define word y,then word x, then string ShowString: push hl ld a,(hl) inc hl ld h,(hl) ld l,a ld (TextCol),hl pop hl inc hl inc hl push hl ld a,(hl) inc hl ld h,(hl) ld l,a ld (TextRow),hl pop hl inc hl inc hl ;inputs-hl points to null terminated string ;a-char ;set textrow,col DisplayString: ld a,(hl) inc hl or a ret z push hl call DisplayChar ld hl,(TextCol) ld de,8 add hl,de ld (TextCol),hl pop hl jp DisplayString ;a-char ;set textrow,col DisplayChar: push af ;set window ld hl,(TextRow) ld de,9 add hl,de ex de,hl ld hl,(TextRow) ld a,$50 call DisplayWriteHLDE ;set window y ld hl,(TextCol) ld de,7 add hl,de ex de,hl ld hl,(TextCol) ld a,$52 call DisplayWriteHLDE ;set window x call SetCursor ;get ready to draw xor a out ($10),a ld a,$22 out ($10),a pop af ;get font char offset sub $20 ;subtract offset (font data starts at $20) ld d,0 ld e,a ld h,0 ld l,a or a rl l rl h rl l rl h rl l rl h add hl,de add hl,de ;mult by 10 ld de,FontData add hl,de ;point to char data ld b,10 DCLoop1: ld a,(hl) ld c,b ld b,8 DCLoop2: rla push af jp c,DispTextColor ld a,$ff out ($11),a out ($11),a pop af djnz DCLoop2 jp EndDCLoop2 DispTextColor: ld a,0 out ($11),a out ($11),a pop af djnz DCLoop2 EndDCLoop2: ld b,c inc hl djnz DCLoop1 ret FontData: .db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00; ' ' $20 .db $30, $78, $78, $78, $30, $30, $00, $30, $30, $00; '!' .db $CC, $CC, $CC, $00, $00, $00, $00, $00, $00, $00; '"' .db $6C, $6C, $FE, $6C, $6C, $6C, $FE, $6C, $6C, $00; '#' .db $7C, $D6, $D0, $70, $38, $1C, $16, $D6, $7C, $00; '$' .db $E0, $A4, $EC, $18, $30, $60, $DC, $94, $1C, $00; '%' .db $70, $D8, $D8, $70, $C0, $DE, $CC, $CC, $76, $00; '&' .db $30, $30, $30, $00, $00, $00, $00, $00, $00, $00; ''' .db $18, $30, $30, $60, $60, $60, $30, $30, $18, $00; '(' .db $60, $30, $30, $18, $18, $18, $30, $30, $60, $00; ')' .db $00, $00, $6C, $38, $FE, $38, $6C, $00, $00, $00; '*' .db $00, $00, $30, $30, $FC, $30, $30, $00, $00, $00; '+' .db $00, $00, $00, $00, $00, $00, $38, $38, $18, $30; ',' .db $00, $00, $00, $00, $FC, $00, $00, $00, $00, $00; '-' .db $00, $00, $00, $00, $00, $00, $00, $38, $38, $00; '.' .db $00, $0C, $18, $18, $30, $30, $60, $60, $C0, $00; '/' .db $78, $CC, $DC, $DC, $CC, $EC, $EC, $CC, $78, $00; '0' $30 .db $18, $38, $F8, $18, $18, $18, $18, $18, $18, $00; '1' .db $78, $CC, $CC, $0C, $18, $30, $60, $C0, $FC, $00; '2' .db $78, $CC, $CC, $0C, $38, $0C, $CC, $CC, $78, $00; '3' .db $60, $60, $6C, $6C, $6C, $CC, $FE, $0C, $0C, $00; '4' .db $FC, $C0, $C0, $C0, $F8, $0C, $0C, $18, $F0, $00; '5' .db $38, $30, $60, $F8, $CC, $CC, $CC, $CC, $78, $00; '6' .db $FC, $0C, $18, $18, $30, $30, $60, $60, $60, $00; '7' .db $78, $CC, $CC, $EC, $78, $DC, $CC, $CC, $78, $00; '8' .db $78, $CC, $CC, $CC, $CC, $7C, $18, $30, $70, $00; '9' .db $00, $38, $38, $00, $00, $00, $38, $38, $00, $00; ':' .db $00, $38, $38, $00, $00, $00, $38, $38, $18, $30; ';' .db $0C, $18, $30, $60, $C0, $60, $30, $18, $0C, $00; '<' .db $00, $00, $00, $FC, $00, $FC, $00, $00, $00, $00; '=' .db $C0, $60, $30, $18, $0C, $18, $30, $60, $C0, $00; '>' .db $78, $CC, $CC, $18, $30, $30, $00, $30, $30, $00; '?' .db $FC, $86, $86, $9E, $B6, $B6, $9E, $80, $FE, $00; '@' .db $30, $78, $CC, $CC, $CC, $FC, $CC, $CC, $CC, $00; 'A' $41 .db $F8, $CC, $CC, $CC, $F8, $CC, $CC, $CC, $F8, $00; 'B' .db $78, $CC, $CC, $C0, $C0, $C0, $CC, $CC, $78, $00; 'C' .db $F0, $D8, $CC, $CC, $CC, $CC, $CC, $D8, $F0, $00; 'D' .db $FC, $C0, $C0, $C0, $F8, $C0, $C0, $C0, $FC, $00; 'E' .db $FC, $C0, $C0, $C0, $F8, $C0, $C0, $C0, $C0, $00; 'F' .db $78, $CC, $CC, $C0, $C0, $DC, $CC, $CC, $7C, $00; 'G' .db $CC, $CC, $CC, $CC, $FC, $CC, $CC, $CC, $CC, $00; 'H' .db $78, $30, $30, $30, $30, $30, $30, $30, $78, $00; 'I' .db $0C, $0C, $0C, $0C, $0C, $0C, $CC, $CC, $78, $00; 'J' .db $CC, $CC, $D8, $D8, $F0, $D8, $D8, $CC, $CC, $00; 'K' .db $C0, $C0, $C0, $C0, $C0, $C0, $C0, $C0, $FC, $00; 'L' .db $C6, $C6, $EE, $D6, $D6, $D6, $C6, $C6, $C6, $00; 'M' .db $C6, $C6, $E6, $F6, $DE, $CE, $C6, $C6, $C6, $00; 'N' .db $78, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $78, $00; 'O' .db $F8, $CC, $CC, $CC, $F8, $C0, $C0, $C0, $C0, $00; 'P' .db $78, $CC, $CC, $CC, $CC, $CC, $CC, $DC, $78, $1C; 'Q' .db $F8, $CC, $CC, $CC, $F8, $D8, $CC, $CC, $CC, $00; 'R' .db $78, $CC, $C0, $60, $30, $18, $0C, $CC, $78, $00; 'S' .db $FC, $30, $30, $30, $30, $30, $30, $30, $30, $00; 'T' .db $CC, $CC, $CC, $CC, $CC, $CC, $CC, $CC, $78, $00; 'U' .db $CC, $CC, $CC, $CC, $CC, $CC, $CC, $78, $30, $00; 'V' .db $C6, $C6, $C6, $D6, $D6, $D6, $6C, $6C, $6C, $00; 'W' .db $CC, $CC, $68, $30, $30, $58, $CC, $CC, $CC, $00; 'X' .db $CC, $CC, $CC, $CC, $78, $30, $30, $30, $30, $00; 'Y' .db $FC, $0C, $0C, $18, $30, $60, $C0, $C0, $FC, $00; 'Z' .db $78, $60, $60, $60, $60, $60, $60, $60, $78, $00; '[' .db $00, $C0, $60, $60, $30, $30, $18, $18, $0C, $00; '\' .db $78, $18, $18, $18, $18, $18, $18, $18, $78, $00; ']' .db $30, $78, $CC, $00, $00, $00, $00, $00, $00, $00; '^' .db $00, $00, $00, $00, $00, $00, $00, $00, $00, $FE; '_' .db $70, $30, $18, $00, $00, $00, $00, $00, $00, $00; '`' .db $00, $00, $78, $0C, $0C, $7C, $CC, $CC, $7C, $00; 'a' $61 .db $C0, $C0, $F8, $CC, $CC, $CC, $CC, $CC, $F8, $00; 'b' .db $00, $00, $78, $CC, $C0, $C0, $C0, $CC, $78, $00; 'c' .db $0C, $0C, $7C, $CC, $CC, $CC, $CC, $CC, $7C, $00; 'd' .db $00, $00, $78, $CC, $CC, $FC, $C0, $C0, $78, $00; 'e' .db $3C, $60, $60, $60, $FC, $60, $60, $60, $60, $00; 'f' .db $00, $00, $7C, $CC, $CC, $CC, $CC, $7C, $0C, $78; 'g' .db $C0, $C0, $F8, $CC, $CC, $CC, $CC, $CC, $CC, $00; 'h' .db $30, $30, $00, $F0, $30, $30, $30, $30, $FC, $00; 'i' .db $18, $18, $00, $78, $18, $18, $18, $18, $18, $F0; 'j' .db $C0, $C0, $CC, $CC, $D8, $F0, $D8, $CC, $CC, $00; 'k' .db $F0, $30, $30, $30, $30, $30, $30, $30, $FC, $00; 'l' .db $00, $00, $FC, $D6, $D6, $D6, $D6, $D6, $C6, $00; 'm' .db $00, $00, $F8, $CC, $CC, $CC, $CC, $CC, $CC, $00; 'n' .db $00, $00, $78, $CC, $CC, $CC, $CC, $CC, $78, $00; 'o' .db $00, $00, $F8, $CC, $CC, $CC, $CC, $F8, $C0, $C0; 'p' .db $00, $00, $7C, $CC, $CC, $CC, $CC, $7C, $0C, $0C; 'q' .db $00, $00, $CC, $DC, $E0, $C0, $C0, $C0, $C0, $00; 'r' .db $00, $00, $7C, $C0, $C0, $78, $0C, $0C, $F8, $00; 's' .db $60, $60, $FC, $60, $60, $60, $60, $60, $3C, $00; 't' .db $00, $00, $CC, $CC, $CC, $CC, $CC, $CC, $7C, $00; 'u' .db $00, $00, $CC, $CC, $CC, $CC, $CC, $78, $30, $00; 'v' .db $00, $00, $C6, $D6, $D6, $D6, $D6, $6C, $6C, $00; 'w' .db $00, $00, $CC, $CC, $78, $30, $78, $CC, $CC, $00; 'x' .db $00, $00, $CC, $CC, $CC, $CC, $CC, $78, $18, $F0; 'y' .db $00, $00, $FC, $0C, $18, $30, $60, $C0, $FC, $00; 'z' .db $18, $30, $30, $60, $C0, $60, $30, $30, $18, $00; '{' .db $30, $30, $30, $30, $30, $30, $30, $30, $30, $00; '|' .db $60, $30, $30, $18, $0C, $18, $30, $30, $60, $00; '}' .db $00, $00, $00, $E2, $B6, $1C, $00, $00, $00, $00; '~' .db $FF, $E7, $C3, $99, $99, $81, $99, $99, $99, $FF; 'A' $7f (special-inverted a) .db $FE, $C6, $BA, $BA, $F6, $EE, $EE, $FE, $EE, $FE; '?' $80 (special-unknown char) BackgroundImage: .db $00, $64, $42, $43, $63, $42, $64, $43, $63, $64, $63, $6A, $CD, $CD, $CD, $00 .db $04, $1A, $CD, $CD, $CD, $64, $63, $84, $63, $84, $84, $64, $63, $64, $63, $63 .db $63, $84, $84, $63, $42, $22, $42, $43, $63, $63, $6A, $CD, $CD, $CD, $00, $04 .db $1A, $CD, $CD, $CD, $64, $63, $84, $63, $84, $84, $64, $63, $64, $63, $63, $63 .db $84, $84, $63, $42, $22, $42, $43, $63, $63, $6A, $CD, $CD, $CD, $00, $04, $1A .db $CD, $CD, $CD, $64, $63, $84, $63, $84, $84, $64, $63, $64, $63, $63, $63, $84 .db $84, $63, $42, $22, $42, $43, $63, $63, $6A, $CD, $CD, $CD, $00, $04, $1A, $CD .db $CD, $CD, $64, $63, $84, $63, $84, $84, $64, $63, $64, $63, $63, $63, $84, $84 .db $63, $42, $22, $42, $43, $63, $63, $6A, $CD, $CD, $CD, $00, $04, $1A, $CD, $CD .db $CD, $64, $63, $84, $63, $84, $84, $64, $63, $64, $63, $63, $64, $63, $63, $AC .db $8A, $43, $6B, $63, $84, $D5, $CD, $CD, $00, $08, $1A, $F5, $F5, $F5, $63, $8C .db $84, $63, $6B, $AC, $63, $64, $43, $42, $43, $43, $43, $42, $63, $63, $42, $22 .db $D5, $CD, $CD, $00, $08, $1A, $F5, $F5, $F5, $63, $6B, $43, $43, $42, $63, $84 .db $43, $6B, $84, $64, $84, $63, $84, $63, $43, $84, $84, $D5, $CD, $CD, $00, $08 .db $1A, $F5, $F5, $F5, $43, $43, $84, $8C, $AB, $6B, $43, $43, $84, $00, $04, $63 .db $42, $6B, $64, $63, $42, $D5, $CD, $CD, $00, $08, $1A, $F5, $F5, $F5, $43, $6B .db $84, $64, $64, $63, $43, $64, $64, $64, $43, $63, $22, $42, $43, $8B, $4A, $64 .db $D5, $CD, $CD, $00, $08, $1A, $F5, $F5, $F5, $63, $8C, $84, $63, $6B, $AC, $63 .db $64, $43, $64, $6B, $63, $8C, $64, $63, $63, $64, $63, $F5, $00, $0C, $1A, $F5 .db $43, $63, $64, $63, $6B, $6B, $43, $6C, $64, $22, $43, $63, $84, $6B, $64, $64 .db $84, $6B, $F5, $00, $0C, $1A, $F5, $84, $84, $63, $63, $43, $63, $84, $43, $63 .db $43, $42, $63, $62, $63, $00, $04, $43, $F5, $00, $0C, $1A, $F5, $64, $22, $42 .db $43, $6A, $63, $84, $64, $63, $43, $42, $43, $43, $22, $63, $42, $43, $42, $F5 .db $00, $0C, $1A, $F5, $43, $63, $64, $42, $63, $63, $63, $64, $43, $43, $64, $64 .db $43, $43, $43, $62, $6A, $84, $F5, $00, $0C, $1A, $F5, $43, $63, $64, $63, $6B .db $6B, $43, $6C, $64, $64, $43, $43, $64, $63, $43, $63, $63, $64, $F5, $00, $0C .db $1A, $F5, $42, $43, $63, $63, $63, $43, $63, $84, $64, $43, $43, $43, $84, $63 .db $63, $63, $B3, $8C, $F5, $00, $0C, $1A, $F5, $63, $63, $43, $64, $42, $63, $6C .db $6B, $63, $64, $63, $43, $64, $64, $6B, $63, $63, $6A, $F5, $00, $0C, $1A, $F5 .db $63, $43, $63, $64, $6B, $8B, $63, $64, $63, $63, $63, $43, $63, $43, $63, $84 .db $A4, $84, $F5, $00, $0C, $1A, $F5, $63, $63, $64, $43, $43, $43, $63, $63, $63 .db $6B, $63, $6B, $8B, $8B, $43, $64, $8B, $43, $F5, $00, $0C, $1A, $F5, $42, $43 .db $63, $63, $63, $43, $63, $84, $64, $63, $63, $43, $42, $8B, $8B, $AB, $8B, $F6 .db $F6, $00, $0C, $1A, $F6, $F6, $63, $43, $64, $63, $63, $43, $63, $63, $63, $42 .db $43, $64, $64, $42, $43, $83, $F6, $F6, $00, $0C, $1A, $F6, $F6, $00, $04, $42 .db $43, $63, $64, $63, $42, $42, $63, $84, $63, $63, $43, $63, $F6, $F6, $00, $0C .db $1A, $F6, $F6, $43, $84, $84, $84, $8C, $6B, $8B, $00, $05, $63, $43, $64, $84 .db $63, $F6, $F6, $00, $0C, $1A, $F6, $F6, $63, $63, $43, $63, $64, $64, $64, $63 .db $63, $43, $8B, $8B, $8B, $63, $6B, $8B, $F6, $F6, $00, $0C, $1A, $F6, $F6, $63 .db $43, $64, $63, $63, $43, $63, $63, $64, $63, $63, $43, $6B, $6B, $6B, $F6, $F6 .db $F6, $00, $0C, $1A, $F6, $F6, $F6, $64, $43, $63, $43, $42, $63, $84, $6C, $63 .db $42, $84, $64, $4A, $42, $F6, $F6, $F6, $00, $0C, $1A, $F6, $F6, $F6, $42, $00 .db $04, $43, $00, $04, $63, $84, $AC, $8B, $43, $63, $F6, $F6, $F6, $00, $0C, $1A .db $F6, $F6, $F6, $43, $43, $43, $63, $8C, $AC, $6C, $43, $8B, $6B, $64, $64, $64 .db $63, $F6, $F6, $F6, $00, $0C, $1A, $F6, $F6, $F6, $43, $42, $63, $8C, $8B, $00 .db $06, $43, $63, $84, $8B, $F6, $F6, $F6, $00, $0C, $1A, $F6, $F6, $F6, $64, $43 .db $63, $43, $42, $63, $84, $63, $63, $43, $43, $43, $F5, $F6, $F5, $D5, $00, $0E .db $1A, $D5, $F5, $F6, $F5, $8C, $63, $22, $22, $63, $64, $63, $43, $63, $63, $F5 .db $F6, $F5, $D5, $00, $0E, $1A, $D5, $F5, $F6, $F5, $A5, $8C, $6A, $43, $63, $43 .db $84, $64, $63, $4A, $F5, $F6, $F5, $D5, $00, $0E, $1A, $D5, $F5, $F6, $F5, $8B .db $AB, $8B, $6B, $64, $63, $6B, $84, $84, $63, $F5, $F6, $F5, $D5, $00, $0E, $1A .db $D5, $F5, $F6, $F5, $84, $8B, $8B, $6B, $84, $64, $63, $43, $42, $43, $F5, $F6 .db $F5, $D5, $00, $0E, $1A, $D5, $F5, $F6, $F5, $8C, $63, $22, $22, $63, $63, $84 .db $84, $63, $42, $F5, $F6, $F5, $00, $10, $1A, $F5, $F6, $F5, $6B, $43, $64, $8C .db $63, $63, $63, $64, $64, $63, $F5, $F6, $F5, $00, $10, $1A, $F5, $F6, $F5, $64 .db $84, $8C, $8C, $42, $42, $42, $43, $4A, $41, $F5, $F6, $F5, $00, $10, $1A, $F5 .db $F6, $F5, $63, $6B, $63, $63, $8B, $8C, $63, $63, $43, $63, $F5, $F6, $F5, $00 .db $10, $1A, $F5, $F6, $F5, $63, $42, $41, $4B, $84, $8C, $42, $22, $43, $43, $F5 .db $F6, $F5, $00, $10, $1A, $F5, $F6, $F5, $6B, $43, $64, $8C, $63, $D5, $CD, $D5 .db $CD, $F6, $F5, $F6, $00, $12, $1A, $F6, $F5, $F6, $F5, $F5, $D5, $CD, $CD, $F5 .db $D5, $CD, $F6, $F5, $F6, $00, $12, $1A, $F6, $F5, $F6, $CD, $CD, $00, $04, $F5 .db $D5, $CD, $F6, $F5, $F6, $00, $12, $1A, $F6, $F5, $F6, $CD, $CD, $00, $04, $F5 .db $D5, $CD, $F6, $F5, $F6, $00, $12, $1A, $F6, $F5, $F6, $D5, $CD, $CD, $F5, $F5 .db $F5, $D5, $CD, $F6, $F5, $F6, $00, $12, $1A, $F6, $F5, $F6, $F5, $F5, $D5, $CD .db $00, $FF, $1A, $00, $FF, $1A, $00, $FF, $1A, $00, $FF, $1A, $00, $FF, $1A, $00 .db $FF, $1A, $00, $FF, $1A, $00, $FF, $1A, $00, $FF, $1A, $00, $FF, $1A, $00, $FF .db $1A, $00, $FF, $1A, $00, $FF, $1A, $00, $FF, $1A, $00, $FF, $1A, $00, $FF, $1A .db $00, $FF, $1A, $00, $FF, $1A, $00, $FF, $1A, $00, $FF, $1A, $00, $FF, $1A, $00 .db $FF, $1A, $00, $FF, $1A, $00, $D7, $1A, $F5, $F5, $F5, $00, $06, $F6, $D5, $D5 .db $F5, $00, $04, $F6, $F5, $F6, $F6, $F5, $CD, $F5, $F5, $F5, $F6, $F6, $00, $04 .db $F5, $00, $0B, $F6, $F5, $F5, $D5, $D5, $00, $04, $F5, $F6, $F6, $F5, $F5, $F5 .db $00, $08, $F6, $00, $04, $F5, $F6, $F6, $F6, $F5, $F6, $D5, $D5, $00, $0B, $F6 .db $00, $05, $F5, $F6, $F6, $00, $04, $F5, $00, $08, $F6, $F5, $F5, $F5, $D5, $D5 .db $F5, $00, $04, $F6, $F5, $F6, $F5, $F5, $F5, $00, $08, $F6, $00, $04, $F5, $F6 .db $F6, $F6, $F5, $F6, $F6, $D5, $00, $0B, $F6, $00, $05, $F5, $F6, $F6, $F5, $F5 .db $F5, $F6, $F5, $D5, $D5, $00, $04, $F5, $F6, $F6, $F5, $D5, $F5, $F6, $F5, $00 .db $09, $F6, $F5, $00, $07, $F6, $F5, $F5, $F5, $00, $08, $F6, $F5, $F5, $D5, $D5 .db $F5, $00, $04, $F6, $F5, $D5, $D5, $00, $04, $F5, $F6, $F6, $F5, $F6, $00, $05 .db $F5, $F6, $F6, $F6, $D5, $F5, $D5, $00, $04, $F5, $00, $08, $F6, $00, $04, $F5 .db $F6, $F6, $F6, $F5, $D5, $D5, $00, $04, $F5, $F6, $F6, $F5, $F6, $00, $04, $F5 .db $D5, $F5, $F6, $F5, $00, $05, $F6, $D5, $D5, $00, $04, $F5, $F6, $F6, $F5, $F6 .db $00, $05, $F5, $F6, $F6, $F6, $D5, $F5, $F6, $D5, $F5, $F5, $F5, $00, $08, $F6 .db $00, $04, $F5, $F6, $F6, $F6, $F5, $00, $04, $F6, $93, $D5, $F5, $93, $F6, $F6 .db $F6, $F5, $F6, $F5, $F5, $F6, $F6, $F5, $F6, $F6, $93, $00, $0C, $F6, $93, $D5 .db $D5, $93, $F5, $F5, $93, $F6, $F6, $F5, $F6, $F5, $F5, $F5, $D5, $F5, $F6, $F5 .db $F6, $93, $F6, $F6, $D5, $D5, $F5, $00, $04, $F6, $F5, $F6, $F6, $93, $CD, $F5 .db $93, $F5, $F6, $93, $00, $05, $F5, $D5, $D5, $00, $04, $F5, $F6, $93, $F5, $F6 .db $00, $05, $F5, $F6, $F6, $F6, $D5, $D5, $93, $F5, $F6, $93, $F6, $F6, $93, $F6 .db $F6, $F5, $CD, $00, $04, $F5, $F6, $F6, $F5, $F6, $93, $F6, $F6, $D5, $D5, $F5 .db $00, $04, $F6, $F5, $F6, $F6, $93, $CD, $F5, $93, $F5, $F6, $93, $00, $05, $F5 .db $D5, $D5, $00, $04, $F5, $F6, $93, $F5, $F6, $00, $05, $F5, $F6, $F6, $F6, $D5 .db $F5, $93, $F6, $F6, $93, $F5, $00, $04, $93, $F6, $F6, $93, $F6, $93, $93, $F6 .db $F5, $00, $06, $93, $F6, $93, $93, $93, $F5, $93, $F5, $F6, $F6, $93, $D5, $93 .db $93, $F6, $00, $04, $93, $F6, $F6, $93, $CD, $93, $93, $F5, $F6, $00, $06, $93 .db $F5, $93, $93, $93, $F6, $93, $F6, $F6, $F6, $93, $F6, $93, $93, $F6, $00, $04 .db $93, $F6, $F6, $93, $D5, $93, $93, $F6, $F6, $00, $06, $93, $CD, $93, $93, $93 .db $F6, $93, $F5, $F5, $D5, $93, $F6, $93, $93, $F6, $00, $04, $93, $F6, $F6, $93 .db $F5, $93, $93, $F6, $F6, $00, $06, $93, $F5, $93, $93, $93, $F6, $93, $F6, $F6 .db $F6, $93, $F6, $93, $93, $F6, $00, $04, $93, $F6, $F6, $93, $D5, $93, $93, $F6 .db $F6, $00, $06, $93, $CD, $93, $93, $93, $F6, $93, $F5, $F5, $F5, $93, $F6, $00 .db $FF, $93, $00, $FF, $93, $00, $83, $93, $00, $FF, $FF, $00, $41, $FF, $00, $FF .db $93, $00, $FF, $93, $00, $FF, $93, $00, $FF, $93, $00, $FF, $93, $00, $FF, $93 .db $00, $FF, $93, $00, $FF, $93, $00, $C8, $93, $00, $04, $FF, $00, $08, $93, $00 .db $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08 .db $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF .db $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00 .db $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08 .db $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF .db $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00 .db $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08 .db $93, $00, $04, $FF, $00, $FF, $93, $00, $FF, $93, $00, $FF, $93, $00, $FF, $93 .db $00, $FF, $93, $00, $FF, $93, $00, $FF, $93, $00, $FF, $93, $00, $C8, $93, $00 .db $04, $FF, $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08 .db $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF .db $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00 .db $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08 .db $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF .db $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00 .db $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08, $93, $00, $08, $FF, $00, $08 .db $93, $00, $08, $FF, $00, $08, $93, $00, $04, $FF, $00, $FF, $93, $00, $FF, $93 .db $00, $FF, $93, $00, $FF, $93, $00, $FF, $93, $00, $FF, $93, $00, $FF, $93, $00 .db $FF, $93, $00, $C8, $93, $00, $FF, $FF, $00, $41, $FF, $00, $FF, $93, $00, $FF .db $93, $00, $83, $93, $8B, $00, $04, $93, $8C, $AC, $93, $AC, $93, $93, $AC, $8C .db $00, $06, $93, $8C, $93, $93, $93, $8C, $93, $8C, $8C, $AC, $93, $8C, $93, $93 .db $8B, $00, $04, $93, $8C, $AC, $93, $AC, $93, $93, $AC, $8C, $00, $06, $93, $8C .db $93, $93, $93, $8C, $93, $8C, $8C, $AC, $93, $8C, $93, $93, $8B, $00, $04, $93 .db $8C, $AC, $93, $AC, $93, $93, $AC, $8C, $00, $06, $93, $8C, $93, $93, $93, $8C .db $93, $8C, $8C, $AC, $93, $8C, $93, $93, $8B, $00, $04, $93, $8C, $AC, $93, $AC .db $93, $93, $AC, $8C, $00, $06, $93, $8C, $93, $93, $93, $8C, $93, $8C, $8C, $AC .db $93, $8C, $93, $93, $8B, $00, $04, $93, $8C, $AC, $93, $AC, $93, $93, $AC, $8C .db $00, $06, $93, $8C, $93, $93, $93, $8C, $93, $8C, $8C, $AC, $93, $8C, $93, $93 .db $8C, $AC, $93, $00, $09, $8C, $8B, $8B, $8B, $93, $AC, $AC, $AC, $00, $05, $8C .db $8B, $8B, $8C, $AC, $93, $8C, $8B, $93, $8B, $8C, $93, $8C, $8C, $AC, $AC, $AC .db $8C, $8B, $8B, $8B, $AC, $8C, $8C, $93, $AC, $AC, $8C, $8C, $AC, $00, $04, $8C .db $8B, $8B, $8C, $93, $8C, $8C, $93, $AC, $AC, $93, $00, $06, $8C, $8B, $8B, $8C .db $8C, $8B, $8B, $93, $AC, $00, $0B, $8C, $93, $8C, $8B, $93, $AC, $AC, $93, $AC .db $8C, $8C, $8C, $AC, $8B, $8B, $AC, $AC, $8C, $8C, $8C, $93, $AC, $00, $0A, $8C .db $AC, $93, $8C, $8C, $93, $AC, $AC, $93, $00, $04, $8C, $00, $05, $AC, $8C, $8B .db $8B, $93, $AC, $00, $0A, $8C, $AC, $93, $8C, $8C, $AC, $00, $07, $8C, $8D, $8D .db $8C, $8C, $AC, $AC, $8B, $8B, $00, $04, $AC, $8C, $84, $84, $00, $08, $8C, $8B .db $8B, $8C, $8C, $8D, $8D, $AC, $AC, $AC, $8C, $8C, $8B, $8B, $AC, $AC, $AC, $8C .db $AC, $AC, $84, $00, $07, $8C, $8B, $8B, $00, $05, $8C, $8B, $8B, $8D, $8D, $00 .db $05, $8C, $8B, $8B, $00, $05, $8C, $84, $84, $00, $0C, $8C, $8B, $8B, $00, $04 .db $8C, $84, $84, $8C, $8C, $84, $84, $AC, $AC, $8B, $8B, $00, $12, $8C, $AC, $AC .db $8C, $8D, $8C, $8C, $8C, $00, $05, $AC, $8B, $8B, $00, $04, $AC, $00, $09, $8C .db $AC, $AC, $8C, $8C, $AC, $AC, $00, $06, $8C, $8D, $8D, $00, $07, $8C, $AC, $8C .db $8C, $8C, $84, $84, $8C, $8C, $AC, $AC, $00, $07, $8C, $8D, $8D, $8C, $8C, $AC .db $AC, $00, $08, $8C, $AC, $AC, $84, $84, $00, $0E, $8C, $8B, $8D, $00, $06, $8C .db $84, $84, $00, $05, $8C, $84, $00, $04, $8D, $00, $0D, $8C, $AD, $84, $84, $8C .db $8C, $8C, $84, $84, $8C, $8C, $8B, $8B, $00, $0B, $8C, $84, $84, $84, $00, $06 .db $8C, $8D, $8D, $8D, $8C, $8C, $AC, $AC, $8C, $8C, $8C, $8B, $8B, $84, $AC, $AC .db $AC, $00, $05, $8C, $AC, $AC, $8C, $8C, $AC, $00, $05, $8C, $8D, $AD, $8D, $00 .db $04, $8C, $8D, $00, $05, $8C, $84, $8C, $8D, $8D, $8C, $8C, $8D, $8C, $8D, $8D .db $AC, $00, $08, $8C, $8D, $AD, $8D, $00, $04, $8C, $8D, $00, $05, $8C, $84, $8C .db $8D, $8D, $8C, $8C, $8D, $8C, $8D, $8D, $AC, $00, $08, $8C, $8D, $AD, $8D, $00 .db $04, $8C, $8D, $00, $05, $8C, $84, $8C, $8D, $8D, $8C, $8C, $8D, $8C, $8D, $8D .db $AC, $00, $08, $8C, $8D, $AD, $8D, $00, $04, $8C, $8D, $00, $05, $8C, $84, $8C .db $8D, $8D, $8C, $8C, $8D, $8C, $8D, $8D, $AC, $00, $08, $8C, $8D, $AD, $8D, $00 .db $04, $8C, $8D, $00, $05, $8C, $84, $8C, $8D, $8D, $8C, $8C, $8D, $8C, $8D, $8D .db $AC, $00, $08, $8C, $AD, $AD, $8C, $8C, $8C, $6C, $8D, $8D, $8C, $AC, $8C, $8C .db $8C, $84, $8D, $AE, $8D, $8C, $8C, $AD, $84, $8C, $00, $04, $8D, $AD, $8C, $8C .db $84, $8C, $8C, $AD, $AD, $8C, $8C, $8C, $6C, $8D, $8D, $8C, $AC, $8C, $8C, $8C .db $84, $8D, $AE, $8D, $8C, $8C, $AD, $84, $8C, $00, $04, $8D, $AD, $8C, $8C, $84 .db $8C, $8C, $AD, $AD, $8C, $8C, $8C, $6C, $8D, $8D, $8C, $AC, $8C, $8C, $8C, $84 .db $8D, $AE, $8D, $8C, $8C, $AD, $84, $8C, $00, $04, $8D, $AD, $8C, $8C, $84, $8C .db $8C, $AD, $AD, $8C, $8C, $8C, $6C, $8D, $8D, $8C, $AC, $8C, $8C, $8C, $84, $8D .db $AE, $8D, $8C, $8C, $AD, $84, $8C, $00, $04, $8D, $AD, $8C, $8C, $84, $8C, $8C .db $AD, $AD, $8C, $8C, $8C, $6C, $8D, $8D, $8C, $AC, $8C, $8C, $8C, $84, $8D, $AE .db $8D, $8C, $8C, $AD, $84, $8C, $00, $04, $8D, $AD, $8C, $8C, $84, $8C, $8C, $AD .db $AC, $8C, $AD, $AD, $8D, $8D, $84, $8C, $8C, $8D, $8D, $8C, $8C, $8C, $8D, $8C .db $8C, $8C, $8D, $8C, $8C, $8D, $AD, $8D, $8D, $8D, $00, $05, $8C, $AD, $AC, $8C .db $AD, $AD, $8D, $8D, $84, $8C, $8C, $8D, $8D, $8C, $8C, $8C, $8D, $8C, $8C, $8C .db $8D, $8C, $8C, $8D, $AD, $8D, $8D, $8D, $00, $05, $8C, $AD, $AC, $8C, $AD, $AD .db $8D, $8D, $84, $8C, $8C, $8D, $8D, $8C, $8C, $8C, $8D, $8C, $8C, $8C, $8D, $8C .db $8C, $8D, $AD, $8D, $8D, $8D, $00, $05, $8C, $AD, $AC, $8C, $AD, $AD, $8D, $8D .db $84, $8C, $8C, $8D, $8D, $8C, $8C, $8C, $8D, $8C, $8C, $8C, $8D, $8C, $8C, $8D .db $AD, $8D, $8D, $8D, $00, $05, $8C, $AD, $AC, $8C, $AD, $AD, $8D, $8D, $84, $8C .db $8C, $8D, $8D, $8C, $8C, $8C, $8D, $8C, $8C, $8C, $8D, $8C, $8C, $8D, $AD, $8D .db $8D, $8D, $00, $05, $8C, $8D, $8C, $AD, $AD, $AD, $8C, $8D, $84, $8C, $8C, $8D .db $8C, $64, $8D, $8C, $8C, $8D, $8C, $AD, $8C, $8D, $84, $8C, $AD, $AC, $AC, $8C .db $AD, $8D, $8C, $8C, $8C, $8D, $8C, $AD, $AD, $AD, $8C, $8D, $84, $8C, $8C, $8D .db $8C, $64, $8D, $8C, $8C, $8D, $8C, $AD, $8C, $8D, $84, $8C, $AD, $AC, $AC, $8C .db $AD, $8D, $8C, $8C, $8C, $8D, $8C, $AD, $AD, $AD, $8C, $8D, $84, $8C, $8C, $8D .db $8C, $64, $8D, $8C, $8C, $8D, $8C, $AD, $8C, $8D, $84, $8C, $AD, $AC, $AC, $8C .db $AD, $8D, $8C, $8C, $8C, $8D, $8C, $AD, $AD, $AD, $8C, $8D, $84, $8C, $8C, $8D .db $8C, $64, $8D, $8C, $8C, $8D, $8C, $AD, $8C, $8D, $84, $8C, $AD, $AC, $AC, $8C .db $AD, $8D, $8C, $8C, $8C, $8D, $8C, $AD, $AD, $AD, $8C, $8D, $84, $8C, $8C, $8D .db $8C, $64, $8D, $8C, $8C, $8D, $8C, $AD, $8C, $8D, $84, $8C, $AD, $AC, $AC, $8C .db $AD, $8D, $8C, $84, $AC, $8C, $8C, $8D, $8D, $8C, $8D, $8D, $84, $8C, $8D, $AC .db $8C, $8C, $8D, $8C, $8C, $8D, $8D, $8D, $8C, $8D, $AC, $8D, $AD, $8C, $8C, $8C .db $8D, $AC, $8C, $84, $AC, $8C, $8C, $8D, $8D, $8C, $8D, $8D, $84, $8C, $8D, $AC .db $8C, $8C, $8D, $8C, $8C, $8D, $8D, $8D, $8C, $8D, $AC, $8D, $AD, $8C, $8C, $8C .db $8D, $AC, $8C, $84, $AC, $8C, $8C, $8D, $8D, $8C, $8D, $8D, $84, $8C, $8D, $AC .db $8C, $8C, $8D, $8C, $8C, $8D, $8D, $8D, $8C, $8D, $AC, $8D, $AD, $8C, $8C, $8C .db $8D, $AC, $8C, $84, $AC, $8C, $8C, $8D, $8D, $8C, $8D, $8D, $84, $8C, $8D, $AC .db $8C, $8C, $8D, $8C, $8C, $8D, $8D, $8D, $8C, $8D, $AC, $8D, $AD, $8C, $8C, $8C .db $8D, $AC, $8C, $84, $AC, $8C, $8C, $8D, $8D, $8C, $8D, $8D, $84, $8C, $8D, $AC .db $8C, $8C, $8D, $8C, $8C, $8D, $8D, $8D, $8C, $8D, $AC, $8D, $AD, $8C, $8C, $8C .db $8D, $AC, $8C, $64, $8D, $8D, $8C, $8D, $8C, $8C, $8C, $AC, $8D, $8C, $8C, $8C .db $AD, $8D, $8C, $8C, $8C, $AD, $8C, $8D, $8C, $8C, $8D, $8D, $AC, $00, $05, $8C .db $84, $64, $8D, $8D, $8C, $8D, $8C, $8C, $8C, $AC, $8D, $8C, $8C, $8C, $AD, $8D .db $8C, $8C, $8C, $AD, $8C, $8D, $8C, $8C, $8D, $8D, $AC, $00, $05, $8C, $84, $64 .db $8D, $8D, $8C, $8D, $8C, $8C, $8C, $AC, $8D, $8C, $8C, $8C, $AD, $8D, $8C, $8C .db $8C, $AD, $8C, $8D, $8C, $8C, $8D, $8D, $AC, $00, $05, $8C, $84, $64, $8D, $8D .db $8C, $8D, $8C, $8C, $8C, $AC, $8D, $8C, $8C, $8C, $AD, $8D, $8C, $8C, $8C, $AD .db $8C, $8D, $8C, $8C, $8D, $8D, $AC, $00, $05, $8C, $84, $64, $8D, $8D, $8C, $8D .db $8C, $8C, $8C, $AC, $8D, $8C, $8C, $8C, $AD, $8D, $8C, $8C, $8C, $AD, $8C, $8D .db $8C, $8C, $8D, $8D, $AC, $00, $05, $8C, $84, $84, $84, $8C, $8C, $8D, $8D, $8C .db $8C, $8D, $8D, $8C, $8C, $8D, $AD, $AD, $8C, $8C, $8D, $AD, $8D, $8D, $AD, $8C .db $8D, $8D, $00, $04, $8C, $AC, $8C, $84, $84, $84, $8C, $8C, $8D, $8D, $8C, $8C .db $8D, $8D, $8C, $8C, $8D, $AD, $AD, $8C, $8C, $8D, $AD, $8D, $8D, $AD, $8C, $8D .db $8D, $00, $04, $8C, $AC, $8C, $84, $84, $84, $8C, $8C, $8D, $8D, $8C, $8C, $8D .db $8D, $8C, $8C, $8D, $AD, $AD, $8C, $8C, $8D, $AD, $8D, $8D, $AD, $8C, $8D, $8D .db $00, $04, $8C, $AC, $8C, $84, $84, $84, $8C, $8C, $8D, $8D, $8C, $8C, $8D, $8D .db $8C, $8C, $8D, $AD, $AD, $8C, $8C, $8D, $AD, $8D, $8D, $AD, $8C, $8D, $8D, $00 .db $04, $8C, $AC, $8C, $84, $84, $84, $8C, $8C, $8D, $8D, $8C, $8C, $8D, $8D, $8C .db $8C, $8D, $AD, $AD, $8C, $8C, $8D, $AD, $8D, $8D, $AD, $8C, $8D, $8D, $00, $04 .db $8C, $AC, $8C, $84, $00, $00 FrogSitImage: .db $00, $00, $00, $24, $24, $00, $00, $00, $24, $00, $20, $24, $24, $20, $00, $24 .db $46, $24, $46, $24, $24, $46, $24, $46, $00, $00, $24, $46, $46, $24, $00, $00 .db $00, $00, $24, $46, $46, $24, $00, $00, $24, $00, $24, $24, $24, $24, $00, $24 .db $46, $24, $24, $00, $00, $24, $24, $46, $00, $00, $00, $00, $00, $00, $00, $00 FrogJumpImage: .db $46, $00, $00, $24, $24, $00, $00, $46, $24, $00, $20, $24, $24, $20, $00, $24 .db $46, $24, $46, $24, $24, $46, $24, $46, $00, $00, $24, $46, $46, $24, $00, $00 .db $00, $00, $24, $46, $46, $24, $00, $00, $00, $00, $24, $24, $24, $24, $00, $00 .db $00, $24, $24, $00, $00, $24, $24, $00, $24, $46, $00, $00, $00, $00, $46, $24 FrogDeadImage: .db $E0, $00, $E0, $00, $00, $E0, $E0, $00, $00, $E0, $00, $E0, $E0, $E0, $00, $E0 .db $00, $E0, $E0, $E0, $E0, $00, $E0, $00, $00, $E0, $E0, $E0, $E0, $E0, $00, $E0 .db $E0, $00, $E0, $E0, $E0, $E0, $E0, $00, $00, $E0, $E0, $E0, $E0, $00, $E0, $E0 .db $E0, $E0, $00, $E0, $E0, $E0, $E0, $00, $00, $E0, $E0, $00, $E0, $00, $00, $00 CarList: .dw Car1Image,Car2Image,Car3Image,Car4Image .dw Car5Image,Car6Image,Car7Image,Car8Image Car1Image: .db $93, $93, $93, $4A, $4A, $4A, $93, $93, $93, $93, $93, $4A, $4A, $4A, $93, $93 .db $93, $1C, $1C, $13, $13, $13, $13, $13, $13, $13, $13, $13, $13, $13, $1C, $93 .db $7E, $1C, $1C, $1C, $1C, $13, $1C, $1C, $1C, $1C, $1C, $1C, $13, $1C, $1C, $93 .db $1C, $1C, $1C, $1C, $FF, $FF, $13, $13, $13, $13, $13, $13, $FF, $FF, $1C, $93 .db $13, $13, $13, $13, $FF, $FF, $13, $13, $13, $13, $13, $13, $FF, $FF, $13, $93 .db $13, $13, $13, $13, $FF, $FF, $13, $13, $13, $13, $13, $13, $FF, $FF, $13, $93 .db $1C, $1C, $1C, $1C, $FF, $FF, $13, $13, $13, $13, $13, $13, $FF, $FF, $1C, $93 .db $7E, $1C, $1C, $1C, $1C, $13, $1C, $1C, $1C, $1C, $1C, $1C, $13, $1C, $1C, $93 .db $93, $1C, $1C, $13, $13, $13, $13, $13, $13, $13, $13, $13, $13, $13, $1C, $93 .db $93, $93, $93, $4A, $4A, $4A, $93, $93, $93, $93, $93, $4A, $4A, $4A, $93, $93 Car2Image: .db $93, $93, $93, $4A, $4A, $4A, $93, $93, $93, $93, $93, $4A, $4A, $4A, $93, $93 .db $93, $E5, $E5, $A4, $A4, $A4, $E5, $E5, $E5, $E5, $E5, $A4, $A4, $A4, $E5, $93 .db $EE, $E5, $E5, $E5, $1A, $1A, $1A, $A4, $A4, $A4, $A4, $1A, $1A, $1A, $E5, $93 .db $E5, $A4, $A4, $E5, $1A, $1A, $A4, $A4, $A4, $A4, $A4, $A4, $1A, $1A, $E5, $93 .db $A4, $A4, $A4, $E5, $1A, $1A, $A4, $A4, $A4, $A4, $A4, $A4, $1A, $1A, $E5, $93 .db $A4, $A4, $A4, $E5, $1A, $1A, $A4, $A4, $A4, $A4, $A4, $A4, $1A, $1A, $E5, $93 .db $E5, $A4, $A4, $E5, $1A, $1A, $A4, $A4, $A4, $A4, $A4, $A4, $1A, $1A, $E5, $93 .db $EE, $E5, $E5, $E5, $1A, $1A, $1A, $A4, $A4, $A4, $A4, $1A, $1A, $1A, $E5, $93 .db $93, $E5, $E5, $A4, $A4, $A4, $E5, $E5, $E5, $E5, $E5, $A4, $A4, $A4, $E5, $93 .db $93, $93, $93, $4A, $4A, $4A, $93, $93, $93, $93, $93, $4A, $4A, $4A, $93, $93 Car3Image: .db $93, $93, $93, $4A, $4A, $4A, $93, $93, $93, $93, $93, $4A, $4A, $4A, $93, $93 .db $93, $E3, $E3, $A2, $A2, $A2, $A2, $A2, $A2, $A2, $A2, $A2, $A2, $A2, $E3, $93 .db $ED, $E3, $E3, $E3, $E3, $A2, $E3, $E3, $E3, $E3, $E3, $E3, $A2, $E3, $E3, $93 .db $E3, $E3, $E3, $E3, $1F, $1F, $A2, $A2, $A2, $A2, $A2, $A2, $1F, $1F, $E3, $93 .db $A2, $A2, $A2, $A2, $1F, $1F, $A2, $A2, $A2, $A2, $A2, $A2, $1F, $1F, $A2, $93 .db $A2, $A2, $A2, $A2, $1F, $1F, $A2, $A2, $A2, $A2, $A2, $A2, $1F, $1F, $A2, $93 .db $E3, $E3, $E3, $E3, $1F, $1F, $A2, $A2, $A2, $A2, $A2, $A2, $1F, $1F, $E3, $93 .db $ED, $E3, $E3, $E3, $E3, $A2, $E3, $E3, $E3, $E3, $E3, $E3, $A2, $E3, $E3, $93 .db $93, $E3, $E3, $A2, $A2, $A2, $A2, $A2, $A2, $A2, $A2, $A2, $A2, $A2, $E3, $93 .db $93, $93, $93, $4A, $4A, $4A, $93, $93, $93, $93, $93, $4A, $4A, $4A, $93, $93 Car4Image: .db $93, $93, $93, $4A, $4A, $4A, $93, $93, $93, $93, $93, $4A, $4A, $4A, $93, $93 .db $93, $B8, $B8, $98, $98, $98, $B8, $B8, $B8, $B8, $B8, $98, $98, $98, $B8, $93 .db $DB, $B8, $B8, $B8, $1F, $1F, $1F, $98, $98, $98, $98, $1F, $1F, $1F, $B8, $93 .db $B8, $98, $98, $B8, $1F, $1F, $98, $98, $98, $98, $98, $98, $1F, $1F, $98, $93 .db $98, $98, $98, $B8, $1F, $1F, $98, $98, $98, $98, $98, $98, $1F, $1F, $B8, $93 .db $98, $98, $98, $B8, $1F, $1F, $98, $98, $98, $98, $98, $98, $1F, $1F, $B8, $93 .db $B8, $98, $98, $B8, $1F, $1F, $98, $98, $98, $98, $98, $98, $1F, $1F, $98, $93 .db $DB, $B8, $B8, $B8, $1F, $1F, $1F, $98, $98, $98, $98, $1F, $1F, $1F, $B8, $93 .db $93, $B8, $B8, $98, $98, $98, $B8, $B8, $B8, $B8, $B8, $98, $98, $98, $B8, $93 .db $93, $93, $93, $4A, $4A, $4A, $93, $93, $93, $93, $93, $4A, $4A, $4A, $93, $93 Car5Image: .db $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93 .db $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93 .db $93, $93, $93, $85, $E0, $E0, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93 .db $93, $85, $85, $85, $1F, $E0, $E0, $E0, $A0, $85, $85, $58, $85, $93, $93, $93 .db $4A, $4A, $4A, $1F, $A7, $58, $58, $E0, $E0, $A0, $85, $E3, $4A, $4A, $4A, $93 .db $4A, $4A, $4A, $1F, $A7, $58, $58, $E0, $E0, $A0, $85, $E3, $4A, $4A, $4A, $93 .db $93, $85, $85, $85, $1F, $E0, $E0, $E0, $A0, $85, $85, $58, $85, $93, $93, $93 .db $93, $93, $93, $85, $E0, $E0, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93 .db $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93 .db $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93, $93 Car6Image: .db $4A, $4A, $4A, $93, $93, $93, $93, $93, $93, $93, $93, $4A, $4A, $4A, $A0, $93 .db $4A, $4A, $4A, $93, $93, $93, $93, $93, $93, $93, $93, $4A, $4A, $4A, $A0, $93 .db $93, $A0, $93, $93, $93, $93, $E0, $A0, $A0, $A0, $A0, $A0, $A0, $A0, $A0, $93 .db $93, $E0, $E0, $E0, $E0, $E0, $E0, $1F, $A0, $A0, $E0, $E0, $60, $60, $A0, $93 .db $A0, $A0, $A0, $A0, $A0, $A0, $1F, $A0, $A0, $A0, $A0, $E0, $60, $A0, $A0, $93 .db $A0, $A0, $A0, $A0, $A0, $A0, $1F, $A0, $A0, $A0, $A0, $E0, $60, $A0, $A0, $93 .db $93, $E0, $E0, $E0, $E0, $E0, $E0, $1F, $A0, $A0, $E0, $E0, $60, $60, $A0, $93 .db $93, $A0, $93, $93, $93, $93, $E0, $A0, $A0, $A0, $A0, $A0, $A0, $A0, $A0, $93 .db $4A, $4A, $4A, $93, $93, $93, $93, $93, $93, $93, $93, $4A, $4A, $4A, $A0, $93 .db $4A, $4A, $4A, $93, $93, $93, $93, $93, $93, $93, $93, $4A, $4A, $4A, $A0, $93 Car7Image: .db $93, $93, $93, $4A, $4A, $4A, $93, $93, $93, $93, $93, $4A, $4A, $4A, $93, $93 .db $A3, $A3, $A3, $A3, $A3, $A3, $A3, $A3, $A3, $A3, $A3, $A3, $A3, $A3, $A3, $93 .db $4A, $A3, $A3, $AC, $AC, $AC, $A3, $AC, $AC, $AC, $AC, $AC, $AC, $AC, $AC, $93 .db $A3, $A3, $9F, $AC, $AC, $9F, $A3, $AC, $AC, $A3, $A3, $A3, $A3, $A3, $A3, $93 .db $AC, $A3, $9F, $AC, $AC, $9F, $A3, $AC, $AC, $AC, $AC, $AC, $AC, $AC, $AC, $93 .db $AC, $A3, $9F, $AC, $AC, $9F, $A3, $AC, $AC, $AC, $AC, $AC, $AC, $AC, $AC, $93 .db $A3, $A3, $9F, $AC, $AC, $9F, $A3, $AC, $AC, $A3, $A3, $A3, $A3, $A3, $A3, $93 .db $4A, $A3, $A3, $AC, $AC, $AC, $A3, $AC, $AC, $AC, $AC, $AC, $AC, $AC, $AC, $93 .db $A3, $A3, $A3, $A3, $A3, $A3, $A3, $A3, $A3, $A3, $A3, $A3, $A3, $A3, $A3, $93 .db $93, $93, $93, $4A, $4A, $4A, $93, $93, $93, $93, $93, $4A, $4A, $4A, $93, $93 Car8Image: .db $93, $93, $4A, $4A, $4A, $93, $93, $93, $93, $93, $4A, $4A, $4A, $93, $93, $93 .db $93, $D6, $D6, $B5, $B5, $B5, $D6, $D6, $D6, $D6, $B5, $B5, $B5, $D6, $93, $93 .db $FF, $D6, $D6, $D6, $7D, $B5, $B5, $B5, $B5, $B5, $B5, $B5, $7D, $D6, $D6, $93 .db $B5, $B5, $B5, $B5, $7D, $7D, $D6, $D6, $D6, $D6, $D6, $7D, $7D, $D6, $EB, $93 .db $B5, $D6, $D6, $D6, $7D, $7D, $D6, $D6, $D6, $D6, $D6, $7D, $7D, $D6, $D6, $93 .db $B5, $D6, $D6, $D6, $7D, $7D, $D6, $D6, $D6, $D6, $D6, $7D, $7D, $D6, $D6, $93 .db $B5, $B5, $B5, $B5, $7D, $7D, $D6, $D6, $D6, $D6, $D6, $7D, $7D, $D6, $EB, $93 .db $FF, $D6, $D6, $D6, $7D, $B5, $B5, $B5, $B5, $B5, $B5, $B5, $7D, $D6, $D6, $93 .db $93, $D6, $D6, $B5, $B5, $B5, $D6, $D6, $D6, $D6, $B5, $B5, $B5, $D6, $93, $93 .db $93, $93, $4A, $4A, $4A, $93, $93, $93, $93, $93, $4A, $4A, $4A, $93, $93, $93 LogImage: .db $1A, $1A, $82, $82, $82, $82, $82, $82, $82, $82, $82, $82, $82, $1A, $1A, $1A .db $1A, $82, $C4, $82, $82, $83, $83, $83, $83, $82, $82, $83, $82, $82, $1A, $1A .db $1A, $82, $C4, $82, $83, $83, $82, $82, $82, $82, $83, $83, $83, $82, $1A, $1A .db $82, $C4, $A3, $C4, $82, $83, $82, $83, $83, $83, $83, $82, $83, $83, $82, $1A .db $82, $A3, $C4, $A3, $82, $83, $83, $83, $83, $82, $83, $82, $82, $83, $82, $1A .db $82, $A3, $C4, $A3, $82, $83, $82, $82, $82, $83, $83, $83, $83, $83, $82, $1A .db $82, $C4, $A3, $C4, $82, $83, $83, $82, $82, $82, $83, $82, $82, $83, $82, $1A .db $1A, $82, $C4, $82, $83, $82, $83, $83, $83, $83, $83, $83, $83, $82, $1A, $1A .db $1A, $82, $C4, $82, $83, $83, $82, $82, $82, $82, $83, $82, $83, $82, $1A, $1A .db $1A, $1A, $82, $82, $82, $82, $82, $82, $82, $82, $82, $82, $82, $1A, $1A, $1A TurtleAnim: .dw Turtle5Image,Turtle3Image,Turtle2Image,Turtle1Image .dw Turtle1Image,Turtle2Image,Turtle3Image,Turtle4Image Turtle1Image: .db $1A, $1A, $1A, $F5, $F5, $2E, $2E, $2E, $2E, $2E, $2E, $1A, $1A, $F5, $F5, $1A .db $1A, $1A, $1A, $F5, $2E, $2E, $2D, $2E, $2D, $2D, $2E, $2E, $F5, $F5, $F5, $1A .db $1A, $1A, $1A, $2E, $2E, $2D, $2D, $2E, $2E, $2D, $2E, $2E, $2E, $1A, $1A, $1A .db $00, $1A, $2E, $2E, $2E, $2D, $2E, $2E, $2E, $2E, $2E, $2D, $2E, $2E, $1A, $1A .db $F5, $F5, $2E, $2D, $2E, $2E, $2E, $2E, $2D, $2D, $2E, $2D, $2D, $2E, $2E, $1A .db $F5, $F5, $2E, $2D, $2D, $2E, $2E, $2E, $2D, $2D, $2E, $2D, $2E, $2E, $2E, $1A .db $00, $1A, $2E, $2E, $2E, $2E, $2D, $2E, $2E, $2E, $2E, $2E, $2E, $2E, $1A, $1A .db $1A, $1A, $1A, $2E, $2E, $2D, $2D, $2E, $2E, $2D, $2D, $2D, $2E, $1A, $1A, $1A .db $1A, $1A, $1A, $F5, $2E, $2E, $2D, $2E, $2E, $2D, $2E, $2E, $F5, $F5, $F5, $1A .db $1A, $1A, $1A, $F5, $F5, $2E, $2E, $2E, $2E, $2E, $2E, $1A, $1A, $F5, $F5, $1A Turtle2Image: .db $1A, $1A, $7C, $1A, $1A, $2E, $2E, $2E, $2E, $2E, $2E, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $2E, $2E, $2D, $2E, $2D, $2D, $2E, $2E, $1A, $7C, $7C, $1A .db $1A, $1A, $1A, $2E, $2E, $2D, $2D, $2E, $2E, $2D, $2E, $2E, $2E, $1A, $1A, $1A .db $1A, $1A, $2E, $2E, $2E, $2D, $2E, $2E, $2E, $2E, $2E, $2D, $2E, $2E, $1A, $1A .db $1A, $1A, $2E, $2D, $2E, $2E, $2E, $2E, $2D, $2D, $2E, $2D, $2D, $2E, $1A, $1A .db $7C, $1A, $2E, $2D, $2D, $2E, $2E, $2E, $2D, $2D, $2E, $2D, $2E, $2E, $1A, $1A .db $1A, $1A, $2E, $2E, $2E, $2E, $2D, $2E, $2E, $2E, $2E, $2E, $2E, $2E, $1A, $1A .db $1A, $1A, $1A, $2E, $2E, $2D, $2D, $2E, $2E, $2D, $2D, $2D, $2E, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $2E, $2E, $2D, $2E, $2E, $2D, $2E, $2E, $1A, $7C, $7C, $1A .db $1A, $1A, $7C, $1A, $1A, $2E, $2E, $2E, $2E, $2E, $2E, $1A, $1A, $1A, $1A, $1A Turtle3Image: .db $1A, $1A, $1A, $1A, $1A, $1A, $7C, $7C, $7C, $7C, $1A, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $7C, $1A, $1A, $1A, $1A, $1A, $1A, $7C, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $7C, $1A, $1A, $2D, $2E, $2E, $2D, $1A, $1A, $7C, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $2D, $2E, $2E, $2E, $2E, $2E, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $7C, $1A, $2E, $2E, $2E, $2E, $2D, $2D, $2E, $2D, $1A, $7C, $1A, $1A .db $1A, $1A, $7C, $1A, $2D, $2E, $2E, $2E, $2D, $2D, $2E, $2D, $1A, $7C, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $2E, $2D, $2E, $2E, $2E, $2E, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $7C, $1A, $1A, $2D, $2E, $2E, $2D, $1A, $1A, $7C, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $7C, $1A, $1A, $1A, $1A, $1A, $1A, $7C, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $1A, $7C, $7C, $7C, $7C, $1A, $1A, $1A, $1A, $1A, $1A Turtle4Image: .db $1A, $1A, $1A, $7C, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $7C, $1A, $1A, $1A .db $1A, $1A, $7C, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $7C, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A .db $1A, $7C, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $7C, $1A .db $1A, $7C, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $7C, $1A .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $7C, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $7C, $1A, $1A .db $1A, $1A, $1A, $7C, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $7C, $1A, $1A, $1A Turtle5Image: .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A SmallAlligatorImage: .db $1A, $1A, $1A, $1A, $1A, $45, $45, $1A, $1A, $45, $45, $45, $45, $45, $FF, $1A .db $45, $E0, $45, $45, $45, $FF, $1A, $1A, $45, $45, $45, $FF, $FF, $1A, $1A, $1A .db $45, $45, $FF, $1A, $1A, $1A, $1A, $1A, $45, $45, $45, $FF, $FF, $FF, $1A, $1A .db $45, $45, $45, $45, $45, $45, $FF, $1A, $1A, $1A, $1A, $1A, $45, $45, $45, $1A SmallFlyImage: .db $1A, $1A, $1A, $00, $00, $1A, $1A, $1A, $1A, $1A, $E0, $00, $00, $E0, $1A, $1A .db $1A, $FF, $00, $00, $00, $00, $FF, $1A, $FF, $B4, $FF, $00, $00, $FF, $B4, $FF .db $FF, $B4, $FF, $00, $00, $FF, $B4, $FF, $FF, $B4, $FF, $00, $00, $FF, $B4, $FF .db $FF, $B4, $FF, $00, $00, $FF, $B4, $FF, $1A, $FF, $1A, $00, $00, $1A, $FF, $1A SmallFrogImage: .db $1A, $1A, $1A, $46, $46, $1A, $1A, $1A, $46, $1A, $46, $46, $46, $46, $1A, $46 .db $1A, $46, $46, $46, $46, $46, $46, $1A, $1A, $1A, $46, $46, $46, $46, $1A, $1A .db $1A, $1A, $46, $46, $46, $46, $1A, $1A, $1A, $1A, $46, $46, $46, $46, $1A, $1A .db $1A, $46, $46, $1A, $1A, $46, $46, $1A, $46, $1A, $1A, $1A, $1A, $1A, $1A, $46 SmallWaterImage: .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A .db $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A, $1A TitlePalette: .db $FF, $FF, $23, $E0, $3E, $00, $57, $E0 TitleData: .db $02, $02, $09, $00, $50, $02, $04, $00, $15, $02, $05, $00, $15, $02, $05, $00 .db $54, $02, $0A, $00, $05, $02, $04, $00, $15, $55, $55, $00, $01, $55, $5A, $54 .db $00, $00, $00, $56, $A5, $40, $00, $00, $00, $56, $A5, $00, $00, $00, $01, $5A .db $94, $00, $00, $00, $55, $55, $55, $40, $00, $15, $55, $A5, $40, $00, $00, $56 .db $AA, $FF, $94, $05, $6A, $AA, $AA, $94, $00, $00, $5A, $AF, $A5, $00, $00, $00 .db $5A, $AF, $E5, $00, $00, $01, $6A, $BF, $94, $00, $01, $5A, $AA, $FF, $A5, $00 .db $56, $AA, $AA, $A9, $40, $00, $5A, $AA, $AA, $E9, $45, $AA, $AA, $AA, $FA, $40 .db $00, $1A, $AA, $AF, $94, $00, $00, $1A, $AA, $BF, $90, $00, $00, $6A, $AA, $FE .db $40, $00, $6B, $EA, $AA, $E9, $50, $5A, $AA, $AA, $AF, $A4, $00, $06, $BE, $AA .db $A9, $51, $AA, $E9, $55, $6B, $E5, $00, $16, $A5, $56, $BE, $40, $00, $06, $A9 .db $56, $BD, $40, $00, $1A, $A5, $5A, $F5, $00, $06, $EA, $AA, $A9, $54, $1A, $AE .db $95, $56, $BE, $50, $00, $6F, $A5, $55, $54, $15, $6A, $95, $05, $BE, $50, $05 .db $A5, $50, $5B, $E5, $00, $01, $A9, $55, $5A, $94, $00, $06, $A5, $55, $6A, $50 .db $00, $6A, $95, $55, $55, $01, $56, $A9, $50, $5B, $E5, $00, $06, $E9, $55, $54 .db $00, $5A, $A5, $00, $1B, $A5, $00, $69, $50, $01, $AE, $50, $00, $6A, $54, $01 .db $A9, $40, $01, $A9, $50, $06, $A5, $00, $06, $A9, $55, $54, $00, $05, $AA, $50 .db $01, $BA, $50, $00, $6E, $54, $00, $00, $01, $A9, $50, $06, $A9, $40, $1A, $54 .db $00, $06, $A5, $00, $1A, $95, $00, $6A, $50, $00, $6A, $54, $01, $A9, $40, $01 .db $AA, $50, $00, $00, $00, $1A, $95, $00, $6A, $94, $00, $1A, $A5, $00, $00, $00 .db $6A, $94, $01, $AA, $54, $06, $A5, $00, $00, $6A, $50, $06, $A5, $40, $06, $55 .db $00, $1A, $95, $00, $19, $54, $00, $1A, $A5, $00, $00, $00, $06, $A9, $40, $1A .db $A5, $40, $01, $A9, $50, $00, $00, $06, $A9, $41, $6A, $95, $01, $A9, $40, $00 .db $06, $A5, $01, $A9, $50, $00, $15, $40, $06, $A5, $40, $00, $55, $00, $06, $A9 .db $40, $10, $00, $00, $6A, $94, $16, $A9, $50, $00, $6A, $95, $55, $50, $01, $AA .db $51, $6A, $A5, $40, $1A, $50, $00, $01, $AA, $50, $1A, $94, $02, $04, $00, $6A .db $50, $02, $04, $00, $6A, $95, $56, $54, $00, $1A, $A5, $16, $AA, $54, $00, $06 .db $AA, $AB, $F9, $40, $1A, $A5, $6A, $A5, $50, $06, $A5, $00, $00, $1A, $95, $06 .db $A5, $40, $00, $05, $00, $1A, $95, $00, $00, $14, $00, $1A, $AA, $AB, $F9, $40 .db $01, $AA, $56, $AA, $55, $00, $01, $AA, $AA, $AE, $54, $06, $AA, $AA, $A5, $50 .db $00, $6A, $40, $00, $01, $A9, $40, $6A, $50, $05, $55, $A4, $01, $A9, $40, $15 .db $56, $90, $01, $AA, $AA, $AE, $54, $00, $6A, $AA, $AA, $55, $00, $00, $1A, $AA .db $55, $55, $00, $6A, $AA, $95, $50, $00, $1A, $94, $00, $00, $6A, $54, $1A, $A5 .db $01, $AA, $AE, $90, $6A, $94, $06, $AA, $BA, $40, $6A, $A5, $55, $55, $00, $06 .db $AA, $A9, $55, $00, $00, $06, $A9, $55, $55, $00, $1A, $AA, $A9, $50, $00, $01 .db $A9, $40, $00, $06, $A5, $01, $A9, $40, $6A, $AA, $F9, $06, $A5, $01, $AA, $AB .db $E4, $06, $A9, $55, $55, $00, $01, $AA, $AA, $95, $00, $00, $00, $6A, $94, $00 .db $00, $01, $AA, $6A, $A4, $00, $00, $6A, $94, $00, $01, $A9, $50, $1A, $94, $06 .db $95, $6B, $90, $6A, $50, $1A, $55, $AE, $40, $6A, $94, $00, $00, $00, $1A, $A6 .db $AA, $40, $00, $00, $06, $A5, $00, $00, $00, $6A, $95, $AA, $90, $00, $06, $A9 .db $40, $00, $1A, $94, $01, $A9, $40, $15, $56, $A5, $06, $A5, $00, $55, $5A, $94 .db $1A, $A5, $00, $00, $00, $06, $A9, $5A, $A9, $00, $00, $01, $AA, $50, $00, $00 .db $06, $A9, $56, $A9, $40, $00, $6A, $94, $00, $06, $A5, $40, $1A, $94, $00, $01 .db $A9, $40, $6A, $50, $00, $06, $A5, $01, $AA, $50, $00, $00, $00, $6A, $95, $6A .db $94, $00, $00, $1A, $A5, $00, $00, $00, $6A, $94, $6A, $A4, $00, $06, $A9, $40 .db $01, $A9, $50, $01, $AA, $40, $00, $6A, $54, $06, $A9, $00, $01, $A9, $50, $1A .db $A4, $00, $00, $00, $06, $A9, $46, $AA, $40, $00, $06, $EA, $50, $00, $00, $1B .db $E5, $01, $AA, $90, $00, $6A, $94, $01, $6A, $54, $00, $1A, $A4, $00, $1A, $95 .db $00, $6A, $90, $00, $6A, $54, $06, $A9, $40, $01, $55, $01, $BE, $50, $1A, $A9 .db $00, $00, $6E, $94, $00, $00, $01, $BA, $50, $06, $AE, $40, $06, $AA, $55, $6A .db $95, $00, $01, $AA, $95, $56, $A5, $40, $06, $AA, $55, $5A, $95, $00, $6F, $A5 .db $55, $6A, $94, $1B, $A5, $00, $6A, $E4, $00, $06, $F9, $40, $00, $00, $1B, $A5 .db $00, $5A, $FD, $00, $1B, $EA, $AA, $A5, $40, $00, $06, $FA, $AA, $A9, $50, $00 .db $1B, $EA, $AA, $A5, $40, $06, $BE, $AA, $AA, $A5, $01, $BA, $50, $05, $AF, $D0 .db $00, $6A, $54, $00, $00, $01, $F9, $50, $01, $AA, $D4, $01, $AF, $AA, $A5, $50 .db $00, $00, $5B, $EA, $AA, $54, $00, $01, $6F, $AA, $A9, $50, $00, $1A, $FA, $AA .db $A5, $50, $1F, $95, $00, $1A, $AD, $40, $06, $55, $00, $00, $00, $19, $54, $00 .db $06, $95, $40, $05, $AA, $A5, $50, $00, $00, $01, $6A, $A9, $55, $00, $00, $05 .db $AA, $A5, $54, $00, $01, $5A, $AA, $55, $50, $01, $95, $40, $00, $69, $54, $00 .db $55, $40, $00, $00, $01, $55, $00, $00, $15, $50, $00, $15, $55, $54, $00, $00 .db $00, $05, $55, $55, $00, $00, $00, $15, $55, $54, $00, $00, $05, $55, $55, $50 .db $00, $15, $50, $00, $01, $55, $02, $06, $00, $04, $02, $06, $00, $55, $54, $02 .db $04, $00, $05, $54, $02, $04, $00, $15, $50, $02, $04, $00, $50, $00, $00, $00 .db $40, $02, $05, $00, $02, $00 ;Appvar info VarName: .db $15,"FroggerD",0 InitHighScoreData: .db "ASM BANDIT",0 .dw 10100 .db 03 .db "**********", 0,0,0,0 .db "**********", 0,0,0,0 .db "**********", 0,0,0,0 .db "**********", 0,0,0,0 StartStr: ;68, 120 .dw 68 .dw 120 .db "Press Any Key To Start!",0 HighScoreStr: ;112, 158 .dw 112 .dw 158 .db "High Scores:",0 GameOverStr: ;124,68 .dw 124 .dw 68 .db "Game Over",0 NewHSStr: ;100,102 .dw 100 .dw 102 .db "New High Score!",0 EnterStr: ;96,123 .dw 96 .dw 123 .db "Enter Your Name:",0 CreditStr: ;56,28 .dw 56 .dw 28 .db "~AssemblyBandit~ Presents:",0 BlogStr: ;108,3 .dw 108 .dw 3 .db "briandm82.com",0 WinStr: ;100,68 .dw 100 .dw 68 .db "Level Complete!",0 NextStr: ;104,156 level:200,156 .dw 104 .dw 156 .db "Next Level:",0 LivesStr: ;84,102 .dw 84 .dw 102 .db "Lives Remaining:",0 ScoreStr: ;104,136 score:160,136 .dw 104 .dw 136 .db "Score:",0 PressStr: ;60,196 .dw 60 .dw 196 .db "Press Any Key To Continue",0 LevelStr: ;124,156 level:188,156 .dw 124 .dw 156 .db "Level:",0 CongratsStr: ;96,68 .dw 96 .dw 68 .db "Congratulations!",0 HoleLocation: .db 28, 60, 92, 124, 156 FloatLocation: .db 0,16,32, 135,151,167 .db 0,16, 90,106, 180,196 .db 0, 45, 90, 135, 180, 225 FloatLayout: .db 0,0,0,0,0,0 .db 1,0,1,0,1,0 .db 0,1,0,1,0,1 .db 1,1,1,0,0,0 .db 0,0,0,1,1,1 .db 0,0,1,1,0,0 .db 1,0,0,0,0,1 .db 0,1,0,0,1,0 CarLayout: .db 0,137,46,166,104 .db 0,135,180,97,30 .db 0,90,180,57,135 .db 0,67,134,201,34 .db 0,54,108,162,216 Rand: .db 208 , 108 , 163 , 40 , 90 , 116 , 222 , 102 , 174 , 111 , 25 , 196 , 36 , 250 , 178 , 29 .db 114 , 20 , 220 , 22 , 245 , 70 , 128 , 239 , 158 , 133 , 27 , 136 , 125 , 142 , 88 , 129 .db 145 , 242 , 98 , 223 , 238 , 80 , 169 , 184 , 69 , 145 , 202 , 249 , 161 , 8 , 239 , 217 .db 11 , 192 , 29 , 17 , 63 , 169 , 113 , 229 , 171 , 82 , 87 , 204 , 244 , 56 , 25 , 185 .db 204 , 31 , 215 , 79 , 148 , 235 , 72 , 238 , 121 , 173 , 225 , 215 , 161 , 5 , 194 , 161 .db 243 , 27 , 57 , 24 , 230 , 141 , 187 , 182 , 246 , 5 , 75 , 10 , 164 , 17 , 39 , 4 .db 210 , 114 , 100 , 116 , 32 , 189 , 102 , 120 , 71 , 86 , 212 , 119 , 152 , 158 , 155 , 249 .db 80 , 91 , 238 , 95 , 71 , 181 , 189 , 63 , 181 , 189 , 113 , 239 , 240 , 13 , 71 , 35 .db 214 , 198 , 231 , 185 , 60 , 55 , 91 , 152 , 72 , 255 , 35 , 16 , 20 , 51 , 32 , 232 .db 30 , 99 , 82 , 228 , 36 , 76 , 15 , 28 , 201 , 103 , 102 , 139 , 4 , 110 , 112 , 124 .db 239 , 198 , 208 , 3 , 212 , 73 , 253 , 99 , 149 , 214 , 245 , 193 , 13 , 15 , 204 , 233 .db 43 , 236 , 36 , 230 , 131 , 58 , 244 , 39 , 169 , 192 , 236 , 120 , 131 , 235 , 251 , 175 .db 44 , 176 , 0 , 157 , 208 , 136 , 112 , 22 , 214 , 234 , 30 , 183 , 61 , 157 , 110 , 143 .db 107 , 97 , 115 , 30 , 116 , 189 , 110 , 145 , 81 , 107 , 6 , 215 , 30 , 237 , 137 , 12 .db 71 , 16 , 216 , 159 , 143 , 241 , 19 , 233 , 107 , 66 , 224 , 120 , 116 , 108 , 192 , 30 .db 137 , 68 , 107 , 145 , 162 , 219 , 169 , 72 , 19 , 238 , 128 , 109 , 102 , 166 , 200 , 124 RandEnd: .end ;Test SetUpLevel: ;Set up vehicles ld a,255 ld (Lane1Timer),a ld (Lane2Timer),a ld (Lane3Timer),a ld a,251;251 ld (Lane1Speed),a ld a,250;250 ld (Lane2Speed),a ld a,253;253 ld (Lane3Speed),a ld a,3 ld (Lane1Dir),a ld (Lane3Dir),a ld a,1 ld (Lane2Dir),a ld a,182 ld (Lane1Y),a ld a,150 ld (Lane2Y),a ld a,118 ld (Lane3Y),a ld hl,Car1Image ld (Lane1Car1Sprite),hl ld (Lane2Car3Sprite),hl ld hl,Car2Image ld (Lane3Car5Sprite),hl ld (Lane1Car2Sprite),hl ld hl,Car3Image ld (Lane2Car4Sprite),hl ld (Lane3Car1Sprite),hl ld hl,Car4Image ld (Lane1Car3Sprite),hl ld (Lane2Car5Sprite),hl ld hl,Car5Image ld (Lane3Car2Sprite),hl ld (Lane1Car4Sprite),hl ld hl,Car6Image ld (Lane2Car1Sprite),hl ld (Lane3Car3Sprite),hl ld hl,Car7Image ld (Lane1Car5Sprite),hl ld hl,Car8Image ld (Lane2Car2Sprite),hl ld (Lane3Car4Sprite),hl ld hl,Lane1Car1X ld a,113 ld (hl),a inc hl ld a,49 ld (hl),a inc hl ld a,87 ld (hl),a inc hl ld a,9 ld (hl),a inc hl ld a,254 ld (hl),a ld hl,Lane2Car1X ld a,231 ld (hl),a inc hl ld a,175 ld (hl),a inc hl ld a,24 ld (hl),a inc hl ld a,55 ld (hl),a inc hl ld a,93 ld (hl),a ld hl,Lane3Car1X ld a,38 ld (hl),a inc hl ld a,123 ld (hl),a inc hl ld a,7 ld (hl),a inc hl ld a,169 ld (hl),a inc hl ld a,64 ld (hl),a ld a,2 ld (Lane1Count),a ld a,3 ld (Lane2Count),a ld a,4 ld (Lane3Count),a ;Set up logs ld a,255 ld (Stream1Timer),a ld (Stream2Timer),a ld (Stream3Timer),a ld a,100 ld (Stream1Speed),a ld a,150 ld (Stream2Speed),a ld a,200 ld (Stream3Speed),a ld a,255 ld (Stream1Anim),a ld (Stream2Anim),a ld (Stream3Anim),a ld hl,$ffff ld (Stream1AnimTimer),hl ld (Stream2AnimTimer),hl ld (Stream3AnimTimer),hl ld hl,$fcff ld (Stream1AnimSpeed),hl ld (Stream2AnimSpeed),hl ld (Stream3AnimSpeed),hl ld a,1 ld (Stream1Dir),a ld (Stream3Dir),a ld a,3 ld (Stream2Dir),a ld a,70 ld (Stream1Y),a ld a,46 ld (Stream2Y),a ld a,22 ld (Stream3Y),a xor a ld (Stream1Object1Sprite),a ld (Stream1Object2Sprite),a ld (Stream1Object3Sprite),a ld (Stream2Object4Sprite),a ld (Stream2Object5Sprite),a ld (Stream2Object6Sprite),a ld (Stream3Object1Sprite),a ld (Stream3Object2Sprite),a ld (Stream3Object3Sprite),a ld a,1 ld (Stream1Object4Sprite),a ld (Stream1Object5Sprite),a ld (Stream1Object6Sprite),a ld (Stream2Object1Sprite),a ld (Stream2Object2Sprite),a ld (Stream2Object3Sprite),a ld (Stream3Object4Sprite),a ld (Stream3Object5Sprite),a ld (Stream3Object6Sprite),a ld hl,Stream1Object1X ld a,0 ld (hl),a inc hl ld a,16 ld (hl),a inc hl ld a,32 ld (hl),a inc hl ld a,64 ld (hl),a inc hl ld a,80 ld (hl),a inc hl ld a,96 ld (hl),a ld hl,Stream2Object1X ld a,160 ld (hl),a inc hl ld a,176 ld (hl),a inc hl ld a,192 ld (hl),a inc hl ld a,32 ld (hl),a inc hl ld a,48 ld (hl),a inc hl ld a,64 ld (hl),a ld hl,Stream3Object1X ld a,128 ld (hl),a inc hl ld a,144 ld (hl),a inc hl ld a,160 ld (hl),a inc hl ld a,192 ld (hl),a inc hl ld a,208 ld (hl),a inc hl ld a,224 ld (hl),a ld a,6 ld (Stream1Count),a ld (Stream2Count),a ld (Stream3Count),a ret