wormy 0.93.1403: beta release
authorMischa Poslawsky <wormy@shiar.org>
Mon, 9 Apr 2001 12:40:32 +0000 (14:40 +0200)
committerMischa Poslawsky <wormy@shiar.org>
Sun, 22 Feb 2009 15:41:57 +0000 (16:41 +0100)
wormy.z80

index 447f511268a54736db81ba3124be2f8ae0a66935..a2c919bf891d934a05bb890702fcf304ba6cc226 100644 (file)
--- a/wormy.z80
+++ b/wormy.z80
@@ -40,7 +40,7 @@
 ;-----------------------------
 
 #define buffer      ;use display buffer (otherwise write directly to screen)
-#define readymask   ;"grays" out the field before starting a level
+#define readymask   ;"greys" out the field before starting a level
 ;#define hlines     ;horizontal-line routine for more speed drawing boxes
 
 ;#define readytext  ;displays "prepare" before level starts
@@ -136,7 +136,7 @@ start:
   .dw WormIcon
 
 WormTxt:
-  .db "WORMY by SHIAR -- alpha 93%",0
+  .db "WORMY by SHIAR -- beta 93%",0
 WormIcon:
   .db 9,2
   .db %10010110,%01101111
@@ -1442,7 +1442,21 @@ handledworm =$-2
   ret nz ;HandleWorm done
   ld  a,(gameCar)
   and _datalivel
-  ret z
+  ret z ;don't end game
+  ld  a,(Gametype)
+  cp  gametron
+  jr  nz,anyworm ;if not Tron, quit at any worm's death
+  ld  a,(nrworms)
+  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
@@ -1784,6 +1798,12 @@ inlink:
 ;------- handle worm ---------
 
 HandleWorm:
+  ld  a,(gameCar)
+  cpl
+  and _datalivel
+  add a,(ix+lives)
+  or  a
+  ret z ;dead
   ld  a,(ix+delay)
   dec a
   jp  nz,respawncheck
@@ -3086,7 +3106,7 @@ send:
 ;outputs: b=8-number of bits sent, both wires high, goes to game over on certain conditions
 ;destroys: af,bc,de
        in a,(7)
-       and %00000011
+       and %11
        jr z,killlink           ;if both lines low, get out of here (game over signal)
        ld b,8                          ;sending 8 bits
 sendloop:
@@ -3354,22 +3374,22 @@ LevelDefC: ;ctf
 
 wdPicture = 16
 wtPicture:
