pico9918-core 1.3.0
TMS9918A / F18A video display processor emulation in C99
Loading...
Searching...
No Matches
pico9918_util.c File Reference

pico9918-core - utility / helper functions More...

#include "pico9918_util.h"
+ Include dependency graph for pico9918_util.c:

Go to the source code of this file.

Macros

#define PICO9918_DLLEXPORT
 
#define PICO9918_DLLEXPORT_CONST
 
#define LAST_SPRITE_YPOS   0xD0
 the sprite Y value that terminates the sprite list
 

Functions

static void clearTmsRam (pico9918_t *tms9918)
 zero the 16KB of VRAM, then park all 32 sprites past the end of the list
 
PICO9918_DLLEXPORT void pico9918_initialise_gfx_i (pico9918_t *tms9918)
 program Graphics I, the default table addresses and black on cyan, then clear VRAM
 
PICO9918_DLLEXPORT void pico9918_initialise_gfx_ii (pico9918_t *tms9918)
 as pico9918_initialise_gfx_i(), but for Graphics II and with the name table filled with a rising pattern index
 

Variables

PICO9918_DLLEXPORT_CONST uint32_t pico9918_palette []
 the sixteen TMS9918 colours, each packed as 0xrrggbbaa
 

Detailed Description

pico9918-core - utility / helper functions

Copyright (c) 2022 Troy Schrapel

This code is licensed under the MIT license

https://github.com/visrealm/pico9918-core

Definition in file pico9918_util.c.

Macro Definition Documentation

◆ PICO9918_DLLEXPORT

#define PICO9918_DLLEXPORT

Definition at line 16 of file pico9918_util.c.

◆ PICO9918_DLLEXPORT_CONST

#define PICO9918_DLLEXPORT_CONST

Definition at line 20 of file pico9918_util.c.

◆ LAST_SPRITE_YPOS

#define LAST_SPRITE_YPOS   0xD0

the sprite Y value that terminates the sprite list

Definition at line 24 of file pico9918_util.c.

Function Documentation

◆ clearTmsRam()

static void clearTmsRam ( pico9918_t *  tms9918)
static

zero the 16KB of VRAM, then park all 32 sprites past the end of the list

Definition at line 47 of file pico9918_util.c.

References LAST_SPRITE_YPOS, PICO9918_INST, pico9918_set_address_write(), pico9918_write_byte_rpt(), pico9918_write_data(), and TMS_DEFAULT_VRAM_SPRITE_ATTR_ADDRESS.

Referenced by pico9918_initialise_gfx_i(), and pico9918_initialise_gfx_ii().

◆ pico9918_initialise_gfx_i()

◆ pico9918_initialise_gfx_ii()

Variable Documentation

◆ pico9918_palette

PICO9918_DLLEXPORT_CONST uint32_t pico9918_palette[]
Initial value:
= {
0x00000000,
0x000000ff,
0x21c942ff,
0x5edc78ff,
0x5455edff,
0x7d75fcff,
0xd3524dff,
0x43ebf6ff,
0xfd5554ff,
0xff7978ff,
0xd3c153ff,
0xe5ce80ff,
0x21b03cff,
0xc95bbaff,
0xccccccff,
0xffffffff
}

the sixteen TMS9918 colours, each packed as 0xrrggbbaa

Definition at line 27 of file pico9918_util.c.