Rename labels conflicting with other capitalisation (eg Start vs start)
because some compilers (at least spasm) do not support case-sensitive
labeling.
grow = 6 ;level
died = 8 ;game:
score = 9
grow = 6 ;level
died = 8 ;game:
score = 9
lives = 12
head = 13
; �15B (wormNset)
tail = 15 ; |also@next level
storepos = 17 ; |
reserv = 18 ; |loop (race:lap|ctf:pea)
lives = 12
head = 13
; �15B (wormNset)
tail = 15 ; |also@next level
storepos = 17 ; |
reserv = 18 ; |loop (race:lap|ctf:pea)
-left = 19 ; |
-right = 20 ; |
+wleft = 19 ; |
+wright = 20 ; |
name = 21 ; |_
wormsize = 30 ;^mark^
name = 21 ; |_
wormsize = 30 ;^mark^
start: ;turn back NOW!
nop ;and so it begins...
start: ;turn back NOW!
nop ;and so it begins...
#ifndef id2
ld bc,$5242
rst 10h
#ifndef id2
ld bc,$5242
rst 10h
cal _AHL_PLUS_2_PG3 ;skip past length bytes
cal _Get_Word_ahl
ld hl,levelhead+(levelhead2*256)
cal _AHL_PLUS_2_PG3 ;skip past length bytes
cal _Get_Word_ahl
ld hl,levelhead+(levelhead2*256)
;--- search levels -------------------------------------------------------------
;--- search levels -------------------------------------------------------------
cal _runindicoff
cal _flushallmenus
cal _runindicoff
cal _flushallmenus
cp K_EXIT
jp z,ExitNoStats
cp K_MORE
cp K_EXIT
jp z,ExitNoStats
cp K_MORE
psh af
cal menupos
cal loadgamecar
psh af
cal menupos
cal loadgamecar
ld (hl),b ;+score+1=0
inc hl
ld c,2
ld (hl),b ;+score+1=0
inc hl
ld c,2
inc hl
ld (hl),3 ;+lives=x
wormbeglives =$-1
inc hl
ld (hl),3 ;+lives=x
wormbeglives =$-1
; 2 = link = 0 + link (name1)
; 3 = worm #2 = #2 + local(name2)
; 4 = link = 0 + link (name2)
; 2 = link = 0 + link (name1)
; 3 = worm #2 = #2 + local(name2)
; 4 = link = 0 + link (name2)
cal moveworm2 ;3=2
ld l,worm1+name&255
cal sendworm
cal moveworm2 ;3=2
ld l,worm1+name&255
cal sendworm
cal linkworm ;worm2+4 over link
pop hl ;loadgamecar
pop de ;leveldata
cal linkworm ;worm2+4 over link
pop hl ;loadgamecar
pop de ;leveldata
;--- set/send worms ------------------------------------------------------------
moveworm2:
;--- set/send worms ------------------------------------------------------------
moveworm2:
- ld hl,worm2+left
-moveworm: ;hl=wormN+left
+ ld hl,worm2+wleft
+moveworm: ;hl=wormN+wleft
ld d,worm1/256
ld bc,11
ldir ;keys+name worm(de) = worm(hl)
ret
ld d,worm1/256
ld bc,11
ldir ;keys+name worm(de) = worm(hl)
ret
-linkworm: ;hl=wormN+left
- ld (hl),0 ;worm1|2+left
+linkworm: ;hl=wormN+wleft
+ ld (hl),0 ;worm1|2+wleft
inc hl
inc hl ;+name
ld b,9
cal recvstuff
ld bc,worm3-worm1-11 ;+2
add hl,bc ;b=0
inc hl
inc hl ;+name
ld b,9
cal recvstuff
ld bc,worm3-worm1-11 ;+2
add hl,bc ;b=0
- ld (hl),b ;worm3|4+left
+ ld (hl),b ;worm3|4+wleft
inc hl
inc hl ;+name
ld b,9
inc hl
inc hl ;+name
ld b,9
; 2 = worm #1 = #1 + local(name1)
; 3 = link = 0 + link (name2)
; 4 = worm #2 = #2 + local(name2)
; 2 = worm #1 = #1 + local(name1)
; 3 = link = 0 + link (name2)
; 4 = worm #2 = #2 + local(name2)
- ld e,worm2+left&255
- ld hl,worm1+left
+ ld e,worm2+wleft&255
+ ld hl,worm1+wleft
cal linkworm ;worm1+3 over link
ld l,worm2+name&255
cal sendworm
cal linkworm ;worm1+3 over link
ld l,worm2+name&255
cal sendworm
GameLoop:
ld bc,(worm1+pos) ;camera worm #1
GameLoop:
ld bc,(worm1+pos) ;camera worm #1
or a ;if #1 not over link
jr nz,showfield
ld bc,(worm2+pos) ;otherwise view from #2
or a ;if #1 not over link
jr nz,showfield
ld bc,(worm2+pos) ;otherwise view from #2
- ld bc,left-died
- add hl,bc ;+left
+ ld bc,wleft-died
+ add hl,bc ;+wleft
+ cp (hl) ;wleft=0 = link
jr nz,NoLinkIndic
ld a,9
ld (_curCol),a
jr nz,NoLinkIndic
ld a,9
ld (_curCol),a
ld a,h ;previous
cp l ;changed?
ret z
ld a,h ;previous
cp l ;changed?
ret z
jr inputcall
chkkey: ;key=a
jr inputcall
chkkey: ;key=a
turnright =$-1
ld l,a
notright:
turnright =$-1
ld l,a
notright:
or a
jr z,inlink ;input by link
cal inkeys ;input by keys
or a
jr z,inlink ;input by link
cal inkeys ;input by keys
or a
ret nz ;live limit
alive:
or a
ret nz ;live limit
alive:
pop hl ;<<call hitworm
pop hl ;<<call HandleWorm
pop hl ;<<$some other call
pop hl ;<<call hitworm
pop hl ;<<call HandleWorm
pop hl ;<<$some other call
jp Nextlevel
chkpeahit: ;bc=ownpos;hl=peapos (destr:ad)
jp Nextlevel
chkpeahit: ;bc=ownpos;hl=peapos (destr:ad)
ld a,2
ld (flashtime),a
#ifdef w00t
ld a,2
ld (flashtime),a
#ifdef w00t
- ld (ix+delay),rspawndelay
+ ld (ix+wdelay),rspawndelay
ld a,(gamecar)
rra ;and _datalink
ret nc ;no link
ld a,(gamecar)
rra ;and _datalink
ret nc ;no link
or a
jr z,receivenewpeaoverlink
ld c,l ;send pea's pos
or a
jr z,receivenewpeaoverlink
ld c,l ;send pea's pos