worm 0.80.0204
authorMischa Poslawsky <wormy@shiar.org>
Fri, 4 Feb 2000 19:17:12 +0000 (20:17 +0100)
committerMischa Poslawsky <wormy@shiar.org>
Sun, 22 Feb 2009 15:09:11 +0000 (16:09 +0100)
- screen flashes when somebody dies
- hunting game mode (will be removed again later)
- you loose 10 points for dieing

worm.asm
worm.txt [new file with mode: 0644]

index 8d0bab19e702045dc9706836d894d6a971d05c45..b58bfe54836dded9f33b3148f62af318c444638d 100644 (file)
--- a/worm.asm
+++ b/worm.asm
@@ -1,7 +1,7 @@
 ; Title                      : Worm
 ; Version                    : 0.92
 ; Release Date               : soon (I hope)
-; Filename                   : worm.86p
+; Filename                   : worm.86p (3404)
 ; Author(s)                  : Shiar
 ; Email Address              : shiar@mailroom.com
 ; ICQ UIN                    : #43840958
@@ -16,7 +16,7 @@
 ;----------- TO-DO -----------
 ;-----------------------------
 
-;       Shiar 23.I .00
+;       Shiar 4.II.00
 
 ;Feel like doing something? (name indicates who's working on it)
 ;  * linkplay TESTING! (+faster)
@@ -26,7 +26,6 @@
 ;  * two worms collide with heads -> both should die
 ;  * bouncing balls :)
 ;  * game types:
-;    * hot pursuit/hunting/kodh: catch the other player and vv
 ;1)  * ctf: take enemy flag (right-bottom) and return to your flag (left-top)
 ;1)  * domination?: take control points by running over them and hold them
 ;  * AI worms?
@@ -34,7 +33,7 @@
 ;  * fix linedraw procedure
 ;  * save hiscore
 
-;1) Shiar: working on a new pickup-system allowing more than one "food" and different pickup-handling
+;1) Working on a new pickup-system allowing more than one "food" and different pickup-handling
 
 #include "TI86.inc"
 
@@ -63,9 +62,9 @@ WormIcon:
   .db %11000011,%10000000
 
 Start:
-  ld (SpSave),sp
+  ld  (SpSave),sp
   call _runIndicOff
-;  call _flushAllMenus
+  call _flushAllMenus
   call _clrLCD
   res 2,(iy+13) ;appAutoScroll
 
@@ -76,25 +75,25 @@ Start:
 ;----- build trig tables -----
 ;-----------------------------
 
-  ld hl,TrigPrecalc
-  ld de,SinCosTable
+  ld  hl,TrigPrecalc
+  ld  de,SinCosTable
   push de                        ; >> 1
-  ld bc,65
+  ld  bc,65
   ldir
   dec hl
-  ld b,63
+  ld  b,63
 MirrorSineWave:
   dec hl
-  ld a,(hl)
-  ld (de),a
+  ld  a,(hl)
+  ld  (de),a
   inc de
   djnz MirrorSineWave
   pop hl                         ; << 0k
-  ld b,128+64
+  ld  b,128+64
 NegativeSineWave:
   xor a
   sub (hl)
-  ld (de),a
+  ld  (de),a
   inc hl
   inc de
   djnz NegativeSineWave
@@ -126,7 +125,7 @@ select:
   ld  a,b
   or  a
   jr  nz,gooptionsMenu
-  jp  ThePartyIsOn
+  jp  LetsGetThisPartyOn
 notselect
   cp  K_EXIT
   jp  z,ExitNoStats
@@ -238,7 +237,7 @@ notup:
 ;-------- start game ---------
 ;-----------------------------
 
-ThePartyIsOn:
+LetsGetThisPartyOn:
   ld  hl,Gametype
   ld  a,(hl)
   add a,a
@@ -258,7 +257,7 @@ notsingle:
   push af
 
   and _datascore
-  ld  de,$FF64
+  ld  de,$FF64 ;virt.infinate
   jr  z,setscorelimit
   ld  d,0 ;de=100
 setscorelimit:
@@ -306,22 +305,19 @@ multiplayer:
 
 GameOver:
   call _clrLCD
