3 ; Release Date : summer 2001
4 ; Filename : wormy.86p (5kb)
6 ; Email Address : shiar0@hotmail.com
8 ; Web Page : www.shiar.org
9 ; Description : ruling Nibbles-like game 1-4 players
10 ; Where to get this game : www.shiar.org (home of Wormy)
11 ; Other games by author(s) : Nemesis beta
12 ; Additional Credits to : Matthew Shepcar (wrote original Peaworm, end'98)
13 ; Jonah Cohen (helped writing worm)
15 ;-----------------------------
16 ;----------- TO-DO -----------
17 ;-----------------------------
22 ; * check levels/gametype
23 ; * enough hiscore saves!
25 ; 1% * misc (pollish, bugs, &&&)
27 ; 2% * fix deaths linkplay and transmit game/level data
28 ; 2% * make linkplay available for all gametypes (not just deathmatch)
30 ; 1% * fix pea XOR problem in ctf (+dom?)
32 ; 1% * domination?: take control points by running over them and hold them
34 ;100% = bugs fixed + levels done
36 ;-----------------------------
37 ;-----------------------------
38 ;--------- W O R M ---------
39 ;-----------------------------
40 ;-----------------------------
42 #define buffer ;use display buffer (otherwise write directly to screen)
43 #define readymask ;"greys" out the field before starting a level
44 ;#define hlines ;horizontal-line routine for more speed drawing boxes
46 ;#define readytext ;displays "prepare" before level starts
47 ;#define invincible ;worms cannot die =)
54 #include "ti86asm.inc"
58 _divHLby10 = $4044 ;hl=hl/10
59 _divAby10 = $4DAF ;a=a/10
60 _HLTIMES10 = $41BF ;hl=hl*10
62 _clrWindow = $4A86 ;clear screen
63 _asapvar = $D6FC ;own name (worm)
64 _MOV4B = $429B ;4x ld (de),(hl)
65 _MOV5B = $4297 ;5x ld (de),(hl)
66 _mov9b = $4283 ;9x ld (de),(hl)
67 _ldHLind = $4010 ;ld hl,(hl)
68 _swapt_ = $45F3 ;ex_ahl_bde
69 _Get_Word_ahl = $521D ;ld de,(ahl)
70 _Set_Word_ahl = $5221 ;ld (ahl),de
71 _INC_PTR_AHL = $4637 ;ahl=ahl+1
72 _AHL_PLUS_2_PG3 = $4C3F ;ahl=ahl+2
73 _SET_ABS_SRC_ADDR = $4647 ;set source for mm.ldir =ahl
74 _LOAD_ABS_SRC_ADDR = $5209 ;ahl = mm.ldir source
75 _SET_ABS_DEST_ADDR = $5285 ;set destination for mm.ldir = ahl
76 _SET_MM_NUM_BYTES = $464F ;number of bytes for mm.ldir = ahl
77 _mm_ldir = $52ED ;24bit ldir
78 _RAM_PAGE_1 = $47E3 ;set $8000+ to page 1
80 _PTEMP_END = $D29A ;end of VAT
81 _load_ram_ahl = $462F ;ahl->page+hl
82 _writeb_inc_ahl = $5567 ;ld (ahl),c
83 _jforce = $409C ;TI-OS stack restored
84 _EXLP = $4493 ;swap (hl),(de) b times
85 _GETB_AHL = $46C3 ;a=(ahl) \ hl=ahl
87 ;-----------------------------
88 ;------- data storage -------
89 ;-----------------------------
93 ScrBuffer = $8820 ;-A7FF (20*FF=1FE0)
94 worm2p = $A800 ;-ABFF (400) %10101O00
95 worm1 = $AC00 ;-AC1D (31d)
96 worm2 = $AC1F ;-AC3B (1F)
97 worm3 = $AC3E ;-AC59 (1F)
98 worm4 = $AC5D ;-AC77 (1F)
99 balls = $AC7C ;-ACFF (3x43d)
100 SinCosTable = $AD00 ;-AE00 (4x40)
101 ;free $AE01 ;-AFFF (1FF)
102 worm1p = $B000 ;-B7FF (800) %1011O000
103 worm3p = $B800 ;-BBFF (400) %10111O00
104 ;free $BF91 ;-BFFF (6F)
106 ;program $D748 ;-E7FF (106D+4A)
107 ;free $E800 ;-EFFF (800)
108 worm4p = $F000 ;-F3FF (400) %11110O00
109 leveldata = $F400 ;-FA70 (<=671)
115 namelength = $BC00 ;(1) @menu
117 DispBuffer = $BC00 ;(10x57d) @game
122 ;-----------------------------
123 ;------- program start -------
124 ;-----------------------------
139 .db "WORMY by SHIAR -- beta 93%",0
142 .db %10010110,%01101111
143 .db %10110101,%01001011
144 .db %01110011,%01001001
145 .db %00000011,%10000000
146 .db %00000001,%11100000
147 .db %00111000,%11111000
148 .db %01111110,%00111111
149 .db %11101111,%00001111
150 .db %11000011,%10000000
153 levelhead2 = 93 ;wormy levels header = "93"
184 ld bc,int_end-int_handler
191 ld hl,$BFFF ;VAT start
194 ld de,(_PTEMP_END+1) ;VAT end
224 ex de,hl ;ld ahl,(hl)
225 cal _AHL_PLUS_2_PG3 ;string id
226 cal _Get_Word_ahl ;ld de,(ahl)
230 jr nz,_searchnext ;not worm
234 inc ix ;save level's ahl
249 cal _Get_Word_ahl ;ld de,(ahl++)
254 ld a,e ;set new level
277 cal _vputs ;"< Select levels: >"
293 ex de,hl ;ahl=ade=(hl)
294 cal _load_ram_ahl ;hl=ahl
295 ld b,(hl) ;b=title size
328 ld b,-3 ;level selected
334 pop bc ;GET_KEY destr. b
349 add a,3 ;sellev+3 (#0==-3)
358 or a ;levelfile on page 0 (=internal)
369 cal _GETB_AHL ;ld a,(ahl)
374 cal _INC_PTR_AHL ;ahl++
376 jr nz,skiptitle ;goto #0-terminator
379 ld (leveldataSize),de
388 cal _SET_ABS_SRC_ADDR ;levelsstart
391 cal _SET_ABS_DEST_ADDR ;store in mem.
394 cal _SET_MM_NUM_BYTES
397 cal _LOAD_ABS_SRC_ADDR ;->ahl
404 ldi ;(de),(hl)\inc hl
409 res 2,(iy+13) ;appAutoScroll
416 ld (hl),1 ;def=level#1
423 ;-----------------------------
424 ;----- build trig tables -----
425 ;-----------------------------
450 ;-----------------------------
451 ;---------- menu -------------
452 ;-----------------------------
454 DisplayMenu: ;---draw menu---
470 cal _vputs ;Mode \ Level \ Limit \ Worms \ worm # \ controls
474 jr _dispmenusets ;mainMenu
489 jp LetsGetThisPartyOn ;1/2/3/5
508 jp z,changelevel ;&&&jr??
520 jr nc,mainMenu ;may not become >(nrworms)
524 jr _dispmenusets ;mainMenu
537 ; jr z,bchangecurworm
542 jr nz,changedcurworm ;save >0
548 jr c,mainMenu ;type 0/1
553 jr nc,mainMenu ;may not be >4
557 jr dispmenusets ;mainMenu
562 jr nz,changednrworms ;save >0
573 jr dispmenusets ;mainMenu
583 jr nc,_mainMenu ;&& _?
586 jr dispmenusets ;mainMenu
593 cal loadgamecar ;c=(gameCar)
594 ;a=(hl)=(Gametype+1)=(wormbeglives)
599 pop hl ;restore stack
600 jr _mainMenu ;singleplayer (no limit)
603 inc hl ;hl=loadgamecar+2
605 ld a,(hl) ;(curlevel)
611 cp (hl) ;max level for sel.game
617 jr dispmenusets ;mainMenu
620 ld a,(hl) ;(curlevel)
645 cal getcustomkey ;left
646 cal getcustomkey ;right
649 ;---display current settings---
652 ld hl,$FD97 ;begin pos
653 ld de,7 ;bytes to add
656 ld c,9 ;bytes to clear
672 add hl,de ;hl=posGame+(Gametype)
673 ld a,(hl) ;str.offset
677 ld (CURtxtGame),hl ;save for g/o
678 cal _vputs ;Singleplayer
684 cal cshowA ;liveslimit
697 pop hl ;cal loadgamecar
706 pop hl ;loadgamecar; hl++
708 ld a,(hl) ;(curlevel)
723 ld hl,$363E ;controls
729 ;--- handle menukeys ---
738 pop bc ;GET_KEY destr. b
748 menupos: ;highlight #b
761 add hl,hl ;$FD20+item*96
794 getwormname: ;of (curworm)
812 cal _puts ;"Enter name player "
882 .db 0,".<>!",0,0,0,0 ;down,L,R,up
883 .db 0,"XTOJE0",0 ;enter..clear
884 .db " WSNID9",0 ;(-)..custom
885 .db "ZVRMHC8",0 ;dot..del
886 .db "YUQLGB7#" ;0..xvar
887 .db $D9,"-PKFA6'" ;on..alpha
888 .db "54321*",0,$D0 ;F5..more
892 skiplevel: ;@hl - destr:ab - alter:hl
897 ld b,(hl) ;spritesize
908 inc b ;multiplayer lvl
910 inc b ;skip other 3 worms (9 bytes)
944 ;build: c=(gameCar)=(hl-1)
945 ; a=(wormbeglives)=(hl)
962 ;-----------------------------
963 ;-------- start game ---------
964 ;-----------------------------
968 ld (CheckExit),a ;set exit state
977 cal _HLTIMES10 ;hl=10*(hl)
978 ld (scorelimit),hl ;set limit
982 ld a,(Gametype) ;4bytes -> 3bytes
984 add a,24+1 ;go to datalevels
986 sbc hl,de ;datalevels
991 dec a ;ld a,$FF ;=no_limit
995 cal _ldHLind ;ld hl,(hl)
996 pop de ;de=loadgamecar
998 ld a,(de) ;(curlevel)
1002 dec d ;levels to skip
1044 ;-----------------------------
1045 ;--------- game over ---------
1046 ;-----------------------------
1050 out (7),a ;link normal
1054 ld a,4 ;4x (all worms)
1063 ld (hl),0 ;score+1=0
1070 ex de,hl ;de=wormX+head
1074 jr nz,createwormsloop
1076 pop hl ;begin of current level
1085 dec (hl) ;curlevel-- (not beyond last lvl)
1090 ;show end msg or smtn
1092 psh bc ;where to go afterwards
1093 inc hl ;location of ending-code
1094 jp (hl) ;go there ("call")
1116 ld b,0 ;bc=sprite size
1117 add hl,bc ;hl=behind sprite
1124 setsprite: ;de=@sprite ;a=sprsize
1157 ld a,SinCosTable/256
1169 ld bc,(worm2-worm1)-5
1174 ;-------- draw level ---------
1268 ;-----------------------------
1270 psh hl ; >> levelp new
1305 ld hl,4+(txtposReady*256)
1316 jr z,initfinished ;no link
1318 ld (Speed),a ;max.speed
1319 SwapPos: ;$18 xx -> $E6 xx
1323 ld (worm1+left),a ;worm 1 via link
1326 ld (worm2+left),a ;worm 2 via link
1335 ;-----------------------------
1336 ;----------- LOOP ------------
1337 ;-----------------------------
1356 jr nz,screeninvertloop
1369 ld (handledworm),a ;=0
1374 cal nz,handlethoseneatlittleballs
1387 inc (hl) ;1..nrworms
1390 ;-----------------------------
1391 ;---------- keys -------------
1392 ;-----------------------------
1407 rla ;=$17 (c=EXIT-key)
1418 ld (ix+delay),respawndelay
1442 ret nz ;HandleWorm done
1445 ret z ;don't end game
1448 jr nz,anyworm ;if not Tron, quit at any worm's death
1451 ld hl,worm1+lives-(worm2-worm1)
1453 xor a ;check for 0 lives
1455 add hl,de ;next worm
1457 ret nz ;any >0: don't exit
1460 ld a,$A7 ;exit@end of turn
1461 ld (CheckExit),a ;set exit state
1475 cal menuinvloop ;invert
1478 cal menuinvloop ;<hr>
1481 cal menuinvloop ;<hr>
1500 cal _vputs ;Died Score
1514 cp (hl) ;input=0 = link
1531 ld a,(hl) ;worm+died
1539 cal _ldHLind ;ld hl,(hl)
1540 cal showHL ;worm+score
1546 dnz displayWormStats
1549 or a ;singleplayer (0) only
1550 jr nz,hilevelcheckdone
1555 jr c,hilevelcheckdone
1556 ld (hl),a ;save local
1561 hilvlposhl =$-2 ;save external
1562 cal _writeb_inc_ahl ;ld (ahl),c
1568 jr z,hiscorecheckdone
1570 cal loadhiscoreposinahl
1571 cal _Get_Word_ahl ;de=old_hi
1579 jr c,NotNewHigh ;New<Old
1580 jr nz,newhigh ;New>Old
1584 jr nc,NotNewHigh ;new<old
1588 cal loadhiscoreposinahl
1589 cal _Set_Word_ahl ;de->(ahl)
1592 NotNewHigh: ;de=current hiscore
1613 ;x123456789012345678901
1614 ;>>>>>> GAME OVER <<<<<
1619 ;6Worm#02 @ 05 00120
1625 rst 20h ;_ABS_MOV10TOOP1
1627 ld hl,savestart-_asm_exec_ram+4
1631 cal _SET_ABS_DEST_ADDR
1635 cal _SET_ABS_SRC_ADDR
1636 ld hl,saveend-savestart
1637 cal _SET_MM_NUM_BYTES
1646 loadhiscoreposinahl:
1651 ld a,(nrlevels+1) ;# peaworm lvls
1658 dec a ;z=(Gametype)=2
1670 hiscrposa =$-1 ;ahl=saveloc
1676 dnz addlevelposition
1679 ;-----------------------------
1680 ;----------- worm ------------
1681 ;-----------------------------
1686 cal saverespawncounter
1692 jr DoesWormTailEqualsWormHead ;chk4 size=0
1703 DoesWormTailEqualsWormHead:
1705 jr nz,removewormloop
1709 jr nz,safewormsizedone
1717 ld (ix+tail),e ;head=tail/size=0
1723 jr nz,saverespawncounter
1751 ld a,%01111111 ;default
1754 dnz bitmask ;a/8 times
1755 out (1),a ;send bitmask
1756 in a,(1) ;input keys
1761 dnz keybit ;check match (cf set)
1764 inkeys: ;use jp not call!
1781 jr z,inlink ;input by link
1782 cal inkeys ;input by keys
1786 ld c,l ;send our keys
1798 ;------- handle worm ---------
1841 ;-------- move worm ----------
1869 notmoveY: ;bc=newpos
1876 pop hl ; << pos (old)
1894 ;--------- worm hit ----------
1900 cal z,checkhitotherworm
1902 and _datamultpeas ;&&bit
1906 jp z,WormDead ;no food
1913 cal DrawPea ;remove pea
1925 jp nz,Drawworm ;continue
1931 jp nz,Exit ;stack restored
1942 cal IncScore ;score+(40*level)
1946 pop hl ; << levelp new
1950 chkpeahit: ;hl=peapos
1979 ld hl,(peaspos) ;1st pea
1985 ld hl,(peaspos+2) ;2nd pea
1988 pop hl ;(peapos) 1st pea
1989 jp c,WormDead ;stopworm ;own pea hit
1991 ld a,e ;peek a (that's x86 asm for pop\push ;)
1994 ld hl,(peaspos+2) ;2nd pea
2007 cal DrawPea ;restore own flag
2008 jr sillylabel ;inv both\die
2010 hitflag: ;correct pea hit
2028 ret ;Z=yes: no flag taken
2030 ;-----------------------------
2049 jr nz,nextotherwormbit
2074 .db $dd,$7d ;ld a,lx
2077 jr nz,chkworm2 ; ret nz
2102 ;-------- draw worm ----------
2111 cal z,checkhitlapline
2117 ret z ;keep tail in "Tron"
2160 ;-----------------------------
2161 ;---------- ball -------------
2162 ;-----------------------------
2164 handlethoseneatlittleballs:
2210 bit 1,d ;1=up; 0=down
2240 letsmovetheotherway:
2255 ;-----------------------------
2256 ;----------- procs -----------
2257 ;-----------------------------
2261 ld a,%10000000 ;all key-masks
2264 inc a ;cp %11111111 (no keys pressed)
2265 jr nz,releasekeys ;keep waitin
2266 cal GET_KEY ;clear buffer
2312 jr nz,NewPea ;pixel found
2319 ;all ok; empty space
2328 ;----------- score -----------
2348 jr z,scorecommon ;hl/1000 not increased
2356 jr c,showstats ;<0=0
2363 jr z,showstats ;de=$FF??=no limit
2508 ;-----------------------------
2626 ld (ShiftRightCounter),a
2628 ld (ShiftRightChunk),a
2642 ShiftRightCounter = $-1
2664 ld (ShiftLeftCounter),a
2666 ld (ShiftLeftChunk),a
2668 jr nc,ShiftLeftSameByte
2687 ShiftLeftCounter = $-1
2698 jr nz,ShiftRowsRight
2732 ;----------- draw ------------
2746 CheckPixel: ;at bc in d
2753 ;CLEM's FIND_PIXEL (131+? cycles; 28+4 bytes)
2754 ;(b,c) to hl:a; "destroyes" ahl
2756 FindPixel: ;(b,c) to hl:a
2789 PutSprite: ;||@(b,c)
2790 ;by SHIAR only ix saved
2865 drawbox: ;(d,e)-(h,l)
2873 drawhline: ;(d,e)-(h,e)
2879 ld c,a ;starting mask
2921 drawline: ;(d,e)-(h,l)
3022 drawcircle: ;(d,e),h ;de=x,y; h=z
3033 ex (sp),hl ;push zz \ pop x,y
3034 cal circledraw ;(x-xx,y+yy)-(x+xx,y+yy)
3035 ;(x-xx,y-yy)-(x+xx,y-yy)
3036 cal circledraw ;(x-yy,y+xx)-(x+yy,y+xx)
3037 ;(x-yy,y-xx)-(x+yy,y-xx)
3039 ex (sp),hl ;push x,y \ pop zz
3042 dec a ;-256<h<0 = $FF**
3044 jr z,circlenext ;jump if zz<0
3048 add a,a ;a=2yy-2 ;nc
3050 sbc hl,de ;zz=zz-2yy+2
3058 add hl,de ;zz=zz+2xx+3
3067 circledraw: ;destr:de
3072 add hl,bc ;h=x+xx; l=y+yy
3074 cal drawline ;(h-b,l+c)-(h+b,l+c)
3080 cal drawline ;(h-b,l-c)-(h+b,l-c)
3081 ld a,b ;swap xx and yy
3091 ;**** link routines ****
3092 ;these are identical in concept to the routines used in ZTetris, ZPong, and probably
3093 ;every other link game out there. However, these are commented :)
3105 ;inputs: c=byte to send, both wires must be high by default
3106 ;outputs: b=8-number of bits sent, both wires high, goes to game over on certain conditions
3110 jr z,killlink ;if both lines low, get out of here (game over signal)
3111 ld b,8 ;sending 8 bits
3113 ld de,$8000 ;error timer
3114 rl c ;force high bit into carry
3115 ld a,%11010100 ;lower the red wire by default (sending 0) ($d4)
3116 jr nc,selected ;if high bit was 0, use above value
3117 ld a,%11101000 ;if 1, lower the white wire instead ($e8)
3119 out (7),a ;put it out the link port
3122 in a,(7) ;see what the wires are doing
3123 and %00000011 ;check lower 2 bits
3124 jr nz,waitconfirm ;if both bits 0, data was received ok (both wires low)
3126 out (7),a ;give the ok to raise both wires (one will be done automatically) ($c0)
3132 jr nz,waitconfirm2 ;wait for other calc to raise the other wire
3133 djnz sendloop ;continue sending
3134 xor a ;reset c; ld a,0
3135 ld (losses),a ;reset number of losses
3145 ;inputs: both wires must be high by default
3146 ;outputs: c=byte received, b=8-number of bits received, both wires high
3147 ; goes to game over on certain conditions
3151 jr z,killlink ;game over signal applies to receiving too
3152 ld b,8 ;receiving 8 bits
3154 ld de,$8000 ;error timer
3159 cp 3 ;if bits 0 and 1 set, both wires are high
3160 jr z,waitreceive ;wait for one of the wires to go low
3161 rra ;check red wire status
3162 rl c ;if set, red is high (thus white is low), so put the correct bit into c
3163 rra ;now check white wire (since the flags are destroyed)
3165 jr nc,selected2 ;if white is low, lower red and vice versa
3168 out (7),a ;so now both wires are low
3173 jr z,waitreceive2 ;wait for the wire we didn't lower to go high again (the other will remain low)
3175 out (7),a ;raise both wires since the other calc will have given the ok sign
3176 djnz receiveloop ;if not done, wait for next bit
3178 ld (losses),a ;reset number of losses
3181 linktimer: ;leave if we have to wait too long (and return an error)
3184 or e ;see if de is 0
3185 ret nz ;if not, keep going as usual
3186 ;otherwise we have to deal with a link failure
3188 out (7),a ;reset link status (both high)
3189 ld a,(losses) ;see how many consecutive losses we have
3191 ld (losses),a ;add this loss to it
3192 pop de ;fix the stack to leave the link routine (de is ok to destroy)
3193 cp 20 ;see if this is the 20th consecutive failure
3194 ret c ;if not, keep playing
3195 ;otherwise, all is probably lost...
3212 ;-----------------------------
3213 ;----------- link ------------
3214 ;-----------------------------
3244 Csend: ;--- send 8 bits in A --- destr:abcdehl ---
3250 out (7),a ;both high
3251 jr Csendloop ;CF = error
3253 Qsend: ;--- try to send 8 bits in C; CF=error --- destr:abcdehl ---
3259 ld b,8 ;bits to send
3262 rl c ;bit to send in cf
3263 ld a,D0LD1H ;0: lower white
3265 ld a,D0HD1L ;1: lower red
3267 out (7),a ;lower one (send bit)
3269 cal checklink ;other calc must lower other wire
3271 ld a,D0HD1H ;raise one, ok to raise other
3275 cp %11 ;both raised (by other calc)
3278 dnz sendloop ;repeat for all bits
3286 Crecv: ;--- receive 8 bits into A/C --- destr:abcdehl ---
3288 ret nc ;return if all went ok
3290 out (7),a ;raise both on error
3291 jr Crecv ;and try again
3293 Qrecv: ;--- receive 8 bits into A/C; CF=error --- destr:abcdehl ---
3296 jp z,Exit ;both low = error, quit
3299 ret z ;both high = nothing yet, wait
3300 ld b,8 ;bits to receive
3306 jr z,recvwait ;both high = nothing sent (yet)
3307 rra ;received bit in cf
3309 jr c,received ;lower white wire as well
3310 ld a,D0HD1L ;lower red
3313 out (7),a ;both wires low
3316 jr z,recvwaitack ;same wire will be raised again by other calc
3318 out (7),a ;raise both
3320 dnz recvloop ;repeat for all bits
3326 ;-----------------------------
3327 ;---------- levels -----------
3328 ;-----------------------------
3331 .db 5,4,15,15,0,0 ;peas,speed,growth,begin_size,sprite,balls
3332 .db 0,2,63 ;start d, y, x
3333 .db 128,57 ;field width (128-255), height (57-255)
3334 .db 0 ;no additional lines, boxes
3340 .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
3345 .db %1110000,%10001000,%10001000,%10001000,%1110000,0
3346 .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
3351 .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
3356 LevelDefT: ;tron=no delay
3358 .db %1110000,%10001000,%10001000,%10001000,%1110000,0
3359 .db $40,30,64,$C0,30,64, $00,30,64,$80,30,64
3365 .db %1110000,%10001000,%10001000,%10001000,%1110000,0
3366 .db $40,30,64,$C0,30,64, $00,30,64,$80,30,64
3371 ;-----------------------------
3372 ;---------- data -------------
3373 ;-----------------------------
3377 .db %00000000,%00000000,%00000111,%10000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%01110000,%00000000,%00000000,%00000000,%00000000,%00000000
3378 .db %00000000,%00000000,%00001111,%10000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%01111000,%00000000,%00000000,%00000110,%01111011,%00100000
3379 .db %00000000,%00000000,%00011100,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00011100,%00001110,%00000000,%00001001,%00010011,%01000000
3380 .db %00000000,%00000000,%00011000,%00011111,%00000000,%01111111,%11000000,%00111100,%00011110,%01111000,%00001100,%00011111,%00000000,%10100111,%00110000,%10000000
3381 .db %00000000,%00000000,%00111000,%00111111,%10000000,%11111111,%11100000,%11111110,%00111111,%11111100,%00001100,%00111011,%00000000,%10100001,%00001001,%01100000
3382 .db %00000000,%00000000,%00110000,%01110001,%11000001,%11000000,%01110001,%11100110,%01110011,%11001110,%00001100,%00110001,%10000000,%01001110,%01110010,%01100000
3383 .db %00000000,%00000000,%00110000,%01100000,%11000001,%10000000,%00111001,%10000000,%01100111,%11100110,%00001110,%01110001,%10000000,%00000000,%00000000,%00000000
3384 .db %00000000,%00000000,%00110000,%01100000,%11000001,%10110000,%00011011,%10000000,%11101110,%01110111,%00001110,%01110001,%10000000,%00000000,%00000000,%00000000
3385 .db %00000000,%00000000,%00110000,%01110001,%11000001,%10110000,%00011011,%00000000,%11001100,%00110011,%00000111,%11100001,%10000000,%00000000,%00000000,%00000000
3386 .db %00000000,%00000000,%00110000,%00110001,%10000001,%10110000,%00011011,%00000000,%11001100,%00110011,%00000011,%11000011,%10000000,%00000000,%00000000,%00000000
3387 .db %00000000,%00000000,%00111000,%00111011,%10000011,%10110000,%00011011,%00000000,%11001110,%01110011,%00000000,%00000011,%00110101,%01001001,%10000000,%00000000
3388 .db %00000000,%00000000,%00011000,%00011111,%00000011,%00110000,%00011011,%00000000,%11000111,%11100011,%10000000,%00000011,%01000101,%00010101,%01000011,%01100011
3389 .db %00000000,%00000000,%00011100,%00001110,%00000111,%00111000,%00111011,%10000000,%11000011,%11000001,%10000000,%00000111,%01100101,%01010101,%01000101,%01010100
3390 .db %00000000,%00000000,%00001110,%00111111,%10001110,%00011100,%01110001,%10000000,%11100000,%00000001,%11100000,%00001110,%00110111,%01011101,%10010101,%01100101
3391 .db %00000000,%00000000,%00000111,%11111011,%11111100,%00001111,%11100001,%11000000,%01100000,%00000000,%11111111,%11111100,%00010101,%01010101,%01000101,%01010101
3392 .db %00000000,%00000000,%00000011,%11100000,%11111000,%00000111,%11000000,%11000000,%01100000,%00000000,%00111111,%11111000,%01100101,%01010101,%01000110,%01010011
3394 txtMenu: .db "Mode",0 ;1st menu item
3400 posMenu: .dw $$2418,$231E,$2524,$1F2A,$1730,$1936
3401 txtGame: .db "Singleplayer",0
3402 txtGame1: .db "Peaworm",0
3403 txtGame2: .db "Tron",0
3404 txtGame3: .db "Deathmatch",0
3405 txtGame4: .db "Foodmatch",0
3406 txtGame5: .db "LinkMatch",0
3407 txtGame6: .db "Race",0
3408 txtGame7: .db "CTF",0
3409 ; .db "Domination",0 ;8
3410 posGame: .db 0,txtGame1-txtGame
3411 .db txtGame2-txtGame
3412 .db txtGame3-txtGame
3413 .db txtGame4-txtGame
3414 .db txtGame5-txtGame
3415 .db txtGame6-txtGame
3416 .db txtGame7-txtGame
3418 txtKeyleft: .db "Left",0
3419 txtKeyright:.db " | Right",0
3420 txtLevsel: .db $CF," Select levels: ",5,0
3421 txtEName: .db "Enter name player ",0
3422 txtWaiting: .db "Waiting...",0
3423 txtReceive: .db "Receiving..." ;,0
3426 .db 0, 3, 6, 9, 12, 15, 18, 21
3427 .db 24, 27, 30, 33, 36, 39, 42, 45
3428 .db 48, 51, 54, 57, 59, 62, 65, 67
3429 .db 70, 73, 75, 78, 80, 82, 85, 87
3430 .db 89, 91, 94, 96, 98,100,102,103
3431 .db 105,107,108,110,112,113,114,116
3432 .db 117,118,119,120,121,122,123,123
3433 .db 124,125,125,126,126,126,126,126
3436 txtLevel: .db "Level ",0
3437 txtWorms: .db "Worms: 0",0 ;follows txtLevel
3438 txtName: .db "Name",0
3439 txtDied: .db "Died " ;follows txtName
3440 txtScore: .db "Score",0 ;follows txtDied
3441 txtLeft: .db " left",0 ;follows txtScore
3442 txthiscore:.db "HiScore:",0
3443 txtReady: .db "Prepare!",0
3445 txtGO: .db 5,5,5,5,5," GAME OVER ",$CF,$CF,$CF,$CF,$CF,0
3447 _datalink = %00000001 ;linkplay
3448 _datalivel = %00000010 ;lives=0 limit
3449 _datafoodl = %00000100 ;left=0 limit
3450 _datanextl = %00001000 ;next level if left=0
3451 _datasingl = %00001000 ;singleplayer=1
3452 ;1=hiscore+keep_length
3453 _datafood = %00010000 ;food present
3454 _datadie = %01000000 ;worm dies on impact
3455 _datascore = %10000000 ;score>=100 limit
3456 _datamultpeas = %00100000
3459 datalevels: .dw LevelDef, LevelDefM
3460 .dw LevelDefT,LevelDefM
3461 .dw LevelDefM,LevelDefM
3462 .dw LevelDefM,LevelDefC
3463 nrlevels: .db 1,3,1,3,3,3,3,1 ;=defaults
3468 datasingle: .db %01011110,3,1,1 ;3 lives (<must b unique)
3470 datapeas: .db %01011010,1,1,1 ;1 "
3472 datatron: .db %01000010,1,1,1
3474 datadeathm: .db %01000010,3,2,1
3476 datafoodm: .db %11010000,10,2,1 ;10 score limit (=100)
3478 datalinkm: .db %01000011,3,2,1
3480 datarace: .db %10000000,10,2,1
3482 datactf: .db %11100000,9,4,1
3484 ;datadomin: .db %01100000,3 ;==(8 modes)
3486 worm1set: .dw worm1p,worm1p
3487 .db %11110111,%00,-01,K_RIGHT,K_LEFT
3488 worm1name: .db "Wormy ",0
3489 worm2set: .dw worm2p,worm2p
3490 .db %11111011,%11,-01,K_F2,K_F1
3491 worm2name: .db "Viper ",0
3492 worm3set: .dw worm3p,worm3p
3493 .db %11111011,%00,-01,K_COMMA,K_STO
3494 worm3name: .db "Nibbler ",0
3495 worm4set: .dw worm4p,worm4p
3496 .db %11111011,%00,-01,K_PLUS,K_ENTER
3497 worm4name: .db "Jim ",0
3514 head = 13 ;4B (head=tail)
3515 tail = 15 ;also@next level
3517 reserv = 18 ;loop (race:lap|ctf:pea)
3528 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3529 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3530 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3531 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3532 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3533 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3534 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3535 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3536 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3537 .db " shiar0@hotmail.com",0
3540 defspriteimg: .db %01100000
3546 .db "Internal Levels" ;,0
3548 .db 0,deflevels/256,deflevels&255
3551 ;-----------------------------
3552 ;----------- end -------------
3553 ;-----------------------------