; xxxxxx xxxxxxx xxx xxx ; DDDDDDxx JJJJJJJ MMM X MMMx ; DDx DDx JJJx MMxM M MMx ; DDx DDx xxJJJx MMx M MMx ; DDx DD JJxJJJ MMx MMx ; DDDDDD JJJJ MM MM ; ; Dumb Jumping Man ; ; v1.1 for ASH 3.0 - TI-82 Assembly Shell ; ; By Don Barnes ; ; (B) 1995,1996,1997 ; ; All graphics routines from graph.inc and graph.h ; were written by Dines Justesen. ; ; (B) 1997 #INCLUDE "ti82.h" #INCLUDE "graph.h" ;----------------- ; TEXT MEM STUFF ;----------------- .org START_ADDR .db "Dumb Jumping Man",0 johny = TEXT_MEM ; john's y pos johnx = TEXT_MEM+1 ; " x pos vy = TEXT_MEM+2 ; y velocity vx = TEXT_MEM+3 ; x velocity padx = TEXT_MEM+4 ; pad xpos gravity = TEXT_MEM+5 ; gravity counter level = TEXT_MEM+6 ; gravity level score = TEXT_MEM+7 ; score lives = TEXT_MEM+$C ; lives speed = TEXT_MEM+$E ; used for menu screen / speed ;high = TEXT_MEM+$10 ;high score ;--------------------- ; START OF ASH PROGRAM ;--------------------- GRAPH_START LD A,3 LD (speed),A ; set speed to default LD HL,$0810 ; LD ($8215),HL ; Move graphics cursor to ($10,$0c)=>(16,12) LD HL,DumbJumpingMan ; Point HL at string ROM_CALL(D_ZM_STR) ; Call ROMCALL LD HL,$1018 ; LD ($8215),HL ; Move graphics cursor LD HL,Donman ; Point HL at string ROM_CALL(D_ZM_STR) ; Call LD HL,$1827 ; LD ($8215),HL ; Move graphics cursor LD HL,Ver ; Point HL at string ROM_CALL(D_ZM_STR) ; Call LD HL,$2d0e ; LD ($8215),HL ; Move graphics cursor LD HL,select ; Point HL at string ROM_CALL(D_ZM_STR) ; Call SELECTLOOP LD A,(speed) cp 1 JP Z,Speed5s cp 2 JP Z,Speed4s cp 3 JP Z,Speed3s cp 4 JP Z,Speed2s cp 5 JP Z,Speed1s afterst ROM_CALL(KEY_HAND) ; GET the KEY CP $3 jr nz,notleft ld a,(speed) cp 1 jr z,SELECTLOOP dec a ld (speed),a jr SELECTLOOP notleft CP $4 jr nz,notright ld a,(speed) cp 5 jr z,SELECTLOOP inc a ld (speed),a jr SELECTLOOP notright CP $5 ; Was enter pressed? JR NZ,SELECTLOOP ; If not, loop LD a,(speed) SLA A SLA A SLA A SLA A ld (speed),a ROM_CALL(CLEARLCD) LD A,3 LD (level),a SUB A LD (score),A LD A,3 LD (lives),A ; ------------- NExT LIFE-------------- nextlife: sub a ld ($800c),a ld ($800d),a LD HL,Final ;Point HL at string ROM_CALL(D_ZT_STR) ; Call ROMCALL ld hl,(score) ROM_CALL(D_HL_DECI) LD HL,Lives ;Point HL at string ROM_CALL(D_ZT_STR) ; Call ROMCALL ld hl,(lives) ROM_CALL(D_HL_DECI) LD HL,$2002 ; LD ($8215),HL ; Move graphics cursor to ($10,$0c)=>(16,12) LD HL,crack ; Point HL at string ROM_CALL(D_ZM_STR) ; Call ROMCALL TITLELOOP2 CALL GET_KEY ; GET the KEY CP $37 ; Was mode pressed? JP Z,ending ; If so, end CP $9 ; Was enter pressed? JR NZ,TITLELOOP2 ; If not, loop ROM_CALL(CLEARLCD) ;draw background LD D,1 LD A,63 LD B,A background1: LD C,B LD B,D CALL Point_on ; put her back!!!! LD A,B ADD A,93 LD B,A CALL Point_on LD B,C DJNZ background1 LD D,0 LD A,62 LD B,A background2: LD C,B LD B,D CALL Point_on ; put her back!!!! LD A,B ADD A,95 LD B,A CALL Point_on LD B,C DEC B DEC B LD A,B CP 0 jr nz,background2 LD A,20 LD (johnx),A LD A,40 LD (johny),A LD A,1 LD (vx),A LD A,0 LD (vy),A LD A,40 LD (padx),A ; pad's starting coords... LD B,A LD A,5 LD C,A CALL Point_on INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on ld a,(level) ld (gravity),a ; ------------------------------- MAIN LOOP -------------------------------- MAINLOOP: LD BC, (johny) ; get john's coords... ld a,c cp 55 jr nc,offscreen2 CALL Point_off INC C INC B CALL Point_off INC C INC B CALL Point_off INC C CALL Point_off INC C CALL Point_off INC C CALL Point_off INC C CALL Point_off DEC B CALL Point_off DEC C CALL Point_off offscreen2 LD A,(vx) LD B,A LD A,(johnx) ADD A,B ;was b LD (johnx),A cp 89 JR NC,yesh cp 4 JR C,yesh JR noth yesh ld A,(vx) neg ld (vx),A noth: LD A,(vy) LD B,A LD A,(johny) ADD A,B ;was b LD (johny),A ld a,(johny) cp 150 jr nc,floor cp 4 jr nc,nofloor floor ; JP C,ending ld a,(padx) ld b,a ld a,(johnx) sub b inc a inc a inc a cp 0 JP Z,not_go JP C,game_over not_go cp 16 JP NC,game_over ld a,(vx) cp 0 jr z,weak ld a,(score) ;ADD SCORE inc a ld (score),a weak sub a ;JOHN MOTION CHANGES out (1),a in a,(1) cp 0 ; Were no keys pressed? JR Z,nomkeys ; If so loop bit 3,a ; Was up pressed? JR NZ,noup ; If so loop ld a,(vy) dec a dec a ld (vy),a jr nomkeys noup bit 1,a ; Was left pressed? JR NZ,noleft ld a,(vx) dec a ld (vx),a jr nomkeys noleft bit 2,a ; Was right pressed? JR NZ,nomkeys ld a,(vx) inc a ld (vx),a nomkeys ld a,(vy) ;BOUNCE JOHN neg dec a ld (vy),a ld a,4 ld (johny),a nofloor ld a,(gravity) cp 1 JR NZ,nogrv ; ld A,(vy) ; cp -3 ; JR C,nogrv ld a,(vy) dec a ld (vy),a nogrv ld a,(gravity) dec a cp 0 jr nz,grvyok ld a,(level) grvyok ld (gravity),a LD BC, (johny) ; get johns coords ld a,c cp 55 jr nc,offscreen CALL Point_on INC C INC B CALL Point_on INC C INC B CALL Point_on INC C CALL Point_on INC C CALL Point_on INC C CALL Point_on INC C CALL Point_on DEC B CALL Point_on DEC C CALL Point_on offscreen CALL Delay TestKeys: sub a out (1),a in a,(1) cp 0 ; Were no keys pressed? JP Z,MAINLOOP ; If so loop bit 6,a ; Was MODE pressed? JP Z,ending ; If not, go ld b,a PUSH BC LD A,(padx) ; get pad's coords... LD B,A LD A,5 LD C,A CALL Point_off INC B CALL Point_off INC B CALL Point_off INC B CALL Point_off INC B CALL Point_off INC B CALL Point_off INC B CALL Point_off INC B CALL Point_off INC B CALL Point_off INC B CALL Point_off INC B CALL Point_off INC B CALL Point_off\ POP BC ld a,b anodj bit 2,a ; Was right pressed? JP Z,rightpad bit 1,a ; Was left pressed? JP Z,leftpad afterpadmove: LD A,(padx) cp 2 jr z,okleft jr nc,okleft ld a,2 ld (padx),a jr okright okleft cp 82 jr c,okright ld a,82 ld (padx),a okright LD A,(padx) ; get pad's coords... LD B,A LD A,5 LD C,A CALL Point_on ; put her back!!!! INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on INC B CALL Point_on ; CP $37 ; Was mode pressed? JP MAINLOOP ; If not, loop ending RET rightpad ld A,(padx) inc A inc A ld (padx),A jr afterpadmove leftpad ld A,(padx) dec A dec A ld (padx),A JP afterpadmove game_over: ROM_CALL(CLEARLCD) ld a,(lives) dec a ld (lives),a cp 0 JP NZ,nextlife TEXT_START LD HL,$101F ; LD ($8215),HL ; Move graphics cursor LD HL,GOver ; Point HL at string ROM_CALL(D_ZM_STR) ; Call sub a ld ($800C),a ld ($800D),a LD HL,Final ;Point HL at string ROM_CALL(D_ZT_STR) ; Call ROMCALL ld hl,(score) ROM_CALL(D_HL_DECI) LD HL,$200B ; LD ($8215),HL ; Move graphics cursor to ($10,$0c)=>(16,12) LD HL,waytogo ; Point HL at string ROM_CALL(D_ZM_STR) ; Call ROMCALL EndLOOP3 CALL GET_KEY ; GET the KEY CP $37 ; Was MODE pressed? JR Z,EndLOOP4 ; If not, loop CP $9 ; Was enter pressed? JR NZ,EndLOOP3 ; If not, loop EndLOOP4 JP ending Speed1s: LD HL,$3418 ; LD ($8215),HL ; Move graphics cursor LD HL,speed1 ; Point HL at string ROM_CALL(D_ZM_STR) ; Call JP afterst Speed2s: LD HL,$3418 ; LD ($8215),HL ; Move graphics cursor LD HL,speed2 ; Point HL at string ROM_CALL(D_ZM_STR) ; Call JP afterst Speed3s: LD HL,$3418 ; LD ($8215),HL ; Move graphics cursor LD HL,speed3 ; Point HL at string ROM_CALL(D_ZM_STR) ; Call JP afterst Speed4s: LD HL,$3418 ; LD ($8215),HL ; Move graphics cursor LD HL,speed4 ; Point HL at string ROM_CALL(D_ZM_STR) ; Call JP afterst Speed5s: LD HL,$3418 ; LD ($8215),HL ; Move graphics cursor LD HL,speed5 ; Point HL at string ROM_CALL(D_ZM_STR) ; Call JP afterst ; ** Delay routine "borrowed" from Bounce by Dan Eble ** Delay: PUSH AF PUSH BC ld BC,$0000 ld a,(speed) ld b,a DelayLoop: DEC BC LD A, B OR C JR NZ, DelayLoop POP BC POP AF RET ;--------------------- ; STRINGS and INCLUDES ;--------------------- #INCLUDE "graph.inc" DumbJumpingMan: .db "Dumb Jumping Man",0 Donman: .db "By Don Barnes",0 Ver: .db "v1.1",0 GOver .db "Game Over",0 Final .db "Score: ",0 Lives .db " Lives: ",0 crack .db "I'm a pterodactyl on crack!",0 waytogo: .db "Way to go, Fonzareli!",0 select .db "Select a speed (U/D):",0 speed1 .db "Slow as dirt" .db " ",0 speed2 .db "Politically Correct ",0 speed3 .db "Regualar " .db " ",0 speed4 .db "Helter Skelter ",0 speed5 .db "Wowzers!!!! ",0 scorestr .db 0,0,0,0,0,0 .END .END .END .END