Kautenja / RackNES

A Nintendo Entertainment System (NES) emulator module for VCV Rack.
Other
98 stars 3 forks source link

Improve Color Palette Memory Organization #8

Closed Kautenja closed 4 years ago

Kautenja commented 4 years ago
Kautenja commented 4 years ago

To address 1, the palette data structure was changed from 32-bit to 8-bit. This allows the palette to be stored in RGBA format irrespective of the memory model of the architecture (little-endian vs big-endian). The palette is still accessed as a 32-bit in places for copying entire pixels. This is a sketchy thing to do because the values are actually byte arrays and don't conform to the standard notion of what a uint32_t value should represent. This should be addressed to make the code more clear and less sketchy.

The loops were also replaced with memset and memcpy.

Kautenja commented 4 years ago

message passing using flags will not work in this case because the frame rate is much slower than the audio rate. The copy to the module is necessary