home *** CD-ROM | disk | FTP | other *** search
- ;==================================
- ; Cars by Cullen Sauls
- ; My first ASM game =)
- ; Last Updated: 4-11-99
- ; Webpage: http://freeweb.pdq.net/sauls1/
- ; (Visit my webpage to get the most recent version of all my programs!)
- ; E-Mail: sauls1@pdq.net
- ; ICQ: 11130342
- ;
- ; IMPORTANT: This game was made by ME! You are allowed to take pieces of it, but you are NOT allowed
- ; to make changes and distribute a modified source. Any and all changes should be for PERSONAL
- ; USE. If you find a better way of doing soemthing, tell me what and I'll try it out and give
- ; your credit if it works.
- ;==================================
- ;
- #include "asm86.h" ;Standard Include Files
- #include "ti86asm.inc" ;"
- ;
- .org _asm_exec_ram ;Every Program Starts With This
- ;
- ;--- Commentation For Shell ---;
- nop ;identifier for comment/icon
- jp Start
- .dw 1 ;note this is version 1 of the table
- ;0 means just a comment
- .dw title ;pointer to title
- .dw icon ;pointer to icon
- ;---
- Start:
- call _runindicoff ;God I Hate That Thing!
- call _flushallmenus ;Close Any Open Windows
- call _clrLCD ;Clear The Screen
- ld de,$fc00 ;Start Drawing At Top-Left Of Screen
- ld hl,TitleScreen ;Load The TitleScreen Into HL
- ld bc,496 ;496 Bytes To Copy
- ldir ;Draw The Title Screen
- ld de,$202A ;Sets Pen Cursor To (42,32)
- ld (_penCol),de ;"
- ld hl,TitleText ;Load Title Texts Into HL
- call _vputs ;Show Text Menu Style (Small Font)
- ld de,$0005 ;Set Cursor To (5,0)
- ld (_curRow),de ;"
- call _puts ;Show Text
- ld de,$3A0C ;Sets Pen Cursor To (12,58)
- ld (_penCol),de ;"
- call _vputs ;Show Text Menu Style (Small Font)
- ld a,5 ;Load (5,0) Into BC
- ld b,a ;"
- xor a ;"
- ld c,a ;"
- ld de,Car ;Load Car Sprite Into DE
- call PutSprite ;Show It!
- ld a,5 ;Load (5,15) Into BC
- ld b,a ;"
- ld a,15 ;"
- ld c,a ;"
- ld de,Car ;Load Car Sprite Into DE
- call PutSprite ;Show It!
- call WaitForEnterOrSecond ;Call WaitForEnterOrSecond
- BeginGame:
- ld hl,0 ;Set Score To 0
- ld (Score),hl ;"
- ld hl,Walls ;HL Points To Walla Variables
- ld b,8 ;The Following Loop Will Repeat 8 Times
- SetWallsLoop:
- ld a,5 ;Sets All Wall Variables To 5
- ld (hl),a ;"
- inc hl ;"
- djnz SetWallsLoop ;"
- ld a,8 ;A = 8
- ld (CarX),a ;Car Starts at 9th Column
- ld hl,SpeedTable ;Load SpeedTable Into HL
- ;==================================
- ; DoMenu Routine By ACZ Coders Electrum and zoomBlock
- ;==================================
- DoMenu:
- push hl ;_clrLCD Destroys HL
-
- call _clrLCD ;Clears The Screen
-
- ;
- ;--- This Was Added By Me To Show The High Score While You Choose Your Speed ---;
- ld hl,$3A29 ;Set PenCol To (39,55)
- ld (_penCol),hl ;"
- ld hl,HiScrStr ;Loads The String HiScrStr Into HL
- call _vputs ;Show It Menu Style (Small Font)
- ld hl,$3A61 ;Set PenCol To (97,58)
- ld (_penCol),hl ;"
- ld hl,HighScore ;Load HighScore Into HL
- call _ldhlind ;Still Dunno What This Does
- ld b,5 ;I Want 5 Didgets With Leading 0's
- call DM_HL_Deci ;Show It Menu Style (Small Font)
- ;---
- pop hl ;Now Restore It
-
- ld c,(hl) ;Get Number Of Entries
-
- inc hl ;Move To Menu Title Text
-
- ld de,$0001 ;Draw At Top, One Char Right
-
- ld (_penCol),de ;Set The Small Font Coords
-
- call _vputs ;Print The Title Text
-
- push hl ;Save Pointer
-
- ld hl,$fc00 ;Point To Video Ram
-
- call DoMenuInv ;Invert The Top Line
-
- pop hl ;Restore Our Pointer
-
- ld b,c ;Load Num Entries For Loop
-
- ld de,$0729 ;Start Printing At Middle Of Second Line
-
- DoMenuDTL:
- ld (_penCol),de ;Set The Font Coords
-
- call _vputs ;Print The Menu Text
-
- ld a,d ;Get The Vertical Coord
-
- add a,7 ;Move To Next Line
-
- ld d,a ;Save New Coord
-
- djnz DoMenuDTL ;Draw All The Text
-
- ld b,1 ;Start Menu At First Entry
-
- call DoMenuInvBar ;Invert It
-
- DoMenuL:
- push bc ;Save Entries And Current Entry
-
- call _getky ;Read Key Presses
-
- pop bc ;Restore It
- cp K_UP ;Did They Press Up?
-
- jr z,DoMenuUp ;Move Menu Bar Up
-
- cp K_DOWN ;Or Was It Down?
-
- jr z,DoMenuDown ;Then Move The Bar Down
-
- cp K_SECOND ;Did They Hit 2nd?
-
- jr z,DoMenuSelect ;Then They Want It
-
- cp K_ENTER ;Some People Like Enter
-
- jr z,DoMenuSelect ;So Check It Too
-
- jr DoMenuL ;They're Just Sitting There, Loop Again
-
- DoMenuUp:
- call DoMenuInvBar ;Invert Current Selection Back To Normal
-
- dec b ;Move Up
-
- jr nz,DoMenuBar ;If It's Zero, We're At The Top
-
- ld b,c ;So Move To The Bottom
-
- jr DoMenuBar ;Handle Menu Bar
-
- DoMenuDown:
- call DoMenuInvBar ;Same As Up, Go Back To Normal Text
-
- ld a,c ;Get Current Entry For Check
-
- cp b ;At The Bottom?
-
- jr z,DoMenuDownT ;Then Move To The Top
-
- inc b ;Move Down
-
- jr DoMenuBar ;Handle Menu Bar
-
- DoMenuDownT:
- ld b,1 ;Move To The Top
-
- DoMenuBar:
- call DoMenuInvBar ;Invert The New Selection
-
- jr DoMenuL ;Now It's Time To Loop
-
- DoMenuInvBar:
- push bc ;Save Position And Entries
-
- ld h,b ;Get Position
-
- ld l,112 ;There Are 7 Lines Of 16 Bytes Each (7*16 = 112)
-
- call _HtimesL ;Do The Multiply
-
- ld de,$fc00 ;We Need To Add To Video Memory
-
- add hl,de ;Do The Add
-
- call DoMenuInv ;Invert The Line
-
- pop bc ;Restore Position And Entries
-
- ret ;Done Inverting
-
- DoMenuInv:
- ld b,7*16 ;Each Row Is 16 Bytes Wide And Text Is 7 Rows High
-
- DoMenuIL:
- ld a,(hl) ;Get The Byte
-
- cpl ;NOT The Byte--Flips All The Bits
-
- ld (hl),a ;Save The New Byte
-
- inc hl ;Next Byte
-
- djnz DoMenuIL ;Loop For All Bytes
-
- ret ;We're Done With The Invert Loop
-
- DoMenuSelect:
- ;--- Took Out Unnecessary Stuff (Unnecessary For My Program Exclusively) ---;
- dec b ;B = B-1 (Or Speed I Want)
- ld a,4 ;A = 4
- sub b ;A = A-B
- ld (Speed),a ;Speed Set Correctly
- ld hl,$fbff ;Point To Byte Before The Video Memory
- ld de,$ffff ;DE = End Of Video Memory
- ld a,%11111111 ;Here Is The Line I Want To Draw
- Loop:
- inc hl ;HL = HL+1
- ld (hl),a ;Draw Line
- call _cphlde ;Compare HL And DE
- jr nz,Loop ;Routine Will Loop Until HL=DE($ffff)
- SetBlankSpots:
- ld hl,$fc05 ;HL Points To 6th Byte In Video Memory
- xor a ;A = 0
- ld de,12 ;DE = 12
- ld b,64 ;B = 64 (Want To Draw On All 64 Lines
- SBSLoop:
- ld (hl),a ;Clear Byte At HL
- inc hl ;HL = HL+1
- ld (hl),a ;Clear Byte At HL
- inc hl ;HL = HL+1
- ld (hl),a ;Clear Byte At HL
- inc hl ;HL = HL+1
- ld (hl),a ;Clear Byte At HL (Repetative, Ain't It =)
- inc hl ;HL = HL+1
- ld (hl),a ;Clear Byte At HL
- add hl,de ;HL = HL+DE
- djnz SBSLoop ;B = B-1; If B != 0, Go To SBSLoop
- GameStart:
- ld a,7 ;A = 7
- ld b,a ;B = A
- ld a,(CarX) ;A = CarX
- ld c,a ;C = A
- ld de,Car ;Load Car Sprite Into DE
- call PutSprite ;Show It!
- call _getky ;Read Key Presses
- cp K_EXIT ;Was Exit Pressed?
- jp z,End ;If So, Go To End
- cp K_MORE ;Was More Pressed?
- call z,Pause ;If So, Call Pause
- cp K_RIGHT ;Was Right Arrow Pressed?
- call z,MoveRight ;If So, Call MoveRight
- cp K_LEFT ;Was Left Arrow Pressed?
- call z,MoveLeft ;If So, Call MoveLeft
- cp K_DEL ;Was Delete Pressed
- jp z,BeginGame ;If So, Let Them Start Over (Go To BeginGame)
- DrawRoads:
- ld hl,Walls+7 ;Point To Last Wall Variable
- ld b,8 ;Want To Draw On All 8 Rows
- DRLoop:
- dec b ;B = B-1
- ld a,(hl) ;Get Where The Wall Is
- ld c,a ;C = A
- ld de,Side ;Want To Draw The Side Sprite
- push bc ;Save B Cause PutSprite Destroys It
- push af ;Save A Cause PutSprite Destroys It
- push hl ;Save HL
- call PutSprite ;Draw The Sprite
- pop hl ;Save HL
- pop af ;Restore A
- pop bc ;Restore B
- ld a,(hl) ;Get Where The Wall Is
- inc a ;A = A+1
- ld c,a ;C = A
- ld de,Road ;Want To Draw The Road Sprite
- push bc ;Save B
- push af ;Save A
- push hl ;Save HL
- call PutSprite ;Draw The Sprite
- pop hl ;Save HL
- pop af ;Restore A
- pop bc ;Restore C
- ld a,(hl) ;Get Where The Wall Is
- add a,5 ;A = A+5
- ld c,a ;C = A
- ld de,Road ;Want To Draw The Road Sprite
- push bc ;Save B
- push af ;Save A
- push hl ;Save HL
- call PutSprite ;Draw The Sprite
- pop hl ;Restore HL
- pop af ;Restore A
- pop bc ;Restore B
- ld a,(hl) ;Get Where The Wall Is
- add a,6 ;A = A+6
- ld c,a ;C = A
- ld de,Side ;Want To Draw The Side Sprite
- push bc ;Save B
- push af ;Save A
- push hl ;Save HL
- call PutSprite ;Draw The Sprite
- pop hl ;Restore HL
- pop af ;Restore A
- pop bc ;Restore B
- dec hl ;HL = HL-1; The Next Side To Draw (1 Row Down)
- inc b ;B = B+1
- djnz DRLoop ;B = B-1; If B=0, Conctinue, Otherwise, Go To DrawRoads
- ;
- ;--- Shows Your Score In Upper Left ---;
- ld hl,$0000 ;Set PenCol To Upper Left
- ld (_penCol),hl ;"
- ld hl,Score ;HL = Score
- call _ldhlind ;HL = (HL); HL = Number At Address HL
- ld b,5 ;Want It To Print 5 Didgets With Leading 0's
- call DM_HL_Deci ;Show It Menu Style (Small Font)
- ;---
- ld a,7 ;A = 7
- ld b,a ;B = A
- ld a,(CarX) ;A = CarX
- ld c,a ;C = A
- ld de,Car ;Load Car Sprite Into DE
- call PutSprite ;Show It!
- AreYouDead:
- ld a,(CarX) ;A = CarX
- ld b,a ;B = A
- ld a,(Walls+7) ;A = 8th Wall Variable
- cp b ;See If You Hit Left Side
- jp z,IsDead ;If So, You Are Dead =(
- add a,6 ;A = A+6
- cp b ;See If You Hit Right Side
- jp z,IsDead ;If So, You Are Dead =(
- ;
- ;--- Increases Score ---;
- ld hl,(Score) ;HL = Score
- inc hl ;HL = HL+1
- ld (Score),hl ;New Score Is Saved
- ;---
- call Scroll ;Call Scroll Routine
- call SpeedOfGame ;Call SpeedOfGame Routine (Slow Game Accorddingly)
- jp GameStart ;Go Back To GameStart And Begin Loop Again
- ;==================================
- ; Subroutines
- ;==================================
- SpeedOfGame:
- ld a,(Speed) ;A = Speed
- or a ;Is A 0?
- ret z ;Return If So
- ld b,a ;B = A
- SpeedLoop:
- halt ;Slow Game
- djnz SpeedLoop ;Go To SpeedLoop If B != 0
- ret ;Return To Game
- IsDead:
- call _clrLCD ;Clear The Screen
- ld hl,$0000 ;Set Cursor Coords To (0,0)
- ld (_curRow),hl ;"
- ld hl,YouDied ;Load The String YouDied Into HL
- call _puts ;Show It!
- ld hl,$151F ;Sets PenCol To (31,21)
- ld (_penCol),hl ;"
- ld hl,FinalScore ;Load String FinalScore Into HL
- call _vputs ;Display It Menu Style (Small Font)
- ld hl,$154D ;Set PenCol To (77,21)
- ld (_penCol),hl ;"
- ld hl,Score ;Load Your Score Into HL
- call _ldhlind ;HL = (HL); HL = Number At Address HL
- ld b,5 ;Want To Show 5 Didgets With Leading 0's
- call DM_HL_Deci ;Show It Menu Style (Small Font)
- ld hl,$0004 ;Set The Cursor Coords To (4,0)
- ld (_curRow),hl ;"
- ld hl,PlayAgain ;Load The String PlayAgain Into HL
- call _puts ;Show It!
- ld hl,(HighScore) ;Load The Current High Score Into HL
- ld de,(Score) ;DE = Score
- call _cphlde ;Compare HL And DE
- jr nc,NotHighScore ;If Your Score Is Not Higher, Go To NotHighScore
- NewHighScore:
- ld hl,$0000 ;Set Cursor To (0,0)
- ld (_curRow),hl ;"
- ld hl,NewHigh ;Load The String NewHigh Into HL
- call _puts ;Show It!
- call InvTopRows ;Invert Top 2 Large Font Lines
- ld hl,(Score) ;HL = Score
- ld (HighScore),hl ;HighScore = HL
- call SaveHigh ;Save It!
- NotHighScore:
- WaitForAnswer:
- call _getkey ;Wait For A Key To Be Pressed
- cp kF1 ;Was F1 Pressed?
- jp z,BeginGame ;If So, Play Game Again
- cp kF2 ;Was F2 Pressed?
- jr z,End ;If So, Quit Game
- jr WaitForAnswer ;If Neither 1 Or 2 Was Pressed, Go To WaitForAnswer
- WaitForEnterOrSecond:
- call _getky ;Wait For A Key TO Be Pressed
- cp K_ENTER ;Was Enter Pressed?
- ret z ;If So, Return To Game
- cp K_SECOND ;Was 2nd Pressed?
- ret z ;If So, Return To Game
- jr WaitForEnterOrSecond ;If Neither Were Pressed, Go To WaitForEnterOrSecond
- End:
- static_on: ;Static Routine By Macross Software
- ld b, 255 ;I Have No Idea How It Works Right Now =P
- ClearSplit: ;"
- push bc ;"
- LD a, r ;"
- LD h, a ;"
- LD a, r ;"
- LD l, a ;"
- LD de,$fc00 ;"
- LD bc,1024 ;"
- ldir ;"
- pop bc ;"
- djnz ClearSplit ;"
- call _clrLCD ;Clear The LCD
- ld hl,$0000 ;Set Cursor Coords To (0,0)
- ld (_curRow),hl ;"
- ld hl,Programmed ;Load The String Programmed Into HL
- call _puts ;Show It!
- call InvTopRows ;Call InvTopRows Routine
- call _getkey ;Wait For Any Key To Be Pressed
- call _clrLCD ;Clears The Screen
- ret ;Quit Program, Return To Shell/Normal OS
- Pause:
- ld hl,$0000 ;Set Cursor Coords To (0,0)
- ld (_curRow),hl ;"
- ld hl,Paused ;Load The String Paused Into HL
- call _puts ;Show It!
- PauseForMore:
- call _getky ;Reads Key Presses
- cp K_MORE ;Was More Pressed?
- jr nz,PauseForMore ;If It Wasn't, Go To PauseForMore
- ld hl,$fc00 ;HL Points To Video Memory
- ld a,%11111111 ;Line To Draw
- ld b,128 ;Loop Will Repeat 128 Times
- PFMLoop:
- ld (hl),a ;Draw A To Address HL Points To
- inc hl ;HL = HL+1
- djnz PFMLoop ;B = B-1; If B != 0, Go To PFMLoop
- ret ;Return To Game
- MoveRight:
- ld a,(CarX) ;A = CarX
- cp 15 ;Is The Car At Far-Right Already?
- jp z,GameStart ;If So, Return To Game
- ld a,7 ;A = 7
- ld b,a ;B = A
- ld a,(CarX) ;A = CarX
- ld c,a ;C = A
- ld de,Road ;Load Car Sprite Into DE
- call PutSprite ;Show It!
- ld a,(CarX)
- inc a ;A = A+1
- ld (CarX),a ;CarX = A
- ret ;Return To Game
- MoveLeft:
- ld a,(CarX) ;A = CarX
- or a ;Is The Car At Far-Left Already?
- jp z,GameStart ;If So, Return To Game
- ld a,7 ;A = 7
- ld b,a ;B = A
- ld a,(CarX) ;A = CarX
- ld c,a ;C = A
- ld de,Road ;Load Car Sprite Into DE
- call PutSprite ;Show It!
- ld a,(CarX)
- dec a ;A = A-1
- ld (CarX),a ;CarX = A
- ret ;Return To Game
- Scroll:
- ld a,(Walls+6) ;Scrolls Road
- ld (Walls+7),a ;"
- ld a,(Walls+5) ;"
- ld (Walls+6),a ;"
- ld a,(Walls+4) ;"
- ld (Walls+5),a ;"
- ld a,(Walls+3) ;"
- ld (Walls+4),a ;"
- ld a,(Walls+2) ;"
- ld (Walls+3),a ;"
- ld a,(Walls+1) ;"
- ld (Walls+2),a ;"
- ld a,(Walls) ;"
- ld (Walls+1),a ;"
- GetRand:
- ld a,0 ;Low Bound Of Random Number
- call _SetXXOP1 ;OP1 = A
- ld a,7 ;High Bound Of Random Number
- call _SetXXOP2 ;OP2 = A
- call _randint ;Gets A Rondom Integer Between OP1 And OP2 (0 And 7 In This Case)
- call _convop1 ;A = Random Number
- cp 1 ;Was The Random Number 1?
- jr z,Left ;If So, Go To Left
- cp 2 ;Was The Random Number 2?
- jr z,Left ;If So, Go To Left
- cp 3 ;Was The Random Number 3?
- jr z,Left ;If So, Go To Left
- cp 4 ;Was The Random Number 4?
- jr z,Right ;If So, Go To Right
- cp 5 ;Was The Random Number 5?
- jr z,Right ;If So, Go To Right
- cp 6 ;Was The Random Number 6?
- jr z,Right ;If So, Go To Right
- ret nz ;If None Of The Above, Road Continues Straight
- Left:
- ld a,(Walls) ;A = Walls
- or a ;Is Road Already At Far-Left?
- ret z ;If So, Return To Game
- dec a ;A = A-1
- ld (Walls),a ;Walls = A
- ret ;Return To Game
- Right:
- ld a,(Walls) ;A = Walls
- cp 9 ;Is Road Already At Far-Right?
- ret z ;If So, Return To Game
- inc a ;A = A+1
- ld (Walls),a ;Walls = A
- ret ;Return To Game
- DM_HL_Deci:
- ld de,String+5 ;Need 6 Bytes
- xor a ;A = 0
- ld (de),a ;Address That DE Points To = 0
- RepUnp:
- dec de ;DE = DE-1
- call _divHLby10 ;HL = HL/10; A = Remainder
- add a,48 ;A = A+48 ('0' = 48)
- ld (de),a ;Address That DE Points To = A
- djnz RepUnp ;B = B-1; If B != 0, Go To RepUnp
- ex de,hl ;HL = DE; DE = HL
- jp _vputs ;Display The Number
- InvTopRows:
- ld hl,$fc00 ;HL Points To Video Memory
- ld a,%11111111 ;Line To Draw
- ld (hl),a ;Address That HL Points To = A
- inc hl ;HL = HL+1
- ld b,255 ;B = 255
- ITRLoop:
- ld a,(hl) ;A = What's At HL's Address
- cpl ;Invert The Pixels
- ld (hl),a ;What's At HL's Address = A
- inc hl ;HL = HL+1
- djnz ITRLoop ;B = B-1; If B != 0, Go To ITRLoop
- ret ;Return To Where Routine Was Called
- ;
- ;--- SaveHigh Was Taken From ZTetris Also, But Slightly Modified ---;
- SaveHigh: ;Saves The New High Score
- ld hl,ProgName ;All This Stuff Is To Make Sure The Hiscore Table
- rst 20h ;And Resume Stuff Are Stored In The Variable
- rst 10h ;Dunno What This Does---I Didn't Write Routine =)
- ex de,hl ;HL -> Start Of Variable
- ld a,b ;A = B
- ld de,HighScore-$D748+4 ;DE = Relative Offset To Stuff To Store (-4)
- add hl,de ;HL = HL+DE
- adc a,0 ;Next Block If Necessary
- ld de,HighScore ;DE = Start Of Bytes To Copy
- ld b,2 ;2 Bytes To Copy
- RepCopy:
- push af ;Save AF
- push hl ;Save HL
- call $46C3 ;Call Whatever Is At $46C3
- ld a,(de) ;Read
- ld (hl),a ;And Save It In The Real Variable
- pop hl ;Restore HL
- pop af ;Restore AF
- call $4637 ;Call Whatever Is At $4637
- inc de ;DE = DE+1
- djnz RepCopy ;B = B-1; If B != 0, Go To RepCopy
- ret ;Return To Calling Routine
- ;==================================
- ; Put Sprite
- ;==================================
- PutSprite:
- push de ;** We Need To Save DE
- ld hl,$fb80 ;Point To The First Byte In Video Memory - 128 Bytes
- inc b ;B=B+1
- ld de,$80 ;Number Of Bytes Per Line
- YCoord:
- add hl,de ;HL = HL+DE
- djnz YCoord ;B=B-1; If B != 0, Go To YCoord
- add hl,bc ;Now HL Points To VID_MEM + OFFSET
- pop de ;** Now DE Still Points To Pprite
- ld b,8 ; Repeat 8 Times
- CopySprite:
- push bc ;Save The Counter
- ld a,(de) ;Get One Byte Of Sprite
- ld (hl),a ;Copy It To Video Mem
- inc de ;Point To Next Byte Of Sprite
- ld bc,16 ;"
- add hl,bc ;Offset Vid Mem By 16 Bytes (Go Next Line Down)
- pop bc ;Get The Counter Back
- djnz CopySprite ;Do The Loop
- ret ;End Of The Routine
- ;==================================
- ; Strings
- ;==================================
- TitleText:
- .db "Version 1.6",0
- .db " By Cullen Sauls "
- .db " sauls1@pdq.net",0
- .db "http://freeweb.pdq.net/sauls1",0
- Paused:
- .db "Paused ",0
- NewHigh:
- .db " Congratulations!! "
- .db " A New High Score! ",0
- YouDied:
- .db " You Crashed",0
- FinalScore:
- .db "Final Score:",0
- PlayAgain:
- .db " Play Again? "
- .db " F1: Yes "
- .db " F2: No",0
- Programmed:
- .db " Programmed by "
- .db " Cullen Sauls",0
- HiScrStr:
- .db "High Score:",0
- ;==================================
- ; Variables
- ;==================================
- Walls:
- .db 5,5,5,5,5,5,5,5 ;8 Bytes, For All 8 Rows Of Screen
- String = $C126 ;6 Bytes
- CarX: .db 8 ;1 Byte
- Speed: .db 0 ;1 Byte
- Score: .dw 0 ;Word (2 Bytes)
- HighScore: .dw 0 ;Word (2 Bytes)
- ProgName: .db $12,4,"Cars"
- ;==================================
- ; Data For Shell Comments
- ;==================================
- title:
- .db "CARS version 1.6 by Cullen Sauls",0
- icon:
- .db 8,1 ;this is the height, then the width (in bytes)
- .db %00011000 ;then a bitmap
- .db %01011010 ;as with comments, this can be placed anywhere
- .db %01111110
- .db %01011010
- .db %00011000
- .db %11011011
- .db %11111111
- .db %11000011
- ;==================================
- ; Table Data {had to change the string commands to .db (were .dw)}
- ;==================================
- SpeedTable:
- .db 5 ;num entries
-
- .db "Choose Your Speed:",0 ;title text (at the top)
-
- .db "Wheres the gas?",0 ;text for each entry
-
- .db "Driving Miss Daisey",0 ;"
- .db "Freeway",0 ;"
- .db "Driving Over Miss Daisey",0 ;"
- .db "Wheres the brake?!",0 ;"
- ;==================================
- ; Title Screen Data
- ;==================================
- TitleScreen:
- .db 0,0,0,%11,%11111111,%11111111,%11111111,%11111111,%11111111,%11111111,%11111111,%11111111,%11100000,0,0,0
- .db 0,0,0,%11,%11111111,%11111111,%11111111,%11111111,%11111111,%11111111,%11111111,%11111111,%11100000,0,0,0
- .db 0,0,0,%11,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%01100000,0,0,0
- .db 0,0,0,%11,%00001111,%11111111,%00001111,%11111000,%01111111,%11111000,%00001111,%11111111,%01100000,0,0,0
- .db 0,0,0,%11,%00011111,%11111111,%00011111,%11111100,%01111111,%11111100,%00011111,%11111111,%01100000,0,0,0
- .db 0,0,0,%11,%00111111,%11111111,%00111111,%11111110,%01111111,%11111110,%00111111,%11111111,%01100000,0,0,0
- .db 0,0,0,%11,%01111111,%11111111,%01111111,%11111111,%01111111,%11111111,%01111111,%11111111,%01100000,0,0,0
- .db 0,0,0,%11,%01111111,%11111111,%01111111,%11111111,%01111111,%11111111,%01111111,%11111111,%01100000,0,0,0
- .db 0,0,0,%11,%00000000,%00000000,%00000000,%00011111,%00000000,%00011111,%00000000,%00000000,%01100000,0,0,0
- .db 0,0,0,%11,%00000000,%00000000,%00000000,%00011111,%00000000,%00011111,%00000000,%00000000,%01100000,0,0,0
- .db 0,0,0,%11,%00000000,%00000000,%00000000,%00011111,%00000000,%00011111,%00000000,%00000000,%01100000,0,0,0
- .db 0,0,0,%11,%01111100,%00000000,%01111100,%00011111,%01111100,%00011111,%01111100,%00000000,%01100000,0,0,0
- .db 0,0,0,%11,%01111100,%00000000,%01111100,%00011111,%01111100,%00011111,%01111100,%00000000,%01100000,0,0,0
- .db 0,0,0,%11,%01111100,%00000000,%01111111,%11111111,%01111111,%11111110,%01111111,%11111000,%01100000,0,0,0
- .db 0,0,0,%11,%01111100,%00000000,%01111111,%11111111,%01111111,%11111100,%01111111,%11111100,%01100000,0,0,0
- .db 0,0,0,%11,%01111100,%00000000,%01111111,%11111111,%01111111,%11111000,%00111111,%11111110,%01100000,0,0,0
- .db 0,0,0,%11,%01111100,%00000000,%01111111,%11111111,%01111111,%11111100,%00011111,%11111111,%01100000,0,0,0
- .db 0,0,0,%11,%01111100,%00000000,%01111111,%11111111,%01111111,%11111110,%00001111,%11111111,%01100000,0,0,0
- .db 0,0,0,%11,%01111100,%00000000,%01111100,%00011111,%01111100,%00011111,%00000000,%00011111,%01100000,0,0,0
- .db 0,0,0,%11,%01111100,%00000000,%01111100,%00011111,%01111100,%00011111,%00000000,%00011111,%01100000,0,0,0
- .db 0,0,0,%11,%01111100,%00000000,%01111100,%00011111,%01111100,%00011111,%00000000,%00011111,%01100000,0,0,0
- .db 0,0,0,%11,%01111100,%00000000,%01111100,%00011111,%01111100,%00011111,%00000000,%00011111,%01100000,0,0,0
- .db 0,0,0,%11,%01111100,%00000000,%01111100,%00011111,%01111100,%00011111,%00000000,%00011111,%01100000,0,0,0
- .db 0,0,0,%11,%01111111,%11111111,%01111100,%00011111,%01111100,%00011111,%01111111,%11111111,%01100000,0,0,0
- .db 0,0,0,%11,%01111111,%11111111,%01111100,%00011111,%01111100,%00011111,%01111111,%11111111,%01100000,0,0,0
- .db 0,0,0,%11,%00111111,%11111111,%01111100,%00011111,%01111100,%00011111,%01111111,%11111110,%01100000,0,0,0
- .db 0,0,0,%11,%00011111,%11111111,%01111100,%00011111,%01111100,%00011111,%01111111,%11111100,%01100000,0,0,0
- .db 0,0,0,%11,%00001111,%11111111,%01111100,%00011111,%01111100,%00011111,%01111111,%11111000,%01100000,0,0,0
- .db 0,0,0,%11,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%01100000,0,0,0
- .db 0,0,0,%11,%11111111,%11111111,%11111111,%11111111,%11111111,%11111111,%11111111,%11111111,%11100000,0,0,0
- .db 0,0,0,%11,%11111111,%11111111,%11111111,%11111111,%11111111,%11111111,%11111111,%11111111,%11100000,0,0,0
- ;==================================
- ; Sprites
- ;==================================
- Road:
- .db %00000000
- .db %00000000
- .db %00000000
- .db %00000000
- .db %00000000
- .db %00000000
- .db %00000000
- .db %00000000
- Side:
- .db %11111111
- .db %11111111
- .db %11111111
- .db %11111111
- .db %11111111
- .db %11111111
- .db %11111111
- .db %11111111
- Car:
- .db %00011000
- .db %01011010
- .db %01111110
- .db %01011010
- .db %00011000
- .db %11011011
- .db %11111111
- .db %11000011
- ;
- .message Copyright ⌐ 1999 Cullen Sauls
- ;
- .end
-
- ;********** THAT'S IT!!!!! **********;
-
- ;Special Thanks:
- ;Matt Johnson for his 86 ASM tutorials.
- ;Trent Lillehaugen for his Frogger tutorial.
- ;And anyone else who helped me with my questions.
-