mirror of
https://github.com/KrisKennaway/ii-vision.git
synced 2024-11-18 17:06:15 +00:00
Don't schedule a NOP for TCP frame padding; instead just have the ACK
include the 2 dummy reads.
This commit is contained in:
parent
7343aa39ed
commit
fffd05f4d1
7
movie.py
7
movie.py
@ -57,12 +57,7 @@ class Movie:
|
|||||||
# Keep track of where we are in TCP client socket buffer
|
# Keep track of where we are in TCP client socket buffer
|
||||||
socket_pos = self.stream_pos % 2048
|
socket_pos = self.stream_pos % 2048
|
||||||
if socket_pos >= 2044:
|
if socket_pos >= 2044:
|
||||||
# Pad out to last byte in frame
|
# 2 dummy bytes + 2 address bytes for next opcode
|
||||||
nops = (2047 - socket_pos) // 2
|
|
||||||
# print("At position %04x, padding with %d nops" % (
|
|
||||||
# socket_pos, nops))
|
|
||||||
for _ in range(nops):
|
|
||||||
yield from self._emit_bytes(opcodes.Nop())
|
|
||||||
yield from self._emit_bytes(opcodes.Ack())
|
yield from self._emit_bytes(opcodes.Ack())
|
||||||
yield from self._emit_bytes(op)
|
yield from self._emit_bytes(op)
|
||||||
|
|
||||||
|
@ -115,6 +115,11 @@ class Ack(Opcode):
|
|||||||
COMMAND = OpcodeCommand.ACK
|
COMMAND = OpcodeCommand.ACK
|
||||||
_CYCLES = 100 # TODO: count
|
_CYCLES = 100 # TODO: count
|
||||||
|
|
||||||
|
def emit_data(self) -> Iterator[int]:
|
||||||
|
# Dummy bytes to pad out TCP frame
|
||||||
|
yield 0xff
|
||||||
|
yield 0xff
|
||||||
|
|
||||||
def __data_eq__(self, other):
|
def __data_eq__(self, other):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user