.nolist #include "ti83plus.inc" #include "mirage.inc" .list .org $9D93 .db t2ByteTok, tAsmCmp varStart equ appBackUpScreen scrolled equ varStart ;1 squareY equ scrolled+1 ;2 tillNext equ squareY+2 ;1 darkGround equ tillNext+1 ;1 jumpCount equ darkGround+1 ;1 lvlPtr equ jumpCount+1 ;2 yVel equ lvlPtr+2 ;2 tillNext2 equ yVel+2 ;1 darkGround2 equ tillNext2+1 ;1 lvlPtr2 equ darkGround2+1 ;2 items equ lvlPtr2+2 ;1 winCount equ items+1 ;1 lvlCount equ winCount+1 ;2 pausePressed equ lvlCount+2 ;1 attempt equ textShadow+9+6 ;2 attemptBuf equ attempt+2 ;12*5 = 60 contrastSave equ attemptBuf+60 ;1 selected equ contrastSave+1 ;1 levelData equ selected+1 ;2 appVarShad equ levelData+2 ;8 appVarDirty equ appVarShad+8 ;1 goodCalc equ appVarDirty+1 ;1 itemBuf equ saveSScreen picStart equ 19*13+$4000 initDelay equ 10 jumpPower equ 4*256+1 ;the +1 is so it won't be 0 midair gravity equ -145 #define DWAIT IN A, ($10) \ AND %10010000 \ JR NZ, $-4 #define exxSend exx \ ld a, (hl) \ out (c), a \ add hl, de \ exx #define exxASend exx \ ex af, af' \ ld a, (hl) \ out (c), a \ add hl, de \ ex af, af' \ exx ret .db 1 .db %00000000,%00000000 .db %00000000,%00000000 .db %00001000,%00000000 .db %00010100,%00000000 .db %00100010,%00000000 .db %00010100,%00000000 .db %00001000,%00000000 .db %00000011,%00011000 .db %00000011,%00011000 .db %00000111,%10111100 .db %00000111,%10111100 .db %11111111,%11111110 .db %00000000,%00000000 .db %00000000,%00000000 .db %00000000,%00000000 .db "The Impossible Game v1.0", 0 ;9DC9 for debugging set textWrite, (iy + sGrFlags) res appTextSave, (iy + appFlags) ld a, 1 ld (goodCalc), a in a, (02) and %00100000 jr z, isGood in a, ($21) and %00000001 jr z, isGood xor a ld (goodCalc), a isGood: im 1 in a, ($29) push af ld a, $0C out ($29), a in a, (06) push af ld a, $83 out (06), a ld a, (contrast) ld (contrastSave), a ld hl, appName rst 20h bcall(_chkFindSym) jr nc, appVarFound ld hl, 8 bcall(_createAppVar) inc de inc de ld l, e ld h, d inc de ld bc, 7 ld (hl), 0 ldir ld hl, appName rst 20h inRam: bcall(_arc_unarc) ld hl, appName rst 20h bcall(_chkFindSym) appVarFound: ld a, b or a jr z, inRam call findStartInRom inc hl inc hl call fast_bhl ld a, b ld de, appVarShad ld bc, 8 bcall(_flashToRam) xor a ld (appVarDirty), a newTitle: xor a ld (selected), a titleLoop: call blackScreen ld hl, 9*12+plotSScreen+1 ld (hl), $F0 inc hl ld (hl), 0 ld de, 9*12+plotSScreen+3 ld bc, 8 ldir ld (hl), $0F ld hl, 12*15+plotSScreen ld de, 11 ld b, 32+8 titleLines: ld (hl), $EF add hl, de ld (hl), $F7 inc hl djnz titleLines set textInverse, (iy + textFlags) ld hl, titleText ld de, 2*256+13 ld (penCol), de bcall(_vPutS) ld de, 19*256+30 ld (penCol), de bcall(_vPutS) ld de, 27*256+31 ld (penCol), de bcall(_vPutS) ld de, 35*256+40 ld (penCol), de bcall(_vPutS) ld de, 43*256+40 ld (penCol), de bcall(_vPutS) ld de, 56*256+17 ld (penCol), de bcall(_vPutS) ld a, (selected) rlca rlca rlca add a, 19 ld (penRow), a ld a, 15 ld (penCol), a bcall(_vPutS) ld a, 70 ld (penCol), a bcall(_vPutS) res textInverse, (iy + textFlags) bcall(_grBufCpy) ei halt bcall(_getCSC) menuKeyLoop: halt bcall(_getCSC) cp skDown jr nz, notDown ld a, (selected) inc a cp 4 jr nz, notOver xor a notOver: ld (selected), a jp titleLoop notDown: cp skUp jr nz, notUp ld a, (selected) dec a jp p, notUnder ld a, 3 notUnder: ld (selected), a jp titleLoop notUp: cp skClear jp z, quit cp skEnter jr z, enter cp sk2nd jr nz, menuKeyLoop enter: ld a, (selected) or a ld hl, xboxData jp z, newGame dec a ld hl, iPodData jp z, newGame dec a jr z, statsScreen quit: pop af out ($06), a pop af out ($29), a ld a, (contrastSave) ld (contrast), a add a, 24 | $C0 out ($10), a bcall(_clrLCDFull) bcall(_fillBasePageTable) ld a, (appVarDirty) or a call nz, writeAppVar bcall(_clrTxtShd) ld hl, name rst 20h bcall(_chkFindSym) ld de, ($96A5) or a sbc hl, de ld a, h add hl, de or a ret nz ld ($96A5), hl ret statsScreen: pop af push af out (06), a set textInverse, (iy + textFlags) call blackScreen ld hl, 4*256+8 ld de, 91*256+8 xor a call fastLine ld hl, 4*256+36 ld de, 91*256+36 xor a call fastLine ld hl, 5*256+18 ld de, 5*256+24 xor a call fastLine ld hl, 55*256+18 ld de, 55*256+24 xor a call fastLine ld hl, 5*256+46 ld de, 5*256+52 xor a call fastLine ld hl, 55*256+46 ld de, 55*256+52 xor a call fastLine ld hl, (appVarShad) ld a, 30 ;3000/100 bcall(_divHLbyA) push hl srl l ld a, 5 add a, l ld h, a ld l, 19 ld de, 5*256+19 call drawBar pop hl ld de, $8000 call convHex ld a, '%' ld (de), a inc de xor a ld (de), a ld hl, $8000 ld de, 18*256+60 ld (penCol), de bcall(_vPutS) ld hl, (appVarShad+4) ld a, 30 bcall(_divHLbyA) push hl srl l ld a, 5 add a, l ld h, a ld l, 47 ld de, 5*256+47 call drawBar pop hl ld de, $8000 call convHex ld a, '%' ld (de), a inc de xor a ld (de), a ld hl, $8000 ld de, 46*256+60 ld (penCol), de bcall(_vPutS) ld hl, statss ld de, 0*256+40 ld (penCol), de bcall(_vPutS) ld hl, statText ld de, 10*256+8 ld (penCol), de bcall(_vPutS) ld de, 38*256+3 ld (penCol), de bcall(_vPutS) ld hl, timesCompleted ld de, $8000 ld bc, 18 ldir ld hl, (appVarShad+2) call convHex xor a ld (de), a ld hl, $8000 ld de, 26*256+12 ld (penCol), de bcall(_vPutS) ld de, $8000+18 ld hl, (appVarShad+6) call convHex xor a ld (de), a ld hl, $8000 ld de, 54*256+12 ld (penCol), de bcall(_vPutS) bcall(_grBufCpy) call waitAnyKey ld a, $83 out (06), a jp titleLoop newGame: ld (levelData), hl ld hl, attempts ld de, textShadow ld bc, 9 ldir ld hl, 0 ld (attempt), hl start: ld hl, varStart ld de, varStart+1 ld bc, 767 ld (hl), 0 ldir bcall(_clrLCDFull) ld hl, $4000 ld de, $4001 ld bc, 13*175-1+300 ld (hl), 0 ldir ld hl, plotSScreen ld de, plotSScreen+1 ld bc, 767 ld (hl), 0 ldir ld hl, (attempt) inc hl ld (attempt), hl ld de, textShadow+9 call convHex xor a ld (de), a ld hl, textShadow ld de, 0 ld (penCol), de bcall(_vPutS) ld hl, plotSScreen+12 ld de, attemptBuf+60-12 ld b, 5 outerAttempt: push bc ld bc, 12 ldir ex de, hl ld bc, -24 add hl, bc ex de, hl pop bc djnz outerAttempt ld a, 4 ;x auto decrement, climb columns out ($10), a ld hl, picStart-13 ld de, picStart-12 ld bc, 12 ld (hl), $FF ldir ld hl, itemBuf ld de, itemBuf+1 ld (hl), 0 ld bc, 768 ldir ld a, initDelay ld (tillNext), a ld a, initDelay+38 ld (tillNext2), a ld hl, (levelData) ld (lvlPtr), hl ld (lvlPtr2), hl call waitDone gameLoop: ;start off by copying the leftmost 8 columns to plotSScreen ;while displaying the rightmost 3 columns di ld hl, (lvlCount) inc hl ld (lvlCount), hl ld a, $BF out ($10), a ld hl, (scrolled) ld h, 0 ld e, l ld d, h add hl, hl add hl, de add hl, hl ld a, $2B out ($10), a add hl, hl add hl, de ld de, 13*64+$4000-1 add hl, de push hl ld de, plotSScreen+767 exx pop hl ld de, -13*63-1 add hl, de call doColumn DWAIT ld a, $BF out ($10), a DWAIT ld a, $2A out ($10), a DWAIT call doColumn exx ld bc, -5 add hl, bc dec de dec de dec de dec de ld a, $BF out ($10), a ld bc, 4 lddr ld a, $29 out ($10), a ld bc, 4 lddr exx call doColumn jp squareTime ;######### ;do a screen column ;input: hl = bottom of screen to copy ; hl' = place to start copying ; de' = place to copy to ;output: hl = next column (moving left) ; de = 13 ; hl', de' = updated ; c = $11 ; 21 rows of 8 copied doColumn: ld de, 13 ld bc, 21*256+$11 columnLoop: ld a, (hl) out (c), a add hl, de exx ld bc, -5 add hl, bc dec de dec de dec de dec de ld bc, 2 lddr exxSend ld bc, 3 lddr exxSend ld bc, 3 lddr exx djnz columnLoop ld a, (hl) out (c), a ld bc, -820 ;-13*63+1 add hl, bc ld c, $11 ret ;hl now points to the bottom of the 9th column, (top memory wise) ;9th column is for displaying the square squareTime: exx ld hl, 12*58+plotSScreen+3 push hl ld de, (attempt) ld hl, 999 or a sbc hl, de pop hl jr nc, normNum dec hl normNum: ld de, attemptBuf ld b, 60 attemptLoop: ld a, (de) or (hl) ld (hl), a inc hl inc de djnz attemptLoop ld a, (scrolled) ld b, a ld a, (squareY+1) sub b add a, 12+5+8 ld l, a ld a, $BF out ($10), a ld e, l ld h, 0 ld d, h add hl, hl add hl, de add hl, hl add hl, hl ld a, $28 out ($10), a ld de, plotSScreen+2 add hl, de ld a, (jumpCount) mod6: sub 6 jp nc, mod6 add a, 6 rlca rlca rlca ld e, a exxSend ;1 push hl ld hl, squarePics ld d, 0 add hl, de pop de ex de, hl ld bc, -12 exxSend ;2 ld a, (de) or (hl) ld (hl), a inc de add hl, bc ld a, (de) or (hl) ld (hl), a inc de add hl, bc exxSend ;3 ld a, (de) or (hl) ld (hl), a inc de add hl, bc ld a, (de) or (hl) ld (hl), a inc de add hl, bc exxSend ;4 ld a, (de) or (hl) ld (hl), a inc de add hl, bc ld a, (de) or (hl) ld (hl), a inc de add hl, bc exxSend ;5 ld a, (de) or (hl) ld (hl), a inc de add hl, bc ld a, (de) or (hl) ld (hl), a inc de add hl, bc exxSend ;6 ld hl, 175*13+$4000-1 ld b, 14 _9Shift: sla (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) exxASend dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl exxASend rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl exxASend rl (hl) dec hl rl (hl) dec hl rl (hl) ;14 shifts dec hl exxASend djnz _9Shift sla (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) exxASend dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl exxASend rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl ;starting doing the leftmost 8 columns, these are all just shifting columns ld a, $BF out ($10), a rl (hl) dec hl rl (hl) dec hl ;15 shifts rl (hl) dec hl ld a, $27 out ($10), a exx ld hl, 7+plotSScreen call doColumnShift ;31 shifts ;the leftmost 7 columns can be nicely grouped together ld bc, 7*256+$26 restColumnsLoop: DWAIT ld a, $BF out ($10), a DWAIT ld a, c out ($10), a push bc call doColumnShift pop bc dec c djnz restColumnsLoop ;31+16*7= 143 shifts jp screenDone ;######### ;do a screen column with shifting ;input: hl = bottom of screen to copy ; hl' = place to start shifting ;output: hl = next column (moving left) ; de = 13 ; hl', de' = updated ; c = $11 ; 16 rows shifted doColumnShift: ld c, $11 ld de, 12 exx ld b, 16 columnLoopz: sla (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) exxASend dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl exxASend rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl exxASend rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl exxASend djnz columnLoopz exx ld bc, -769 add hl, bc ld c, $11 ret ;Here the screen is done and it is all power go on shifting screenDone: exx ld b, 175-143 call shiftThisMany ld hl, 175*13+$4000-1 ld b, 175 call shiftThisMany ;43000 clocks, but shifting is done jp shiftingDone ;########## shiftThisMany: sla (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl rl (hl) dec hl djnz shiftThisMany ret ;screen is ready to draw next frame, yay!! shiftingDone: ld a, (tillNext) dec a ld (tillNext), a jr nz, notThisFrame ld hl, (lvlPtr) parseLoop: ld a, (hl) or a jr nz, notWin ld a, 125 ld (winCount), a inc hl jr parseLoop notWin: and %11000000 jr z, thisFrameDone rlca jr nc, toggleGround ld de, triangle rlca jr nc, wasTri ld de, square wasTri: push hl push de ld a, (hl) and %00011111 rlca ld b, a rlca add a, b ld l, a ld h, 0 ld e, l ld d, h add hl, hl add hl, de add hl, hl add hl, hl add hl, de ld de, 5*13+picStart+12 add hl, de pop de ld b, 6 newItemLoop: push bc ld a, (de) ld (hl), a inc de ld bc, -13 add hl, bc pop bc djnz newItemLoop pop hl inc hl jr parseLoop toggleGround: ld a, (darkGround) xor 1 ld (darkGround), a inc hl jr parseLoop thisFrameDone: ld a, (hl) ld (tillNext), a inc hl ld (lvlPtr), hl notThisFrame: ld a, $FF ld (picStart-1), a xor a ld (picStart-14), a ld (picStart-27), a ld a, (darkGround) or a jr z, notDark ld a, $FF ld (picStart-14), a ld (picStart-27), a notDark: ;the controlling part, you can use 2nd and up to jump ld a, (winCount) or a jr nz, jumpin ld a, $BF call keyScan bit 5, b jr z, jumpin bit 7, b jp z, titleLoop ld a, $FE call keyScan bit 3, b jr nz, notJumpin jumpin: ld hl, (yVel) ld a, h or l jr nz, notJumpin ld hl, jumpPower ld (yVel), hl ld hl, squareY inc (hl) notJumpin: ld hl, (yVel) ld de, gravity add hl, de ld (yVel), hl ld de, (squareY) add hl, de ld (squareY), hl ld hl, jumpCount inc (hl) ld a, (squareY+1) cp 230 jr c, notNeg ld hl, 0 ld (yVel), hl ld (squareY), hl xor a ld (jumpCount), a notNeg: ld a, $FD call keyScan bit 6, b jp z, quit ;collision detection and platform detection ld a, (tillNext2) dec a ld (tillNext2), a jr nz, notAddingShapes ld hl, (lvlPtr2) parseLoop2: ld a, (hl) or a jr nz, notWinz inc hl jr parseLoop2 notWinz: and %11000000 jr z, thisPartDone2 rlca jr nc, toggleDark rlca ld b, a ld de, itemBuf-3 findOpening: inc de inc de inc de ld a, (de) or a jr nz, findOpening ld a, 5 ld (de), a inc de ld a, b ld (de), a inc de ld a, (hl) and %00111111 sla a ld c, a sla a add a, c ld (de), a ld a, (items) inc a ld (items), a inc hl jr parseLoop2 toggleDark: ld a, (darkGround2) xor 1 ld (darkGround2), a inc hl jr parseLoop2 thisPartDone2: ld a, (hl) ld (tillNext2), a inc hl ld (lvlPtr2), hl notAddingShapes: ld hl, (squareY) ld a, h or l jr nz, notOnGround ld a, (darkGround2) or a call nz, death notOnGround: ld a, (items) or a jp z, noItems ld b, a ld a, (squareY+1) ld c, a ld hl, itemBuf blockProccess: ld a, (hl) or a jr nz, realItem inc hl inc hl inc hl jr blockProccess realItem: inc hl ld a, (hl) cp 3 jr z, itsBlock inc hl notTouching: inc hl djnz blockProccess jr blocksDone itsBlock: inc hl ld a, (hl) sub c jp p, notNegz neg notNegz: cp 6 jr nc, notTouching ld a, (hl) sub c jp p, blockDeath neg cp 3 jr c, blockDeath ;landed on the block blockLand: ld a, (hl) add a, 6 ld (squareY+1), a xor a ld (squareY), a ld (jumpCount), a ld hl, 0 ld (yVel), hl jr blocksDone blockDeath: ld a, (yVel+1) cp 3 jr nc, blockLand call death blocksDone: ld a, (items) ld b, a ld a, (squareY+1) ld c, a ld hl, itemBuf triangleLoop: ld a, (hl) or a jr nz, realItemz inc hl inc hl inc hl jr triangleLoop realItemz: cp 3 jr z, goodDist cp 2 jr z, goodDist inc hl notTri: inc hl inc hl djnz triangleLoop jr triDone goodDist: inc hl ld a, (hl) cp 2 jr nz, notTri inc hl ld a, (hl) sub c jp p, positivo neg positivo: cp 6 call c, death djnz triangleLoop triDone: ld a, (items) ld b, a ld hl, itemBuf decreaseItems: ld a, (hl) or a jr nz, toDec backToDecrease: inc hl inc hl inc hl jr decreaseItems toDec: dec (hl) jr nz, notGone ld a, (items) dec a ld (items), a notGone: djnz backToDecrease noItems: ;fix scrolling ld a, (scrolled) ld b, a ld a, (squareY+1) sub b ;relative pos on screen ld hl, scrolled jp p, notBotScroll add a, (hl) ld (hl), a jr scrollDone notBotScroll: cp 29 jr c, scrollDone sub 29 add a, (hl) ld (hl), a scrollDone: ;wrap up and go to next frame ld a, (winCount) or a jr z, notWinning dec a ld (winCount), a jr z, totalVictory and %00000111 jr nz, notWinning ld a, (contrast) cp 39 jr nc, notWinning inc a ld (contrast), a add a, 24 | $C0 out ($10), a notWinning: ld a, $BF call keyScan bit 6, b jr nz, notToPause ld a, (pausePressed) or a jr nz, pauseDone inc a ld (pausePressed), a ld b, 10 initPauseLp: ei halt halt djnz initPauseLp pauseLp1: ld a, $BF call keyScan bit 6, b jr z, pauseLp1 ld b, 10 initPauseLp2: ei halt halt djnz initPauseLp2 pauseLp2: ld a, $BF call keyScan bit 6, b jr nz, pauseLp2 jr pauseDone notToPause: xor a ld (pausePressed), a pauseDone: ld a, (goodCalc) or a jr z, badCalc call waitLoop jr waitDonez badCalc: ei halt halt waitDonez: jp gameLoop totalVictory: ;sasuke call blackScreen set textInverse, (iy + textFlags) ld hl, winText ld de, 19*256+35 ld (penCol), de bcall(_vPutS) ld de, 32*256+38 ld (penCol), de bcall(_vPutS) res textInverse, (iy + textFlags) bcall(_grBufCpy) DWAIT ld a, (contrastSave) ld (contrast), a add a, 24 | $C0 out ($10), a ld hl, 3000 ld a, (selected) or a jr z, xboxNums3 ld (appVarShad+4), hl ld hl, (appVarShad+6) inc hl ld (appVarShad+6), hl jr finishWin xboxNums3: ld (appVarShad), hl ld hl, (appVarShad+2) inc hl ld (appVarShad+2), hl finishWin: ld a, 1 ld (appVarDirty), a call waitAnyKey jp titleLoop death: pop hl ld hl, (appVarShad) ld a, (selected) or a jr z, xboxNums ld hl, (appVarShad+4) xboxNums: ld de, (lvlCount) sbc hl, de jp nc, start ld a, (selected) or a jr z, xboxNums2 ld (appVarShad+4), de jr finishDeath xboxNums2: ld (appVarShad), de finishDeath: ld a, 1 ld (appVarDirty), a jp start ;################################# waitAnyKey: ei halt bcall(_getCSC) winKeyLoop: halt bcall(_getCSC) or a jr z, winKeyLoop ret ;############################### blackScreen: ld hl, plotSScreen ld de, plotSScreen+1 ld bc, 767 ld (hl), $FF ldir ret ;############################### ;wait a frame WaitLoop: IN A, ($31) BIT 2, A JR NZ, WaitDone IN A, ($04) BIT 5, A JR Z, WaitLoop WaitDone: LD A, $45 OUT ($30), A XOR A OUT ($31), A LD A, 58 OUT ($32), A ret ;############################### ;convert HL to decimal ;input: hl = number ; de = location to put number ;output: b = number of numbers ; de = byte after last number convHex: push de inc de inc de inc de inc de push de ld b, 1 convHexLoop: push de or a ld de, 10 sbc hl, de add hl, de jr c, next pop de inc b ld a, 10 bcall(_divHLbyA) add a, $30 ld (de), a dec de jr convHexLoop next: pop de ld a, $30 add a, l ld (de), a pop hl pop de inc hl push bc backLoop: dec hl djnz backLoop pop bc push bc ld c, b ld b, 0 ldir pop bc ret ;######################################## ;faster bhl ;only checks for going over fast_bhl: ld a, h res 7, h set 6, h cp h ret z inc b ret ;################################## ;Move to start of data in Rom ;Input: Output of _ChkFindSym ;Output: HL = start ; B = rom page ;Destroys: C DE FindStartInRom: ex de, hl LD de, 9 add hl, de call fast_bhl bcall(_LoadCIndPaged) inc c ld e, c add hl, de call fast_bhl ret ;#################################### ;key scan ;input: a = group ;output: b = buttons ;destorys: a keyScan: out (01), a nop nop nop nop in a, (01) ld b, a ld a, $FF out (01), a ret ;####################################### writeAppVar: ld hl, appName rst 20h bcall(_arc_unarc) ld hl, appName rst 20h bcall(_chkFindSym) inc de inc de ld hl, appVarShad ld bc, 8 ldir bcall(_arc_unarc) ret ;############################ drawBar: ld b, 5 barLoop: push bc push hl push de xor a call fastLine pop de pop hl inc e inc l pop bc djnz barLoop ret squarePics: .db %00000000 .db %01111110 .db %01000010 .db %01000010 .db %01000010 .db %01000010 .db %01111110 .db %00000000 .db %01110000 .db %01001110 .db %01000010 .db %10000010 .db %10000100 .db %11100100 .db %00011100 .db %00000000 .db %00110000 .db %01001100 .db %01000010 .db %10000010 .db %10000100 .db %01100100 .db %00011000 .db %00000000 .db %00010000 .db %00101000 .db %01000100 .db %10000010 .db %01000100 .db %00101000 .db %00010000 .db %00000000 .db %00011000 .db %01100100 .db %10000100 .db %10000010 .db %01000010 .db %01001100 .db %00110000 .db %00000000 .db %00011100 .db %11100100 .db %10000100 .db %10000010 .db %01000010 .db %01001110 .db %01110000 .db %00000000 ;triangle: .db %00110000 .db %00110000 .db %01001000 .db %01001000 .db %10000100 .db %11111100 square: .db %11111100 .db %11111100 .db %11111100 .db %11111100 .db %11111100 .db %11111100 triangle: .db %00111000 .db %00111000 .db %01101100 .db %01101100 .db %11000110 .db %11111110 ;square: .db %11111111 .db %10100101 .db %10100101 .db %10100101 .db %10100101 .db %11111111 attempts: .db "Attempt " winText: .db "You Win!", 0 .db "Nice...", 0 titleText: .db "The Impossible Game", 0 .db "Xbox Level", 0 .db "iPod Level", 0 statss: .db "Stats", 0 .db "Quit", 0 .db "By: Brian Coventry", 0 .db ">>>", 0 .db "<<<", 0 statText: .db "Xbox Indie Level", 0 .db "iPod Touch Fire Aura", 0 timesCompleted: .db "Times completed: " appName: .db appVarObj, "Imposble", 0 name: .db protProgObj, "IMPOSBLE", 0 ;levels are 3000 frames long ; tthhhhhh ;type height ;0 number of frames till next item ;1 toggle death ground ;2 triangle ;3 square #define single(x,y) .db x*3, y+$80 #define double(x,y) .db x*3, y+$80, 3, y+$80 #define triple(x,y) .db x*3, y+$80, 3, y+$80, 3, y+$80 #define quad(x,y) .db x*3, y+$80, 3, y+$80, 3, y+$80, 3, y+$80 #define block(x,y) .db x*3, y+$C0 #define dark .db 3, $40 #define light .db 3, $40 #define triStk(y) .db y+$80 #define blockStk(y) .db y+$C0 #define win .db 0 xboxData: .db $80 single(9, 0) double(8, 0) block(15, 0) dark block(3, 1) light double(7, 0) single(14, 0) single(16, 0) single(8, 0) double(5, 0) block(7, 0) dark block(3, 1) block(4, 2) block(5, 1) block(5, 0) light single(7, 0) single(17, 0) block(10, 0) triple(1, 0) single(7, 0) block(1, 0) .db 1*3+1 triStk(0) single(6, 0) block(18, 0) block(4, 1) block(1, 1) triStk(2) double(5, 0) single(6, 0) single(9, 0) ;2nd music set block(7, 0) dark block(3, 1) block(4, 2) block(4, 3) block(1, 3) block(1, 3) block(1, 3) block(1, 3) block(1, 3) block(1, 3) block(1, 3) block(1, 3) block(1, 3) block(1, 3) block(4, 4) block(5, 3) block(5, 2) block(3, 1) block(1, 3) triStk(4) block(2, 0) .db 4*3+2 blockStk(0) block(4, 1) block(4, 2) block(4, 3) block(4, 4) block(4, 5) block(3, 4) block(1, 6) block(2, 3) block(2, 7) block(1, 2) block(3, 1) blockStk(8) block(3, 0) single(1, 0) blockStk(9) triple(1, 0) block(1, 10) block(4, 11) block(4, 12) block(4, 13) block(4, 14) block(4, 15) block(4, 16) block(4, 17) block(4, 18) block(4, 19) block(4, 20) block(4, 21) .db 5*3+1 blockStk(20) block(1, 20) triStk(21) block(1, 20) triStk(21) block(3, 19) block(5, 18) block(5, 17) block(1, 17) triStk(18) block(4, 16) block(5, 15) block(1, 15) block(1, 15) block(1, 15) block(1, 15) triStk(16) block(1, 15) block(1, 15) block(1, 15) block(1, 15) block(1, 15) triStk(16) block(1, 15) block(1, 15) block(1, 15) block(1, 15) block(1, 15) triStk(16) block(3, 14) block(5, 13) block(5, 12) block(5, 11) block(5, 10) block(5, 9) block(5, 8) block(5, 7) block(5, 6) block(5, 5) block(5, 4) block(5, 3) block(5, 2) block(5, 1) block(5, 0) light ;3rd music set single(5, 0) triple(7, 0) single(9, 0) block(7, 0) dark block(4, 1) block(4, 2) block(4, 3) block(4, 4) block(4, 5) block(6, 1) .db 3*3 light single(3, 0) single(6, 0) single(6, 0) single(5, 0) double(6, 0) double(4, 0) triple(7, 0) block(6, 0) quad(1, 0) block(8, 0) dark block(3, 1) block(4, 2) block(4, 3) block(4, 4) block(4, 5) block(4, 6) block(4, 7) block(4, 8) block(4, 9) block(3, 8) .db 4*3+2 blockStk(8) block(4, 9) block(4, 10) block(4, 11) block(4, 12) block(6, 8) block(4, 9) block(4, 10) block(4, 11) block(4, 12) block(4, 13) block(4, 14) block(4, 15) block(4, 16) block(3, 15) block(4, 16) block(3, 15) block(4, 16) block(4, 17) block(4, 18) block(5, 17) block(4, 18) block(4, 19) block(4, 20) block(8, 2) block(1, 2) .db 3*3 light double(8, 0) double(8, 0) double(4, 0) double(7, 0) double(4, 0) triple(9, 0) .db 2*3+2 ;double triple triStk(0) double(1, 0) single(4, 0) double(4, 0) block(1, 0) dark block(4, 1) block(3, 0) light triStk(0) triple(1, 0) single(4, 0) single(5, 0) single(10, 0) single(5, 0) single(5, 0) block(12, 0) dark block(3, 1) block(4, 2) block(3, 1) block(4, 2) block(3, 1) block(4, 2) block(5, 1) block(4, 2) block(3, 1) block(4, 2) block(5, 1) block(4, 2) block(5, 1) block(4, 2) block(3, 1) block(5, 0) light single(8, 0) double(7, 0) triple(7, 0) double(7, 0) single(7, 0) block(11, 0) dark block(3, 1) block(4, 2) block(4, 3) block(4, 4) block(4, 5) block(4, 6) win block(4, 7) block(4, 8) block(4, 9) block(4, 10) block(4, 11) block(4, 12) block(4, 13) block(4, 14) block(4, 15) block(4, 16) block(4, 17) block(4, 18) iPodData: triStk(0) double(17, 0) block(16, 0) dark .db 3*3+1 blockStk(0) light double(16, 0) single(18, 0) double(8, 0) single(5, 0) block(7, 0) dark block(3, 1) block(4, 2) block(5, 1) block(5, 0) light single(7, 0) single(18, 0) block(16, 0) dark block(3, 1) block(2, 1) triStk(2) .db 2*3+1 blockStk(1) block(5, 0) light single(4, 0) single(12, 0) single(10, 0) single(7, 0) single(9, 0) block(7, 0) dark block(3, 1) block(4, 2) block(4, 3) block(4, 4) block(1, 4) block(1, 4) block(1, 4) block(1, 4) block(1, 4) block(1, 4) block(1, 4) block(1, 4) block(1, 4) block(1, 4) block(1, 4) triStk(5) .db 2*3+1 blockStk(5) block(1, 5) block(1, 5) block(1, 5) block(1, 5) triStk(6) block(1, 5) block(1, 5) block(1, 5) block(1, 5) block(1, 5) triStk(6) block(1, 5) block(1, 5) block(1, 5) block(3, 4) block(1, 6) triStk(7) block(2, 3) block(3, 2) block(3, 1) block(3, 0) block(4, 1) block(4, 2) block(4, 3) block(4, 4) block(4, 5) block(4, 6) block(4, 7) block(4, 8) block(4, 9) block(4, 10) block(4, 11) block(4, 12) block(3, 11) .db 3*3+2 blockStk(12) block(1, 12) triStk(13) block(1, 12) triStk(13) block(1, 12) triStk(13) block(1, 12) block(5, 11) block(5, 11) block(1, 11) block(1, 11) block(4, 12) block(4, 13) block(4, 14) block(5, 13) block(3, 12) block(1, 12) block(1, 12) triStk(13) block(1, 12) block(1, 12) block(1, 12) block(1, 12) block(1, 12) block(1, 11) triStk(12) block(1, 11) triStk(12) block(1, 11) triStk(12) block(1, 11) block(1, 11) block(1, 11) block(1, 11) block(1, 11) block(1, 11) block(1, 11) block(5, 10) block(5, 9) block(5, 8) block(5, 7) block(5, 6) block(5, 5) block(5, 4) block(5, 3) block(5, 2) block(5, 1) block(5, 0) light single(4, 0) double(7, 0) triple(9, 0) block(10, 0) dark block(3, 1) block(4, 2) block(4, 3) block(4, 4) block(3, 3) block(4, 4) .db 4*3+2 blockStk(4) block(3, 3) block(4, 4) block(5, 3) block(4, 4) block(3, 3) block(4, 4) .db 4*3+2 blockStk(4) .db 4*3+2 blockStk(4) block(5, 3) block(4, 4) block(3, 3) block(4, 4) block(4, 5) block(3, 4) block(1, 6) triStk(7) block(2, 3) block(3, 2) .db 5*3+1 blockStk(0) .db 4*3+2 blockStk(0) block(4, 1) block(4, 2) block(4, 3) block(2, 3) triStk(4) block(2, 4) .db 1*3 light single(2, 0) single(6, 0) triple(8, 0) double(7, 0) single(6, 0) block(7, 0) dark block(3, 1) block(4, 2) block(4, 3) block(4, 4) block(4, 5) block(4, 6) block(4, 7) block(4, 8) block(4, 9) block(4, 10) block(4, 11) block(4, 12) block(4, 13) block(4, 14) block(4, 15) block(4, 16) block(4, 17) block(4, 18) block(4, 19) block(4, 20) block(4, 21) block(4, 22) block(4, 23) .db 3*3+2 blockStk(24) triStk(25) block(3, 5) block(1, 5) .db 6*3 light single(2, 0) single(5, 0) single(11, 0) double(7, 0) double(4, 0) block(1, 0) double(1, 0) block(7, 0) quad(1, 0) block(9, 0) dark block(3, 1) block(4, 2) block(1, 2) block(1, 2) block(1, 2) block(1, 2) triStk(3) block(3, 3) block(3, 2) block(5, 1) block(3, 0) .db $40 quad(1, 0) single(7, 0) triple(10, 0) .db 2*3+2 triStk(0) ;double triple double(1, 0) .db 5*3+2 blockStk(0) dark block(3, 1) block(4, 2) block(4, 3) blockStk(0) triStk(1) block(4, 4) blockStk(1) triStk(2) block(4, 5) blockStk(2) triStk(3) block(4, 6) blockStk(3) triStk(4) block(4, 7) blockStk(4) triStk(5) block(4, 8) blockStk(5) triStk(6) block(3, 7) blockStk(10) triStk(11) block(3, 6) blockStk(11) triStk(12) block(5, 5) blockStk(9) triStk(10) block(5, 4) blockStk(8) triStk(9) .db 4*3+2 blockStk(4) blockStk(8) triStk(9) block(4, 5) blockStk(2) triStk(3) block(4, 6) blockStk(3) triStk(4) block(4, 7) blockStk(4) triStk(5) block(4, 8) blockStk(5) triStk(6) .db 3*3+2 blockStk(9) blockStk(6) triStk(7) block(1, 9) triStk(10) block(1, 8) triStk(9) block(1, 7) triStk(8) block(1, 5) triStk(6) block(1, 3) triStk(4) block(1, 0) triStk(1) light single(8, 0) double(6, 0) triple(7, 0) double(7, 0) single(8, 0) block(6, 0) dark block(3, 1) block(4, 2) block(4, 3) block(4, 4) block(4, 5) block(4, 6) win block(4, 7) block(4, 8) block(4, 9) block(4, 10) block(4, 11) block(4, 12) block(4, 13) block(4, 14) block(4, 15) block(4, 16) block(4, 17) block(4, 18) .end .end