-  xor a
-  ld  (worm1+died),a
-  ld  (worm2+died),a
-  ld  (worm3+died),a
-  ld  (worm4+died),a
-  ld  h,a
-  ld  l,a
-  ld  (worm1+score),hl
-  ld  (worm2+score),hl
-  ld  (worm3+score),hl
-  ld  (worm4+score),hl
-  inc a
-  ld  (worm1+delay),a
-  ld  (worm2+delay),a
-  ld  (worm3+delay),a
-  ld  (worm4+delay),a
+  ld  hl,0
+  ld  (worm1+died),hl
+;+died=0 \ +score1=0
+  ld  (worm2+died),hl
+  ld  (worm3+died),hl
+  ld  (worm4+died),hl
+  inc h
+  ld  (worm1+score+1),hl
+;+score2=0 \ +delay=1
+  ld  (worm2+score+1),hl
+  ld  (worm3+score+1),hl
+  ld  (worm4+score+1),hl
+  ld  a,l
   ld  (Level),a
   ld  hl,worm1set+4
   ld  de,worm1+lives
@@ -355,6 +351,13 @@ StartLevel:
   ld  (worm4+grow),a
   inc de
 
+  ld  a,(gameCar)
+  and _datahunt
+  jr  z,nohunter
+  ld  a,huntersize
+  ld  (worm2+grow),a
+nohunter:
+
   ld  (thislevel),de
   push de
   ld  hl,worm1set
@@ -587,6 +590,22 @@ GameLoop:
   ld  bc,(worm1+pos)
   call DisplayField
 
+  ld  a,1
+flashtime =$-1
+  dec a
+  jr  z,noflash
+  ld  (flashtime),a
+  ld  hl,$fc00+(16*7)
+screeninvertloop:
+  ld  a,(hl)
+  cpl
+  ld  (hl),a
+  inc hl
+  xor a
+  cp  h
+  jr  nz,screeninvertloop
+noflash:
+
   ld  a,0
 Speed =$-1
   or  a
@@ -630,6 +649,9 @@ NotPaused:
   jr  Exit ;&&
 
 WormDead:
+  ld  a,2
+  ld  (flashtime),a
+
   ld  h,(ix+tail+1)
   ld  l,(ix+tail)
   push hl
@@ -651,18 +673,17 @@ removewormloop:
 
   ;hl=ix+head
   pop de ;ix+tail
-  or  a
+  ld  a,(gameCar)
+  and _dataMulti
+  jr  nz,safewormsizedone
+;  or  a
   sbc hl,de
   ld  a,l
   rr  h
   rra
   inc a
   ld  (ix+grow),a
-
-  push ix
-  ld  de,10
-  call DecScore
-  pop ix
+safewormsizedone:
 
   ld  h,(ix+head+1)
   ld  l,(ix+head)
@@ -684,6 +705,10 @@ thislevel =$+1
 
   inc (ix+died)
   dec (ix+lives)
+  push af
+  ld  de,10
+  call DecScore
+  pop af
   ret nz ;HandleWorm done
   ld  a,(gameCar)
   and _datalivel
@@ -751,7 +776,7 @@ NoLinkIndic:
 
   ld  a,16
   ld  (_curCol),a
-  inc hl
+  inc hl ;worm+score
   call _ldHLind ;ld hl,(hl)
   call showHL ;worm+score
 
@@ -967,22 +992,19 @@ PeaX =$-1
   ld  hl,Left
   dec (hl)
   push af
-  push ix
   ld  de,10
   call IncScore
-  pop ix
   pop af
-  jr  nz,NotNextLevel
+  jr  nz,still_alive_not_dead
   ld  a,(gameCar)
   and _datafoodl
-  jr  z,NotNextLevel
+  jr  z,still_alive_not_dead
   ld  hl,Level
   ld  a,(hl)
   inc (hl)
   pop hl                         ; << call
   pop hl                         ; << call
   pop de                         ; << levelp new
-;  pop hl                         ; << levelp old
   cp  NUM_LEVELS
   jp  z,Exit
   ld  a,(gameCar)
@@ -996,17 +1018,17 @@ checkhitotherworm:
   .db $dd,$7d ;ld a,lx
   cp  worm2&255
   ret nz
-
-  ld  hl,worm1+tail
-  ld  d,20
+ThisIsJustASillyUselessLabel:
+  ld  hl,(worm1+tail)
+  ld  de,(worm1+head)
 nextotherwormbit:
-  ld  a,b
+  ld  a,c
   sub (hl)
   inc hl
   inc a
   cp  4
   jr  nc,nothit1 ;no
-  ld  a,c
+  ld  a,b
   sub (hl)
   inc a
   cp  4
