CHGame 0.3.0
Libraries for the CHGame handheld
Loading...
Searching...
No Matches
Internals and scratch

The converters the Benchmark example measures, the flush's chunk buffers as scratch memory, and the frame size. More...

Functions

uint32_t gfx_convertRows_ram (uint8_t *dst, uint16_t row, uint16_t rows)
 Converts framebuffer rows into the panel's format, with the converter in SRAM.
 
uint32_t gfx_convertRows_flash (uint8_t *dst, uint16_t row, uint16_t rows)
 Converts framebuffer rows into the panel's format, with the converter in flash (for comparison with gfx_convertRows_ram()).
 
uint32_t gfx_convertSpan_ram (uint8_t *dst, const uint8_t *src, uint32_t srcBytes)
 Converts a run of framebuffer bytes into the panel's format (the SRAM converter every flush uses).
 
uint8_t * gfx_chunkScratch (void)
 1 KB of word-aligned scratch memory: the flush's chunk buffers.
 
uint32_t gfx_frameBytes (void)
 Bytes the panel receives for a full frame in the current mode.
 

Detailed Description

The converters the Benchmark example measures, the flush's chunk buffers as scratch memory, and the frame size.

Function Documentation

◆ gfx_convertRows_ram()

uint32_t gfx_convertRows_ram ( uint8_t *  dst,
uint16_t  row,
uint16_t  rows 
)

Converts framebuffer rows into the panel's format, with the converter in SRAM.

_ram lives in SRAM, _flash lives in flash. Benchmarking both is how you measure the 3-wait-state penalty.

Parameters
dstWhere the panel-format bytes go.
rowFirst framebuffer row.
rowsHow many rows.
Returns
Bytes written to dst.

◆ gfx_convertRows_flash()

uint32_t gfx_convertRows_flash ( uint8_t *  dst,
uint16_t  row,
uint16_t  rows 
)

Converts framebuffer rows into the panel's format, with the converter in flash (for comparison with gfx_convertRows_ram()).

Parameters
dstWhere the panel-format bytes go.
rowFirst framebuffer row.
rowsHow many rows.
Returns
Bytes written to dst.

◆ gfx_convertSpan_ram()

uint32_t gfx_convertSpan_ram ( uint8_t *  dst,
const uint8_t *  src,
uint32_t  srcBytes 
)

Converts a run of framebuffer bytes into the panel's format (the SRAM converter every flush uses).

Parameters
dstWhere the panel-format bytes go.
src4 bpp source bytes, two pixels each.
srcBytesHow many source bytes.
Returns
Bytes written to dst.

◆ gfx_chunkScratch()

uint8_t * gfx_chunkScratch ( void  )

1 KB of word-aligned scratch memory: the flush's chunk buffers.

2 * GFX_CHUNK_BYTES, idle from gfx_wait() until the next flush starts. Handy for decoding, masks, building a flash page, an SD card block - never across a flush. gfx_sprite4Rot() and gfx_textFx() use it, so it does not survive them either.

Returns
The start of the scratch.

◆ gfx_frameBytes()

uint32_t gfx_frameBytes ( void  )

Bytes the panel receives for a full frame in the current mode.

Returns
32768 (16 bpp), 24576 (12 bpp) or 49152 (18 bpp) at 128x128.