My next project is tools to manipulate an NES Stripe Image stored starting at $0108. (I chose $0108 because of how the 6502's only autoincrementing read instruction interacts with interrupts.) This would allow me to combine CHR and nametable updates in one vblank without needing a plethora of specific update formats such as the seven different bgup routines in RHDE. An update containing eight tiles would need two packet headers:
Code: Select all
$0100-$0107: scratch space in case the uploader is interrupted, enough for PC, P, A, X, Y
$0108-$010A: address and length for first four tiles
$010B-$014A: first four tiles
$014B-$014D: address and length for second four tiles
$014E-$018D: second four tiles
$018E: $FF terminator
Code: Select all
;;
; bagel_stream_ptr = the input stream pointer,
; points to after stream on exit.
; X = output buffer offset, restored on exit.
; Returns: flags of decrementing bagel_block_count