@@ -1014,19 +1036,9 @@ nextotherwormbit:
 nothit1:
   inc hl
   res resbit,h
-  push bc
-  push de
-  push hl
-;  ld  de,worm1+head
-;  call _cphlde
- dec d
-  pop hl
-  pop de
-  pop bc
+  call _cphlde
   jr  nz,nextotherwormbit
   ret
-otherwormHIT:
-  jp Exit
 
 checkhitlapline:
   ld  a,63
@@ -1036,26 +1048,36 @@ checkhitlapline:
   ret nz
 nextlaphalf:
   ld  a,c
-  and 32 ;>=32?
+  and 32 ;y>=32?
   jr  nz,nolap
   cp  (ix+reserv)
   jr  z,nolap
-  push ix
   push bc
   ld  de,20
   call IncScore
   pop bc
-  pop ix
   xor a
 nolap:
   ld  (ix+reserv),a
   ret
 
-NotNextLevel:
+otherwormHIT:
+  push ix
+  ld  de,10
+  call IncScore
+  ld  ix,worm1
+  call WormDead
+  pop ix
+  pop bc
+still_alive_not_dead:
 
 ;-------- draw worm ----------
 
 Drawworm:
+  ld  a,(gameCar)
+  and _datahunt
+  call nz,HuntingTimeScore
+
   ld  c,(ix+pos)
   ld  b,(ix+pos+1)
 
@@ -1200,7 +1222,41 @@ CheckPixel: ;at bc in d
   dec d
   ret
 
-FindPixel: ;bc to ahl + de gone
+;------------------------------------------------------
+;  CLEM's FIND_PIXEL
+;  by Clem
+;
+;  131 cycles  28 bytes    (b,c) to hl:a  destroyes: none
+;------------------------------------------------------
+
+FindPixel:
+       ld h,ScrBuffer/$800
+       ld a,c
+       add a,a
+       add a,a
+       ld l,a    ;hl=$3f00+4*y
+       ld a,b
+       rra
+       add hl,hl
+       rra
+       add hl,hl ;hl=$fc00+16*y
+       add hl,hl
+       rra       ;a=x/8
+       or l
+       ld l,a
+       ld a,b
+       and 7
+       cpl
+       rlca
+       rlca
+       rlca
+       ld (FP_Bit),a
+       xor a
+FP_Bit =$+1
+       set 0,a
+       ret
+
+;FindPixel: ;bc to ahl + de gone
   push de
   push bc
   ld  a,b
@@ -1210,11 +1266,11 @@ FindPixel: ;bc to ahl + de gone
   ld  d,offsets_table/256
   ld  h,0
   ld  l,c
-  add hl,hl
-  add hl,hl
-  add hl,hl
-  add hl,hl
-  add hl,hl
+  add hl,hl ;2y
+  add hl,hl ;4y
+  add hl,hl ;8y
+  add hl,hl ;16y
+  add hl,hl ;32y
   ld  a,b
   and %11111000
   rra
@@ -1231,17 +1287,25 @@ FindPixel: ;bc to ahl + de gone
 
 ;----------- score -----------
 
-DecScore:
+HuntingTimeScore:
+  .db $dd,$7d ;ld a,lx
+  cp  worm2&255
+  ret z ;=worm#2
+  dec (ix+reserv)
+  ret nz
+  ld  de,10
+
+IncScore:
   ld  h,(ix+score+1)
   ld  l,(ix+score)
-  or  a
-  sbc hl,de
-  ret c
+  add hl,de
   jr  scorecommon
-IncScore:
+DecScore: ;&&&
   ld  h,(ix+score+1)
   ld  l,(ix+score)
-  add hl,de
+  or  a
+  sbc hl,de
+  ret c
 scorecommon:
   ld  (ix+score+1),h
   ld  (ix+score),l
@@ -1251,8 +1315,9 @@ scorelimit =$-2
   jp  nc,Exit
 
 showstats:
-  xor a
-  sbc hl,hl
+  push ix
+  ld  h,0
+  ld  l,h
   ld  (_penCol),hl
   ld  a,(nrworms)
   ld  b,a
@@ -1262,9 +1327,9 @@ showstats:
   jr  nz,showstatsS
 showstatloop:
   push bc
-  push ix
+;  push ix
   call showstat
-  pop ix
+;  pop ix
   ld  de,worm2-worm1
   add ix,de
   ld  hl,_penCol
