;Urane 0.01 par Eric Piel le 21 avril 98 ;Urane 0.02 le 23 juin 98 ;Urane 1.00 le 27 aout 98 .INCLUDE CRASH82.INC .db "Urane",0 LigneColli = TEXT_MEM + 16 LigneEntree = TEXT_MEM + (16*7) Vaisseau_X = FREE_A1 ;1 byte Vitesse = FREE_A1 + 1 ;1 byte ;speed Vit_L = FREE_A1 + 2 ;1 byte ;Time before speed change Score = FREE_A1 + 3 ;1 byte set 1,(IY+0Dh) res 2,(IY+0Dh) call CR_GRBCopy ;clear screen ld hl,$3607 ld (Vaisseau_X),hl ld a,0Ah ld (Vit_L),a Loop: Affichage: ld hl,$0B01 ld (CURSOR_POS),hl ld hl,(Score) ROM_CALL(D_HL_DECI) ld a,(Vaisseau_X) ld h,a ld l,1 ld (CURSOR_POS),hl ld a,'Y' ROM_CALL(TR_CHARPUT) ld hl,$0008 ; xor a ld ($8B30),hl ; ld ($8B2F),a ;Starting row is 0 ; ld a,8 ;or ld hl,$0008\ld($8B30),hl ; ld ($8B30),a ;Last row to scroll is 8 ROM_CALL(SCROLL_UP) ld a,7 ld (CURSOR_ROW),a ld de,LigneEntree call RAND and %00001111 ld h,0 ld l,a add hl,de ld a,5Bh ;Theta ld (hl),a call RAND and %00001111 ld h,0 ld l,a add hl,de ld a,'*' ld (hl),a ROM_CALL(3804h) ;Update current line from text mem from the wonderful work of Mattias Lindqvist & Dines Justesen ld hl,Vit_L dec (hl) jr nz,NoSave ld a,(Vitesse) ld b,a cpl ;the quicker the vessel goes, the longer it is sub 0C0h ld (hl),a ld a,b cp 3 ;avoids less than 0 jr c,NoSave rra ;rra=srl a because carry is reset ld b,a srl b ContDiv2: add a,b srl b ;srl=a/2+a/4+a/8+a/16+a/32=31a/32 jr nz,ContDiv2 ;dec hl ld (Vitesse),a NoSave: ld c,6 KeyLoop: dec c jr z,TestColli ld a,(Vitesse) ld b,a srl b srl b srl b jr z,NoRal Ralentit: halt djnz Ralentit NoRal: call GET_KEY cp G_DEL push bc call z,CR_KHAND pop bc cp K_MODE ret z cp G_MODE ret z ld hl,Vaisseau_X cp G_LEFT ;=K_LEFT jr z,gauche cp K_RIGHT jr z,droite cp G_RIGHT jr nz,KeyLoop droite: ld a,(hl) cp $0F jr z,KeyLoop inc a jr deplac gauche: ld a,(hl) dec a jp m,KeyLoop deplac: ld (hl),a jr KeyLoop TestColli: ld a,(Vaisseau_X) ld hl,LigneColli add a,l ld l,a ld a,(hl) cp 5Bh jr z,Collision cp '*' jp nz,Loop ColUrane: ld hl,Score inc (hl) jp Loop Collision: ld hl,$0703 ld (CURSOR_POS),hl ld hl,(Score) ld a,(HighScore) cp l jr nc,NotHighScore ld a,l ld (HighScore),a NotHighScore: ROM_CALL(D_HL_DECI) ld hl,$0704 ld (CURSOR_POS),hl ld a,(HighScore) ld l,a xor a ld h,a ROM_CALL(D_HL_DECI) ld hl,$0303 ld (CURSOR_POS),hl ld hl,ScoreStr ROM_CALL(D_ZT_STR) ex de,hl ;hl points to HighStr ld hl,$0304 ld (CURSOR_POS),hl ex de,hl ROM_CALL(D_ZT_STR) wait_for_key: call CR_KHAND ;from tunnel for CrASH by Andrew Von Dollen and Hideaki Omuro cp K_LEFT+1 ;If this weren't here, you probably wouldn't see the score screen jr c,wait_for_key ;Right and left are < 3 Fin: set 2,(IY+0Dh) ; set 1,(IY+0Dh) ret ScoreStr: .db "Score:",0 HighStr: .db "High:",0 HighScore: .db 0 .end