-.db %01001010,%00101001,%00000111,%10000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%01110000,%00000000,%00000000,%00000000,%01000000,%00000000
-.db %10001010,%10101000,%10001111,%10000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%01111000,%00000000,%00000000,%00000000,%10100100,%01000000
-.db %10101010,%10101010,%10011100,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00011100,%00001110,%00000000,%00000000,%10101010,%10100000
-.db %01010001,%01000101,%00011000,%00011111,%00000000,%01111111,%11000000,%00111100,%00011110,%01111000,%00001100,%00011111,%00000000,%00000000,%11001001,%10100000
-.db %00000000,%00000000,%00111000,%00111111,%10000000,%11111111,%11100000,%11111110,%00111111,%11111100,%00001100,%00111011,%10000000,%00000011,%10001000,%00100000
-.db %01101010,%10010011,%00110000,%01110001,%11000001,%11000000,%01110001,%11100110,%01110011,%11001110,%00001100,%00110001,%10000000,%00000000,%10010000,%00100000
-.db %10001010,%00101010,%10110000,%01100000,%11000001,%10000000,%00111001,%10000000,%01100111,%11100110,%00001110,%01110001,%10000000,%00000000,%01100000,%01000000
-.db %11101110,%10111011,%00110000,%01100000,%11000001,%10110000,%00011011,%10000000,%11101110,%01110111,%00001110,%01110001,%10000011,%11100000,%00000011,%10000000
-.db %00101010,%10101010,%10110000,%01110001,%11000001,%10110000,%00011011,%00000000,%11001100,%00110011,%00000111,%11100001,%10001100,%00011000,%00010000,%00000000
-.db %11001010,%10101010,%10110000,%00110001,%10000001,%10110000,%00011011,%00000000,%11001100,%00110011,%00000011,%11000011,%10010000,%00000100,%00100011,%00001100
-.db %00000000,%00000000,%00111000,%00111011,%10000011,%10110000,%00011011,%00000000,%11001110,%01110011,%00000000,%00000011,%00010011,%00000100,%00100100,%10010010
-.db %00111001,%11000111,%00011000,%00011111,%00000011,%00110000,%00011011,%00000000,%11000111,%11100011,%10000000,%00000011,%00001100,%10000100,%00101000,%10010100
-.db %01100101,%00101000,%00011100,%00001110,%00000111,%00111000,%00111011,%10000000,%11000011,%11000001,%10000000,%00000111,%00000000,%01001110,%00101000,%10011000
-.db %01001101,%11001011,%00001110,%00111111,%10001110,%00011100,%01110001,%10000000,%11100000,%00000001,%11100000,%00001110,%00000000,%01010101,%00101000,%10011000
-.db %00111001,%01100111,%00000111,%11111011,%11111100,%00001111,%11100001,%11000000,%01100000,%00000000,%11111111,%11111100,%00000000,%10010101,%00100110,%00010100
-.db %00000000,%00000000,%00000011,%11100000,%11111000,%00000111,%11000000,%11000000,%01100000,%00000000,%00111111,%11111000,%11111111,%00001000,%11000001,%11100011
+.db %00000000,%00000000,%00000111,%10000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%01110000,%00000000,%00000000,%00000000,%00000000,%00000000
+.db %00000000,%00000000,%00001111,%10000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%01111000,%00000000,%00000000,%00000110,%01111011,%00100000
+.db %00000000,%00000000,%00011100,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00011100,%00001110,%00000000,%00001001,%00010011,%01000000
+.db %00000000,%00000000,%00011000,%00011111,%00000000,%01111111,%11000000,%00111100,%00011110,%01111000,%00001100,%00011111,%00000000,%10100111,%00110000,%10000000
+.db %00000000,%00000000,%00111000,%00111111,%10000000,%11111111,%11100000,%11111110,%00111111,%11111100,%00001100,%00111011,%00000000,%10100001,%00001001,%01100000
+.db %00000000,%00000000,%00110000,%01110001,%11000001,%11000000,%01110001,%11100110,%01110011,%11001110,%00001100,%00110001,%10000000,%01001110,%01110010,%01100000
+.db %00000000,%00000000,%00110000,%01100000,%11000001,%10000000,%00111001,%10000000,%01100111,%11100110,%00001110,%01110001,%10000000,%00000000,%00000000,%00000000
+.db %00000000,%00000000,%00110000,%01100000,%11000001,%10110000,%00011011,%10000000,%11101110,%01110111,%00001110,%01110001,%10000000,%00000000,%00000000,%00000000
+.db %00000000,%00000000,%00110000,%01110001,%11000001,%10110000,%00011011,%00000000,%11001100,%00110011,%00000111,%11100001,%10000000,%00000000,%00000000,%00000000
+.db %00000000,%00000000,%00110000,%00110001,%10000001,%10110000,%00011011,%00000000,%11001100,%00110011,%00000011,%11000011,%10000000,%00000000,%00000000,%00000000
+.db %00000000,%00000000,%00111000,%00111011,%10000011,%10110000,%00011011,%00000000,%11001110,%01110011,%00000000,%00000011,%00110101,%01001001,%10000000,%00000000
+.db %00000000,%00000000,%00011000,%00011111,%00000011,%00110000,%00011011,%00000000,%11000111,%11100011,%10000000,%00000011,%01000101,%00010101,%01000011,%01100011
+.db %00000000,%00000000,%00011100,%00001110,%00000111,%00111000,%00111011,%10000000,%11000011,%11000001,%10000000,%00000111,%01100101,%01010101,%01000101,%01010100
+.db %00000000,%00000000,%00001110,%00111111,%10001110,%00011100,%01110001,%10000000,%11100000,%00000001,%11100000,%00001110,%00110111,%01011101,%10010101,%01100101
+.db %00000000,%00000000,%00000111,%11111011,%11111100,%00001111,%11100001,%11000000,%01100000,%00000000,%11111111,%11111100,%00010101,%01010101,%01000101,%01010101
+.db %00000000,%00000000,%00000011,%11100000,%11111000,%00000111,%11000000,%11000000,%01100000,%00000000,%00111111,%11111000,%01100101,%01010101,%01000110,%01010011
 
 txtMenu:  .db "Mode",0  ;1st menu item
          .db "Level",0 ;2nd
@@ -3449,7 +3469,7 @@ datasingle: .db %01011110,3,1,1 ;3 lives (<must b unique)
 gamepeas     =  1
 datapeas:   .db %01011010,1,1,1 ;1 "
 gametron     =  2
-datatron:   .db %01000010,1,2,1
+datatron:   .db %01000010,1,1,1
 gamedeathm   =  3
 datadeathm: .db %01000010,3,2,1
 gamefoodm    =  4