timotheeg / nestrischamps

A web-based OCR and restreamer system for NES Classic Tetris players
MIT License
45 stars 11 forks source link

Allow saving color palette on classic rom #136

Closed timotheeg closed 1 year ago

timotheeg commented 1 year ago

Context

In classic mode, the board is scanned using the colors read form the right side. This guarantees colors are in sync.

A capture setup for any Tetris player doesn't change however, so while each combination of console and capture hardware is sort of unique, the setup itself is very stable, so it would be much more efficient to store the color range across all levels once, and then use that palette in all games thereafter.

This will reduce the overall capture size required, and remove the need to scan the color.

Approach

In classic mode, NTC now tracks the colors for the 10 levels (colors read from the piece stats). When all 10 levels colors are captured, a new button Save Last Game's Palette is enabled.

When clicking it, the color palette is saved locally in local storage, the producer page reloaded, and the palette is used again right away.

A NTC user may then switch to a different rom (e.g. Das Trainer or Tetris Gym), select the saved palette, and recalibrate from it.

Caveat and Side effect: