; ~assemblybandit~ http://briandm82.com ;Buttonz v1.5.1 ;created using Assembly Studio 8x v4.0 ;Macro definitions #define bcall(xxxx) rst 28h \ .dw xxxx #define bjump(xxxx) call 50h \ .dw xxxx ;Ports KeypadPort equ $01 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 LCDInstPort equ $10 ;set register LCDDataPort equ $11 ;set value ;/--LCD Registers and Bits------------------\ LCDEntry equ $03 ;max colors,color format,origin,GRAM update 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) LCDControl equ $07 ;partial image enable, base image enable, 8 color mode 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 ;read/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 LCDLREV equ 0 ;0=invert colors 1=normal colors (def) ;\--LCD Registers and Bits------------------/ SpeedPort equ $20 ;write 0=6 Mhz, write 1=15 Mhz Timer1Port equ $30 ;set clock and divisor Timer2Port equ $33 ;set clock and divisor Timer3Port equ $36 ;set clock and divisor LightPort equ $3a ;bit 5 controls backlight ;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 AddTimer = $8bd9 LevelUp = $8bf3 CurrentColor = $8be0 C4Color = $8be4 C5BlockCount = $8bc7 Level = $8be7 StringRam = $8be8 KeyFlag = $8b90 AddFlag = $8bde C2BlockCount = $8ba3 BonusMod = $8be6 C3BlockQue = $8bb0 C2BlockQue = $8ba4 C1Color = $8be1 C3BlockCount = $8baf KeyRepeat = $8b8e HighScoreTable = $8b8c DrawFlag = $8bdf TextCol = $8b94 WaitKey = $8bf6 C3Color = $8be3 ImagePalette = $8bf7 CharCursor = $8bf9 C1BlockCount = $8b97 UpdateFlag = $8bdd C5Color = $8be5 C5BlockQue = $8bc8 C1SpaceGood = $8b96 TextRow = $8b92 C4BlockQue = $8bbc Score = $8bd2 UpdateTimer = $8bd5 C2SpaceGood = $8ba2 CharColor = $8bf5 AddTimerReset = $8bdb C3SpaceGood = $8bae C1BlockQue = $8b98 C4SpaceGood = $8bba C2Color = $8be2 UpdateTimerReset = $8bd7 C5SpaceGood = $8bc6 C4BlockCount = $8bbb OldKey = $8b91 ; Keys K2nd equ $00 KLeft equ $01 KRight equ $02 KF5 equ $03 KF4 equ $04 KF3 equ $05 KF2 equ $06 KF1 equ $07 .org $4000 ;This code has not been particularly optimized for size or speed. ;Current size: 16,310 bytes (max size rabbitsign can sign?) ;All routines (with the exception of the modified DivAHLby10) and data ; have been created by me and can be freely used for any purpose. ;There has been a lot of copying and pasting with this code, I really mean ; it when I say it has not been optimized! ;Special thanks to jacobly and Xeda112358 of omnimaga.org for verifying ; and optimizing my original DivAHLby10 routine! ;Thanks to Dr. D'nar, Brandon Wilson, Patrick Davidson, Jeremy Goetsch, ; Benjamin Moody, Kerm Martian, and Pat Milheron. ;Thanks to everyone who has documented the ports,ram,rom,rom calls. ;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 "Buttonz", 000h .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 call UpdateTimers ;--- 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 $06 ; a=(|||||,right,left,|) rra ; a=(||||||,right,left) ld b,a ld a,$ff out (KeypadPort),a nop nop nop nop nop nop nop nop ld a,$bf ; a=(||,2nd,f1,f2,f3,f4,f5) out (KeypadPort),a nop nop nop nop nop nop nop nop in a,(KeypadPort) rla rla rla ; a=(f1,f2,f3,f4,f5,|||) rl b ; b=(|||||,right,left,2nd) and $f8 or b ; a=(f1,f2,f3,f4,f5,right,left,2nd) ld b,a ;reset bit = button pressed ld a,$ff out (KeypadPort),a ld a,(OldKey) ;*not (extensively) tested! just added on to old key routine xor 255 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: ;before we do anything crazy, get a pointer to the high score data 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 (old = 65) 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 NoDelete 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: ld a,(de) ;check if old hs table cp 70 jp z,NoDelete bcall(_DelVarArc) jp CreateVar NoDelete: inc de ;skip over size inc de ld (HighScoreTable),de ;store pointer to HighScoreTable ;*Initialize Calc* di ;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 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 call ClearTemp ;clear tempswap except for HighScoreTable pointer ld a,LCDEntry ;save entry call DisplayReadHL push hl ld a,LCDControl ;save control call DisplayReadHL push hl ld a,1 out (SpeedPort),a ;set speed to 15Mhz call SetOrigin ;*Display Blog* Blog: call HideImage xor a ld (CharColor),a call DrawBWScreen call DisplayBlog ld hl,31 ld (TextCol),hl ld hl,12 ld (TextRow),hl ld hl,Omni1Str call DisplayString ld hl,44 ld (TextCol),hl ld hl,37 ld (TextRow),hl ld hl,Omni2Str call DisplayString ld hl,26 ld (TextCol),hl ld hl,65 ld (TextRow),hl ld hl,Omni3Str call DisplayString ld hl,186 ld (TextCol),hl ld hl,18 ld (TextRow),hl ld hl,Omni4Str call DisplayString ld hl,155 ld (TextCol),hl ld hl,47 ld (TextRow),hl ld hl,Omni5Str call DisplayString ld hl,188 ld (TextCol),hl ld hl,72 ld (TextRow),hl ld hl,Omni6Str call DisplayString ld hl,60 ld (TextCol),hl ld hl,161 ld (TextRow),hl ld hl,Omni7Str call DisplayString ld hl,27 ld (TextCol),hl ld hl,190 ld (TextRow),hl ld hl,Omni8Str call DisplayString ld hl,91 ld (TextCol),hl ld hl,215 ld (TextRow),hl ld hl,Omni9Str call DisplayString ld hl,190 ld (TextCol),hl ld hl,168 ld (TextRow),hl ld hl,Omni10Str call DisplayString ld hl,174 ld (TextCol),hl ld hl,205 ld (TextRow),hl ld hl,Omni11Str call DisplayString call ShowImage call Wait call SetLowColor ;*Display Title Screen* Title: di call HideLight call HideImage ld a,$ff ld (CharColor),a ;set white on black text call DrawBWScreen call DisplayTitle call WriteStart call WriteHighScores call ShowImage call ShowLight call Wait ;*Start Game* Game: call HideLight call HideImage call SetUpGame call DrawBWScreen call DrawArrows call DrawHeaderLine call DrawHeaderText call WriteScore call WriteBonus call WriteLevel call ShowImage call ShowLight ei MainKeyLoop: halt ld a,(KeyFlag) bit KF1,a call z,C1Press ;use calls to read simultaneous presses must save a! bit KF2,a call z,C2Press bit KF3,a call z,C3Press bit KF4,a call z,C4Press bit KF5,a call z,C5Press bit KLeft,a call z,ShiftLeft bit KRight,a call z,ShiftRight bit K2nd,a call z,IncreaseLevel ;2nd now skips level in a,(IntStatusPort) ;have on button exit immediately out of program bit 3,a jp z,Exit ld a,(UpdateFlag) or a call nz,UpdateBlocks ;addblock is called during update if needed ld a,(DrawFlag) or a call nz,DrawBlocks jp MainKeyLoop ;*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 HideLight call HideImage call DrawBWScreen call DisplayTitle call WriteEnterName 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 call ShowLight 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 ;*Display Game Over* GameOver: di ld bc,0 call Pause call Pause call WriteGameOver ;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 call WriteNewHighScore pop bc call Wait ;shouldn't have anything pushed when calling wait ld a,c jp HighScore NoHighScore: call Wait jp Title WriteHighScores: ;pure laziness ld hl,112 ld (TextCol),hl ld hl,158 ld (TextRow),hl ld hl,HighScoreStr call DisplayString 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 WriteEnterName: ld hl,96 ld (TextCol),hl ld hl,123 ld (TextRow),hl ld hl,EnterStr jp DisplayString WriteNewHighScore: ld hl,100 ld (TextCol),hl ld hl,128 ld (TextRow),hl ld hl,NewHSStr jp DisplayString WriteGameOver: ld hl,124 ld (TextCol),hl ld hl,114 ld (TextRow),hl ld hl,GameOverStr jp DisplayString WriteStart: ld hl,68 ld (TextCol),hl ld hl,113 ld (TextRow),hl ld hl,StartStr jp DisplayString WriteScore: ;draw 3 byte 7 (9,999,999 max) digit score in decimal ld hl,66 ld (TextCol),hl ld hl,1 ld (TextRow),hl 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,275 ld (TextCol),hl ld hl,1 ld (TextRow),hl 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 WriteBonus: ld hl,206 ld (TextCol),hl ld hl,1 ld (TextRow),hl ld a,(BonusMod) call DivAby10 add a,$30 jp DisplayChar ;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: ret ;XXXXXXXXXXXXXXXXXXXXXXXXX just return need to read,save, mod 'contrast' ld a,LCDControl call DisplayReadHL res LCDHBASEE,h ld a,LCDControl ; jp DisplayWriteHL ;--- ShowImage --- ;Displays the base image after drawing ShowImage: ret ;XXXXXXXXXXXXXXXXXXXXXXXXX just return need to read,save, mod 'contrast' ld a,LCDControl call DisplayReadHL set LCDHBASEE,h ld a,LCDControl ; jp DisplayWriteHL ;--- HideLight --- ;Turns off backlight HideLight: ret ;XXXXXXXXXXXXXXXXXXXXXXXXX just return need to read,save, mod 'contrast' in a,(LightPort) res 5,a out (LightPort),a ret ;--- ShowLight --- ;Turns on backlight ShowLight: ret ;XXXXXXXXXXXXXXXXXXXXXXXXX just return need to read,save, mod 'contrast' push bc ;delay showing light for a bit ld bc,$f00 call Pause pop bc in a,(LightPort) set 5,a out (LightPort),a ret UpdateBlocks: ;go through ques and increment each row xor a ld (UpdateFlag),a ;clear updateFlag ld (C1SpaceGood),a ;clear out space limits ld (C2SpaceGood),a ;will be set if row < 42 ld (C3SpaceGood),a ld (C4SpaceGood),a ld (C5SpaceGood),a ld a,(C1BlockCount) or a jp z,C2UB ;go through each block in the que and update if necessary ld hl,C1BlockQue ld b,5 ;loop through 5 possible blocks C1UBLoop: ld a,(hl) ;get row or a jp z,SkipC1UB ;if nothing skip inc a jp nz,SC1RL pop hl jp GameOver SC1RL: ld (hl),a ;save updated row cp 46 jp nc,SkipC1UB ;keep space good if >= 46 or a jp z,SkipC1UB ;if zero, keep space good ld (C1SpaceGood),a SkipC1UB: inc hl inc hl djnz C1UBLoop C2UB: ld a,(C2BlockCount) or a jp z,C3UB ;go through each block in the que and update if necessary ld hl,C2BlockQue ld b,5 ;loop through 5 possible blocks C2UBLoop: ld a,(hl) ;get row or a jp z,SkipC2UB ;if nothing skip inc a jp nz,SC2RL pop hl jp GameOver SC2RL: ld (hl),a ;save updated row cp 46 jp nc,SkipC2UB ;keep space good if >= 46 or a jp z,SkipC2UB ;if zero, keep space good ld (C2SpaceGood),a SkipC2UB: inc hl inc hl djnz C2UBLoop C3UB: ld a,(C3BlockCount) or a jp z,C4UB ;go through each block in the que and update if necessary ld hl,C3BlockQue ld b,5 ;loop through 5 possible blocks C3UBLoop: ld a,(hl) ;get row or a jp z,SkipC3UB ;if nothing skip inc a jp nz,SC3RL pop hl jp GameOver SC3RL: ld (hl),a ;save updated row cp 46 jp nc,SkipC3UB ;keep space good if >= 46 or a jp z,SkipC3UB ;if zero, keep space good ld (C3SpaceGood),a SkipC3UB: inc hl inc hl djnz C3UBLoop C4UB: ld a,(C4BlockCount) or a jp z,C5UB ;go through each block in the que and update if necessary ld hl,C4BlockQue ld b,5 ;loop through 5 possible blocks C4UBLoop: ld a,(hl) ;get row or a jp z,SkipC4UB ;if nothing skip inc a jp nz,SC4RL pop hl jp GameOver SC4RL: ld (hl),a ;save updated row cp 46 jp nc,SkipC4UB ;keep space good if >=46 or a jp z,SkipC4UB ;if zero, keep space good ld (C4SpaceGood),a SkipC4UB: inc hl inc hl djnz C4UBLoop C5UB: ld a,(C5BlockCount) or a jp z,C5UBDone ;go through each block in the que and update if necessary ld hl,C5BlockQue ld b,5 ;loop through 5 possible blocks C5UBLoop: ld a,(hl) ;get row or a jp z,SkipC5UB ;if nothing skip inc a jp nz,SC5RL pop hl jp GameOver SC5RL: ld (hl),a ;save updated row cp 46 jp nc,SkipC5UB ;keep space good if >=46 or a jp z,SkipC5UB ;if zero, keep space good ld (C5SpaceGood),a SkipC5UB: inc hl inc hl djnz C5UBLoop C5UBDone: ld a,(AddFlag) or a call nz,AddBlock ;addblock can only be called after update! ret AddBlock: ;a=column 0-4 c=color 0-4 xor a ld (AddFlag),a ;clear add flag ld a,(CurrentColor) inc a ;dont let same color be too close together cp 5 jp c,SkipColor xor a SkipColor: ld (CurrentColor),a ld c,a ColLoop: ld a,r and $07 ;get sort of random column, 0 and 1 least likely :( cp 5 jp c,SkipCol sub 3 SkipCol: cp 0 jp z,AC1 cp 1 jp z,AC2 cp 2 jp z,AC3 cp 3 jp z,AC4 cp 4 jp z,AC5 AC1: ld a,(C1BlockCount) cp 5 ret z ;return if already full ld a,(C1SpaceGood) or a ret nz ;check for minimum space between blocks ld hl,C1BlockQue ABC1Loop: ld a,(hl) or a jp nz,SkipABC1 ;skip if not empty ld a,12 ;set to 1st row ld (hl),a ld a,(C1BlockCount) inc a ld (C1BlockCount),a inc hl ld (hl),c ;set color ret ;added block SkipABC1: inc hl inc hl djnz ABC1Loop AC2: ld a,(C2BlockCount) cp 5 ret z ;return if already full ld a,(C2SpaceGood) or a ret nz ;check for minimum space between blocks ld hl,C2BlockQue ABC2Loop: ld a,(hl) or a jp nz,SkipABC2 ;skip if not empty ld a,12 ;set to 1st row ld (hl),a ld a,(C2BlockCount) inc a ld (C2BlockCount),a inc hl ld (hl),c ;set color ret ;added block SkipABC2: inc hl inc hl djnz ABC2Loop AC3: ld a,(C3BlockCount) cp 5 ret z ;return if already full ld a,(C3SpaceGood) or a ret nz ;check for minimum space between blocks ld hl,C3BlockQue ABC3Loop: ld a,(hl) or a jp nz,SkipABC3 ;skip if not empty ld a,12 ;set to 1st row ld (hl),a ld a,(C3BlockCount) inc a ld (C3BlockCount),a inc hl ld (hl),c ;set color ret ;added block SkipABC3: inc hl inc hl djnz ABC3Loop AC4: ld a,(C4BlockCount) cp 5 ret z ;return if already full ld a,(C4SpaceGood) or a ret nz ;check for minimum space between blocks ld hl,C4BlockQue ABC4Loop: ld a,(hl) or a jp nz,SkipABC4 ;skip if not empty ld a,12 ;set to 1st row ld (hl),a ld a,(C4BlockCount) inc a ld (C4BlockCount),a inc hl ld (hl),c ;set color ret ;added block SkipABC4: inc hl inc hl djnz ABC4Loop AC5: ld a,(C5BlockCount) cp 5 ret z ;return if already full ld a,(C5SpaceGood) or a ret nz ;check for minimum space between blocks ld hl,C5BlockQue ABC5Loop: ld a,(hl) or a jp nz,SkipABC5 ;skip if not empty ld a,12 ;set to 1st row ld (hl),a ld a,(C5BlockCount) inc a ld (C5BlockCount),a inc hl ld (hl),c ;set color ret ;added block SkipABC5: inc hl inc hl djnz ABC5Loop DrawBlocks: ;go through ques and draw each block xor a ld (DrawFlag),a ;clear draw flag ld a,(C1BlockCount) or a jp z,C2 ;set win x ld hl,18 ld de,18+26 ld a,$52 call DisplayWriteHLDE ;go through que and find blocks ld hl,C1BlockQue ld b,5 ;loop through 5 possible blocks C1Loop: push bc ld a,(hl) or a jp z,SkipC1Block push hl ;save location in que ld c,a ;save row inc hl ld a,(hl) ;get color rla ;mult by 2 ld d,0 ld e,a ld hl,Red add hl,de ;offset by color ld a,(hl) ;store color into hl inc hl ld l,(hl) ld h,a ld a,c ;restore row call DB ;draws block (a=row color pop hl ;restore que location SkipC1Block: inc hl inc hl pop bc djnz C1Loop C2: ld a,(C2BlockCount) or a jp z,C3 ;set win x ld hl,82 ld de,82+26 ld a,$52 call DisplayWriteHLDE ;go through que and find blocks ld hl,C2BlockQue ld b,5 ;loop through 5 possible blocks C2Loop: push bc ld a,(hl) or a jp z,SkipC2Block push hl ;save location in que ld c,a ;save row inc hl ld a,(hl) ;get color rla ;mult by 2 ld d,0 ld e,a ld hl,Red add hl,de ;offset by color ld a,(hl) ;store color into hl inc hl ld l,(hl) ld h,a ld a,c ;restore row call DB ;draws block (a=row color pop hl ;restore que location SkipC2Block: inc hl inc hl pop bc djnz C2Loop C3: ld a,(C3BlockCount) or a jp z,C4 ;set win x ld hl,146 ld de,146+26 ld a,$52 call DisplayWriteHLDE ;go through que and find blocks ld hl,C3BlockQue ld b,5 ;loop through 5 possible blocks C3Loop: push bc ld a,(hl) or a jp z,SkipC3Block push hl ;save location in que ld c,a ;save row inc hl ld a,(hl) ;get color rla ;mult by 2 ld d,0 ld e,a ld hl,Red add hl,de ;offset by color ld a,(hl) ;store color into hl inc hl ld l,(hl) ld h,a ld a,c ;restore row call DB ;draws block (a=row color pop hl ;restore que location SkipC3Block: inc hl inc hl pop bc djnz C3Loop C4: ld a,(C4BlockCount) or a jp z,C5 ;set win x ld hl,210 ld de,210+26 ld a,$52 call DisplayWriteHLDE ;go through que and find blocks ld hl,C4BlockQue ld b,5 ;loop through 5 possible blocks C4Loop: push bc ld a,(hl) or a jp z,SkipC4Block push hl ;save location in que ld c,a ;save row inc hl ld a,(hl) ;get color rla ;mult by 2 ld d,0 ld e,a ld hl,Red add hl,de ;offset by color ld a,(hl) ;store color into hl inc hl ld l,(hl) ld h,a ld a,c ;restore row call DB ;draws block (a=row color pop hl ;restore que location SkipC4Block: inc hl inc hl pop bc djnz C4Loop C5: ld a,(C5BlockCount) or a ret z ;set win x ld hl,274 ld de,274+26 ld a,$52 call DisplayWriteHLDE ;go through que and find blocks ld hl,C5BlockQue ld b,5 ;loop through 5 possible blocks C5Loop: push bc ld a,(hl) or a jp z,SkipC5Block push hl ;save location in que ld c,a ;save row inc hl ld a,(hl) ;get color rla ;mult by 2 ld d,0 ld e,a ld hl,Red add hl,de ;offset by color ld a,(hl) ;store color into hl inc hl ld l,(hl) ld h,a ld a,c ;restore row call DB ;draws block (a=row color pop hl ;restore que location SkipC5Block: inc hl inc hl pop bc djnz C5Loop ret DB: ;draws block at row a (win x should be setup) color hl push hl cp 29 jp c,DrawPartialBox cp 239 DrawFullBox: ;really just draws first and last row ;) push af ;f stores needed flags sub 17 ;get box top row ld h,0 ld l,a ld d,0 ld e,a ld a,$50 call DisplayWriteHLDE ;set y call SetCursor xor a out ($10),a ld a,$22 out ($10),a ld b,3 ;1 27 pixel row ;shoulda put more thought into the size :( was 29 DBLLoop1: ld a,$00 ;draw 9 pixels per loop out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a djnz DBLLoop1 pop af ;get bottom row jp c,DrawPartialBox pop hl ;lose color ret ;going off screen, dont draw color DrawPartialBox: ld h,0 ld l,a ld d,0 ld e,a ld a,$50 call DisplayWriteHLDE ;set y call SetCursor xor a out ($10),a ld a,$22 out ($10),a ld b,3 ;1 27 pixel row ;shoulda put more thought into the size :( was 29 pop hl ;get color ld c,$11 DBLLoop2: out (c),h ;draw 9 pixels per loop out (c),l out (c),h out (c),l out (c),h out (c),l out (c),h out (c),l out (c),h out (c),l out (c),h out (c),l out (c),h out (c),l out (c),h out (c),l out (c),h out (c),l djnz DBLLoop2 ret DeleteBlock: ;window should be set call SetCursor xor a out ($10),a ld a,$22 out ($10),a ld b,51 ;17 27 pixel rows DelBLLoop1: ld a,$00 ;draw 9 pixels per loop out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a djnz DelBLLoop1 ret NoBlockScore: ld a,1 ld (BonusMod),a ;go straight back to 1 if no block hit ld a,(Score) ld hl,(Score+1) ld de,10 sbc hl,de ;-10 for no block present sbc a,0 jp nc,ScoreDecGood xor a ld hl,0 ScoreDecGood: ld (Score),a ld (Score+1),hl jp WriteScore UpdateScore: ;a = row sub 215 jp nc,ScoreSubGood neg ;get absolute value ScoreSubGood: sub 16 neg ;invert point offsetd cp 15 ;gives 3 pixel oppurtunity instea of 1 jp c,ScoreOff ;missed perfect rla ;perfect 30 or 32 points * bonus received call IncScore call FlashScreen ld a,(BonusMod) inc a cp 6 ret nc ;score added, bonus at max, return ld (BonusMod),a jp WriteBonus ;increased bonus recieved, display and return ScoreOff: call IncScore ;set and display score ld a,(BonusMod) dec a ;dec bonus if not perfect ret z ;return if bonus at minimum ld (BonusMod),a ;store new bonus jp WriteBonus ;display it IncScore: ;a=score ld c,a ld a,(Level) or a rla rla add a,c ;add quadruple the level to the score ld c,a ld a,(BonusMod) dec a jp z,SkipBonus ld h,0 ld l,c ld d,0 ld e,c ld b,a BonusLoop: add hl,de djnz BonusLoop SkipBonus: ld a,(Score) ld hl,(Score+1) ld d,0 ld e,c add hl,de adc a,0 ld (Score),a ld (Score+1),hl ;assume it impossible to get 10,000,000 jp WriteScore IncreaseLevel: set K2nd,a ld (KeyFlag),a ;acknowledge key press push af ;save button presses ld a,(Level) cp 10 jp nc,SkipLI ;can't skip past level 10 ld a,1 call LevelInc SkipLI: pop af ret C1Press: set KF1,a ld (KeyFlag),a ;acknowledge key press push af ;save button presses ;go through que and check if a block is close to ;to the arrows, if it is delete it ld a,(C1BlockCount) or a jp z,C1DelSkip ;no block near ld hl,C1BlockQue ld b,5 ;loop through 5 possible blocks C1DelLoop: ld a,(hl) ;get row or a jp z,SkipC1D ;if nothing skip ;check if its 199-231, if not skip cp 199 jp c,SkipC1D cp 232 jp nc,SkipC1D ;this block is close, check color, delete, update score and leave ld c,a ;save the row ld a,(C1Color) ld e,a inc hl ld a,(hl) cp e jp z,C1Same pop hl pop hl jp GameOver C1Same: dec hl xor a ld (hl),a ;set the block to 0 to remove it from the que ld a,(C1BlockCount) dec a ;reduce the block count, this ones gone ld (C1BlockCount),a ld a,c ;restore the row push af ;set window y and x ld d,0 ;set bottom row ld e,a sub 16 ;get block top row ld h,0 ld l,a ld a,$50 call DisplayWriteHLDE ;set y ;set win x ld hl,18 ld de,18+26 ld a,$52 call DisplayWriteHLDE call DeleteBlock pop af call UpdateScore jp C1DelDone SkipC1D: inc hl inc hl djnz C1DelLoop C1DelSkip: call NoBlockScore C1DelDone: pop af ret C2Press: set KF2,a ld (KeyFlag),a ;acknowledge key press push af ;go through que and check if a block is close to ;to the arrows, if it is delete it ld a,(C2BlockCount) or a jp z,C2DelSkip ;no block near ld hl,C2BlockQue ld b,5 ;loop through 5 possible blocks C2DelLoop: ld a,(hl) ;get row or a jp z,SkipC2D ;if nothing skip ;check if its 199-231, if not skip cp 199 jp c,SkipC2D cp 232 jp nc,SkipC2D ;this block is close, check color, delete, update score and leave ld c,a ;save the row ld a,(C2Color) ld e,a inc hl ld a,(hl) cp e jp z,C2Same pop hl pop hl jp GameOver C2Same: dec hl xor a ld (hl),a ;set the block to 0 to remove it from the que ld a,(C2BlockCount) dec a ;reduce the block count, this ones gone ld (C2BlockCount),a ld a,c ;restore the row push af ;set window y and x ld d,0 ;set bottom row ld e,a sub 16 ;get block top row ld h,0 ld l,a ld a,$50 call DisplayWriteHLDE ;set y ;set win x ld hl,82 ld de,82+26 ld a,$52 call DisplayWriteHLDE call DeleteBlock pop af call UpdateScore jp C2DelDone SkipC2D: inc hl inc hl djnz C2DelLoop C2DelSkip: call NoBlockScore C2DelDone: pop af ret C3Press: set KF3,a ld (KeyFlag),a ;acknowledge key press push af ;go through que and check if a block is close to ;to the arrows, if it is delete it ld a,(C3BlockCount) or a jp z,C3DelSkip ;no block near ld hl,C3BlockQue ld b,5 ;loop through 5 possible blocks C3DelLoop: ld a,(hl) ;get row or a jp z,SkipC3D ;if nothing skip ;check if its 199-231, if not skip cp 199 jp c,SkipC3D cp 232 jp nc,SkipC3D ;this block is close, check color, delete, update score and leave ld c,a ;save the row ld a,(C3Color) ld e,a inc hl ld a,(hl) cp e jp z,C3Same pop hl pop hl jp GameOver C3Same: dec hl xor a ld (hl),a ;set the block to 0 to remove it from the que ld a,(C3BlockCount) dec a ;reduce the block count, this ones gone ld (C3BlockCount),a ld a,c ;restore the row push af ;set window y and x ld d,0 ;set bottom row ld e,a sub 16 ;get block top row ld h,0 ld l,a ld a,$50 call DisplayWriteHLDE ;set y ;set win x ld hl,146 ld de,146+26 ld a,$52 call DisplayWriteHLDE call DeleteBlock pop af call UpdateScore jp C3DelDone SkipC3D: inc hl inc hl djnz C3DelLoop C3DelSkip: call NoBlockScore C3DelDone: pop af ret C4Press: set KF4,a ld (KeyFlag),a ;acknowledge key press push af ;go through que and check if a block is close to ;to the arrows, if it is delete it ld a,(C4BlockCount) or a jp z,C4DelSkip ;no block near ld hl,C4BlockQue ld b,5 ;loop through 5 possible blocks C4DelLoop: ld a,(hl) ;get row or a jp z,SkipC4D ;if nothing skip ;check if its 199-231, if not skip cp 199 jp c,SkipC4D cp 232 jp nc,SkipC4D ;this block is close, check color, delete, update score and leave ld c,a ;save the row ld a,(C4Color) ld e,a inc hl ld a,(hl) cp e jp z,C4Same pop hl pop hl jp GameOver C4Same: dec hl xor a ld (hl),a ;set the block to 0 to remove it from the que ld a,(C4BlockCount) dec a ;reduce the block count, this ones gone ld (C4BlockCount),a ld a,c ;restore the row push af ;set window y and x ld d,0 ;set bottom row ld e,a sub 16 ;get block top row ld h,0 ld l,a ld a,$50 call DisplayWriteHLDE ;set y ;set win x ld hl,210 ld de,210+26 ld a,$52 call DisplayWriteHLDE call DeleteBlock pop af call UpdateScore jp C4DelDone SkipC4D: inc hl inc hl djnz C4DelLoop C4DelSkip: call NoBlockScore C4DelDone: pop af ret C5Press: set KF5,a ld (KeyFlag),a ;acknowledge key press push af ;go through que and check if a block is close to ;to the arrows, if it is delete it ld a,(C5BlockCount) or a jp z,C5DelSkip ;no block near ld hl,C5BlockQue ld b,5 ;loop through 5 possible blocks C5DelLoop: ld a,(hl) ;get row or a jp z,SkipC5D ;if nothing skip ;check if its 199-231, if not skip cp 199 jp c,SkipC5D cp 232 jp nc,SkipC5D ;this block is close, check color, delete, update score and leave ld c,a ;save the row ld a,(C5Color) ld e,a inc hl ld a,(hl) cp e jp z,C5Same pop hl pop hl jp GameOver C5Same: dec hl xor a ld (hl),a ;set the block to 0 to remove it from the que ld a,(C5BlockCount) dec a ;reduce the block count, this ones gone ld (C5BlockCount),a ld a,c ;restore the row push af ;set window y and x ld d,0 ;set bottom row ld e,a sub 16 ;get block top row ld h,0 ld l,a ld a,$50 call DisplayWriteHLDE ;set y ;set win x ld hl,274 ld de,274+26 ld a,$52 call DisplayWriteHLDE call DeleteBlock pop af call UpdateScore jp C5DelDone SkipC5D: inc hl inc hl djnz C5DelLoop C5DelSkip: call NoBlockScore C5DelDone: pop af ret 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 DrawHeaderLine: ;draws line under header 0,11 ;blocks will not draw over line ld hl,11 ld de,11 ld a,$50 call DisplayWriteHLDE ;set y ld hl,0 ld de,319 ld a,$52 call DisplayWriteHLDE ;set x call SetCursor xor a out ($10),a ld a,$22 out ($10),a ld de,320 DLLoop1: ld a,$ff out ($11),a out ($11),a dec de ld a,d or e jp nz,DLLoop1 ret DrawHeaderText: ld hl,1 ;set consistent height at 1-9 ld de,1+8 ld a,$50 call DisplayWriteHLDE ;set y ld hl,31 ;set window for score ld de,31+39 ld a,$52 call DisplayWriteHLDE ;set x call SetCursor ld c,45 ld hl,ScoreData call DrawHText ld hl,159 ;set window for bonus ld de,159+47 ld a,$52 call DisplayWriteHLDE ;set x call SetCursor ld c,54 ld hl,BonusData call DrawHText ld hl,243 ;set window for level ld de,243+31 ld a,$52 call DisplayWriteHLDE ;set x call SetCursor ld c,36 ld hl,LevelData jp DrawHText DrawHText: xor a out ($10),a ld a,$22 out ($10),a DTLoop2: ;go through data size ld a,(hl) ld b,8 DTLoop1: ;go through each bit rla push af jp c,DrawTextColor xor a out (LCDDataPort),a out (LCDDataPort),a pop af djnz DTLoop1 jp EndDT DrawTextColor: ld a,$ff out (LCDDataPort),a out (LCDDataPort),a pop af djnz DTLoop1 EndDT: inc hl dec c ld a,c or a jp nz,DTLoop2 ret ShiftRight: ;rotate arrow colors right ;color 0-4 set KRight,a ld (KeyFlag),a ;acknowledge key press push af ld a,(C1Color) dec a jp p,C1CGoodR ld a,4 C1CGoodR: ld (C1Color),a ld a,(C2Color) dec a jp p,C2CGoodR ld a,4 C2CGoodR: ld (C2Color),a ld a,(C3Color) dec a jp p,C3CGoodR ld a,4 C3CGoodR: ld (C3Color),a ld a,(C4Color) dec a jp p,C4CGoodR ld a,4 C4CGoodR: ld (C4Color),a ld a,(C5Color) dec a jp p,C5CGoodR ld a,4 C5CGoodR: ld (C5Color),a call DrawArrows pop af ret ShiftLeft: ;rotate arrow colors left ;color 0-4 set KLeft,a ld (KeyFlag),a ;acknowledge key press push af ld a,(C1Color) inc a cp 5 jp c,C1CGoodL xor a C1CGoodL: ld (C1Color),a ld a,(C2Color) inc a cp 5 jp c,C2CGoodL xor a C2CGoodL: ld (C2Color),a ld a,(C3Color) inc a cp 5 jp c,C3CGoodL xor a C3CGoodL: ld (C3Color),a ld a,(C4Color) inc a cp 5 jp c,C4CGoodL xor a C4CGoodL: ld (C4Color),a ld a,(C5Color) inc a cp 5 jp c,C5CGoodL xor a C5CGoodL: ld (C5Color),a call DrawArrows pop af ret DrawArrows: ld hl,200 ;set consistent height at 200 ld de,200+14 ld a,$50 call DisplayWriteHLDE ;set y ;C1 ld hl,9 ;set window for left arrow ld de,9+7 ld a,$52 call DisplayWriteHLDE ;set x call SetCursor ld hl,Red ld a,(C1Color) ;get current color or a rla ;mult by 2 ld d,0 ld e,a add hl,de ex de,hl ;de points to color xor a call DArrow ;draw left arrow ld hl,46 ;set window for right red arrow ld de,46+7 ld a,$52 call DisplayWriteHLDE ;set x call SetCursor ld hl,Red ld a,(C1Color) ;get current color or a rla ;mult by 2 ld d,0 ld e,a add hl,de ex de,hl ;de points to color inc a call DArrow ;draw right arrow ;C2 ld hl,73 ld de,73+7 ld a,$52 call DisplayWriteHLDE ;set x call SetCursor ld hl,Red ld a,(C2Color) ;get current color or a rla ;mult by 2 ld d,0 ld e,a add hl,de ex de,hl ;de points to color xor a call DArrow ld hl,110 ld de,110+7 ld a,$52 call DisplayWriteHLDE ;set x call SetCursor ld hl,Red ld a,(C2Color) ;get current color or a rla ;mult by 2 ld d,0 ld e,a add hl,de ex de,hl ;de points to color inc a call DArrow ;C3 ld hl,137 ld de,137+7 ld a,$52 call DisplayWriteHLDE ;set x call SetCursor ld hl,Red ld a,(C3Color) ;get current color or a rla ;mult by 2 ld d,0 ld e,a add hl,de ex de,hl ;de points to color xor a call DArrow ld hl,174 ld de,174+7 ld a,$52 call DisplayWriteHLDE ;set x call SetCursor ld hl,Red ld a,(C3Color) ;get current color or a rla ;mult by 2 ld d,0 ld e,a add hl,de ex de,hl ;de points to color inc a call DArrow ;C4 ld hl,201 ld de,201+7 ld a,$52 call DisplayWriteHLDE ;set x call SetCursor ld hl,Red ld a,(C4Color) ;get current color or a rla ;mult by 2 ld d,0 ld e,a add hl,de ex de,hl ;de points to color xor a call DArrow ld hl,238 ld de,238+7 ld a,$52 call DisplayWriteHLDE ;set x call SetCursor ld hl,Red ld a,(C4Color) ;get current color or a rla ;mult by 2 ld d,0 ld e,a add hl,de ex de,hl ;de points to color inc a call DArrow ;C5 ld hl,265 ld de,265+7 ld a,$52 call DisplayWriteHLDE ;set x call SetCursor ld hl,Red ld a,(C5Color) ;get current color or a rla ;mult by 2 ld d,0 ld e,a add hl,de ex de,hl ;de points to color xor a call DArrow ld hl,302 ld de,302+7 ld a,$52 call DisplayWriteHLDE ;set x call SetCursor ld hl,Red ld a,(C5Color) ;get current color or a rla ;mult by 2 ld d,0 ld e,a add hl,de ex de,hl ;de points to color inc a jp DArrow ;set id to 01 to draw flipped (right) 11=default (left) ;window has to be set to the right location DArrow: ;de=points to color a=0=left or a jp z,IDDefault call SetID01 IDDefault: xor a out ($10),a ld a,$22 out ($10),a ld hl,Arrow ld c,15 DARLoop2: ;go through each row ld a,(hl) ld b,8 DARLoop1: ;go through each bit rla push af jp c,DrawColor xor a out (LCDDataPort),a out (LCDDataPort),a pop af djnz DARLoop1 jp EndDAR DrawColor: ld a,(de) out (LCDDataPort),a inc de ld a,(de) out (LCDDataPort),a dec de ;reset color pop af djnz DARLoop1 EndDAR: inc hl dec c ld a,c or a jp nz,DARLoop2 jp SetID11 ;--- Exit --- ;Exits program with everything intact Exit: ;jp to exit, make sure nothing is left on stack! di ld hl,VarName bcall(_Mov9ToOP1) bcall(_Arc_Unarc) ;archive high scores pop hl ld a,LCDControl call DisplayWriteHL pop hl ld a,LCDEntry call DisplayWriteHL call SetFullWindow call SetCursor 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) SetCursor: ld hl,0 ld de,0 ld a,$20 jp DisplayWriteHLDE SetFullWindow: ld hl,0 ld de,239 ld a,$50 call DisplayWriteHLDE ;set y ld hl,0 ld de,319 ld a,$52 jp DisplayWriteHLDE ;set x DrawBWScreen: ;draws black or white depending on char color call SetFullWindow call SetCursor ;draw screen xor a out ($10),a ld a,$22 out ($10),a ld de,19200 DBSLoop1: ld a,(CharColor) xor $ff out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a out ($11),a dec de ld a,d or e jp nz,DBSLoop1 ret SetOrigin: ld a,LCDEntry call DisplayReadHL set LCDLORG,l ;set origin jp DisplayWriteHL SetID01: ld a,LCDEntry call DisplayReadHL set LCDLID0,l res LCDLID1,l jp DisplayWriteHL SetID11: ld a,LCDEntry call DisplayReadHL set LCDLID0,l set LCDLID1,l jp DisplayWriteHL DisplayBlog: ;call to display blog info ;set window ld hl,95 ld de,95+49 ld a,$50 call DisplayWriteHLDE ;set y ld hl,28 ld de,28+263 ld a,$52 call DisplayWriteHLDE ;set x call SetCursor ld hl,BlogPalette ld (ImagePalette),hl ld hl,BlogData+1 ld ix,BlogData jp DrawImage DisplayTitle: ;call to display title ;set window ld hl,0 ld de,$004d ld a,$50 call DisplayWriteHLDE ;set y ld hl,0 ld de,$013f ld a,$52 call DisplayWriteHLDE ;set x call SetCursor ld hl,TitlePalette ld (ImagePalette),hl ld hl,TitleData+1 ld ix,TitleData jp DrawImage ;call to draw 16 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,2 B4Loop: xor a rl c rla rl c rla rl c rla rl c rla ld hl,(ImagePalette) ld d,0 rla 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 djnz B4Loop 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 ;inputs-hl points to null terminated string ;set textrow,col DisplayString: ld a,(hl) or a ret z push hl call DisplayChar ld hl,(TextCol) ld de,8 add hl,de ld (TextCol),hl pop hl inc 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 de,CharColor ld b,10 DCLoop1: ld a,(hl) ld c,b ld b,8 DCLoop2: rla push af jp c,DispTextColor ld a,(de) xor $ff ;will draw opposite of char color for background out ($11),a out ($11),a pop af djnz DCLoop2 jp EndDCLoop2 DispTextColor: ld a,(de) out ($11),a out ($11),a pop af djnz DCLoop2 EndDCLoop2: ld b,c inc hl djnz DCLoop1 ret ClearTemp: ;clear tempSwapArea ld hl,tempSwapArea+2 ;skip over HighScoreTable xor a ld (hl),a ld de,tempSwapArea+3 ld bc,107 ldir ret SetUpGame: call ClearTemp ld a,$ff ld (KeyFlag),a ;initialize KeyFlag ld (CharColor),a ;set white on black text xor a ld (C1Color),a ;set initial colors inc a ld (C2Color),a ld (BonusMod),a ;set bonus inc a ld (C3Color),a inc a ld (C4Color),a inc a ld (C5Color),a ld hl,150 ;150 to start ld (UpdateTimer),hl ;wait a second before dropping blocks ld hl,15 ;15=lvl 00 Lvl 15 max 1 min (very fast) ld (UpdateTimerReset),hl ;start at a slow rate ld hl,150 ;150 to start ld (AddTimer),hl ;wait a second before dropping blocks ld hl,1500 ;1500=lvl 00 ld (AddTimerReset),hl ;add blocks slowly ret UpdateTimers: xor a ;used to determine manual level skip ld de,$4000 ld hl,(LevelUp) inc hl ld (LevelUp),hl sbc hl,de jp nz,SkipLevelUp LevelInc: push af ld hl,0 ld (LevelUp),hl ld a,(Level) inc a ld (Level),a ;assuming its impossible to reach level 100 ld hl,(UpdateTimerReset) dec hl ld a,h or l jp nz,UTRGood ld hl,1 UTRGood: ld (UpdateTimerReset),hl ld hl,(AddTimerReset) ld de,100 or a sbc hl,de jp nz,ATRGood ld hl,100 ATRGood: ld (AddTimerReset),hl pop af or a jp nz,WriteLevel ;if manual increase exit call WriteLevel SkipLevelUp: ld hl,(UpdateTimer) dec hl ld (UpdateTimer),hl ;dec and check expiration ld a,h or l jp nz,SkipUpdate ld a,1 ld (UpdateFlag),a ;set to update ld a,1 ld (DrawFlag),a ;set to draw ld hl,(UpdateTimerReset) ld (UpdateTimer),hl SkipUpdate: ld hl,(AddTimer) dec hl ld (AddTimer),hl ;dec and check expiration ld a,h or l ret nz ld a,1 ld (AddFlag),a ;set to update ld a,1 ld (DrawFlag),a ;set to draw ld hl,(AddTimerReset) ld (AddTimer),hl ret FlashScreen: ld a,LCDBaseCtrl call DisplayReadHL res LCDLREV,l call DisplayWriteHL ld bc,$0800 call Pause ld a,LCDBaseCtrl call DisplayReadHL set LCDLREV,l jp DisplayWriteHL SetLowColor: ld a,LCDControl call DisplayReadHL set LCDLCL,l jp DisplayWriteHL ;--- DisplayWriteHLDE --- ;Writes hl to a, de to consecutive address ;inputs: ;a=start address ;hl,de DisplayWriteHLDE: ld c,$10 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,$11 ld b,a xor a out ($10),a ld a,b out ($10),a out (c),h out (c),l ret ;--- DisplayReadHL --- ;read hl at a ;inputs: ;a=address ;hl DisplayReadHL: ld c,$11 ld b,a xor a out ($10),a ld a,b out ($10),a in h,(c) in l,(c) 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 ; Divides HL by 10 or a DivHLby10: ld a,$0a DivHLbyA: ld c,a sub a ld b,$10 DHLLoop1: add hl,hl rla cp c jr c,DHLLoop2 sub c inc l DHLLoop2: djnz DHLLoop1 ret ;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 ;original version ;DivAHLBy10: ; ld d,a ; ld c,$0a ; sub a ; ld b,$18 ;DAHLLoop1: ; add hl,hl ; ld e,a ; ld a,d ; adc a,a ; ld d,a ; ld a,e ; rla ; cp c ; jr c,DAHLLoop2 ; sub c ; inc l ;DAHLLoop2: ; djnz DAHLLoop1 ; ld e,a ; ld a,d ; ret Arrow: .db %00000001 .db %00000011 .db %00000111 .db %00001111 .db %00011111 .db %00111111 .db %01111111 .db %11111111 .db %01111111 .db %00111111 .db %00011111 .db %00001111 .db %00000111 .db %00000011 .db %00000001 ;ColorTable Red: .db $f8, $00 Yellow: .db $ff, $e0 Blue: .db $00, $1f Green: .db $07, $e0 Purple: .db $f8, $1f White: .db $ff, $ff Black: .db $00, $00 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, $00, $38, $38; '.' .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 $E2, $B6, $1C, $00, $00, $00, $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) ;image size = 9x40 ;location: 1,31 ScoreData: ;data size = 45 bytes .db $78, $00, $00, $00, $00, $CC, $00, $00, $00, $00, $CC, $E3, $CF, $71, $80, $F1 .db $B6, $6C, $D8, $00, $79, $86, $6C, $D8, $00, $1D, $86, $6C, $F8, $00, $CD, $86 .db $6C, $C0, $00, $CD, $B6, $6C, $D8, $00, $78, $E3, $CC, $71, $80 ;image size = 9x48 ;location: 1,159 BonusData: ;data size = 54 bytes .db $F8, $00, $00, $00, $00, $00, $CC, $00, $00, $00, $00, $00, $CC, $F3, $E6, $67 .db $19, $98, $CD, $9B, $36, $6D, $81, $98, $F9, $9B, $36, $6C, $00, $F0, $CD, $9B .db $36, $6F, $80, $60, $CD, $9B, $36, $61, $80, $F0, $CD, $9B, $36, $6D, $81, $98 .db $F8, $F3, $33, $E7, $19, $98 ;image size = 9x32 ;location: 1,243 LevelData: ;data size = 36 bytes .db $C0, $00, $00, $C0, $C0, $00, $00, $C0, $C1, $CD, $9C, $CC, $C3, $6D, $B6, $C0 .db $C3, $6D, $B6, $C0, $C3, $ED, $BE, $C0, $C3, $05, $30, $C0, $C3, $67, $36, $C0 .db $F9, $C7, $1C, $CC ;Appvar info VarName: .db $15,"ButtonzD",0 InitHighScoreData: .db "ASM BANDIT",0 .dw 9936 .db 11 .db "**********", 0,0,0,0 .db "**********", 0,0,0,0 .db "**********", 0,0,0,0 .db "**********", 0,0,0,0 StartStr: .db "Press Any Key To Start!",0 HighScoreStr: .db "High Scores:",0 GameOverStr: .db "Game Over",0 NewHSStr: .db "New High Score!",0 EnterStr: .db "Enter Your Name:",0 Omni1Str: .db "adriweb",0 Omni2Str: .db "Sorunome",0 Omni3Str: .db "Keoni29",0 Omni4Str: .db "Hayleia",0 Omni5Str: .db "DrDnar",0 Omni6Str: .db "DJ Omnimaga",0 Omni7Str: .db "Xeda112358",0 Omni8Str: .db "Streetwalker",0 Omni9Str: .db "tr1p1ea",0 Omni10Str: .db "Runer112",0 Omni11Str: .db "jacobly",0 #include "title.asm" #include "blog.asm" .end