#define B_CALL(xxxx) rst 28h \ .dw xxxx #define SETPEN(xx,yy) .db 21h \ .db xx \ .db yy \ ld (PenCol),hl _clrlcdfull =4540h _ClrScrnFull =4546h _GrBufClr =4BD0h _dispimg =4D9Bh _getkey =4018h _runindicoff =4570h _VPutS =4561h _VPutMap =455Eh _ChkFindSym =42f1h _DelVarArc =4fc6h _CreateAppVar =4E6Ah _CpHLDE =400Ch _SetXXXXOP2 =4792h _SetXXOP2 =478Fh _OP2ToOP1 =4156h _OP1ToOP2 =412Fh _CpOP1OP2 =4111h _DispOP1A =4BF7h _Mov9ToOP1 =417Ah curRow =844Bh curCol =844Ch PenRow =86D8h PenCol =86D7h OP1 =847Ah keyRt =03h keyLt =02h keyUp =04h keyDn =01h keyQt =0Fh keyEn =09h keyDel =38h Char_ArrowUp =06h Char_ArrowDown =07h Char_Space =20h ;############### ;# User Define # ;############### uLives =3 uLevels =7 uWinPause =150 uSpeed =10 ;############## ;# MirageOS # ;############## .org $9d95 ;Origin ret ;So TIOS wont run the program .db 1 ;Identifier as MirageOS program .db %00000111,%11100000 ;16x16 Icon .db %00011111,%11111000 .db %00111111,%00111100 .db %01111111,%00111000 .db %01111111,%11110000 .db %11111111,%11100000 .db %11111111,%11000000 .db %11111111,%10000000 .db %11111111,%11000000 .db %11111111,%11100000 .db %01111111,%11110000 .db %01111111,%11111000 .db %00111111,%11111100 .db %00011111,%11111000 .db %00000111,%11100000 .db "Pacman",0 ;Zero terminated description ;########### ;# Menus # ;########### ld (Save_sp),SP call ResetScores HighScore2RAM: B_CALL(_runindicoff) ld hl,txt_pacscore B_CALL(_Mov9ToOP1) B_CALL(_ChkFindSym) jr c,MainMenu inc de inc de ld hl,PSStart ex de,hl ld bc,PSEnd - PSStart ldir MainMenu: ld SP,(Save_sp) res 5,(IY+0) res 2,(IY+50) B_CALL(_clrlcdfull) ld e,24 ld d,8 ld hl,MainTitle B_CALL(_dispimg) ld e,10 ld d,56 ld hl,Copyright B_CALL(_dispimg) res 3,(IY+5) SETPEN(19,57) ld hl,txt_Copyright B_CALL(_VPutS) xor a ld (Storage),a RedrawMainMenu: res 3,(IY+5) ld a,(Storage) cp 0 jr nz,MainMenu_skip1 set 3,(IY+5) MainMenu_skip1: SETPEN(40,24) ld hl,txt_Play B_CALL(_VPutS) res 3,(IY+5) ld a,(Storage) cp 1 jr nz,MainMenu_skip2 set 3,(IY+5) MainMenu_skip2: SETPEN(26,32) ld hl,txt_HighScores B_CALL(_VPutS) res 3,(IY+5) ld a,(Storage) cp 2 jr nz,MainMenu_skip3 set 3,(IY+5) MainMenu_skip3: SETPEN(40,40) ld hl,txt_Exit B_CALL(_VPutS) res 3,(IY+5) MainMenuGetKey: call WaitForKey cp keyQt jr z,Game_Quit_sc1 cp keyEn jr z,MainMenuEnter cp keyUp jr z,MainMenuUp cp keyDn jr z,MainMenuDown jr MainMenuGetKey MainMenuUp: ld hl,Storage ld a,(hl) cp 0 jr z,MainMenuGetKey dec (hl) jp RedrawMainMenu MainMenuDown: ld hl,Storage ld a,(hl) cp 2 jr z,MainMenuGetKey inc (hl) jp RedrawMainMenu MainMenuEnter: ld a,(Storage) cp 0 jp z,GameStart cp 2 Game_Quit_sc1: jp z,Game_Quit ScoreMenu: set 2,(IY+50) B_CALL(_clrlcdfull) SETPEN(10,8) ld hl,txt_HighScores2 B_CALL(_VPutS) ShowScore1: SETPEN(24,30) ld hl,PSName1 B_CALL(_VPutS) ld hl,(PSScore1) B_CALL(_SetXXXXOP2) B_CALL(_Op2ToOP1) SETPEN(54,30) ld a,5 B_CALL(_DispOP1A) ShowScore2: SETPEN(24,40) ld hl,PSName2 B_CALL(_VPutS) ld hl,(PSScore2) B_CALL(_SetXXXXOP2) B_CALL(_Op2ToOP1) SETPEN(54,40) ld a,5 B_CALL(_DispOP1A) ShowScore3: SETPEN(24,50) ld hl,PSName3 B_CALL(_VPutS) ld hl,(PSScore3) B_CALL(_SetXXXXOP2) B_CALL(_Op2ToOP1) SETPEN(54,50) ld a,5 B_CALL(_DispOP1A) call WaitForKey cp keyDel jp nz,MainMenu ClearHSMenu: res 3,(IY+5) res 2,(IY+50) B_CALL(_clrlcdfull) SETPEN(19,19) ld hl,txt_ClearHS B_CALL(_VPutS) xor a ld (Storage),a RedrawClearHS: res 3,(IY+5) ld a,(Storage) cp 1 jr nz,ClearHS_skip1 set 3,(IY+5) ClearHS_skip1: SETPEN(30,28) ld hl,txt_Yes B_CALL(_VPutS) res 3,(IY+5) ld a,(Storage) cp 0 jr nz,ClearHS_skip2 set 3,(IY+5) ClearHS_skip2: SETPEN(50,28) ld hl,txt_No B_CALL(_VPutS) res 3,(IY+5) ClearHSGetKey: call WaitForKey cp keyQt jp z,ScoreMenu cp keyEn jr z,ClearHSEnter cp keyLt jr z,ClearHSLt cp keyRt jr z,ClearHSRt jr ClearHSGetKey ClearHSLt: ld hl,Storage ld a,(hl) cp 1 jr z,ClearHSGetKey inc (hl) jr RedrawClearHS ClearHSRt: ld hl,Storage ld a,(hl) cp 0 jr z,ClearHSGetKey dec (hl) jr RedrawClearHS ClearHSEnter: ld a,(Storage) cp 1 call z,ResetScores jp ScoreMenu EnterHighScore: push hl set 2,(IY+50) B_CALL(_clrlcdfull) SETPEN(10,8) ld hl,txt_HighScores2 B_CALL(_VPutS) SETPEN(18,17) ld hl,txt_enterName B_CALL(_VPutS) xor a ld (Storage),a res 3,(IY+5) DrawName: SETPEN(35,32) ld hl,txt_Spaces B_CALL(_VPutS) SETPEN(35,48) ld hl,txt_Spaces B_CALL(_VPutS) SETPEN(35,40) ld a,(Storage) cp 0 call z,DrawArrows ld a,(Name) B_CALL(_VPutMap) res 3,(IY+5) SETPEN(42,40) ld a,(Storage) cp 1 call z,DrawArrows ld a,(Name+1) B_CALL(_VPutMap) res 3,(IY+5) SETPEN(49,40) ld a,(Storage) cp 2 call z,DrawArrows ld a,(Name+2) B_CALL(_VPutMap) res 3,(IY+5) EnterHSKeyLoop: call WaitForKey cp keyEn jr z,CopyName2RAM cp keyUp jr z,IncLetter cp keyDn jr z,DecLetter cp keyRt jr z,IncChar cp keyLt jr z,DecChar jr EnterHSKeyLoop CopyName2RAM: ld bc,3 ld hl,Name pop de ldir jp ScoreMenu DrawArrows: push hl ld a,32 ld (PenRow),a ld a,Char_ArrowUp B_CALL(_VPutMap) pop hl push hl ld a,l ld (PenCol),a ld a,48 ld (PenRow),a ld a,Char_ArrowDown B_CALL(_VPutMap) pop hl ld (PenCol),hl set 3,(IY+5) ret IncLetter: call GetLetAddress ld a,(hl) cp 5Ah jr nz,NotLetterMin ld a,40h ld (hl),a NotLetterMin: inc (hl) jp DrawName DecLetter: call GetLetAddress ld a,(hl) cp 41h jr nz,NotLetterMax ld a,5Bh ld (hl),a NotLetterMax: dec (hl) jp DrawName IncChar: ld hl,Storage ld a,(hl) cp 2 jr z,EnterHSKeyLoop inc (hl) jp DrawName DecChar: ld hl,Storage ld a,(hl) cp 0 jr z,EnterHSKeyLoop dec (hl) jp DrawName GetLetAddress: ld a,(Storage) ld c,a ld b,0 ld hl,Name add hl,bc ret ResetScores: ld hl,txt_score_clear ld de,PSStart ld bc,PSEnd - PSStart ldir ret WaitForKey: B_CALL(_getkey) cp 0 jr z,WaitForKey ret ;################ ;# Initialize # ;################ GameStart: set 2,(IY+50) NewGame: ld hl,Level1 ld (Level),hl ld hl,0 ld (Score),hl ld a,uLives ld (Lives),a ld a,uSpeed ld (Speed),a DrawAllMap: ld bc,77 ld hl,(Level) ld de,LevelRAM ldir DrawOldMap: B_CALL(_clrlcdfull) ld bc,BStuffEnd-BackupStuff ld hl,BackupStuff ld de,Storage ldir ld bc,0 jp MapEnterLoop DrawAllMapLoop: ld hl,Storage ld a,(hl) add a,8 ld (hl),a cp 88 jp nz,DrawAllMapLoop2 ld (hl),0 inc hl ld a,(hl) add a,8 ld (hl),a cp 56 jp nz,DrawAllMapLoop2 DrawScoreArea: SETPEN(0,57) ld hl,txt_Score B_CALL(_VPutS) Game_DrawLives: ld hl,PacPic1 ld a,(Lives) ld b,a ld e,88 ld d,56 DrawLivesLoop: push hl push de push bc B_CALL(_dispimg) pop bc pop de pop hl ld a,e sub 9 ld e,a djnz DrawLivesLoop jp GamePlay DrawAllMapLoop2: ld a,(Storage+2) inc a ld (Storage+2),a ld c,a ld b,0 MapEnterLoop: ld hl,LevelRAM add hl,bc ld a,(hl) ld c,a cp 0 jp nz,NotIncDotNum ld hl,DotNumber inc (hl) NotIncDotNum: ld hl,Dot add hl,bc DrawBlock: push hl ld hl,Storage ld e,(hl) inc e inc e inc e inc e inc hl ld d,(hl) pop hl B_CALL(_dispimg) jp DrawAllMapLoop ;############### ;# Main Loop # ;############### GamePlay: ld hl,(Score) ;Draw the score B_CALL(_SetXXXXOP2) B_CALL(_Op2ToOP1) SETPEN(36,57) ld a,5 B_CALL(_DispOP1A) ld hl,Ghost1Data call Game_DoAllGhostStuff ld de,Ghost1Data call Game_RAM2Ghost ld hl,Ghost2Data call Game_DoAllGhostStuff ld de,Ghost2Data call Game_RAM2Ghost ld hl,Ghost3Data call Game_DoAllGhostStuff ld de,Ghost3Data call Game_RAM2Ghost call Game_DoAllPacStuff ld a,(Speed) ld b,a GetKey: B_CALL(_getkey) cp 0 jr z,NoKeyPressed cp keyQt jp z,MainMenu cp keyEn call z,WaitForKey ld (CurrentKey),a NoKeyPressed: halt djnz GetKey ld hl,PacData call Game_CheckGrid cp 1 jp z,GamePlay call Game_ProcessKey call Game_EatDot jp GamePlay ;############ ;# Pacman # ;############ Game_DoAllPacStuff: Game_ClearPac: ld hl,PacData ld e,(hl) inc hl ld d,(hl) ld hl,Blank B_CALL(_dispimg) Game_MovePac: ld a,(PacData+4) ld hl,PacData dec (hl) dec (hl) add a,(hl) ld (hl),a ld a,(PacData+5) ld hl,PacData+1 dec (hl) dec (hl) add a,(hl) ld (hl),a Game_DrawPac: ld hl,PacData ld e,(hl) inc hl ld d,(hl) inc hl ld a,(hl) cp 0 jp z,PacClosed inc hl ld a,(hl) cp 0 jp z,ShowPacRight cp 1 jp z,ShowPacLeft cp 2 jp z,ShowPacDown cp 3 jp z,ShowPacUp ShowPacRight: ld hl,PacPic1 jp PacClosed+3 ShowPacLeft: ld hl,PacPic3 jp PacClosed+3 ShowPacDown: ld hl,PacPic4 jp PacClosed+3 ShowPacUp: ld hl,PacPic2 jp PacClosed+3 PacClosed: ld hl,PacPic5 B_CALL(_dispimg) ld hl,PacData+2 ld a,(hl) xor %00000001 ld (hl),a ret PacRight: ld hl,PacData+3 ld (hl),0 inc hl ld (hl),4 inc hl ld (hl),2 call Game_StopPac cp 1 call z,PacStop ret PacLeft: ld hl,PacData+3 ld (hl),1 inc hl ld (hl),0 inc hl ld (hl),2 call Game_StopPac cp 1 call z,PacStop ret PacDown: ld hl,PacData+3 ld (hl),2 inc hl ld (hl),2 inc hl ld (hl),4 call Game_StopPac cp 1 call z,PacStop ret PacUp: ld hl,PacData+3 ld (hl),3 inc hl ld (hl),2 inc hl ld (hl),0 call Game_StopPac cp 1 call z,PacStop ret PacStop: ld hl,PacData+4 ld (hl),2 inc hl ld (hl),2 ret Game_StopPac: ld hl,PacData+4 ld a,(hl) cp 0 jp z,StopPacXL cp 4 jp z,StopPacXR inc hl ld a,(hl) cp 0 jp z,StopPacYU cp 4 jp z,StopPacYD xor a ret StopPacXL: ld hl,PacData ld a,(hl) cp 4 jp z,StopPacXY sub 8 ld c,a inc hl ld a,(hl) call Game_GetMapIndex ld a,(hl) cp 0Ah jp z,StopPacXY xor a ret StopPacXR: ld hl,PacData ld a,(hl) cp 84 jp z,StopPacXY add a,8 ld c,a inc hl ld a,(hl) call Game_GetMapIndex ld a,(hl) cp 0Ah jp z,StopPacXY xor a ret StopPacYU: ld hl,PacData ld a,(hl) ld c,a inc hl ld a,(hl) cp 0 jp z,StopPacXY sub 8 call Game_GetMapIndex ld a,(hl) cp 0Ah jp z,StopPacXY xor a ret StopPacYD: ld hl,PacData ld a,(hl) ld c,a inc hl ld a,(hl) cp 48 jp z,StopPacXY add a,8 call Game_GetMapIndex ld a,(hl) cp 0Ah jp z,StopPacXY xor a ret StopPacXY: ld a,1 ret Game_EatDot: ld hl,PacData ld c,(hl) inc hl ld a,(hl) call Game_GetMapIndex ld a,(hl) cp 0 ret nz ld (hl),14h ld hl,(Score) inc hl ld (Score),hl ld hl,DotNumber dec (hl) ld a,(hl) cp 0 ret nz jp Game_WinLevel Game_ProcessKey: ld a,(CurrentKey) cp keyRt jp z,gkRt cp keyLt jp z,gkLt cp keyDn jp z,gkDn cp keyUp jp z,gkUp ReturnLastKey: ld a,(LastKey) cp keyRt jp z,PacRight cp keyLt jp z,PacLeft cp keyDn jp z,PacDown cp keyUp jp z,PacUp ret gkRt: call StopPacXR cp 1 jp z,ReturnLastKey ld a,(CurrentKey) ld (LastKey),a jp PacRight gkLt: call StopPacXL cp 1 jp z,ReturnLastKey ld a,(CurrentKey) ld (LastKey),a jp PacLeft gkDn: call StopPacYD cp 1 jp z,ReturnLastKey ld a,(CurrentKey) ld (LastKey),a jp PacDown gkUp: call StopPacYU cp 1 jp z,ReturnLastKey ld a,(CurrentKey) ld (LastKey),a jp PacUp Game_GetMapIndex: ;Input TestX = c srl c ;Input TestY = a srl c ;Output MapIx= hl srl c srl a srl a srl a ld b, 10 ld d,a MultiplyLoop: add a,d djnz MultiplyLoop add a,c ld c,a ld b,0 ld hl,LevelRAM add hl,bc ret ;############## ;# Ghost AI # ;############## Game_RAM2Ghost: ld bc,6 ld hl,GhostRAM ldir ret Game_DoAllGhostStuff: Game_Ghost2RAM: ld bc,6 ld de,GhostRAM ldir Game_StepGhost: ld hl,GhostRAM call Game_CheckGrid cp 1 jp z,Game_MoveGhost ld a,(GhostRAM) ld (GhostRAM+4),a ld a,(GhostRAM+1) ld (GhostRAM+5),a ld hl,0 ld (Storage),hl ld (Storage+2),hl ScanRightWall: ld a,(GhostRAM) cp 84 jp z,ScanLeftWall add a,8 ld c,a ld a,(GhostRAM+1) call Game_GetMapIndex ld a,(hl) cp 0Ah jp z,ScanLeftWall ld a,(GhostRAM+2) cp 0 jp z,ScanLeftWall ld hl,Storage ld (hl),1 ScanLeftWall: ld a,(GhostRAM) cp 4 jp z,ScanDownWall sub 8 ld c,a ld a,(GhostRAM+1) call Game_GetMapIndex ld a,(hl) cp 0Ah jp z,ScanDownWall ld a,(GhostRAM+2) cp 4 jp z,ScanDownWall ld hl,Storage+1 ld (hl),1 ScanDownWall: ld a,(GhostRAM+1) cp 48 jp z,ScanUpWall add a,8 ld hl,GhostRAM ld c,(hl) call Game_GetMapIndex ld a,(hl) cp 0Ah jp z,ScanUpWall ld a,(GhostRAM+3) cp 0 jp z,ScanUpWall ld hl,Storage+2 ld (hl),1 ScanUpWall: ld a,(GhostRAM+1) cp 0 jp z,MoveRandomDir sub 8 ld hl,GhostRAM ld c,(hl) call Game_GetMapIndex ld a,(hl) cp 0Ah jp z,MoveRandomDir ld a,(GhostRAM+3) cp 4 jp z,MoveRandomDir ld hl,Storage+3 ld (hl),1 MoveRandomDir: call Game_GetRand jp z,MoveRandomDirY MoveRandomDirX: call Game_GetRand jp z,MoveRandomDirXL MoveRandomDirXR: xor a ld (Storage+4),a jp MoveDirLoop MoveRandomDirXL: ld a,1 ld (Storage+4),a jp MoveDirLoop MoveRandomDirY: call Game_GetRand jp z,MoveRandomDirYU MoveRandomDirYD: ld a,2 ld (Storage+4),a jp MoveDirLoop MoveRandomDirYU: ld a,3 ld (Storage+4),a MoveDirLoop: ld hl,Storage+4 ld a,(hl) inc a ld (hl),a cp 4 jp nz,SkipZeroOutA xor a ld (hl),a SkipZeroOutA: ld hl,Storage ld b,0 ld c,a add hl,bc ld a,(hl) cp 0 jp z,MoveDirLoop ld hl,GhostRAM+2 ld a,(Storage+4) MoveDirSkip0: cp 0 jp nz,MoveDirSkip1 ld hl,GhostRAM+2 ld (hl),4 inc hl ld (hl),2 jp Game_MoveGhost MoveDirSkip1: cp 1 jp nz,MoveDirSkip2 ld (hl),0 inc hl ld (hl),2 jp Game_MoveGhost MoveDirSkip2: cp 2 jp nz,MoveDirSkip3 ld (hl),2 inc hl ld (hl),4 jp Game_MoveGhost MoveDirskip3: ld (hl),2 inc hl ld (hl),0 Game_MoveGhost: ld a,(GhostRAM+2) ld hl,GhostRAM dec (hl) dec (hl) add a,(hl) ld (hl),a ld a,(GhostRAM+3) ld hl,GhostRAM+1 dec (hl) dec (hl) add a,(hl) ld (hl),a Game_DrawGhost: ld hl,GhostRAM+4 ld c,(hl) inc hl ld a,(hl) call Game_GetMapIndex ld b,0 ld c,(hl) ld hl,Dot add hl,bc ld a,(GhostRAM+4) ld e,a ld a,(GhostRAM+5) ld d,a B_CALL(_dispimg) ld hl,GhostRAM ld e,(hl) inc hl ld d,(hl) ld hl,Ghost B_CALL(_dispimg) Game_CheckDeath: ld a,(PacData) ld hl,GhostRAM sub (hl) cp 6 jp c,Game_CheckDeath2 ld a,(GhostRAM) ld hl,PacData sub (hl) cp 6 jp c,Game_CheckDeath2 ret Game_CheckDeath2: ld a,(PacData+1) ld hl,GhostRAM+1 sub (hl) cp 6 jp c,Game_Die ld a,(GhostRAM+1) ld hl,PacData+1 sub (hl) cp 6 jp c,Game_Die ret Game_GetRand: ld a,r and %00000010 cp %00000010 ret ;################ ;# Game Stuff # ;################ Game_CheckGrid: ld a,(hl) and %00000111 rlca rlca rlca ld c,a inc hl ld a,(hl) and %00000111 add a,c cp %00100000 ret z ld a,1 ret Game_SetHighScore: ld de,(PSScore1) ld hl,(Score) B_CALL(_CpHLDE) jp c,TryScore2 ld hl,PSName2 ld de,PSName3 ld bc,6 ldir ld hl,PSName1 ld de,PSName2 ld bc,6 ldir ld hl,(Score) ld (PSScore1),hl ld hl,PSName1 jp EnterHighScore TryScore2: ld de,(PSScore2) ld hl,(Score) B_CALL(_CpHLDE) jp c,TryScore3 ld hl,PSName2 ld de,PSName3 ld bc,6 ldir ld hl,(Score) ld (PSScore2),hl ld hl,PSName2 jp EnterHighScore TryScore3: ld de,(PSScore3) ld hl,(Score) B_CALL(_CpHLDE) jp c,MainMenu ld hl,(Score) ld (PSScore3),hl ld hl,PSName3 jp EnterHighScore Game_WinLevel ld hl,(Level) ld de,LastLevel B_CALL(_CpHLDE) jp z,LevSpeedInc ld bc,77 add hl,bc ld (Level),hl WinLevelRet: ld b,uWinPause call Game_Pause pop bc jp DrawAllMap LevSpeedInc: ld hl,Level1 ld (Level),hl ld hl,Speed dec (hl) dec (hl) dec (hl) jr WinLevelRet Game_Pause: halt djnz Game_Pause ret Game_Die: pop hl ld b,12 call Game_Pause ld b,04h GameDieLoop: push bc ld hl,PacData ld e,(hl) inc hl ld d,(hl) ld hl,PacPic1 B_CALL(_dispimg) ld b,12 call Game_Pause ld hl,PacData ld e,(hl) inc hl ld d,(hl) ld hl,PacPic2 B_CALL(_dispimg) ld b,12 call Game_Pause ld hl,PacData ld e,(hl) inc hl ld d,(hl) ld hl,PacPic3 B_CALL(_dispimg) ld b,12 call Game_Pause ld hl,PacData ld e,(hl) inc hl ld d,(hl) ld hl,PacPic4 B_CALL(_dispimg) ld b,12 call Game_Pause pop bc djnz GameDieLoop FinishDying: ld hl,PacData ld e,(hl) inc hl ld d,(hl) ld hl,Pop B_CALL(_dispimg) ld b,100 call Game_Pause ld hl,Lives dec (hl) ld a,(hl) cp 0 jp z,Game_Over jp DrawOldMap Game_Over: B_CALL(_clrlcdfull) SETPEN(22,20) ld hl,txt_GameOver B_CALL(_VPutS) ld e,36 ld d,30 ld hl,DeadPac B_CALL(_dispimg) call WaitForKey jp Game_SetHighScore Game_Quit: RAM2HighScore: ld hl,txt_pacscore B_CALL(_Mov9ToOP1) B_CALL(_ChkFindSym) call nc,SkipCreateHS ld hl,PSEnd - PSStart B_CALL(_CreateAppVar) SkipCreateHS: inc de inc de ld hl,PSStart ld bc,PSEnd - PSStart ldir ResetStuff: res 2,(IY+50) ld hl,0 ld (curRow),hl B_CALL(_GrBufClr) B_CALL(_ClrScrnFull) ld SP,(Save_sp) ret ;################ ;# Static RAM # ;################ txt_Play: .db " Play ",0 txt_HighScores: .db " High Scores ",0 txt_Exit: .db " Exit ",0 txt_Copyright: .db "2008 Kevin Horowitz",0 txt_HighScores2: .db "-High Scores-",0 txt_GameOver: .db "GAME OVER",0 txt_EnterName: .db "Enter Name:",0 txt_Score: .db "Score:",0 txt_ClearHS: .db "Clear High Scores?",0 txt_Yes: .db " Yes ",0 txt_No: .db " No ",0 txt_pacscore: .db 15h,"PacScore" txt_spaces: .db " ",0 txt_score_clear: .db "---",0,0,0 .db "---",0,0,0 .db "---",0,0,0 BackupStuff: .db 0,0,0,0,0 ;Storage .db 0 ;LastKey .db 0 ;Currentkey .db 44,0 ;Pac X and Y .db 0 ;Pac Open or Closed .db 0 ;Pac Sprite Index .db 2,2 ;Pac DX and DY .db 20,48 ;G1 X and Y .db 0,2 ;G1 DX and DY .db 20,48 ;G1 PX and PY .db 44,48 ;G2 X and Y .db 2,2 ;G2 DX and DY .db 44,48 ;G2 PX and PY .db 68,48 ;G3 X and Y .db 4,2 ;G3 DX and DY .db 68,48 ;G3 PX and PY .db 0 ;Initial Dots .db "AAA" ;Initial Name BStuffEnd: Level1: .db 00h,00h,00h,00h,00h,14h,00h,00h,00h,00h,00h .db 00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h .db 00h,00h,00h,0Ah,00h,00h,00h,0Ah,00h,00h,00h .db 00h,0Ah,0Ah,0Ah,00h,0Ah,00h,0Ah,0Ah,0Ah,00h .db 00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h .db 00h,0Ah,00h,0Ah,0Ah,0Ah,0Ah,0Ah,00h,0Ah,00h .db 00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h Level2: .db 00h,00h,00h,00h,00h,14h,00h,00h,00h,00h,00h .db 00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h .db 00h,0Ah,00h,0Ah,00h,00h,00h,0Ah,00h,0Ah,00h .db 00h,0Ah,00h,00h,00h,0Ah,00h,00h,00h,0Ah,00h .db 00h,0Ah,00h,0Ah,00h,00h,00h,0Ah,00h,0Ah,00h .db 00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h .db 00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h Level3: .db 00h,00h,00h,00h,00h,14h,00h,00h,00h,00h,00h .db 00h,0Ah,0Ah,00h,0Ah,0Ah,0Ah,00h,0Ah,0Ah,00h .db 00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h .db 0Ah,0Ah,00h,0Ah,0Ah,00h,0Ah,0Ah,00h,0Ah,0Ah .db 00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h .db 00h,0Ah,0Ah,00h,0Ah,0Ah,0Ah,00h,0Ah,0Ah,00h .db 00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h Level4: .db 00h,00h,00h,00h,00h,14h,00h,00h,00h,00h,00h .db 00h,0Ah,00h,0Ah,0Ah,00h,0Ah,0Ah,00h,0Ah,00h .db 00h,00h,00h,0Ah,00h,00h,00h,0Ah,00h,00h,00h .db 0Ah,0Ah,00h,00h,00h,0Ah,00h,00h,00h,0Ah,0Ah .db 00h,00h,00h,0Ah,00h,00h,00h,0Ah,00h,00h,00h .db 00h,0Ah,00h,0Ah,0Ah,00h,0Ah,0Ah,00h,0Ah,00h .db 00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h Level5: .db 00h,00h,00h,00h,00h,14h,00h,00h,00h,00h,00h .db 00h,0Ah,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,0Ah,00h .db 00h,0Ah,00h,00h,00h,00h,00h,00h,00h,0Ah,00h .db 00h,00h,00h,0Ah,00h,0Ah,00h,0Ah,00h,00h,00h .db 00h,0Ah,00h,00h,00h,00h,00h,00h,00h,0Ah,00h .db 00h,0Ah,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,0Ah,00h .db 00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h Level6: .db 00h,00h,00h,0Ah,00h,14h,00h,0Ah,00h,00h,00h .db 00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h .db 00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h .db 0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah .db 00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h .db 00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h .db 00h,00h,00h,0Ah,00h,00h,00h,0Ah,00h,00h,00h LastLevel: .db 00h,00h,00h,00h,00h,14h,00h,00h,00h,00h,00h .db 00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h .db 00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h .db 00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h .db 00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h .db 00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h,0Ah,00h .db 00h,00h,00h,00h,00h,00h,00h,00h,00h,00h,00h ;############## ;# Pictures # ;############## Dot: .db 8,8 .db %00000000 .db %00000000 .db %00011000 .db %00100100 .db %00100100 .db %00011000 .db %00000000 .db %00000000 Wall: .db 8,8 .db %11111111 .db %11111111 .db %11111111 .db %11111111 .db %11111111 .db %11111111 .db %11111111 .db %11111111 Blank: .db 8,8 .db %00000000 .db %00000000 .db %00000000 .db %00000000 .db %00000000 .db %00000000 .db %00000000 .db %00000000 PacPic1: .db 8,8 .db %00111110 .db %01111100 .db %11111000 .db %11110000 .db %11110000 .db %11111000 .db %01111100 .db %00111110 PacPic2: .db 8,8 .db %00000000 .db %10000001 .db %11000011 .db %11100111 .db %11111111 .db %11111111 .db %01111110 .db %00111100 PacPic3: .db 8,8 .db %01111100 .db %00111110 .db %00011111 .db %00001111 .db %00001111 .db %00011111 .db %00111110 .db %01111100 PacPic4: .db 8,8 .db %00111100 .db %01111110 .db %11111111 .db %11111111 .db %11100111 .db %11000011 .db %10000001 .db %00000000 PacPic5: .db 8,8 .db %00111100 .db %01111110 .db %11111111 .db %11111111 .db %11111111 .db %11111111 .db %01111110 .db %00111100 Ghost: .db 8,8 .db %00111100 .db %01000010 .db %10000001 .db %10100101 .db %10000001 .db %10000001 .db %11010101 .db %10101010 Pop: .db 8,8 .db %00000000 .db %01000010 .db %00100100 .db %00000000 .db %00000000 .db %00100100 .db %01000010 .db %00000000 MainTitle: .db 8,48 .db %11111000,%00100000,%01111100,%00100000,%10000100,%00100011 .db %11001100,%01110000,%11111000,%00110001,%10001110,%00110011 .db %11001100,%01110001,%11110000,%00111011,%10001110,%00111011 .db %11111100,%11111001,%11100011,%10111111,%10011111,%00111111 .db %11111000,%11011001,%11100011,%10111111,%10011011,%00111111 .db %11100001,%11011101,%11110000,%00111111,%10111011,%10111111 .db %11100001,%11111100,%11111000,%00111111,%10111111,%10111111 .db %11100001,%11111100,%01111100,%00111011,%10111111,%10111111 DeadPac: .db 20,24 .db %00010000,%00000000,%00001000 .db %00111000,%00000000,%00011100 .db %00111100,%00000000,%00111100 .db %01111110,%00000000,%01111110 .db %01111111,%00000000,%11111110 .db %11111111,%10000001,%11111111 .db %11011101,%11000011,%11111111 .db %11101011,%11100111,%11111111 .db %11110111,%11111111,%11111111 .db %11101011,%11111111,%11111111 .db %11011101,%11111111,%11111111 .db %01111111,%11111111,%11111110 .db %01111111,%11111111,%11111110 .db %00111111,%11111111,%11111100 .db %00111111,%11111111,%11111100 .db %00011111,%11111111,%11111000 .db %00001111,%11111111,%11110000 .db %00000111,%11111111,%11100000 .db %00000001,%11111111,%10000000 .db %00000000,%00111100,%00000000 Copyright: .db 8,8 .db %00000000 .db %00111110 .db %01000001 .db %01011101 .db %01010001 .db %01011101 .db %01000001 .db %00111110 LvlCounter: .db 4,4 .db %01100000 .db %10010000 .db %10110000 .db %01100000 ;################ ;# Variable RAM # ;################ Storage =9872h ; .db 0,0,0,0,0 LastKey =Storage+5 ; .db 0 CurrentKey =LastKey+1 ; .db 0 PacData =CurrentKey+1 ; .db 0,0 ;X and Y ; .db 0 ;Open or Closed ; .db 0 ;Sprite Index ; .db 0,0 ;DX and DY Ghost1Data =PacData+6 ; .db 0,0 ;X and Y ; .db 0,0 ;DX and DY ; .db 0,0 ;PX and PY Ghost2Data =Ghost1Data+6 ; .db 0,0 ;X and Y ; .db 0,0 ;DX and DY ; .db 0,0 ;PX and PY Ghost3Data =Ghost2Data+6 ; .db 0,0 ;X and Y ; .db 0,0 ;DX and DY ; .db 0,0 ;PX and PY DotNumber =Ghost3Data+6 ; .db 0 Name =DotNumber+1 ; .db 0,0,0 Save_sp =Name+3 ; .db 0,0 LevelRAM =Save_sp+2 ; .db 0,0,0,0,0,0,0,0,0,0,0 ; .db 0,0,0,0,0,0,0,0,0,0,0 ; .db 0,0,0,0,0,0,0,0,0,0,0 ; .db 0,0,0,0,0,0,0,0,0,0,0 ; .db 0,0,0,0,0,0,0,0,0,0,0 ; .db 0,0,0,0,0,0,0,0,0,0,0 ; .db 0,0,0,0,0,0,0,0,0,0,0 Lives =LevelRAM+77 ; .db 0 Speed =Lives+1 ; .db 0 GhostRAM =Speed+1 ; .db 0,0 ; .db 0,0 ; .db 0,0 Score =GhostRAM+6 ; .db 0,0 Level =Score+2 ; .db 0,0 PSStart =Level+2 PSName1 =PSStart ; .db 0,0,0,0 PSScore1 =PSName1+4 ; .db 0,0 PSName2 =PSScore1+2 ; .db 0,0,0,0 PSScore2 =PSName2+4 ; .db 0,0 PSName3 =PSScore2+2 ; .db 0,0,0,0 PSScore3 =PSName3+4 ; .db 0,0 PSEnd =PSScore3+2 .end END