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
45 ;#define readytext ;displays "prepare" before level starts
46 ;#define invincible ;worms cannot die =)
53 #include "ti86asm.inc"
57 _divHLby10 = $4044 ;hl=hl/10
58 _divAby10 = $4DAF ;a=a/10
59 _HLTIMES10 = $41BF ;hl=hl*10
61 _clrWindow = $4A86 ;clear screen
62 _asapvar = $D6FC ;own name (worm)
63 _MOV4B = $429B ;4x ld (de),(hl)
64 _MOV5B = $4297 ;5x ld (de),(hl)
65 _mov9b = $4283 ;9x ld (de),(hl)
66 _ldHLind = $4010 ;ld hl,(hl)
67 _swapt_ = $45F3 ;ex_ahl_bde
68 _Get_Word_ahl = $521D ;ld de,(ahl)
69 _Set_Word_ahl = $5221 ;ld (ahl),de
70 _INC_PTR_AHL = $4637 ;ahl=ahl+1
71 _AHL_PLUS_2_PG3 = $4C3F ;ahl=ahl+2
72 _SET_ABS_SRC_ADDR = $4647 ;set source for mm.ldir =ahl
73 _LOAD_ABS_SRC_ADDR = $5209 ;ahl = mm.ldir source
74 _SET_ABS_DEST_ADDR = $5285 ;set destination for mm.ldir = ahl
75 _SET_MM_NUM_BYTES = $464F ;number of bytes for mm.ldir = ahl
76 _mm_ldir = $52ED ;24bit ldir
77 _RAM_PAGE_1 = $47E3 ;set $8000+ to page 1
79 _PTEMP_END = $D29A ;end of VAT
80 _load_ram_ahl = $462F ;ahl->page+hl
81 _writeb_inc_ahl = $5567 ;ld (ahl),c
82 _jforce = $409C ;TI-OS stack restored
83 _EXLP = $4493 ;swap (hl),(de) b times
85 ;-----------------------------
86 ;------- data storage -------
87 ;-----------------------------
91 ScrBuffer = $8820 ;-A7FF (20*FF=1FE0)
92 worm2p = $A800 ;-ABFF (400) %10101O00
93 worm1 = $AC00 ;-AC1D (31d)
94 worm2 = $AC1F ;-AC3B (1F)
95 worm3 = $AC3E ;-AC59 (1F)
96 worm4 = $AC5D ;-AC77 (1F)
97 balls = $AC7C ;-ACFF (3x43d)
98 SinCosTable = $AD00 ;-AE00 (4x40)
99 ;free $AE01 ;-AFFF (1FF)
100 worm1p = $B000 ;-B7FF (800) %1011O000
101 worm3p = $B800 ;-BBFF (400) %10111O00
102 ;free $BF91 ;-BFFF (6F)
104 ;program $D748 ;-E7FF (106D+4A)
105 ;free $E800 ;-EFFF (800)
106 worm4p = $F000 ;-F3FF (400) %11110O00
107 leveldata = $F400 ;-FA70 (<=671)
113 namelength = $BC00 ;(1) @menu
115 DispBuffer = $BC00 ;(10x57d) @game
120 ;-----------------------------
121 ;------- program start -------
122 ;-----------------------------
137 .db "WORMY by SHIAR -- alpha 93%",0
140 .db %10010110,%01101111
141 .db %10110101,%01001011
142 .db %01110011,%01001001
143 .db %00000011,%10000000
144 .db %00000001,%11100000
145 .db %00111000,%11111000
146 .db %01111110,%00111111
147 .db %11101111,%00001111
148 .db %11000011,%10000000
151 levelhead2 = 93 ;wormy levels header = "93"
182 ld bc,int_end-int_handler
189 ld hl,$BFFF ;VAT start
192 ld de,(_PTEMP_END+1) ;VAT end
225 ex de,hl ;ld ahl,(hl)
226 cal _AHL_PLUS_2_PG3 ;string id
227 cal _Get_Word_ahl ;ld de,(ahl)
232 jr nz,searchnext ;not worm
250 cal _Get_Word_ahl ;ld de,(ahl++)
255 ld a,e ;set new level
280 cal _puts ;"< Select levels: >"
299 cal _load_ram_ahl ;hl=ahl
300 ld b,(hl) ;b=title size
302 cal _putps ;destr=abchl
320 cp K_ENTER-K_EXIT+256
325 or a ;levelfile on page 0 (=internal)
335 ld (leveldataSize),de
344 cal _SET_ABS_SRC_ADDR ;levelsstart
347 cal _SET_ABS_DEST_ADDR ;store in mem.
350 cal _SET_MM_NUM_BYTES
353 cal _LOAD_ABS_SRC_ADDR ;->ahl
360 ldi ;(de),(hl)\inc hl
365 res 2,(iy+13) ;appAutoScroll
369 ;-----------------------------
370 ;----- build trig tables -----
371 ;-----------------------------
396 ;-----------------------------
397 ;---------- menu -------------
398 ;-----------------------------
400 DisplayMenu: ;---draw menu---
416 cal _vputs ;Mode \ Level \ Limit \ Worms \ worm # \ controls
420 jr setgame ;> dispmenusets > mainMenu
435 jp LetsGetThisPartyOn ;1/2/3/5
454 jp z,changelevel ;&&&jr??
466 jr nc,mainMenu ;may not become >(nrworms)
470 jp dispmenusets ;mainMenu
483 ; jr z,bchangecurworm
488 jr nz,changedcurworm ;save >0
494 jr c,mainMenu ;type 0/1
499 jr nc,mainMenu ;may not be >4
502 jr dispmenusets ;mainMenu
507 jr nz,changednrworms ;save >0
520 ld (curlevel),a ;reset level#
521 jr dispmenusets ;mainMenu
531 jr nc,_mainMenu ;&& _?
534 jr dispmenusets ;mainMenu
541 cal loadgamecar ;c=(gameCar)
542 ;a=(hl)=(Gametype+1)=(wormbeglives)
547 pop hl ;restore stack
548 jr _mainMenu ;singleplayer (no limit)
556 ld d,(hl) ;max level for sel.game
564 jr dispmenusets ;mainMenu
591 cal getcustomkey ;left
592 cal getcustomkey ;right
595 ;---display current settings---
598 ld hl,$FD97 ;begin pos
599 ld de,7 ;bytes to add
602 ld c,9 ;bytes to clear
618 add hl,de ;hl=posGame+(Gametype)
619 ld a,(hl) ;str.offset
623 ld (CURtxtGame),hl ;save for g/o
624 cal _vputs ;Singleplayer
635 cal cshowA ;liveslimit
648 pop hl ;cal loadgamecar
666 ld hl,$363E ;controls
672 ;--- handle menukeys ---
681 pop bc ;GET_KEY destr. b
691 menupos: ;highlight #b
704 add hl,hl ;$FD20+item*96
737 getwormname: ;of (curworm)
755 cal _puts ;"Enter name player "
825 .db 0,".<>!",0,0,0,0 ;down,L,R,up
826 .db 0,"XTOJE0",0 ;enter..clear
827 .db " WSNID9",0 ;(-)..custom
828 .db "ZVRMHC8",0 ;dot..del
829 .db "YUQLGB7#" ;0..xvar
830 .db $D9,"-PKFA6'" ;on..alpha
831 .db "54321*",0,$D0 ;F5..more
835 skiplevel: ;@hl - destr:ab - alter:hl
840 ld b,(hl) ;spritesize
851 inc b ;multiplayer lvl
853 inc b ;skip other 3 worms (9 bytes)
887 ;build: c=(gameCar)=(hl-1)
888 ; a=(wormbeglives)=(hl)
906 ;-----------------------------
907 ;-------- start game ---------
908 ;-----------------------------
912 ld (CheckExit),a ;set exit state
921 cal _HLTIMES10 ;hl=10*(hl)
922 ld (scorelimit),hl ;set limit
925 ld a,(Gametype) ;3bytes -> 2bytes
926 add a,24+1 ;go to datalevels
928 sbc hl,de ;datalevels
933 dec a ;ld a,$FF ;=no_limit
937 cal _ldHLind ;ld hl,(hl)
942 dec d ;levels to skip
984 ;-----------------------------
985 ;--------- game over ---------
986 ;-----------------------------
990 out (7),a ;link normal
994 ld a,4 ;4x (all worms)
1003 ld (hl),0 ;score+1=0
1010 ex de,hl ;de=wormX+head
1014 jr nz,createwormsloop
1016 pop hl ;begin of current level
1028 ;show end msg or smtn
1030 psh bc ;where to go afterwards
1031 inc hl ;location of ending-code
1032 jp (hl) ;go there ("call")
1054 ld b,0 ;bc=sprite size
1055 add hl,bc ;hl=behind sprite
1062 setsprite: ;de=@sprite ;a=sprsize
1095 ld a,SinCosTable/256
1107 ld bc,(worm2-worm1)-5
1112 ;-------- draw level ---------
1198 ;-----------------------------
1200 psh hl ; >> levelp new
1235 ld hl,4+(txtposReady*256)
1246 jr z,initfinished ;no link
1248 ld (Speed),a ;max.speed
1249 SwapPos: ;$18 xx -> $E6 xx
1253 ld (worm1+left),a ;worm 1 via link
1256 ld (worm2+left),a ;worm 2 via link
1265 ;-----------------------------
1266 ;----------- LOOP ------------
1267 ;-----------------------------
1286 jr nz,screeninvertloop
1299 ld (handledworm),a ;=0
1304 cal nz,handlethoseneatlittleballs
1317 inc (hl) ;1..nrworms
1320 ;-----------------------------
1321 ;---------- keys -------------
1322 ;-----------------------------
1337 rla ;=$17 (c=EXIT-key)
1348 ld (ix+delay),respawndelay
1372 ret nz ;HandleWorm done
1376 ld a,$A7 ;exit@end of turn
1377 ld (CheckExit),a ;set exit state
1391 cal menuinvloop ;invert
1394 cal menuinvloop ;<hr>
1397 cal menuinvloop ;<hr>
1416 cal _vputs ;Died Score
1430 cp (hl) ;input=0 = link
1447 ld a,(hl) ;worm+died
1455 cal _ldHLind ;ld hl,(hl)
1456 cal showHL ;worm+score
1462 dnz displayWormStats
1465 or a ;singleplayer (0) only
1466 jr nz,hilevelcheckdone
1471 jr c,hilevelcheckdone
1472 ld (hl),a ;save local
1477 hilvlposhl =$-2 ;save external
1478 cal _writeb_inc_ahl ;ld (ahl),c
1484 jr z,hiscorecheckdone
1486 cal loadhiscoreposinahl
1487 cal _Get_Word_ahl ;de=old_hi
1495 jr c,NotNewHigh ;New<Old
1496 jr nz,newhigh ;New>Old
1500 jr nc,NotNewHigh ;new<old
1504 cal loadhiscoreposinahl
1505 cal _Set_Word_ahl ;de->(ahl)
1508 NotNewHigh: ;de=current hiscore
1529 ;x123456789012345678901
1530 ;>>>>>> GAME OVER <<<<<
1535 ;6Worm#02 @ 05 00120
1541 rst 20h ;_ABS_MOV10TOOP1
1543 ld hl,savestart-_asm_exec_ram+4
1547 cal _SET_ABS_DEST_ADDR
1551 cal _SET_ABS_SRC_ADDR
1552 ld hl,saveend-savestart
1553 cal _SET_MM_NUM_BYTES
1562 loadhiscoreposinahl:
1567 ld a,(nrlevels+1) ;# peaworm lvls
1574 dec a ;z=(Gametype)=2
1586 hiscrposa =$-1 ;ahl=saveloc
1592 dnz addlevelposition
1595 ;-----------------------------
1596 ;----------- worm ------------
1597 ;-----------------------------
1602 cal saverespawncounter
1608 jr DoesWormTailEqualsWormHead ;chk4 size=0
1619 DoesWormTailEqualsWormHead:
1621 jr nz,removewormloop
1625 jr nz,safewormsizedone
1633 ld (ix+tail),e ;head=tail/size=0
1639 jr nz,saverespawncounter
1667 ld a,%01111111 ;default
1670 dnz bitmask ;a/8 times
1671 out (1),a ;send bitmask
1672 in a,(1) ;input keys
1677 dnz keybit ;check match (cf set)
1680 inkeys: ;use jp not call!
1697 jr z,inlink ;input by link
1698 cal inkeys ;input by keys
1702 ld c,l ;send our keys
1714 ;------- handle worm ---------
1751 ;-------- move worm ----------
1779 notmoveY: ;bc=newpos
1786 pop hl ; << pos (old)
1804 ;--------- worm hit ----------
1810 cal z,checkhitotherworm
1812 and _datamultpeas ;&&bit
1816 jp z,WormDead ;no food
1823 cal DrawPea ;remove pea
1835 jp nz,Drawworm ;continue
1841 jp nz,Exit ;stack restored
1852 cal IncScore ;score+(40*level)
1856 pop hl ; << levelp new
1860 chkpeahit: ;hl=peapos
1889 ld hl,(peaspos) ;1st pea
1895 ld hl,(peaspos+2) ;2nd pea
1898 pop hl ;(peapos) 1st pea
1899 jp c,WormDead ;stopworm ;own pea hit
1901 ld a,e ;peek a (that's x86 asm for pop\push ;)
1904 ld hl,(peaspos+2) ;2nd pea
1917 cal DrawPea ;restore own flag
1918 jr sillylabel ;inv both\die
1920 hitflag: ;correct pea hit
1938 ret ;Z=yes: no flag taken
1940 ;-----------------------------
1959 jr nz,nextotherwormbit
1984 .db $dd,$7d ;ld a,lx
1987 jr nz,chkworm2 ; ret nz
2012 ;-------- draw worm ----------
2021 cal z,checkhitlapline
2027 ret z ;keep tail in "Tron"
2070 ;-----------------------------
2071 ;---------- ball -------------
2072 ;-----------------------------
2074 handlethoseneatlittleballs:
2120 bit 1,d ;1=up; 0=down
2150 letsmovetheotherway:
2165 ;-----------------------------
2166 ;----------- procs -----------
2167 ;-----------------------------
2171 ld a,%10000000 ;all key-masks
2174 inc a ;cp %11111111 (no keys pressed)
2175 jr nz,releasekeys ;keep waitin
2176 cal GET_KEY ;clear buffer
2222 jr nz,NewPea ;pixel found
2229 ;all ok; empty space
2238 ;----------- score -----------
2258 jr z,scorecommon ;hl/1000 not increased
2266 jr c,showstats ;<0=0
2273 jr z,showstats ;de=$FF??=no limit
2418 ;-----------------------------
2536 ld (ShiftRightCounter),a
2538 ld (ShiftRightChunk),a
2552 ShiftRightCounter = $-1
2574 ld (ShiftLeftCounter),a
2576 ld (ShiftLeftChunk),a
2578 jr nc,ShiftLeftSameByte
2597 ShiftLeftCounter = $-1
2608 jr nz,ShiftRowsRight
2642 ;----------- draw ------------
2656 CheckPixel: ;at bc in d
2663 ;CLEM's FIND_PIXEL (131+? cycles; 28+4 bytes)
2664 ;(b,c) to hl:a; "destroyes" ahl
2666 FindPixel: ;(b,c) to hl:a
2699 PutSprite: ;||@(b,c)
2700 ;by SHIAR only ix saved
2769 drawbox: ;(d,e)-(h,l)
2898 circle: ;de=x,y; h=z
2909 ex (sp),hl ;push zz \ pop x,y
2910 cal circledraw ;(x-xx,y+yy)-(x+xx,y+yy)
2911 ;(x-xx,y-yy)-(x+xx,y-yy)
2912 cal circledraw ;(x-yy,y+xx)-(x+yy,y+xx)
2913 ;(x-yy,y-xx)-(x+yy,y-xx)
2915 ex (sp),hl ;push x,y \ pop zz
2918 dec a ;-256<h<0 = $FF**
2920 jr z,circlenext ;jump if zz<0
2924 add a,a ;a=2yy-2 ;nc
2926 sbc hl,de ;zz=zz-2yy+2
2934 add hl,de ;zz=zz+2xx+3
2943 circledraw: ;destr:de
2948 add hl,bc ;h=x+xx; l=y+yy
2950 cal drawline ;(h-b,l+c)-(h+b,l+c)
2956 cal drawline ;(h-b,l-c)-(h+b,l-c)
2957 ld a,b ;swap xx and yy
2967 ;**** link routines ****
2968 ;these are identical in concept to the routines used in ZTetris, ZPong, and probably
2969 ;every other link game out there. However, these are commented :)
2977 ;inputs: c=byte to send, both wires must be high by default
2978 ;outputs: b=8-number of bits sent, both wires high, goes to game over on certain conditions
2982 jr z,killlink ;if both lines low, get out of here (game over signal)
2983 ld b,8 ;sending 8 bits
2985 ld de,$8000 ;error timer
2986 rl c ;force high bit into carry
2987 ld a,%11010100 ;lower the red wire by default (sending 0) ($d4)
2988 jr nc,selected ;if high bit was 0, use above value
2989 ld a,%11101000 ;if 1, lower the white wire instead ($e8)
2991 out (7),a ;put it out the link port
2994 in a,(7) ;see what the wires are doing
2995 and %00000011 ;check lower 2 bits
2996 jr nz,waitconfirm ;if both bits 0, data was received ok (both wires low)
2998 out (7),a ;give the ok to raise both wires (one will be done automatically) ($c0)
3004 jr nz,waitconfirm2 ;wait for other calc to raise the other wire
3005 djnz sendloop ;continue sending
3006 xor a ;reset c; ld a,0
3007 ld (losses),a ;reset number of losses
3017 ;inputs: both wires must be high by default
3018 ;outputs: c=byte received, b=8-number of bits received, both wires high
3019 ; goes to game over on certain conditions
3023 jr z,killlink ;game over signal applies to receiving too
3024 ld b,8 ;receiving 8 bits
3026 ld de,$8000 ;error timer
3031 cp 3 ;if bits 0 and 1 set, both wires are high
3032 jr z,waitreceive ;wait for one of the wires to go low
3033 rra ;check red wire status
3034 rl c ;if set, red is high (thus white is low), so put the correct bit into c
3035 rra ;now check white wire (since the flags are destroyed)
3037 jr nc,selected2 ;if white is low, lower red and vice versa
3040 out (7),a ;so now both wires are low
3045 jr z,waitreceive2 ;wait for the wire we didn't lower to go high again (the other will remain low)
3047 out (7),a ;raise both wires since the other calc will have given the ok sign
3048 djnz receiveloop ;if not done, wait for next bit
3050 ld (losses),a ;reset number of losses
3053 linktimer: ;leave if we have to wait too long (and return an error)
3056 or e ;see if de is 0
3057 ret nz ;if not, keep going as usual
3058 ;otherwise we have to deal with a link failure
3060 out (7),a ;reset link status (both high)
3061 ld a,(losses) ;see how many consecutive losses we have
3063 ld (losses),a ;add this loss to it
3064 pop de ;fix the stack to leave the link routine (de is ok to destroy)
3065 cp 20 ;see if this is the 20th consecutive failure
3066 ret c ;if not, keep playing
3067 ;otherwise, all is probably lost...
3084 ;-----------------------------
3085 ;----------- link ------------
3086 ;-----------------------------
3116 Csend: ;--- send 8 bits in A --- destr:abcdehl ---
3122 out (7),a ;both high
3123 jr Csendloop ;CF = error
3125 Qsend: ;--- try to send 8 bits in C; CF=error --- destr:abcdehl ---
3131 ld b,8 ;bits to send
3134 rl c ;bit to send in cf
3135 ld a,D0LD1H ;0: lower white
3137 ld a,D0HD1L ;1: lower red
3139 out (7),a ;lower one (send bit)
3141 cal checklink ;other calc must lower other wire
3143 ld a,D0HD1H ;raise one, ok to raise other
3147 cp %11 ;both raised (by other calc)
3150 dnz sendloop ;repeat for all bits
3158 Crecv: ;--- receive 8 bits into A/C --- destr:abcdehl ---
3160 ret nc ;return if all went ok
3162 out (7),a ;raise both on error
3163 jr Crecv ;and try again
3165 Qrecv: ;--- receive 8 bits into A/C; CF=error --- destr:abcdehl ---
3168 jp z,Exit ;both low = error, quit
3171 ret z ;both high = nothing yet, wait
3172 ld b,8 ;bits to receive
3178 jr z,recvwait ;both high = nothing sent (yet)
3179 rra ;received bit in cf
3181 jr c,received ;lower white wire as well
3182 ld a,D0HD1L ;lower red
3185 out (7),a ;both wires low
3188 jr z,recvwaitack ;same wire will be raised again by other calc
3190 out (7),a ;raise both
3192 dnz recvloop ;repeat for all bits
3198 ;-----------------------------
3199 ;---------- levels -----------
3200 ;-----------------------------
3203 .db 5,4,15,15,0,0 ;peas,speed,growth,begin_size,sprite,balls
3204 .db 0,2,63 ;start d, y, x
3205 .db 128,57 ;field width (128-255), height (57-255)
3206 .db 0 ;no additional lines, boxes
3212 .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
3217 .db %1110000,%10001000,%10001000,%10001000,%1110000,0
3218 .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
3223 .db $40,30,2,$C0,30,125, $00,2,64,$80,54,64
3228 LevelDefT: ;tron=no delay
3230 .db %1110000,%10001000,%10001000,%10001000,%1110000,0
3231 .db $40,30,64,$C0,30,64, $00,30,64,$80,30,64
3237 .db %1110000,%10001000,%10001000,%10001000,%1110000,0
3238 .db $40,30,64,$C0,30,64, $00,30,64,$80,30,64
3243 ;-----------------------------
3244 ;---------- data -------------
3245 ;-----------------------------
3249 .db %01001010,%00101001,%00000111,%10000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%01110000,%00000000,%00000000,%00000000,%01000000,%00000000
3250 .db %10001010,%10101000,%10001111,%10000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%01111000,%00000000,%00000000,%00000000,%10100100,%01000000
3251 .db %10101010,%10101010,%10011100,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00000000,%00011100,%00001110,%00000000,%00000000,%10101010,%10100000
3252 .db %01010001,%01000101,%00011000,%00011111,%00000000,%01111111,%11000000,%00111100,%00011110,%01111000,%00001100,%00011111,%00000000,%00000000,%11001001,%10100000
3253 .db %00000000,%00000000,%00111000,%00111111,%10000000,%11111111,%11100000,%11111110,%00111111,%11111100,%00001100,%00111011,%10000000,%00000011,%10001000,%00100000
3254 .db %01101010,%10010011,%00110000,%01110001,%11000001,%11000000,%01110001,%11100110,%01110011,%11001110,%00001100,%00110001,%10000000,%00000000,%10010000,%00100000
3255 .db %10001010,%00101010,%10110000,%01100000,%11000001,%10000000,%00111001,%10000000,%01100111,%11100110,%00001110,%01110001,%10000000,%00000000,%01100000,%01000000
3256 .db %11101110,%10111011,%00110000,%01100000,%11000001,%10110000,%00011011,%10000000,%11101110,%01110111,%00001110,%01110001,%10000011,%11100000,%00000011,%10000000
3257 .db %00101010,%10101010,%10110000,%01110001,%11000001,%10110000,%00011011,%00000000,%11001100,%00110011,%00000111,%11100001,%10001100,%00011000,%00010000,%00000000
3258 .db %11001010,%10101010,%10110000,%00110001,%10000001,%10110000,%00011011,%00000000,%11001100,%00110011,%00000011,%11000011,%10010000,%00000100,%00100011,%00001100
3259 .db %00000000,%00000000,%00111000,%00111011,%10000011,%10110000,%00011011,%00000000,%11001110,%01110011,%00000000,%00000011,%00010011,%00000100,%00100100,%10010010
3260 .db %00111001,%11000111,%00011000,%00011111,%00000011,%00110000,%00011011,%00000000,%11000111,%11100011,%10000000,%00000011,%00001100,%10000100,%00101000,%10010100
3261 .db %01100101,%00101000,%00011100,%00001110,%00000111,%00111000,%00111011,%10000000,%11000011,%11000001,%10000000,%00000111,%00000000,%01001110,%00101000,%10011000
3262 .db %01001101,%11001011,%00001110,%00111111,%10001110,%00011100,%01110001,%10000000,%11100000,%00000001,%11100000,%00001110,%00000000,%01010101,%00101000,%10011000
3263 .db %00111001,%01100111,%00000111,%11111011,%11111100,%00001111,%11100001,%11000000,%01100000,%00000000,%11111111,%11111100,%00000000,%10010101,%00100110,%00010100
3264 .db %00000000,%00000000,%00000011,%11100000,%11111000,%00000111,%11000000,%11000000,%01100000,%00000000,%00111111,%11111000,%11111111,%00001000,%11000001,%11100011
3266 txtMenu: .db "Mode",0 ;1st menu item
3272 posMenu: .dw $$2418,$231E,$2524,$1F2A,$1730,$1936
3273 txtGame: .db "Singleplayer",0
3274 txtGame1: .db "Peaworm",0
3275 txtGame2: .db "Tron",0
3276 txtGame3: .db "Deathmatch",0
3277 txtGame4: .db "Foodmatch",0
3278 txtGame5: .db "LinkMatch",0
3279 txtGame6: .db "Race",0
3280 txtGame7: .db "CTF",0
3281 ; .db "Domination",0 ;8
3282 posGame: .db 0,txtGame1-txtGame
3283 .db txtGame2-txtGame
3284 .db txtGame3-txtGame
3285 .db txtGame4-txtGame
3286 .db txtGame5-txtGame
3287 .db txtGame6-txtGame
3288 .db txtGame7-txtGame
3290 txtKeyleft: .db "Left",0
3291 txtKeyright:.db " | Right",0
3292 txtLevsel: .db $CF," Select levels: ",5,0
3293 txtEName: .db "Enter name player ",0
3294 txtWaiting: .db "Waiting...",0
3295 txtReceive: .db "Receiving..." ;,0
3298 .db 0, 3, 6, 9, 12, 15, 18, 21
3299 .db 24, 27, 30, 33, 36, 39, 42, 45
3300 .db 48, 51, 54, 57, 59, 62, 65, 67
3301 .db 70, 73, 75, 78, 80, 82, 85, 87
3302 .db 89, 91, 94, 96, 98,100,102,103
3303 .db 105,107,108,110,112,113,114,116
3304 .db 117,118,119,120,121,122,123,123
3305 .db 124,125,125,126,126,126,126,126
3308 txtLevel: .db "Level ",0
3309 txtWorms: .db "Worms: 0",0 ;follows txtLevel
3310 txtName: .db "Name",0
3311 txtDied: .db "Died " ;follows txtName
3312 txtScore: .db "Score",0 ;follows txtDied
3313 txtLeft: .db " left",0 ;follows txtScore
3314 txthiscore:.db "HiScore:",0
3315 txtReady: .db "Prepare!",0
3317 txtGO: .db 5,5,5,5,5," GAME OVER ",$CF,$CF,$CF,$CF,$CF,0
3319 _datalink = %00000001 ;linkplay
3320 _datalivel = %00000010 ;lives=0 limit
3321 _datafoodl = %00000100 ;left=0 limit
3322 _datanextl = %00001000 ;next level if left=0
3323 _datasingl = %00001000 ;singleplayer=1
3324 ;1=hiscore+keep_length
3325 _datafood = %00010000 ;food present
3326 _datadie = %01000000 ;worm dies on impact
3327 _datascore = %10000000 ;score>=100 limit
3328 _datamultpeas = %00100000
3331 datalevels: .dw LevelDef, LevelDefT
3332 .dw LevelDefT,LevelDefM
3333 .dw LevelDefM,LevelDefM
3334 .dw LevelDefM,LevelDefC
3335 nrlevels: .db 1,3,1,3,3,3,3,1 ;=defaults
3340 datasingle: .db %01011110,3,1 ;3 lives (<must b unique)
3342 datapeas: .db %01011010,1,1 ;1 "
3344 datatron: .db %01000010,1,2
3346 datadeathm: .db %01000010,3,2
3348 datafoodm: .db %11010000,10,2 ;10 score limit (=100)
3350 datalinkm: .db %01000011,3,2
3352 datarace: .db %10000000,10,2
3354 datactf: .db %11100000,9,4
3356 ;datadomin: .db %01100000,3 ;==(8 modes)
3358 worm1set: .dw worm1p,worm1p
3359 .db %11110111,%00,%01111110,K_RIGHT,K_LEFT
3360 worm1name: .db "Wormy ",0
3361 worm2set: .dw worm2p,worm2p
3362 .db %11111011,%11,%00111111,K_F2,K_F1
3363 worm2name: .db "Viper ",0
3364 worm3set: .dw worm3p,worm3p
3365 .db %11111011,0,%01011111,K_COMMA,K_STO
3366 worm3name: .db "Nibbler ",0
3367 worm4set: .dw worm4p,worm4p
3368 .db %11111011,0,%01111101,K_PLUS,K_ENTER
3369 worm4name: .db "Spunky ",0
3386 head = 13 ;4B (head=tail)
3387 tail = 15 ;also@next level
3389 reserv = 18 ;loop (race:lap|ctf:pea)
3400 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3401 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3402 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3403 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3404 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3405 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3406 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3407 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3408 .db "WWW.SHIAR.ORG WWW.SHIAR.ORG "
3409 .db " shiar0@hotmail.com",0
3412 defspriteimg: .db %01100000
3418 .db 15,"Internal Levels"
3420 .db 0,deflevels/256,deflevels&255
3423 ;-----------------------------
3424 ;----------- end -------------
3425 ;-----------------------------