git.shiar.nl
/
wormy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
worm 0.80.0212: link improvements
[wormy.git]
/
worm.asm
diff --git
a/worm.asm
b/worm.asm
index b58bfe54836dded9f33b3148f62af318c444638d..6c8415462fec146fc27dd9273b0152677a7fbf42 100644
(file)
--- a/
worm.asm
+++ b/
worm.asm
@@
-272,8
+272,14
@@
setscorelimit:
linkmatch:
call _clrWindow
linkmatch:
call _clrWindow
+
+
+; in a,(7)
+; and %11
+; cp %11
ld a,WormVersion
ld a,WormVersion
- call SendByte
+; jr nz,host
+ call send
jr c,host
client:
jr c,host
client:
@@
-674,7
+680,7
@@
removewormloop:
;hl=ix+head
pop de ;ix+tail
ld a,(gameCar)
;hl=ix+head
pop de ;ix+tail
ld a,(gameCar)
- and _data
M
ulti
+ and _data
m
ulti
jr nz,safewormsizedone
; or a
sbc hl,de
jr nz,safewormsizedone
; or a
sbc hl,de
@@
-1809,6
+1815,8
@@
boxloopx:
;-----------------------------
;----------- link ------------
;-----------------------------
;-----------------------------
;----------- link ------------
;-----------------------------
+#ifdef 0
+TIMEOUT = $1200
send:
push af ;ld b,a
send:
push af ;ld b,a
@@
-1842,6
+1850,7
@@
ReceiveByteCont:
ReceiveByte:
call LinkPrep
ReceiveBits:
ReceiveByte:
call LinkPrep
ReceiveBits:
+ ld de,TIMEOUT
WaitRecBit:
call checklink
jr z,LinkFailed
WaitRecBit:
call checklink
jr z,LinkFailed
@@
-1859,6
+1868,7
@@
ReceiveLow:
ld (AckBit),a
ld a,d
out (7),a
ld (AckBit),a
ld a,d
out (7),a
+ ld de,TIMEOUT
WaitAckRec:
call checklink
cp 0
WaitAckRec:
call checklink
cp 0
@@
-1891,12
+1901,14
@@
sendbit:
ld a,D0hD1l
sendselected:
out (7),a
ld a,D0hD1l
sendselected:
out (7),a
+ ld de,TIMEOUT
waitacknowledge:
call checklink
jr nz,waitacknowledge
SendAcked:
ld a,D0hD1h
out (7),a
waitacknowledge:
call checklink
jr nz,waitacknowledge
SendAcked:
ld a,D0hD1h
out (7),a
+ ld de,TIMEOUT
waitsendready:
call checklink
cp %11
waitsendready:
call checklink
cp %11
@@
-1918,6
+1930,11
@@
linkerror:
jp Exit
checklink:
jp Exit
checklink:
+ pop hl
+ dec de
+ ld a,d
+ or e
+ jr z,LinkFailed
ld a,$BF ;key
call _readkeypad
bit 6,a
ld a,$BF ;key
call _readkeypad
bit 6,a
@@
-1925,6
+1942,7
@@
checklink:
in a,(7)
and %11
in a,(7)
and %11
+ jp (hl)
ret
_readkeypad:
ret
_readkeypad:
@@
-1935,6
+1953,97
@@
_readkeypad:
out (1),a
pop af
ret
out (1),a
pop af
ret
+#endif
+
+send:
+SendByte:
+ in a,(7)
+ and %11
+ jr z,nolink
+ ld b,8
+sendloop:
+ ld de,$8000
+ rl c
+ ld a,%11010100
+ jr nc,sendbit
+ ld a,%11101000
+sendbit:
+ out (7),a
+sendwait1:
+ call checklink
+ in a,(7)
+ and %11
+ jr nz,sendwait1
+ ld a,%11000000
+ out (7),a
+sendwait2:
+ call checklink
+ in a,(7)
+ and %11
+ cp %11
+ jr nz,sendwait2
+ djnz sendloop
+ xor a
+ ret
+timeout:
+ scf
+ ret
+
+
+receive:
+ in a,(7)
+ and %11
+ jr z,nolink
+ cp %11
+ jr z,receive
+ ld b,8
+receiveloop:
+ ld de,$8000
+receivewait1:
+ call checklink
+ in a,(7)
+ and %11
+ cp %11
+ jr z,receivewait1
+ rra
+ rl c
+ rra
+ ld a,%11010100
+ jr nc,receivebit
+ ld a,%11101000
+receivebit:
+ out (7),a
+receivewait2:
+ call checklink
+ in a,(7)
+ and %11
+ jr z,receivewait2
+ ld a,%11000000
+ out (7),a
+ djnz receiveloop
+ xor a
+ ret
+
+checklink:
+ dec de
+ ld a,d
+ or e
+ jr z,timeout
+ ld a,$BF ;key
+ call _readkeypad
+ bit 6,a
+ jr z,timeout
+ ret
+_readkeypad:
+ out (1),a
+ in a,(1)
+ push af
+ ld a,%11111111
+ out (1),a
+ pop af
+ ret
+nolink:
+ jp Exit
;-----------------------------
;---------- levels -----------
;-----------------------------
;---------- levels -----------
@@
-2119,6
+2228,7
@@
HiScore: .db 0
gamesdata:
_datalink = %00000001
gamesdata:
_datalink = %00000001
+_datamulti = %00000010
_datalivel = %00000010 ;ix+lives=0 limit
_datafoodl = %00000100 ;left=0 limit
_datanextl = %00001000 ;next level if left=0
_datalivel = %00000010 ;ix+lives=0 limit
_datafoodl = %00000100 ;left=0 limit
_datanextl = %00001000 ;next level if left=0