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 ;"grays" 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 -- alpha 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
1446 ld a,$A7 ;exit@end of turn
1447 ld (CheckExit),a ;set exit state
1461 cal menuinvloop ;invert
1464 cal menuinvloop ;<hr>
1467 cal menuinvloop ;<hr>
1486 cal _vputs ;Died Score
1500 cp (hl) ;input=0 = link
1517 ld a,(hl) ;worm+died
1525 cal _ldHLind ;ld hl,(hl)
1526 cal showHL ;worm+score
1532 dnz displayWormStats
1535 or a ;singleplayer (0) only
1536 jr nz,hilevelcheckdone
1541 jr c,hilevelcheckdone
1542 ld (hl),a ;save local
1547 hilvlposhl =$-2 ;save external
1548 cal _writeb_inc_ahl ;ld (ahl),c
1554 jr z,hiscorecheckdone
1556 cal loadhiscoreposinahl
1557 cal _Get_Word_ahl ;de=old_hi
1565 jr c,NotNewHigh ;New<Old
1566 jr nz,newhigh ;New>Old
1570 jr nc,NotNewHigh ;new<old
1574 cal loadhiscoreposinahl
1575 cal _Set_Word_ahl ;de->(ahl)
1578 NotNewHigh: ;de=current hiscore
1599 ;x123456789012345678901
1600 ;>>>>>> GAME OVER <<<<<
1605 ;6Worm#02 @ 05 00120
1611 rst 20h ;_ABS_MOV10TOOP1
1613 ld hl,savestart-_asm_exec_ram+4
1617 cal _SET_ABS_DEST_ADDR
1621 cal _SET_ABS_SRC_ADDR
1622 ld hl,saveend-savestart
1623 cal _SET_MM_NUM_BYTES
1632 loadhiscoreposinahl:
1637 ld a,(nrlevels+1) ;# peaworm lvls
1644 dec a ;z=(Gametype)=2
1656 hiscrposa =$-1 ;ahl=saveloc
1662 dnz addlevelposition
1665 ;-----------------------------
1666 ;----------- worm ------------
1667 ;-----------------------------
1672 cal saverespawncounter
1678 jr DoesWormTailEqualsWormHead ;chk4 size=0
1689 DoesWormTailEqualsWormHead:
1691 jr nz,removewormloop
1695 jr nz,safewormsizedone
1703 ld (ix+tail),e ;head=tail/size=0
1709 jr nz,saverespawncounter
1737 ld a,%01111111 ;default
1740 dnz bitmask ;a/8 times
1741 out (1),a ;send bitmask
1742 in a,(1) ;input keys
1747 dnz keybit ;check match (cf set)
1750 inkeys: ;use jp not call!
1767 jr z,inlink ;input by link
1768 cal inkeys ;input by keys
1772 ld c,l ;send our keys
1784 ;------- handle worm ---------
1821 ;-------- move worm ----------
1849 notmoveY: ;bc=newpos
1856 pop hl ; << pos (old)
1874 ;--------- worm hit ----------
1880 cal z,checkhitotherworm
1882 and _datamultpeas ;&&bit
1886 jp z,WormDead ;no food
1893 cal DrawPea ;remove pea
1905 jp nz,Drawworm ;continue
1911 jp nz,Exit ;stack restored
1922 cal IncScore ;score+(40*level)
1926 pop hl ; << levelp new
1930 chkpeahit: ;hl=peapos
1959 ld hl,(peaspos) ;1st pea
1965 ld hl,(peaspos+2) ;2nd pea
1968 pop hl ;(peapos) 1st pea
1969 jp c,WormDead ;stopworm ;own pea hit
1971 ld a,e ;peek a (that's x86 asm for pop\push ;)
1974 ld hl,(peaspos+2) ;2nd pea
1987 cal DrawPea ;restore own flag
1988 jr sillylabel ;inv both\die
1990 hitflag: ;correct pea hit
2008 ret ;Z=yes: no flag taken
2010 ;-----------------------------
2029 jr nz,nextotherwormbit
2054 .db $dd,$7d ;ld a,lx
2057 jr nz,chkworm2 ; ret nz
2082 ;-------- draw worm ----------
2091 cal z,checkhitlapline
2097 ret z ;keep tail in "Tron"
2140 ;-----------------------------
2141 ;---------- ball -------------
2142 ;-----------------------------
2144 handlethoseneatlittleballs:
2190 bit 1,d ;1=up; 0=down
2220 letsmovetheotherway:
2235 ;-----------------------------
2236 ;----------- procs -----------
2237 ;-----------------------------
2241 ld a,%10000000 ;all key-masks
2244 inc a ;cp %11111111 (no keys pressed)
2245 jr nz,releasekeys ;keep waitin
2246 cal GET_KEY ;clear buffer
2292 jr nz,NewPea ;pixel found
2299 ;all ok; empty space
2308 ;----------- score -----------
2328 jr z,scorecommon ;hl/1000 not increased
2336 jr c,showstats ;<0=0
2343 jr z,showstats ;de=$FF??=no limit
2488 ;-----------------------------
2606 ld (ShiftRightCounter),a
2608 ld (ShiftRightChunk),a
2622 ShiftRightCounter = $-1
2644 ld (ShiftLeftCounter),a
2646 ld (ShiftLeftChunk),a
2648 jr nc,ShiftLeftSameByte
2667 ShiftLeftCounter = $-1
2678 jr nz,ShiftRowsRight
2712 ;----------- draw ------------
2726 CheckPixel: ;at bc in d
2733 ;CLEM's FIND_PIXEL (131+? cycles; 28+4 bytes)
2734 ;(b,c) to hl:a; "destroyes" ahl
2736 FindPixel: ;(b,c) to hl:a
2769 PutSprite: ;||@(b,c)
2770 ;by SHIAR only ix saved
2845 drawbox: ;(d,e)-(h,l)
2853 drawhline: ;(d,e)-(h,e)
2859 ld c,a ;starting mask
2901 drawline: ;(d,e)-(h,l)
3002 drawcircle: ;(d,e),h ;de=x,y; h=z
3013 ex (sp),hl ;push zz \ pop x,y
3014 cal circledraw ;(x-xx,y+yy)-(x+xx,y+yy)
3015 ;(x-xx,y-yy)-(x+xx,y-yy)
3016 cal circledraw ;(x-yy,y+xx)-(x+yy,y+xx)
3017 ;(x-yy,y-xx)-(x+yy,y-xx)
3019 ex (sp),hl ;push x,y \ pop zz
3022 dec a ;-256<h<0 = $FF**
3024 jr z,circlenext ;jump if zz<0
3028 add a,a ;a=2yy-2 ;nc
3030 sbc hl,de ;zz=zz-2yy+2
3038 add hl,de ;zz=zz+2xx+3
3047 circledraw: ;destr:de
3052 add hl,bc ;h=x+xx; l=y+yy
3054 cal drawline ;(h-b,l+c)-(h+b,l+c)
3060 cal drawline ;(h-b,l-c)-(h+b,l-c)
3061 ld a,b ;swap xx and yy
3071 ;**** link routines ****
3072 ;these are identical in concept to the routines used in ZTetris, ZPong, and probably
3073 ;every other link game out there. However, these are commented :)
3085 ;inputs: c=byte to send, both wires must be high by default
3086 ;outputs: b=8-number of bits sent, both wires high, goes to game over on certain conditions
3090 jr z,killlink ;if both lines low, get out of here (game over signal)
3091 ld b,8 ;sending 8 bits
3093 ld de,$8000 ;error timer
3094 rl c ;force high bit into carry
3095 ld a,%11010100 ;lower the red wire by default (sending 0) ($d4)
3096 jr nc,selected ;if high bit was 0, use above value
3097 ld a,%11101000 ;if 1, lower the white wire instead ($e8)
3099 out (7),a ;put it out the link port
3102 in a,(7) ;see what the wires are doing
3103 and %00000011 ;check lower 2 bits
3104 jr nz,waitconfirm ;if both bits 0, data was received ok (both wires low)
3106 out (7),a ;give the ok to raise both wires (one will be done automatically) ($c0)
3112 jr nz,waitconfirm2 ;wait for other calc to raise the other wire
3113 djnz sendloop ;continue sending
3114 xor a ;reset c; ld a,0
3115 ld (losses),a ;reset number of losses
3125 ;inputs: both wires must be high by default
3126 ;outputs: c=byte received, b=8-number of bits received, both wires high
3127 ; goes to game over on certain conditions
3131 jr z,killlink ;game over signal applies to receiving too
3132 ld b,8 ;receiving 8 bits
3134 ld de,$8000 ;error timer
3139 cp 3 ;if bits 0 and 1 set, both wires are high
3140 jr z,waitreceive ;wait for one of the wires to go low
3141 rra ;check red wire status
3142 rl c ;if set, red is high (thus white is low), so put the correct bit into c
3143 rra ;now check white wire (since the flags are destroyed)
3145 jr nc,selected2 ;if white is low, lower red and vice versa
3148 out (7),a ;so now both wires are low
3153 jr z,waitreceive2 ;wait for the wire we didn't lower to go high again (the other will remain low)
3155 out (7),a ;raise both wires since the other calc will have given the ok sign
3156 djnz receiveloop ;if not done, wait for next bit
3158 ld (losses),a ;reset number of losses
3161 linktimer: ;leave if we have to wait too long (and return an error)
3164 or e ;see if de is 0
3165 ret nz ;if not, keep going as usual
3166 ;otherwise we have to deal with a link failure
3168 out (7),a ;reset link status (both high)
3169 ld a,(losses) ;see how many consecutive losses we have
3171 ld (losses),a ;add this loss to it
3172 pop de ;fix the stack to leave the link routine (de is ok to destroy)
3173 cp 20 ;see if this is the 20th consecutive failure
3174 ret c ;if not, keep playing
3175 ;otherwise, all is probably lost...
3192 ;-----------------------------
3193 ;----------- link ------------
3194 ;-----------------------------
3224 Csend: ;--- send 8 bits in A --- destr:abcdehl ---
3230 out (7),a ;both high
3231 jr Csendloop ;CF = error
3233 Qsend: ;--- try to send 8 bits in C; CF=error --- destr:abcdehl ---
3239 ld b,8 ;bits to send
3242 rl c ;bit to send in cf
3243 ld a,D0LD1H ;0: lower white
3245 ld a,D0HD1L ;1: lower red
3247 out (7),a ;lower one (send bit)
3249 cal checklink ;other calc must lower other wire
3251 ld a,D0HD1H ;raise one, ok to raise other
3255 cp %11 ;both raised (by other calc)
3258 dnz sendloop ;repeat for all bits
3266 Crecv: ;--- receive 8 bits into A/C --- destr:abcdehl ---
3268 ret nc ;return if all went ok
3270 out (7),a ;raise both on error
3271 jr Crecv ;and try again
3273 Qrecv: ;--- receive 8 bits into A/C; CF=error --- destr:abcdehl ---
3276 jp z,Exit ;both low = error, quit
3279 ret z ;both high = nothing yet, wait
3280 ld b,8 ;bits to receive
3286 jr z,recvwait ;both high = nothing sent (yet)
3287 rra ;received bit in cf
3289 jr c,received ;lower white wire as well
3290 ld a,D0HD1L ;lower red
3293 out (7),a ;both wires low
3296 jr z,recvwaitack ;same wire will be raised again by other calc
3298 out (7),a ;raise both
3300 dnz recvloop ;repeat for all bits
3306 ;-----------------------------
3307 ;---------- levels -----------
3308 ;-----------------------------
3311 .db 5,4,15,15,0,0 ;peas,speed,growth,begin_size,sprite,balls
3312 .db 0,2,63 ;start d, y, x
3313 .db 128,57 ;field width (128-255), height (57-255)
3314 .db 0 ;no additional lines, boxes
3320 .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
3325 .db %1110000,%10001000,%10001000,%10001000,%1110000,0
3326 .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
3331 .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
3336 LevelDefT: ;tron=no delay
3338 .db %1110000,%10001000,%10001000,%10001000,%1110000,0
3339 .db $40,30,64,$C0,30,64, $00,30,64,$80,30,64
3345 .db %1110000,%10001000,%10001000,%10001000,%1110000,0
3346 .db $40,30,64,$C0,30,64, $00,30,64,$80,30,64
3351 ;-----------------------------
3352 ;---------- data -------------
3353 ;-----------------------------
3357 .db %01001010,%00101001,%00000111,%10000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%01110000,%00000000,%00000000,%00000000,%01000000,%00000000
3358 .db %10001010,%10101000,%10001111,%10000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%01111000,%00000000,%00000000,%00000000,%10100100,%01000000
3359 .db %10101010,%10101010,%10011100,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00011100,%00001110,%00000000,%00000000,%10101010,%10100000
3360 .db %01010001,%01000101,%00011000,%00011111,%00000000,%01111111,%11000000,%00111100,%00011110,%01111000,%00001100,%00011111,%00000000,%00000000,%11001001,%10100000
3361 .db %00000000,%00000000,%00111000,%00111111,%10000000,%11111111,%11100000,%11111110,%00111111,%11111100,%00001100,%00111011,%10000000,%00000011,%10001000,%00100000
3362 .db %01101010,%10010011,%00110000,%01110001,%11000001,%11000000,%01110001,%11100110,%01110011,%11001110,%00001100,%00110001,%10000000,%00000000,%10010000,%00100000
3363 .db %10001010,%00101010,%10110000,%01100000,%11000001,%10000000,%00111001,%10000000,%01100111,%11100110,%00001110,%01110001,%10000000,%00000000,%01100000,%01000000
3364 .db %11101110,%10111011,%00110000,%01100000,%11000001,%10110000,%00011011,%10000000,%11101110,%01110111,%00001110,%01110001,%10000011,%11100000,%00000011,%10000000
3365 .db %00101010,%10101010,%10110000,%01110001,%11000001,%10110000,%00011011,%00000000,%11001100,%00110011,%00000111,%11100001,%10001100,%00011000,%00010000,%00000000
3366 .db %11001010,%10101010,%10110000,%00110001,%10000001,%10110000,%00011011,%00000000,%11001100,%00110011,%00000011,%11000011,%10010000,%00000100,%00100011,%00001100
3367 .db %00000000,%00000000,%00111000,%00111011,%10000011,%10110000,%00011011,%00000000,%11001110,%01110011,%00000000,%00000011,%00010011,%00000100,%00100100,%10010010
3368 .db %00111001,%11000111,%00011000,%00011111,%00000011,%00110000,%00011011,%00000000,%11000111,%11100011,%10000000,%00000011,%00001100,%10000100,%00101000,%10010100
3369 .db %01100101,%00101000,%00011100,%00001110,%00000111,%00111000,%00111011,%10000000,%11000011,%11000001,%10000000,%00000111,%00000000,%01001110,%00101000,%10011000
3370 .db %01001101,%11001011,%00001110,%00111111,%10001110,%00011100,%01110001,%10000000,%11100000,%00000001,%11100000,%00001110,%00000000,%01010101,%00101000,%10011000
3371 .db %00111001,%01100111,%00000111,%11111011,%11111100,%00001111,%11100001,%11000000,%01100000,%00000000,%11111111,%11111100,%00000000,%10010101,%00100110,%00010100
3372 .db %00000000,%00000000,%00000011,%11100000,%11111000,%00000111,%11000000,%11000000,%01100000,%00000000,%00111111,%11111000,%11111111,%00001000,%11000001,%11100011
3374 txtMenu: .db "Mode",0 ;1st menu item
3380 posMenu: .dw $$2418,$231E,$2524,$1F2A,$1730,$1936
3381 txtGame: .db "Singleplayer",0
3382 txtGame1: .db "Peaworm",0
3383 txtGame2: .db "Tron",0
3384 txtGame3: .db "Deathmatch",0
3385 txtGame4: .db "Foodmatch",0
3386 txtGame5: .db "LinkMatch",0
3387 txtGame6: .db "Race",0
3388 txtGame7: .db "CTF",0
3389 ; .db "Domination",0 ;8
3390 posGame: .db 0,txtGame1-txtGame
3391 .db txtGame2-txtGame
3392 .db txtGame3-txtGame
3393 .db txtGame4-txtGame
3394 .db txtGame5-txtGame
3395 .db txtGame6-txtGame
3396 .db txtGame7-txtGame
3398 txtKeyleft: .db "Left",0
3399 txtKeyright:.db " | Right",0
3400 txtLevsel: .db $CF," Select levels: ",5,0
3401 txtEName: .db "Enter name player ",0
3402 txtWaiting: .db "Waiting...",0
3403 txtReceive: .db "Receiving..." ;,0
3406 .db 0, 3, 6, 9, 12, 15, 18, 21
3407 .db 24, 27, 30, 33, 36, 39, 42, 45
3408 .db 48, 51, 54, 57, 59, 62, 65, 67
3409 .db 70, 73, 75, 78, 80, 82, 85, 87
3410 .db 89, 91, 94, 96, 98,100,102,103
3411 .db 105,107,108,110,112,113,114,116
3412 .db 117,118,119,120,121,122,123,123
3413 .db 124,125,125,126,126,126,126,126
3416 txtLevel: .db "Level ",0
3417 txtWorms: .db "Worms: 0",0 ;follows txtLevel
3418 txtName: .db "Name",0
3419 txtDied: .db "Died " ;follows txtName
3420 txtScore: .db "Score",0 ;follows txtDied
3421 txtLeft: .db " left",0 ;follows txtScore
3422 txthiscore:.db "HiScore:",0
3423 txtReady: .db "Prepare!",0
3425 txtGO: .db 5,5,5,5,5," GAME OVER ",$CF,$CF,$CF,$CF,$CF,0
3427 _datalink = %00000001 ;linkplay
3428 _datalivel = %00000010 ;lives=0 limit
3429 _datafoodl = %00000100 ;left=0 limit
3430 _datanextl = %00001000 ;next level if left=0
3431 _datasingl = %00001000 ;singleplayer=1
3432 ;1=hiscore+keep_length
3433 _datafood = %00010000 ;food present
3434 _datadie = %01000000 ;worm dies on impact
3435 _datascore = %10000000 ;score>=100 limit
3436 _datamultpeas = %00100000
3439 datalevels: .dw LevelDef, LevelDefM
3440 .dw LevelDefT,LevelDefM
3441 .dw LevelDefM,LevelDefM
3442 .dw LevelDefM,LevelDefC
3443 nrlevels: .db 1,3,1,3,3,3,3,1 ;=defaults
3448 datasingle: .db %01011110,3,1,1 ;3 lives (<must b unique)
3450 datapeas: .db %01011010,1,1,1 ;1 "
3452 datatron: .db %01000010,1,2,1
3454 datadeathm: .db %01000010,3,2,1
3456 datafoodm: .db %11010000,10,2,1 ;10 score limit (=100)
3458 datalinkm: .db %01000011,3,2,1
3460 datarace: .db %10000000,10,2,1
3462 datactf: .db %11100000,9,4,1
3464 ;datadomin: .db %01100000,3 ;==(8 modes)
3466 worm1set: .dw worm1p,worm1p
3467 .db %11110111,%00,-01,K_RIGHT,K_LEFT
3468 worm1name: .db "Wormy ",0
3469 worm2set: .dw worm2p,worm2p
3470 .db %11111011,%11,-01,K_F2,K_F1
3471 worm2name: .db "Viper ",0
3472 worm3set: .dw worm3p,worm3p
3473 .db %11111011,%00,-01,K_COMMA,K_STO
3474 worm3name: .db "Nibbler ",0
3475 worm4set: .dw worm4p,worm4p
3476 .db %11111011,%00,-01,K_PLUS,K_ENTER
3477 worm4name: .db "Jim ",0
3494 head = 13 ;4B (head=tail)
3495 tail = 15 ;also@next level
3497 reserv = 18 ;loop (race:lap|ctf:pea)
3508 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3509 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3510 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3511 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3512 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3513 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3514 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3515 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3516 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3517 .db " shiar0@hotmail.com",0
3520 defspriteimg: .db %01100000
3526 .db "Internal Levels" ;,0
3528 .db 0,deflevels/256,deflevels&255
3531 ;-----------------------------
3532 ;----------- end -------------
3533 ;-----------------------------