Proof of concept DHGR encoding/playback

- Every time we process an ACK opcode, toggle page 1/page 2 soft
  switches to steer subsequent writes between MAIN and AUX memory
- while I'm here, squeeze out some unnecessary operations from the
  buffer management

On the player side, this is implemented by maintaining two screen
memory maps, and alternating between opcode streams for each of them.
This is using entirely the wrong colour model for errors, but
surprisingly it already works pretty well in practise (and the frame
rate is acceptable on test videos)

DHGR/HGR could be made runtime selectable by adding a header byte that
determines whether to set the DHGR soft switches before initiating
the decode loop.

While I'm in here, fix op_terminate to clear keyboard strobe before
waiting.
This commit is contained in:
kris
2019-03-27 21:37:06 +00:00
parent d4a27444c6
commit 10fa4bc72d
4 changed files with 97 additions and 65 deletions

View File

@@ -76,13 +76,18 @@ class Ack(Opcode):
"""Instructs player to perform TCP stream + buffer management."""
COMMAND = OpcodeCommand.ACK
def __init__(self, aux_active: bool):
self.aux_active = aux_active
def emit_data(self) -> Iterator[int]:
# Dummy bytes to pad out TCP frame
yield 0xff
# Flip $C054 or $C055 soft-switches to steer subsequent writes to
# MAIN/AUX screen memory
yield 0x54 if self.aux_active else 0x55
# Dummy byte to pad out TCP frame
yield 0xff
def __data_eq__(self, other):
return True
return self.aux_active == other.aux_active
class BaseTick(Opcode):