@@ -1273,6 +1338,7 @@ showstatloop:
   ld  (hl),a
   pop bc
   djnz showstatloop
+  pop ix
   ret
 
 showstat:
@@ -1283,16 +1349,19 @@ showscore:
   ld  h,(ix+score+1)
   ld  l,(ix+score)
   call _D_HL_DECI
-  jp  _vputs
+  jr __vputs
 showlives:
   ld  a,(ix+lives)
   add a,'0'
-  jp  _vputmap
+__vputmap:
+  push ix
+  call _vputmap
+  pop ix
+  ret
 
 showstatsS:
-  push ix
   ld  hl,txtLevel
-  call _vputs
+  call __vputs
   ld  a,(Level)
   cp  10
   jr  c,tilllevel9
@@ -1302,12 +1371,11 @@ showstatsS:
   push af
   ld  a,l
   add a,'0'
-  call _vputmap
+  call __vputmap
   pop af
 tilllevel9:
   add a,'0'
-  call _vputmap
-  pop ix
+  call __vputmap
 
   ld  a,98
   ld  (_penCol),a
@@ -1323,12 +1391,17 @@ Left =$-1
   push af
   call _divAby10
   add a,'0'
-  call _vputmap
+  call __vputmap
   pop af
   add a,'0'
-  call _vputmap
+  call __vputmap
   ld  hl,txtLeft
-  jp _vputs
+  pop ix
+__vputs:
+  push ix
+  call _vputs
+  pop ix
+  ret
 
 showLevel:
   ld  hl,txtLevel
@@ -1894,11 +1967,24 @@ LevelsR:
   .db 1
   .db 8,29,32,20
 
+LevelsH:
+
+  .db 8,5,5
+huntersize = 31
+  .db $40,28,2,$C0,28,125, $00,2,63,$80,54,63
+  .db 128,57
+  .db 0
+  .db 4
+  .db 4,19,16,14
+  .db 4,19,80,14
+  .db 4,19,16,34
+  .db 4,19,80,34
+
 NUM_LEVELS = 9
 
 LevelsS:
 
-  .db 5,4,15        ;5 peas, speed 5
+  .db 5,4,15        ;peas,speed,begin_size
   .db 0,2,63        ;d,y,x
   .db 128,57        ;field width, height
   .db 0             ;no additional lines
@@ -2050,7 +2136,7 @@ datafoodm:  .db %10010000
 datalinkm:  .db %00000011
             .dw LevelsDM
 datahuntin: .db %00110100
-            .dw LevelsDM
+            .dw LevelsH
 datarace:   .db %11000000
             .dw LevelsR
 datactf:    .db %00000000
@@ -2061,16 +2147,16 @@ datadomin:  .db %00000000
 
 setdata = 18
 resbit  = 2 ;and%11111011
-worm1set:  .dw $B000,$B000 ;10110000
+worm1set:  .dw $B000,$B000 ;%10110000
            .db 3,0,%01111110,%10,%100 ;< >
            .db "Worm #1",0
-worm2set:  .dw $B800,$B800 ;10111000
+worm2set:  .dw $B800,$B800 ;%10111000
            .db 3,0,%00111111,%10000,%1000 ;f1 f2
            .db "Worm #2",0
-worm3set:  .dw $E800,$E800 ;11101000 ;$D748+$1000+
+worm3set:  .dw $E800,$E800 ;%11101000 ;$D748+$1000+
            .db 3,0,%01011111,%10,%100 ;sto ,
            .db "Worm #3",0
-worm4set:  .dw $F000,$F000 ;11110000
+worm4set:  .dw $F000,$F000 ;%11110000
            .db 3,0,%01111101,%10,%1 ;enter +
            .db "Worm #4",0
 worm1 = $B400
@@ -2084,14 +2170,15 @@ pos     = 2   ;level*
 pos2    = 4   ;level
 grow    = 6   ;level
 died    = 8   ;game
-delay   = 9   ;game
-score   = 10  ;game
+score   = 9   ;game
+delay   = 11  ;game
 
 head    = 12  ;level
 tail    = 14  ;level
 lives   = 16  ;game
 reserv  = 17  ;loop
- ;race=lap
+ ;race:lap
+ ;hunt:time
 input   = 18  ;&
 left    = 19  ;&
 right   = 20  ;&
@@ -2100,11 +2187,11 @@ name    = 21  ;game
 Level =$+1
 DispBuffer =$+2 ;912 bytes
 
