|
pico9918-core 1.3.0
TMS9918A / F18A video display processor emulation in C99
|
pico9918-core - Core interface More...
#include "impl/pico9918_priv.h"#include "impl/pico9918_gpu_priv.h"#include "overlay/splash.h"#include <string.h>#include <stdlib.h>
Include dependency graph for pico9918.c:Go to the source code of this file.
Data Structures | |
| struct | TileRowAddr |
| struct | TileLayerConfig |
| struct | TextScroll |
Macros | |
| #define | EMITTER_NOINLINE PICO9918_NOINLINE |
| #define | MASK_NEXT_PIXEL 0x80000000u |
| #define | TEXT_SCROLL_CELL(s) ((s) & 0xffffu) |
| #define | TEXT_SCROLL_OFFSET(s) ((s) >> 16) |
| #define | TEXT80_COLOR_WORD(n) ((uint32_t)((n) * 0x111111u)) |
| #define | TEXT80_MASK_WORD(bits) |
| #define | TEXT80_MASK_WORD4(bits) TEXT80_MASK_WORD(bits), TEXT80_MASK_WORD(bits), TEXT80_MASK_WORD(bits), TEXT80_MASK_WORD(bits) |
| #define | TEXT40_NEXT_CELL() |
| #define | TEXT40_CELL(wrapping) |
| #define | TEXT40_ECM_CELL() |
| #define | TEXT_ROW_PARAMS |
| #define | TEXT_ROW_CLONE(name, cols, t2, e) |
| #define | TEXT80_NEXT_CELL() |
| #define | TEXT80_OPAQUE_CELL() |
| #define | TEXT80_OVERLAY_CELL() |
| #define | TEXT80_OVERLAY_STORE(shift) |
| #define | TEXT80_ROW_CLONE(name, cells, scroll) |
| #define | LOCKED_ROW_CLONE(name, g, m) |
| #define | TILE_ROW_PARAMS |
| #define | TILE_ROW_ARGS |
| #define | TILE_ROW_CLONE(name, t2, e, g, m) |
| #define | TILE_ROW_GM2 4 |
| #define | TILE_ROW_MCM 5 |
| #define | UNDER_PIXEL(n) |
| #define | MIXED_PIXEL(n) |
Typedefs | |
| typedef uint32_t | BitMask[9] |
| typedef uint32_t | TileMask[SCANLINE_MASK_WORDS] |
Functions | |
| PICO9918_COPY_STATE () PICO9918_SECTION_SCRATCH_Y(buffer) static uint32_t bg | |
| static | PICO9918_SECTION_SCRATCH_X (buffer) |
| create a new TMS9918 | |
| static pico9918_mode_t | tmsMode (pico9918_t *tms9918) |
| static uint8_t | tmsSpriteSize (pico9918_t *tms9918) |
| sprite size (8 or 16) | |
| static bool | tmsSpriteMag (pico9918_t *tms9918) |
| sprite size (0 = 1x, 1 = 2x) | |
| static uint16_t | tmsNameTableAddr (pico9918_t *tms9918) |
| name table base address | |
| static uint16_t | tmsNameTable2Addr (pico9918_t *tms9918) |
| name table base address | |
| static uint16_t | tmsColorTableAddr (pico9918_t *tms9918) |
| color table base address | |
| static uint16_t | tmsColorTable2Addr (pico9918_t *tms9918) |
| color table base address | |
| static uint16_t | tmsPatternTableAddr (pico9918_t *tms9918) |
| pattern table base address | |
| static uint16_t | tmsSpriteAttrTableAddr (pico9918_t *tms9918) |
| sprite attribute table base address | |
| static uint16_t | tmsSpritePatternTableAddr (pico9918_t *tms9918) |
| sprite pattern table base address | |
| static pico9918_color_t | tmsMainBgColor (pico9918_t *tms9918) |
| background color | |
| static pico9918_color_t | tmsMainFgColor (pico9918_t *tms9918) |
| foreground color | |
| static pico9918_color_t | tmsFgColor (pico9918_t *tms9918, uint8_t colorByte) |
| foreground color | |
| static pico9918_color_t | tmsBgColor (pico9918_t *tms9918, uint8_t colorByte) |
| background color | |
| static PICO9918_NOINLINE void | vdpRegisterReset (pico9918_t *tms9918) |
| static uint8_t | chipFeatures (pico9918_chip_t chip) |
| the feature bits a personality answers to - the ladder, in one place | |
| void | pico9918_set_chip (pico9918_t *tms9918, pico9918_chip_t chip) |
| select which chip this instance answers as | |
| pico9918_chip_t | pico9918_chip (pico9918_t *tms9918) |
| which chip this instance answers as | |
| void | pico9918_reset (pico9918_t *tms9918) |
| reset the new TMS9918 | |
| void | pico9918_destroy (pico9918_t *tms9918) |
| destroy a TMS9918 | |
| void | pico9918_write_addr (pico9918_t *tms9918, uint8_t data) |
| write an address (mode = 1) to the tms9918 | |
| uint8_t | pico9918_read_status (pico9918_t *tms9918) |
| read from the status register | |
| uint8_t | pico9918_peek_status (pico9918_t *tms9918) |
| read from the status register without resetting it | |
| void | pico9918_write_data (pico9918_t *tms9918, uint8_t data) |
| write data (mode = 0) to the tms9918 | |
| uint8_t | pico9918_read_data (pico9918_t *tms9918) |
| read data (mode = 0) from the tms9918 | |
| uint8_t | pico9918_read_data_no_inc (pico9918_t *tms9918) |
| read data (mode = 0) from the tms9918 | |
| bool | pico9918_interrupt_status (pico9918_t *tms9918) |
| return true if both INT status and INT control set | |
| void | pico9918_interrupt_set (pico9918_t *tms9918) |
| raise the INT status flag | |
| void | pico9918_set_status (pico9918_t *tms9918, uint8_t status) |
| set status flag | |
| static | PICO9918_SECTION_SCRATCH_X (lookup) |
| static uint32_t | tmsTestCollisionMask (const uint32_t xPos, const uint32_t spritePixels, const uint32_t spriteWidth) |
| Test and update the sprite collision mask. | |
| static void | tmsSetTransparentSpriteMask (const uint32_t xPos, const uint32_t spritePixels, const uint32_t spriteWidth) |
| set the transparent sprite mask. | |
| static void | tmsClearRowBitsMask (const uint32_t xPos, const uint32_t tilePixels, const uint32_t tileWidth, BitMask rowBitsMask) |
| Clear the row pixels bit mask. | |
| static void | tmsUpdateRowBitsMaskAligned (const uint32_t xPos, const uint32_t tilePixels, BitMask rowBitsMask) |
| Update the row pixels bit mask (aligned - no word boundary crossing). | |
| static uint32_t | tmsTestRowBitsMaskAligned (const uint32_t xPos, const uint32_t tilePixels, const BitMask rowBitsMask) |
| Test against the row pixels bit mask (aligned - no word boundary crossing). | |
| static PICO9918_NOINLINE void | tmsCopyAlignMask (TileMask dstMask, const TileMask srcMask, int pixelShift) |
| static PICO9918_NOINLINE void | tmsRestoreAlignMask (TileMask dstMask, const TileMask srcMask, int pixelShift, int otherShift) |
| static uint32_t | tmsTestRowBitsMask (const uint32_t xPos, const uint32_t tilePixels, const uint32_t tileWidth, const bool update, const bool test, const bool testColl) |
| Test and update the row pixels bit mask. | |
| static uint32_t | PICO9918_UNINITIALIZED (ecmLookup)[16 *16 *16] |
| static uint8_t | ecmByte (bool h, bool m, bool l) |
| static void | ecmLookupInit (void) |
| static uint32_t | repeatedPalette (const uint32_t index) |
| void | initLookups (void) |
| static uint32_t | ecmSplitQuads (const uint32_t patt) |
| static uint32_t | calculateEcmIndex (const uint32_t ecm, const uint32_t sb0, const uint32_t sb1, const uint32_t sb2) |
| static void | loadSpriteData (const uint8_t *vram, uint32_t *spriteBits, uint32_t pattOffset, uint32_t *pattMask, const uint32_t ecm, const uint32_t ecmOffset, const bool flipX, const bool sprite16) |
| static uint32_t | spriteEcm (pico9918_t *tms9918) |
| the sprite ECM level, zero on a locked device - the one term a clone can pin | |
| static uint8_t | renderSprites (pico9918_t *tms9918, const uint32_t spriteCount, const bool spriteMag, const bool wide, const bool ecm0, uint8_t pixels[TMS9918_PIXELS_X]) |
| Output Sprites to a scanline. | |
| static uint8_t | pico9918_output_sprites (pico9918_t *tms9918, uint16_t y, uint8_t pixels[TMS9918_PIXELS_X]) |
| static void | tileRowAddr (pico9918_t *tms9918, const uint16_t y, const uint16_t rawY, const uint8_t colorReg, const bool gm2, const bool mcm, TileRowAddr *addr, uint16_t *colorTableAddr) |
| the per-mode half of a tile row's addressing, once per layer per scanline. | |
| static uint32_t | textScrollCell (const uint32_t hscrollPixels) |
| static uint32_t | textScrollSplit (const uint32_t hscroll, const bool wide) |
| static uint32_t | textPixelOffset (const uint32_t hscroll, const bool wide) |
| static int | scrollOffset (const uint32_t hscroll, const bool text, const bool wide) |
| static TextScroll | textScroll80 (pico9918_t *tms9918, const TileLayerConfig *config) |
| static void | tileLayerAddr (pico9918_t *tms9918, const uint16_t rawY, const TileLayerConfig *config, const uint8_t numCols, const uint8_t nameAddrMask, const bool textMode, const bool gm2, const bool mcm, const bool attrPerPos, TileRowAddr *addr, uint16_t *namesAddr, uint16_t *colorAddr) |
| where one layer reads this scanline from: the vertical scroll and its page swap, the name and colour rows, and the mode's pattern table. | |
| PICO9918_INLINE_HOT void | renderTextRow (pico9918_t *tms9918, const uint8_t *__restrict rowNames, const TileRowAddr *__restrict addr, const uint8_t *__restrict rowColors, const uint32_t colorStride, uint32_t pal, uint8_t *__restrict dest, const uint32_t scroll, const bool alwaysOnTop, const uint32_t numCols, const bool isTile2, const uint32_t ecm, const bool blend) |
| one 40- or 80-column text row, six pixels a cell at one byte each | |
| static void | text80RowT2Blend (pico9918_t *tms9918, const uint8_t *rowNames, const TileRowAddr *addr, const uint8_t *rowColors, const uint32_t colorStride, const uint32_t pal, uint8_t *dest, const uint32_t scroll, const bool alwaysOnTop) |
| PICO9918_INLINE_HOT void | renderText80Row (pico9918_t *tms9918, const uint8_t *__restrict rowNames, const uint8_t *__restrict patternTable, const uint8_t *__restrict rowColors, const bool opaq, uint8_t *__restrict pixels, const uint32_t startCol, const uint32_t numCells, const bool scrolled) |
| one 80-column text row, six pixels a cell at half a byte each. | |
| static void | renderText80Layer (pico9918_t *tms9918, const uint8_t *rowNames, const uint8_t *patternTable, const uint8_t *rowColors, const bool opaq, uint8_t *pixels, const uint32_t startCol, const uint32_t numCells, const bool scrolled) |
| static uint8_t * | text80TwoTone (const uint8_t *__restrict names, const uint8_t *__restrict patternTable, const uint32_t bgWord, const uint32_t diffWord, uint8_t *__restrict pixels, uint32_t cells) |
| static void | text_scan_line (pico9918_t *tms9918, uint16_t y, uint8_t pixels[TMS9918_PIXELS_X]) |
| generate a 40- or 80-column text mode scanline. | |
| static void | writeToAlignedBuffer (uint8_t *buffer, uint32_t xPos, const uint32_t left, const uint32_t right) |
| Write full tile to aligned buffer - 8 pixels at once. | |
| static void | renderEcm0Tile (pico9918_t *tms9918, uint8_t *buffer, const uint32_t xPos, const uint8_t pattIdx, const uint8_t patternTable[], const uint32_t colorTableAddr, const uint32_t pal, const bool isTile2, const bool gm2Color, const bool mcm) |
| render an ECM0 (enhanced color mode) graphics I tile. | |
| static void | renderEcmTileToAlignedBuffer (pico9918_t *tms9918, uint8_t *buffer, const uint32_t xPos, const uint32_t pixelOffset, const uint8_t pattIdx, const uint8_t patternTable[], const uint32_t colorTableAddr, const uint32_t ecm, const uint32_t ecmOffset, const uint32_t ecmColorMask, const uint32_t ecmColorOffset, const uint32_t pal, const bool attrPerPos, const int32_t flipY, const uint32_t tileIndex, uint32_t *lastEmpty, const bool isTile2, const bool alwaysOnTop) |
| render one ECM tile into the layer buffer | |
| static void | lockedFgBg (pico9918_t *tms9918, uint32_t fgbg[2], const uint8_t pal, const uint32_t colorByte) |
| PICO9918_INLINE_HOT void | renderTileRowLocked (pico9918_t *tms9918, uint16_t rowNamesAddr, uint16_t colorTableAddr, uint8_t tileIndex, uint8_t pal, uint8_t pixels[TMS9918_PIXELS_X], const TileRowAddr *addr, const bool gm2, const bool mcm) |
| generate a locked (plain TMS9918) tile row, straight into the scanline | |
| PICO9918_INLINE_HOT void | renderTileRow (pico9918_t *tms9918, const bool hpSize, uint16_t rowNamesAddr, uint16_t colorTableAddr, uint8_t tileIndex, uint8_t startPattBit, const bool attrPerPos, uint8_t pal, const bool alwaysOnTop, const TileRowAddr *addr, const bool isTile2, const uint32_t ecm, const bool gm2, const bool mcm) |
| PICO9918_INLINE_HOT void | f18a_tile_layer_scan_line (pico9918_t *tms9918, uint16_t y, const TileLayerConfig *config, const bool blend) |
| generate a tile mode scanline for either T1 or T2 layer | |
| static void | f18a_tile1_scan_line (pico9918_t *tms9918, uint16_t y) |
| generate a Graphics I mode scanline for the T1 layer | |
| static void | f18a_tile2_scan_line (pico9918_t *tms9918, uint16_t y, const bool blend) |
| generate a Graphics I mode scanline for the T2 layer | |
| PICO9918_INLINE_HOT bool | renderBitmapLayerBody (pico9918_t *tms9918, uint16_t y, bool opaque, const uint8_t width, const uint16_t addr, const uint8_t bmlCtl, uint8_t pixels[TMS9918_PIXELS_X], const bool wide, const bool intoTile1) |
| generate an F18A bitmap layer scanline | |
| static bool | renderBitmapLayer80 (pico9918_t *tms9918, uint16_t y, bool opaque, const uint8_t width, const uint16_t addr, const uint8_t bmlCtl, uint8_t pixels[TMS9918_PIXELS_X], const bool intoTile1) |
| static bool | renderBitmapLayer40 (pico9918_t *tms9918, uint16_t y, bool opaque, const uint8_t width, const uint16_t addr, const uint8_t bmlCtl, uint8_t pixels[TMS9918_PIXELS_X]) |
| static bool | bitmap_layer_scan_line (pico9918_t *tms9918, uint16_t y, uint8_t pixels[TMS9918_PIXELS_X], const bool intoTile1) |
| generate an F18A bitmap layer scanline | |
| static void | compositeChunkWide (uint32_t *__restrict pix32, const uint32_t *__restrict l1, const uint32_t *__restrict l2, uint32_t sel, uint32_t open, const bool hasSprites) |
| static void | compositeChunkUnder (uint8_t *__restrict pixels, const uint8_t *__restrict layer1, const uint8_t *__restrict layer2, uint32_t mask, uint32_t spriteMask, const bool hasSprites) |
| static void | compositeChunkBytes (uint8_t *__restrict pixels, const uint8_t *__restrict layer1, const uint8_t *__restrict layer2, uint32_t mask, uint32_t spriteMask, const bool hasSprites) |
| static uint32_t | spriteGridWord (const uint32_t maskWord, const BitMask mask, const bool wide) |
| static void | overlaySpritesOnTile1 (uint32_t *__restrict dst, const uint32_t *__restrict src, const bool wide) |
| PICO9918_INLINE_HOT void | compositeAlignedBody (pico9918_t *tms9918, uint8_t pixels[TMS9918_PIXELS_X], const int t1Scroll, const int t2Scroll, const bool wide) |
| static void | compositeAligned40 (pico9918_t *tms9918, uint8_t pixels[TMS9918_PIXELS_X], const int t1Scroll, const int t2Scroll) |
| static void | compositeAligned80 (pico9918_t *tms9918, uint8_t pixels[TMS9918_PIXELS_X], const int t1Scroll, const int t2Scroll) |
| static void | compositeAlignedTileBuffers (pico9918_t *tms9918, uint8_t pixels[TMS9918_PIXELS_X], const int t1Scroll, const int t2Scroll, const bool wide) |
| static PICO9918_NOINLINE void | compositeTile2OnlyBuffer (pico9918_t *tms9918, uint8_t pixels[TMS9918_PIXELS_X], const int t2Scroll, const bool wide) |
| Composite with tile layer 1 disabled (reg 0x32 bit 4). | |
| static void | textRowBorder (pico9918_t *tms9918, const int t1Scroll, const uint32_t padding, const uint32_t width) |
| A text row draws 240 of the 256 pixels and the composite copies all of them, so layer 1's buffer has to carry the side borders itself. | |
| static uint8_t | graphics_i_scan_line (pico9918_t *tms9918, uint16_t y, uint8_t pixels[TMS9918_PIXELS_X]) |
| generate a Graphics I or Graphics II mode scanline | |
| uint8_t | pico9918_scan_line (pico9918_t *tms9918, uint16_t y) |
| generate a scanline | |
| uint8_t | pico9918_reg_value (pico9918_t *tms9918, pico9918_register_t reg) |
| return a register value - see the header for the locked-device aliasing | |
| uint8_t | pico9918_status_value (pico9918_t *tms9918, pico9918_status_register_t reg) |
| return a status register value without the side effects of reading it | |
| void | pico9918_write_reg_value_impl (pico9918_t *tms9918, uint8_t reg, uint8_t value) |
| set a register from the second byte of a host register write | |
| uint8_t | pico9918_vram_value (pico9918_t *tms9918, uint16_t addr) |
| return a value from vram | |
| bool | pico9918_display_enabled (pico9918_t *tms9918) |
| check BLANK flag | |
| pico9918_mode_t | pico9918_display_mode (pico9918_t *tms9918) |
| current display mode | |
| void | pico9918_debug_sync_mode_impl (pico9918_t *tms9918) |
| see impl/pico9918_priv.h. | |
| uint32_t | pico9918_line_bytes (pico9918_t *tms9918) |
| how many bytes of pixels[] this mode fills. | |
| const uint8_t * | pico9918_line_source (pico9918_t *tms9918) |
| where the scanline just generated actually is. | |
| uint16_t | pico9918_default_palette (int index) |
| a default palette entry, 0xargb | |
Variables | |
| static const pico9918_mode_t | r1Modes [] |
| static const uint16_t | defaultPalette [] |
| static const uint32_t | zeroWord = 0 |
| rowMasks | |
| static uint8_t | doubledBitsNibble [16] |
| static uint32_t | transparentPixels [2] |
| bool | lookupsReady = false |
| static const TileLayerConfig | T1_CONFIG |
| static const TileLayerConfig | T2_CONFIG |
| static const uint32_t | text80ColorWord [16] |
| static const uint32_t | text80MaskWord [256] |
| static void(*const | textRowClones [2][4])(pico9918_t *tms9918, const uint8_t *rowNames, const TileRowAddr *addr, const uint8_t *rowColors, const uint32_t colorStride, const uint32_t pal, uint8_t *dest, const uint32_t scroll, const bool alwaysOnTop) |
| static void(*const | text80RowClones [2][4])(pico9918_t *tms9918, const uint8_t *rowNames, const TileRowAddr *addr, const uint8_t *rowColors, const uint32_t colorStride, const uint32_t pal, uint8_t *dest, const uint32_t scroll, const bool alwaysOnTop) |
| static void(*const | tileRowClones [2][6])(pico9918_t *tms9918, const bool hpSize, uint16_t rowNamesAddr, uint16_t colorTableAddr, uint8_t tileIndex, uint8_t startPattBit, const bool attrPerPos, uint8_t pal, const bool alwaysOnTop, const TileRowAddr *addr) |
| static bool | underLayer = false |
| const uint8_t * | pico9918_cached_line_source = 0 |
pico9918-core - Core interface
Copyright (c) 2021 Troy Schrapel
This code is licensed under the MIT license
https://github.com/visrealm/pico9918-core
Definition in file pico9918.c.
| #define EMITTER_NOINLINE PICO9918_NOINLINE |
Definition at line 26 of file pico9918.c.
| #define MASK_NEXT_PIXEL 0x80000000u |
Definition at line 443 of file pico9918.c.
| #define TEXT_SCROLL_CELL | ( | s | ) | ((s) & 0xffffu) |
Definition at line 1343 of file pico9918.c.
| #define TEXT_SCROLL_OFFSET | ( | s | ) | ((s) >> 16) |
Definition at line 1344 of file pico9918.c.
| #define TEXT80_COLOR_WORD | ( | n | ) | ((uint32_t)((n) * 0x111111u)) |
Definition at line 1496 of file pico9918.c.
| #define TEXT80_MASK_WORD | ( | bits | ) |
Definition at line 1497 of file pico9918.c.
| #define TEXT80_MASK_WORD4 | ( | bits | ) | TEXT80_MASK_WORD(bits), TEXT80_MASK_WORD(bits), TEXT80_MASK_WORD(bits), TEXT80_MASK_WORD(bits) |
Definition at line 1510 of file pico9918.c.
| #define TEXT40_NEXT_CELL | ( | ) |
| #define TEXT_ROW_PARAMS |
Definition at line 1803 of file pico9918.c.
| #define TEXT_ROW_CLONE | ( | name, | |
| cols, | |||
| t2, | |||
| e | |||
| ) |
Definition at line 1807 of file pico9918.c.
| #define TEXT80_NEXT_CELL | ( | ) |
| #define TEXT80_OPAQUE_CELL | ( | ) |
| #define TEXT80_OVERLAY_CELL | ( | ) |
| #define TEXT80_OVERLAY_STORE | ( | shift | ) |
| #define TEXT80_ROW_CLONE | ( | name, | |
| cells, | |||
| scroll | |||
| ) |
Definition at line 2008 of file pico9918.c.
| #define LOCKED_ROW_CLONE | ( | name, | |
| g, | |||
| m | |||
| ) |
Definition at line 2374 of file pico9918.c.
| #define TILE_ROW_PARAMS |
Definition at line 2398 of file pico9918.c.
| #define TILE_ROW_ARGS |
Definition at line 2402 of file pico9918.c.
| #define TILE_ROW_CLONE | ( | name, | |
| t2, | |||
| e, | |||
| g, | |||
| m | |||
| ) |
Definition at line 2465 of file pico9918.c.
| #define TILE_ROW_GM2 4 |
Definition at line 2486 of file pico9918.c.
| #define TILE_ROW_MCM 5 |
Definition at line 2487 of file pico9918.c.
| #define UNDER_PIXEL | ( | n | ) |
| #define MIXED_PIXEL | ( | n | ) |
| typedef uint32_t BitMask[9] |
Definition at line 438 of file pico9918.c.
| typedef uint32_t TileMask[SCANLINE_MASK_WORDS] |
Definition at line 439 of file pico9918.c.
|
static |
create a new TMS9918
Definition at line 46 of file pico9918.c.
References PICO9918_BASE_TMS9918, PICO9918_CHIP_MAX, PICO9918_INST, PICO9918_INST_ONLY, pico9918_reset(), and pico9918_set_chip().
|
inlinestatic |
Definition at line 115 of file pico9918.c.
|
inlinestatic |
sprite size (8 or 16)
Definition at line 134 of file pico9918.c.
References TMS_R1_SPRITE_16.
Referenced by renderSprites().
|
inlinestatic |
sprite size (0 = 1x, 1 = 2x)
Definition at line 140 of file pico9918.c.
References TMS_R1_SPRITE_MAG2.
|
inlinestatic |
name table base address
Definition at line 146 of file pico9918.c.
Referenced by graphics_i_scan_line().
|
inlinestatic |
name table base address
Definition at line 152 of file pico9918.c.
References PICO9918_REG_NAME_TABLE2.
|
inlinestatic |
color table base address
Definition at line 158 of file pico9918.c.
Referenced by graphics_i_scan_line().
|
inlinestatic |
color table base address
Definition at line 166 of file pico9918.c.
References PICO9918_REG_COLOR_TABLE2.
|
inlinestatic |
|
inlinestatic |
sprite attribute table base address
Definition at line 182 of file pico9918.c.
|
inlinestatic |
sprite pattern table base address
Definition at line 188 of file pico9918.c.
Referenced by renderSprites().
|
inlinestatic |
background color
Definition at line 194 of file pico9918.c.
Referenced by f18a_tile_layer_scan_line(), pico9918_scan_line(), renderText80Row(), text_scan_line(), tmsBgColor(), tmsFgColor(), and tmsMainFgColor().
|
inlinestatic |
foreground color
Definition at line 200 of file pico9918.c.
References tmsMainBgColor().
Referenced by f18a_tile_layer_scan_line(), and text_scan_line().
|
inlinestatic |
|
inlinestatic |
|
static |
Definition at line 236 of file pico9918.c.
|
static |
the feature bits a personality answers to - the ladder, in one place
Definition at line 259 of file pico9918.c.
References PICO9918_CHIP_F18A, PICO9918_CHIP_PICO9918, PICO9918_CHIP_PICO9918_PRO, and PICO9918_CHIP_TMS9918A.
Referenced by pico9918_set_chip().
| void pico9918_set_chip | ( | pico9918_t * | tms9918, |
| pico9918_chip_t | chip | ||
| ) |
select which chip this instance answers as
Clamped to PICO9918_CHIP_MAX, so a request the build cannot honour comes back as the highest it can rather than as a half-honoured one - read pico9918_chip() to find out which you got. Stepping down from an unlocked personality relocks the device, because the register file it would otherwise leave visible is not one a TMS9918A has.
A reset preserves it: the personality is the chip on the board, not state the bus can clear. A new instance starts at PICO9918_CHIP_MAX, which is what a consumer that never calls this keeps.
Definition at line 276 of file pico9918.c.
References chipFeatures(), PICO9918_CHIP_MAX, PICO9918_CHIP_PICO9918_PRO, PICO9918_REG_GPU_CONTROL, pico9918_splash_select_pro(), and PICO9918_SR_IDENT.
Referenced by PICO9918_SECTION_SCRATCH_X().
| pico9918_chip_t pico9918_chip | ( | pico9918_t * | tms9918 | ) |
which chip this instance answers as
Definition at line 310 of file pico9918.c.
| void pico9918_reset | ( | pico9918_t * | tms9918 | ) |
reset the new TMS9918
reset the TMS9918
Definition at line 318 of file pico9918.c.
References pico9918_frame_reset_int_impl(), PICO9918_INST_ONLY, pico9918_splash_reset(), PICO9918_SR_IDENT, PICO9918_SR_STATUS, and PICO9918_SR_VERSION.
Referenced by PICO9918_SECTION_SCRATCH_X().
| void pico9918_destroy | ( | pico9918_t * | tms9918 | ) |
destroy a TMS9918
destroy a TMS9918 and release everything it owns
tms9918: tms9918 object to destroy / clean up
Definition at line 360 of file pico9918.c.
| void pico9918_write_addr | ( | pico9918_t * | tms9918, |
| uint8_t | data | ||
| ) |
write an address (mode = 1) to the tms9918
write an address (mode = 1) to the tms9918 - the data byte DB0 -> DB7
data: the data (DB0 -> DB7) to send
Definition at line 373 of file pico9918.c.
References PICO9918_INST, and pico9918_write_addr_impl().
Referenced by pico9918_set_address_read(), and pico9918_write_register_value().
| uint8_t pico9918_read_status | ( | pico9918_t * | tms9918 | ) |
read from the status register
Definition at line 379 of file pico9918.c.
References PICO9918_INST_ONLY, and pico9918_read_status_impl().
| uint8_t pico9918_peek_status | ( | pico9918_t * | tms9918 | ) |
read from the status register without resetting it
Definition at line 385 of file pico9918.c.
References PICO9918_INST_ONLY, and pico9918_peek_status_impl().
| void pico9918_write_data | ( | pico9918_t * | tms9918, |
| uint8_t | data | ||
| ) |
write data (mode = 0) to the tms9918
write data (mode = 0) to the tms9918 - the data byte DB0 -> DB7
data: the data (DB0 -> DB7) to send
Definition at line 395 of file pico9918.c.
References PICO9918_INST, and pico9918_write_data_impl().
Referenced by clearTmsRam(), pico9918_initialise_gfx_ii(), pico9918_write_byte_rpt(), pico9918_write_bytes(), pico9918_write_string(), and pico9918_write_string_offset().
| uint8_t pico9918_read_data | ( | pico9918_t * | tms9918 | ) |
read data (mode = 0) from the tms9918
Definition at line 402 of file pico9918.c.
References PICO9918_INST_ONLY, and pico9918_read_data_impl().
| uint8_t pico9918_read_data_no_inc | ( | pico9918_t * | tms9918 | ) |
read data (mode = 0) from the tms9918
read data (mode = 0) without incrementing the address pointer
Definition at line 408 of file pico9918.c.
References PICO9918_INST_ONLY, and pico9918_read_data_no_inc_impl().
| bool pico9918_interrupt_status | ( | pico9918_t * | tms9918 | ) |
return true if both INT status and INT control set
true if both the INT status and the INT control bit are set
Definition at line 414 of file pico9918.c.
References PICO9918_INST_ONLY, and pico9918_interrupt_status_impl().
| void pico9918_interrupt_set | ( | pico9918_t * | tms9918 | ) |
raise the INT status flag
set the interrupt flag
Definition at line 420 of file pico9918.c.
References PICO9918_INST_ONLY, and pico9918_interrupt_set_impl().
| void pico9918_set_status | ( | pico9918_t * | tms9918, |
| uint8_t | status | ||
| ) |
set status flag
set the status flags
Definition at line 427 of file pico9918.c.
References PICO9918_INST, and pico9918_set_status_impl().
|
static |
Definition at line 447 of file pico9918.c.
|
inlinestatic |
Test and update the sprite collision mask.
Definition at line 455 of file pico9918.c.
Referenced by renderSprites().
|
inlinestatic |
set the transparent sprite mask.
Definition at line 479 of file pico9918.c.
Referenced by renderSprites().
|
inlinestatic |
Clear the row pixels bit mask.
Definition at line 496 of file pico9918.c.
Referenced by renderEcmTileToAlignedBuffer().
|
inlinestatic |
Update the row pixels bit mask (aligned - no word boundary crossing).
Definition at line 515 of file pico9918.c.
Referenced by renderEcm0Tile(), and renderEcmTileToAlignedBuffer().
|
inlinestatic |
Test against the row pixels bit mask (aligned - no word boundary crossing).
Definition at line 522 of file pico9918.c.
Referenced by renderEcm0Tile(), and renderEcmTileToAlignedBuffer().
|
static |
Definition at line 530 of file pico9918.c.
|
static |
Definition at line 589 of file pico9918.c.
|
inlinestatic |
Test and update the row pixels bit mask.
Definition at line 597 of file pico9918.c.
Referenced by renderBitmapLayerBody().
|
static |
Definition at line 640 of file pico9918.c.
|
static |
Definition at line 649 of file pico9918.c.
|
inlinestatic |
Definition at line 721 of file pico9918.c.
| void initLookups | ( | void | ) |
Definition at line 767 of file pico9918.c.
|
inlinestatic |
Definition at line 796 of file pico9918.c.
|
inlinestatic |
Definition at line 809 of file pico9918.c.
|
inlinestatic |
Definition at line 826 of file pico9918.c.
|
inlinestatic |
the sprite ECM level, zero on a locked device - the one term a clone can pin
Definition at line 919 of file pico9918.c.
References PICO9918_R49_ECM_SPRITE, and PICO9918_REG_ENHANCED1.
Referenced by renderSprites().
|
inlinestatic |
Output Sprites to a scanline.
ecm0 pins the ECM level to zero, which folds the plane loop to one pass, the colour shift to nothing and the whole ECM emit arm away.
Definition at line 928 of file pico9918.c.
References PICO9918_INST_ONLY, PICO9918_R24_SPRITE_PS, PICO9918_R29_SPRITE_STRIDE, PICO9918_R50_REPORT_MAX, PICO9918_REG_ENHANCED2, PICO9918_REG_MAX_SCAN_SPRITES, PICO9918_REG_PAGE_SIZE, PICO9918_REG_PALETTE_SELECT, PICO9918_SR0_5S, PICO9918_SR0_COLLISION, spriteEcm(), TMS9918_PIXELS_X, tmsSetTransparentSpriteMask(), tmsSpritePatternTableAddr(), tmsSpriteSize(), and tmsTestCollisionMask().
|
static |
Definition at line 1251 of file pico9918.c.
|
inlinestatic |
the per-mode half of a tile row's addressing, once per layer per scanline.
y is the scrolled raster row and rawY the unscrolled one. Multicolor is the only mode that needs both, and it needs them apart: its name address uses the scrolled row while its pattern byte comes from the raw one, so a vertical scroll changes which tiles are fetched but not which four-line block of each is shown.
Definition at line 1306 of file pico9918.c.
References tmsPatternTableAddr().
Referenced by graphics_i_scan_line(), and tileLayerAddr().
|
inlinestatic |
Definition at line 1332 of file pico9918.c.
|
inlinestatic |
Definition at line 1346 of file pico9918.c.
|
inlinestatic |
Definition at line 1360 of file pico9918.c.
|
inlinestatic |
Definition at line 1365 of file pico9918.c.
|
inlinestatic |
Definition at line 1430 of file pico9918.c.
|
inlinestatic |
where one layer reads this scanline from: the vertical scroll and its page swap, the name and colour rows, and the mode's pattern table.
Every mode and both layers come through here, which is what stops the scroll from being written a fourth time.
Position attributes decide the attribute row offset for every mode alike - by name when they are off, ECM0 or not. textMode selects only what a text row does not have: the page bits, in either direction.
Definition at line 1455 of file pico9918.c.
References PICO9918_INST, PICO9918_R49_ROW30, PICO9918_REG_ENHANCED1, PICO9918_REG_PAGE_SIZE, tileRowAddr(), and TMS_R0_DOUBLE_ROWS.
Referenced by f18a_tile_layer_scan_line(), and text_scan_line().
| PICO9918_INLINE_HOT void renderTextRow | ( | pico9918_t * | tms9918, |
| const uint8_t *__restrict | rowNames, | ||
| const TileRowAddr *__restrict | addr, | ||
| const uint8_t *__restrict | rowColors, | ||
| const uint32_t | colorStride, | ||
| uint32_t | pal, | ||
| uint8_t *__restrict | dest, | ||
| const uint32_t | scroll, | ||
| const bool | alwaysOnTop, | ||
| const uint32_t | numCols, | ||
| const bool | isTile2, | ||
| const uint32_t | ecm, | ||
| const bool | blend | ||
| ) |
one 40- or 80-column text row, six pixels a cell at one byte each
colorStride is 0 when the whole row shares one colour pair. At ECM1-3 a cell is an ordinary ECM tile six pixels wide and the fg/bg pair goes inert.
Definition at line 1539 of file pico9918.c.
References PICO9918_R29_TILE_STRIDE, and PICO9918_REG_PAGE_SIZE.
|
static |
Definition at line 1843 of file pico9918.c.
| PICO9918_INLINE_HOT void renderText80Row | ( | pico9918_t * | tms9918, |
| const uint8_t *__restrict | rowNames, | ||
| const uint8_t *__restrict | patternTable, | ||
| const uint8_t *__restrict | rowColors, | ||
| const bool | opaq, | ||
| uint8_t *__restrict | pixels, | ||
| const uint32_t | startCol, | ||
| const uint32_t | numCells, | ||
| const bool | scrolled | ||
| ) |
one 80-column text row, six pixels a cell at half a byte each.
Four cells are twelve bytes, so a group goes out as three words.
scrolled splits it in two. Unscrolled, the colour bytes arrive four at a time as one aligned word and the row cannot wrap, so the colour memo and the four-cell transparent skip both live in that loop. Scrolled, the row starts on an arbitrary cell and wraps to its own first one, so neither holds: the colour table is not word-aligned to the group and the group can straddle the wrap. That clone reads a colour byte a cell and does without the skip.
The fine offset is only ever 0, 2 or 4 pixels, which at 4bpp is a whole number of bytes - so the caller backs the start cell up by that many and moves pixels four bytes per byte of offset, which keeps the three-word store aligned and puts the cells it skipped over in the side border.
Definition at line 1870 of file pico9918.c.
References tmsMainBgColor().
|
inlinestatic |
Definition at line 2020 of file pico9918.c.
|
inlinestatic |
Definition at line 2037 of file pico9918.c.
|
static |
generate a 40- or 80-column text mode scanline.
Text has a path of its own, and hardware says so: it selects a different name address, a different attribute address, a different colour source, a different flip, a different horizontal scroll counter and a different expansion width - six pixels against eight. What it shares with the graphics modes is the fetch schedule, which for us is the address generator above, the sprite pass and the backdrop.
The emitters write the finished line rather than a layer buffer, so the composite runs only where something has to be arbitrated - a bitmap layer, or a priority second layer.
Definition at line 2064 of file pico9918.c.
References PICO9918_INST, PICO9918_R49_TILE2_ENABLE, PICO9918_R50_POS_ATTR, PICO9918_R50_TILE1_OFF, PICO9918_REG_ENHANCED1, PICO9918_REG_ENHANCED2, tileLayerAddr(), tmsMainBgColor(), and tmsMainFgColor().
Referenced by pico9918_scan_line().
|
inlinestatic |
Write full tile to aligned buffer - 8 pixels at once.
Definition at line 2157 of file pico9918.c.
Referenced by renderEcm0Tile(), and renderEcmTileToAlignedBuffer().
|
inlinestatic |
render an ECM0 (enhanced color mode) graphics I tile.
basically the same as original, but can scroll
INLINE: so will be different versions generated, depending on hard-coded (or known at compile-time) arguments
Definition at line 2170 of file pico9918.c.
References tmsTestRowBitsMaskAligned(), tmsUpdateRowBitsMaskAligned(), and writeToAlignedBuffer().
|
inlinestatic |
render one ECM tile into the layer buffer
Definition at line 2220 of file pico9918.c.
References tmsClearRowBitsMask(), tmsTestRowBitsMaskAligned(), tmsUpdateRowBitsMaskAligned(), and writeToAlignedBuffer().
|
inlinestatic |
Definition at line 2320 of file pico9918.c.
| PICO9918_INLINE_HOT void renderTileRowLocked | ( | pico9918_t * | tms9918, |
| uint16_t | rowNamesAddr, | ||
| uint16_t | colorTableAddr, | ||
| uint8_t | tileIndex, | ||
| uint8_t | pal, | ||
| uint8_t | pixels[TMS9918_PIXELS_X], | ||
| const TileRowAddr * | addr, | ||
| const bool | gm2, | ||
| const bool | mcm | ||
| ) |
generate a locked (plain TMS9918) tile row, straight into the scanline
Definition at line 2328 of file pico9918.c.
References PICO9918_INST.
| PICO9918_INLINE_HOT void renderTileRow | ( | pico9918_t * | tms9918, |
| const bool | hpSize, | ||
| uint16_t | rowNamesAddr, | ||
| uint16_t | colorTableAddr, | ||
| uint8_t | tileIndex, | ||
| uint8_t | startPattBit, | ||
| const bool | attrPerPos, | ||
| uint8_t | pal, | ||
| const bool | alwaysOnTop, | ||
| const TileRowAddr * | addr, | ||
| const bool | isTile2, | ||
| const uint32_t | ecm, | ||
| const bool | gm2, | ||
| const bool | mcm | ||
| ) |
Definition at line 2406 of file pico9918.c.
| PICO9918_INLINE_HOT void f18a_tile_layer_scan_line | ( | pico9918_t * | tms9918, |
| uint16_t | y, | ||
| const TileLayerConfig * | config, | ||
| const bool | blend | ||
| ) |
generate a tile mode scanline for either T1 or T2 layer
Inlined into both callers on purpose, not by the compiler's judgement: only there does config fold to a constant, and every field it reads is otherwise a load on a hot line. It sits near the size gcc stops at, so a statement added here has twice silently cost the board a layer.
Definition at line 2499 of file pico9918.c.
References PICO9918_INST, PICO9918_R49_ECM_TILE, PICO9918_R50_POS_ATTR, PICO9918_REG_ENHANCED1, PICO9918_REG_ENHANCED2, PICO9918_REG_PAGE_SIZE, PICO9918_REG_PALETTE_SELECT, PICO9918_REG_T1_HSCROLL, tileLayerAddr(), tmsMainBgColor(), and tmsMainFgColor().
Referenced by f18a_tile1_scan_line(), and f18a_tile2_scan_line().
|
static |
generate a Graphics I mode scanline for the T1 layer
Definition at line 2573 of file pico9918.c.
References f18a_tile_layer_scan_line(), and PICO9918_INST.
Referenced by graphics_i_scan_line().
|
static |
generate a Graphics I mode scanline for the T2 layer
Definition at line 2579 of file pico9918.c.
References f18a_tile_layer_scan_line(), and PICO9918_INST.
Referenced by graphics_i_scan_line().
| PICO9918_INLINE_HOT bool renderBitmapLayerBody | ( | pico9918_t * | tms9918, |
| uint16_t | y, | ||
| bool | opaque, | ||
| const uint8_t | width, | ||
| const uint16_t | addr, | ||
| const uint8_t | bmlCtl, | ||
| uint8_t | pixels[TMS9918_PIXELS_X], | ||
| const bool | wide, | ||
| const bool | intoTile1 | ||
| ) |
generate an F18A bitmap layer scanline
INLINE: so will be different versions generated, depending on hard-coded (or known at compile-time) arguments
Definition at line 2596 of file pico9918.c.
References PICO9918_REG_BML_X, TMS9918_PIXELS_X, and tmsTestRowBitsMask().
|
static |
Definition at line 2750 of file pico9918.c.
|
inlinestatic |
Definition at line 2758 of file pico9918.c.
|
static |
generate an F18A bitmap layer scanline
Definition at line 2767 of file pico9918.c.
References PICO9918_INST, PICO9918_REG_BML_BASE, PICO9918_REG_BML_CONTROL, PICO9918_REG_BML_HEIGHT, PICO9918_REG_BML_TOP_ROW, and PICO9918_REG_BML_WIDTH.
Referenced by graphics_i_scan_line().
|
inlinestatic |
Definition at line 2804 of file pico9918.c.
|
inlinestatic |
Definition at line 2830 of file pico9918.c.
|
inlinestatic |
Definition at line 2858 of file pico9918.c.
|
inlinestatic |
Definition at line 2888 of file pico9918.c.
|
inlinestatic |
Definition at line 2902 of file pico9918.c.
| PICO9918_INLINE_HOT void compositeAlignedBody | ( | pico9918_t * | tms9918, |
| uint8_t | pixels[TMS9918_PIXELS_X], | ||
| const int | t1Scroll, | ||
| const int | t2Scroll, | ||
| const bool | wide | ||
| ) |
Definition at line 2924 of file pico9918.c.
|
static |
Definition at line 3034 of file pico9918.c.
|
static |
Definition at line 3042 of file pico9918.c.
|
inlinestatic |
Definition at line 3049 of file pico9918.c.
|
static |
Composite with tile layer 1 disabled (reg 0x32 bit 4).
Layer 1 contributes no pixel at all, so every position the selection mask leaves to it must keep whatever the backdrop, bitmap layer and sprites already put there - the colour stage falls through to the backdrop for a transparent merged pixel. Writing layer 1's buffer, or a zero buffer, would paint palette entry 0 instead.
Definition at line 3069 of file pico9918.c.
References TMS9918_PIXELS_X.
Referenced by graphics_i_scan_line().
|
static |
A text row draws 240 of the 256 pixels and the composite copies all of them, so layer 1's buffer has to carry the side borders itself.
The row is emitted on cell boundaries and read back t1Scroll pixels along, so the border moves with the scroll - and the cells that fall outside it either side are overwritten here rather than never written.
Definition at line 3113 of file pico9918.c.
Referenced by graphics_i_scan_line().
|
static |
generate a Graphics I or Graphics II mode scanline
Definition at line 3127 of file pico9918.c.
References bitmap_layer_scan_line(), compositeTile2OnlyBuffer(), f18a_tile1_scan_line(), f18a_tile2_scan_line(), PICO9918_INST, PICO9918_R31_BML_ENABLE, PICO9918_R49_ECM_TILE, PICO9918_R49_TILE2_ENABLE, PICO9918_R50_TILE1_OFF, PICO9918_REG_BML_CONTROL, PICO9918_REG_ENHANCED1, PICO9918_REG_ENHANCED2, PICO9918_REG_T1_HSCROLL, PICO9918_REG_T2_HSCROLL, textRowBorder(), tileRowAddr(), TMS9918_PIXELS_X, tmsColorTableAddr(), and tmsNameTableAddr().
Referenced by pico9918_scan_line().
| uint8_t pico9918_scan_line | ( | pico9918_t * | tms9918, |
| uint16_t | y | ||
| ) |
generate a scanline
Read it back with pico9918_line_source and pico9918_line_bytes: how wide a line is and which buffer holds it are both properties of the mode and the build, so the library owns the memory.
Definition at line 3256 of file pico9918.c.
References graphics_i_scan_line(), PICO9918_INST, PICO9918_INST_ONLY, pico9918_line_bytes(), PICO9918_R24_TILE1_PS, PICO9918_REG_PALETTE_SELECT, text_scan_line(), TMS_R1_DISP_ACTIVE, and tmsMainBgColor().
Referenced by pico9918_frame_scanline().
| uint8_t pico9918_reg_value | ( | pico9918_t * | tms9918, |
| pico9918_register_t | reg | ||
| ) |
return a register value - see the header for the locked-device aliasing
return a register value
Definition at line 3329 of file pico9918.c.
| uint8_t pico9918_status_value | ( | pico9918_t * | tms9918, |
| pico9918_status_register_t | reg | ||
| ) |
return a status register value without the side effects of reading it
return a status register value, without the side effects of reading it
Definition at line 3336 of file pico9918.c.
References PICO9918_R15_STATUS_NUM.
| void pico9918_write_reg_value_impl | ( | pico9918_t * | tms9918, |
| uint8_t | regSelect, | ||
| uint8_t | value | ||
| ) |
set a register from the second byte of a host register write
regSelect is that byte, not a register number: bit 7 set, the register in the low six. The locked-mask aliasing and the M4 rule are both defined on it, which is why it is not a pico9918_register_t. Carries the unlock sequence, the GPU arming writes, the palette rebuild, and the /INT reconcile on the three writes that can change the pin - R0, R1 and the unlock latch. Out of line, unlike its neighbours here: it is large, and the inline entry below is its only hot caller.
Definition at line 3342 of file pico9918.c.
References PICO9918_INST_ONLY, PICO9918_R50_RESET, PICO9918_R56_GPU_RUN, PICO9918_REG_CONFIG_INDEX, PICO9918_REG_CONFIG_VALUE, PICO9918_REG_ENHANCED2, PICO9918_REG_FLASH_CONTROL, PICO9918_REG_GPU_CONTROL, PICO9918_REG_GPU_PC_LSB, PICO9918_REG_GPU_PC_MSB, PICO9918_REG_MAX_SCAN_SPRITES, PICO9918_REG_STATUS_SELECT, PICO9918_REG_UNLOCK, PICO9918_SR_CONFIG_VALUE, PICO9918_SR_GPU, PICO9918_SR_MICROS_LSB, PICO9918_SR_MICROS_MSB, PICO9918_SR_MILLIS_LSB, PICO9918_SR_MILLIS_MSB, PICO9918_SR_SECONDS_LSB, PICO9918_SR_SECONDS_MSB, and pico9918_write_reconcile_int_impl().
Referenced by pico9918_write_addr_impl().
| uint8_t pico9918_vram_value | ( | pico9918_t * | tms9918, |
| uint16_t | addr | ||
| ) |
return a value from vram
Definition at line 3485 of file pico9918.c.
| bool pico9918_display_enabled | ( | pico9918_t * | tms9918 | ) |
check BLANK flag
check the BLANK flag
Definition at line 3492 of file pico9918.c.
References TMS_R1_DISP_ACTIVE.
| pico9918_mode_t pico9918_display_mode | ( | pico9918_t * | tms9918 | ) |
current display mode
the current display mode
Definition at line 3499 of file pico9918.c.
Referenced by pico9918_diag_update().
| void pico9918_debug_sync_mode_impl | ( | pico9918_t * | tms9918 | ) |
see impl/pico9918_priv.h.
What the scanline entry does, for a caller between two.
Definition at line 3506 of file pico9918.c.
Referenced by pico9918_debug_reg_write().
| uint32_t pico9918_line_bytes | ( | pico9918_t * | tms9918 | ) |
how many bytes of pixels[] this mode fills.
how many bytes of the line the current mode fills: 256, or 512 for unlocked 80-column text on a board built with the 8bpp tier
Every mode is 256 but unlocked 80-column text on a board with the 8bpp tier, which is 512 - so the palette expansion, the backdrop fill and anything reading the line ask here rather than each deciding it again.
Definition at line 3518 of file pico9918.c.
References TMS9918_PIXELS_X.
Referenced by pico9918_scan_line().
| const uint8_t * pico9918_line_source | ( | pico9918_t * | tms9918 | ) |
where the scanline just generated actually is.
where the scanline just generated actually is - the arbitration buffer, or a tile layer's own buffer on a line that needed no compositing
Usually the buffer that was passed in, but on a line with nothing to arbitrate it is a tile layer's own buffer and the passed one holds only the backdrop fill - so read the line from here rather than from what was handed over.
Definition at line 3529 of file pico9918.c.
| uint16_t pico9918_default_palette | ( | int | index | ) |
a default palette entry, 0xargb
a default palette value, 0x0rgb
Definition at line 3536 of file pico9918.c.
Referenced by pico9918_config_defaults().
|
static |
Definition at line 112 of file pico9918.c.
|
static |
Definition at line 222 of file pico9918.c.
|
static |
Definition at line 432 of file pico9918.c.
| rowMasks |
Definition at line 452 of file pico9918.c.
|
static |
Definition at line 674 of file pico9918.c.
|
static |
Definition at line 749 of file pico9918.c.
| bool lookupsReady = false |
Definition at line 766 of file pico9918.c.
|
static |
Definition at line 1386 of file pico9918.c.
|
static |
Definition at line 1399 of file pico9918.c.
|
static |
Definition at line 1502 of file pico9918.c.
|
static |
Definition at line 1513 of file pico9918.c.
|
static |
Definition at line 1823 of file pico9918.c.
|
static |
Definition at line 1849 of file pico9918.c.
|
static |
Definition at line 2488 of file pico9918.c.
|
static |
Definition at line 2584 of file pico9918.c.
| const uint8_t* pico9918_cached_line_source = 0 |
Definition at line 2590 of file pico9918.c.