From: Mischa Poslawsky Date: Fri, 14 Dec 2001 15:45:58 +0000 (+0100) Subject: wormy 0.96.1C14 X-Git-Url: http://git.shiar.nl/wormy.git/commitdiff_plain/26fb52490a2e38fde7ebf17e201773c254ba9929 wormy 0.96.1C14 --- diff --git a/wormy.z80 b/wormy.z80 index 8af33c2..22fc918 100644 --- a/wormy.z80 +++ b/wormy.z80 @@ -1,6 +1,6 @@ ; Title : Wormy -; Version : 95% (0.95.B09) -; Release Date : OOHHhhh... soon?!? +; Version : 96% (0.96.C14) +; Release Date : UUHHhhh... soon?!? ; Filename : wormy.86p (5kb) ; Author(s) : Shiar ; Email Address : wormy@shiar.org @@ -15,7 +15,7 @@ ;----------- TO-DO ----------- ;----------------------------- -; 95% = DONE +; 96% = DONE ; [* internal levels ] ; [ * check levels/gametype ] @@ -145,7 +145,7 @@ start: .dw WormIcon WormTxt: - .db "WORMY by SHIAR -- beta 95%",0 + .db "WORMY by SHIAR -- 96% C14",0 WormIcon: .db 8,2 .db %00000000,%00111100 @@ -505,9 +505,10 @@ dispmainmenu: ;Mode|Level|Limit|Worms|worm #|controls ; jr dispmenucommon ;cal +dispmenucommon_: + ld b,36*16/4 dispmenucommon: ld de,$FD80 ;begin pos - ld b,36*16/3 xor a clroldmenuloop: ld (de),a @@ -516,13 +517,15 @@ clroldmenuloop: inc de ld (de),a inc de + ld (de),a + inc de dnz clroldmenuloop - ld b,6 + ld b,(ix) dispmenuloop: - ld d,(ix) + ld d,(ix+1) inc ix - ld e,(ix) + ld e,(ix+1) inc ix ld (_penCol),de cal _vputs @@ -530,9 +533,17 @@ dispmenuloop: ; ld b,0 ;b=menu# ret -hr: ;draw horizontal line at hl +;hr: ;draw horizontal line at hl +; ld b,16 +; jp menuinvloop + +hr: ld b,16 - jp menuinvloop +hrloop: + ld (hl),-1 + inc hl + dnz hrloop + ret ;--- menu loop --- @@ -540,7 +551,7 @@ dispoptionmenu: ld hl,txtoMenu ld ix,posoMenu ;Back|Lives|Limit|Speed|Rotation|Growth - cal dispmenucommon + cal dispmenucommon_ dispomenusets: cal clrold @@ -1828,76 +1839,93 @@ HandleKeys: out (1),a in a,(1) rla ;MORE? - jr c,CheckExit - ld bc,$0103 - out (c),b - halt ;pause/off - ld b,11 - out (c),b - + jr nc,disppausemenu CheckExit: rla ;=$17 (c=EXIT-key) ;or$A7 (c=0) jp c,GameLoop - jr Exit + jp Exit ;jr? -WormDead: -#ifdef invincible - jp stopworm -#else - ld a,2 - ld (flashtime),a - ld (ix+delay),respawndelay +;------- pause menu ------- -thislevel =$+1 - ld hl,0 - ld de,0 -handledworm =$-2 - add hl,de - add hl,de - add hl,de - ld a,(hl) - inc hl - ld (ix+heading),a - ld a,(hl) - ld (ix+pos),a ;y - inc hl - ld a,(hl) - ld (ix+pos+1),a ;x - xor a - ld (ix+pos2),a ;y2 - ld (ix+pos2+1),a ;x2 +disppausemenu: + ld hl,txtpMenu + ld ix,pospMenu +;Resume|Turn Off|Contrast|Exit|| + ld b,25*16/4 + cal dispmenucommon + ld hl,$FC00+$170 ;(*,23) + cal hr + ld hl,$FC00+$310 ;(*,49) + cal hr + cal menupos - inc (ix+died) - dec (ix+lives) +pauseMenu: + psh bc +pmenuwaitkey: + cal ubergetkey + or a + jr z,pmenuwaitkey + pop bc ;GET_KEY + ld d,b ;c=new b + cp K_UP + jr nz,pmenunotup + dec d +pmenunotup: + cp K_DOWN + jr nz,pmenunotdown + inc d +pmenunotdown: psh af - ld de,10 - ld a,(Gametype) - cp gamectf ;ctf no death penalty - cal nz,DecScore + cal menupos + ld a,d ;new pos + and 3 ;0-3 + ld b,a + cal menupos pop af - ret nz ;HandleWorm done - ld a,(wormbeglives) - or a ;0=no live limit - ret z ;don't end game - ld a,(gameCar) - and _datatime - jr z,anyworm ;quit at any worm's death - ld a,(nrworms) ;timematch: all worms must've died - ld b,a ;# of worms - ld hl,worm1+lives-(worm2-worm1) - ld de,worm2-worm1 - xor a ;check for 0 lives -checklives: - add hl,de ;next worm - cp (hl) ;lives==0? - ret nz ;any >0: don't exit - dnz checklives -anyworm: - ld a,$A7 ;exit@end of turn - ld (CheckExit),a ;set exit state - ret ;finish turn -#endif + cp K_ENTER + jr z,pselect + cp K_SECOND + jr nz,notpselect +pselect: + ld a,b + or a ;1: continue + jr z,donepausing + dec a ;2: off + jr z,turnoff + dec a ;3: contrast + jr z,pauseMenu + jr Exit ;4: exit +notpselect + cp K_EXIT + jr z,donepausing + ld hl,CONTRAST + sub K_LEFT + jr z,contrastdown + dec a ;K_RIGHT + jr nz,pauseMenu +contrastup: + inc (hl) + jr setcontrast +contrastdown: + dec (hl) +setcontrast: + ld a,(hl) + out (2),a + jr pauseMenu + +turnoff: + ld bc,$0103 + out (c),b + halt ;pause/off + ld b,11 + out (c),b + ld b,1 + jr pauseMenu + +donepausing: + cal releasekeys + jp GameLoop Exit: cal releasekeys @@ -2796,6 +2824,64 @@ Seed =$+1 add a,2 ret +WormDead: +#ifdef invincible + jp stopworm +#else + ld a,2 + ld (flashtime),a + ld (ix+delay),respawndelay + +thislevel =$+1 + ld hl,0 + ld de,0 +handledworm =$-2 + add hl,de + add hl,de + add hl,de + ld a,(hl) + inc hl + ld (ix+heading),a + ld a,(hl) + ld (ix+pos),a ;y + inc hl + ld a,(hl) + ld (ix+pos+1),a ;x + xor a + ld (ix+pos2),a ;y2 + ld (ix+pos2+1),a ;x2 + + inc (ix+died) + dec (ix+lives) + psh af + ld de,10 + ld a,(Gametype) + cp gamectf ;ctf no death penalty + cal nz,DecScore + pop af + ret nz ;HandleWorm done + ld a,(wormbeglives) + or a ;0=no live limit + ret z ;don't end game + ld a,(gameCar) + and _datatime + jr z,anyworm ;quit at any worm's death + ld a,(nrworms) ;timematch: all worms must've died + ld b,a ;# of worms + ld hl,worm1+lives-(worm2-worm1) + ld de,worm2-worm1 + xor a ;check for 0 lives +checklives: + add hl,de ;next worm + cp (hl) ;lives==0? + ret nz ;any >0: don't exit + dnz checklives +anyworm: + ld a,$A7 ;exit@end of turn + ld (CheckExit),a ;set exit state + ret ;finish turn +#endif + CheckPea: ;@hl; destr:abcde ld c,l ld a,(sprsize) @@ -3867,8 +3953,8 @@ txtMenu: .db "Mode",0 ;1st menu item .db "Link",0 ;... .db "Worms",0 .db "worm #",0 - .db 0 -posMenu: .dw $2418,$231E,$2824,$1F2A,$1730,$1936 +posMenu: .db 5 + .dw $2418,$231E,$2824,$1F2A,$1730 txtMenuR: .db "controls",0 txtoMenu: .db "Back",0 ;1st menu item .db "Lives",0 ;2nd @@ -3876,7 +3962,14 @@ txtoMenu: .db "Back",0 ;1st menu item .db "Speed",0 .db "Rotation",0 .db "Growth",0 -posoMenu: .dw $2618,$251E,$2524,$222A,$1A30,$1C36 +posoMenu: .db 6 + .dw $2618,$251E,$2524,$222A,$1A30,$1C36 +txtpMenu: .db "Resume",0 ;1st menu item + .db "Turn Off",0 ;2nd + .db "Contrast",$CF,5,0 ;... + .db "Exit",0 +pospMenu: .db 4 + .dw $3418,$331E,$2F24,$3A2A txtGame: .db "Singleplayer",0 txtGame1: .db "Peaworm",0 txtGame2: .db "Tron",0