-ScrBuffer   = $8200 ;32x256 bytes
-SinCosTable = $A200
+ScrBuffer   = $8000 ;-$A1FF (32x256)
+SinCosTable = $A200 ;-$A300 (4x64)
 
 ;-----------------------------
 ;----------- end -------------
 ;-----------------------------
 
-.end
+.end
\ No newline at end of file
diff --git a/worm.txt b/worm.txt
new file mode 100644 (file)
index 0000000..7efdcc2
--- /dev/null
+++ b/worm.txt
@@ -0,0 +1,85 @@
+                          ###############
+                  Title : ### W O R M ###
+                          ###############
+                Version : 0.92.211
+                 Author : SHIAR
+                File(s) : worm.86p (4kb) + worm.txt
+           Release Date : ~ april 2000 (I hope)
+          Email Address : shiar@mailroom.com
+                ICQ UIN : #43840958
+               Web Page : www.games3.net/shiar
+            Description : Nibbles-like game, 1-4 players.
+ Where to get this game : games3.net/shiar (home of Worm) or ticalc.org
+  Other games by author : Nemesis (beta)
+  Additional Credits to : Matthew Shepcar and Jonah Cohen
+
+GENERAL =------------------------------------------------------------------
+Avoid your worm from crashing  by it turning left/right.  The controls are:
+1) left/right  2) F1/F2  3) sto/,  4) enter/+
+ EXIT : exits to the stats-screen
+ MORE : turns your calc off (pauses)
+GRAPH : teacher key (not made yet)
+
+STATS-SCREEN =-------------------------------------------------------------
+At the end of each game,  the stats-screen will be displayed.  It shows the
+score and deaths for each worm. Hit enter to return to the main menu.
+
+SINGLEPLAYER =-------------------------------------------------------------
+Move your worm over the "food". When you ate enough food you advance to the
+next, more difficult, level.
+On the top of the screen you can see  in which level you are, how many peas
+you still have to eat, your score and your lives left.
+
+DEATHMATCH =---------------------------------------------------------------
+A multiplayer game  where you  have to kill  the other worm(s)  before they
+kill you.  When you have no lives left, the game ends.  The number of lives
+left for each player are displayed  on the top of the screen.  You can play
+with 2-4 humans.
+
+FOODMATCH =----------------------------------------------------------------
+Like deathmatch,  with the difference  that your objective  is to score 100
+points. You'll get 10 points for taking a pea, if you die however, you lose
+10.
+
+HUNTING =------------------------------------------------------------------
+In hunting,  the hunter (player 1) has to "catch" the prey (2).  The hunter
+must hit the prey  with his head,  killing the prey  and scoring 10 points.
+However, the prey gains 5 points for every 250 turns he's alive.  The first
+one scoring 100 points wins.
+
+RACE =---------------------------------------------------------------------
+In this gametype,  all worms have to move around like race-cars.  The first
+one to complete 3 laps wins.
+
+CTF =----------------------------------------------------------------------
+Each player has to capture the enemy flag, and return it to his own flag.
+
+DOMINATION =---------------------------------------------------------------
+There are several control points which you have to control (by running over
+them).  Every ten turns  each player  is given  one point  for each control
+point he/she controls. The first one scoring 100 points wins.
+
+OF COURSE =----------------------------------------------------------------
+I am not responisble  for any damage Worm causes.  Furthermore, you may not
+release an altered version of Worm,  distribute it without this readme file
+included, nor may you charge money for it.
+
+HISTORY =------------------------------------------------------------------
+This is a historical overview of Worm (facts may not match reality)
+* End 1998: Matthew Shepcar released Peaworm, worm in it's simplest form
+* Matt didn't release another version with levels and vertical scrolling
+* End 1999: I (Shiar) asked him whether I could complete Worm
+* Jonah Cohen helped me for a while, but he either died or got bored
+* 4/2000: Shiar completed Worm and the program looked worse than ever
+
+CREDITS =------------------------------------------------------------------
+This game was made by SHIAR.  Please contact me  at  shiar@mailroom.com, or
+ICQ UIN #43840958.  Also visit  the home  of Worm  at  www.games3.net/shiar
+(come.to/shiar) for the latest news about Worm and other games by me.
+
+Matthew Shepcar - for writing the original Peaworm
+Jonah Cohen     - wrote some parts of Worm
+Free Bird       - calc2calc linkplay testing
+JQL             - betatesting
+
+.