82#define PICO9918_GPU_IPS_CLASSIC 7000000u
83#define PICO9918_GPU_IPS_PRO 10000000u
84#define PICO9918_GPU_IPS_F18A 8500000u
193#define PICO9918_GPU_ST_LGT 0x8000
194#define PICO9918_GPU_ST_AGT 0x4000
195#define PICO9918_GPU_ST_EQ 0x2000
196#define PICO9918_GPU_ST_C 0x1000
197#define PICO9918_GPU_ST_OV 0x0800
198#define PICO9918_GPU_ST_P 0x0400
uint16_t pico9918_gpu_status(pico9918_t *tms9918)
the GPU's status register between instructions
uint16_t pico9918_gpu_pc(pico9918_t *tms9918)
Where the GPU is: the address the next slice resumes from.
void pico9918_gpu_reset_time(void)
Reset the internal GPU time accumulator to 0.
void pico9918_gpu_set_flash_callback(pico9918_t *tms9918, pico9918_gpu_flash_fn cb, void *userdata)
Register a callback that will be invoked when the GPU wants to flash a sector.
volatile uint8_t pico9918_gpu_palette_guard_off
The palette guard, as much of it as the host has to see.
void pico9918_gpu_init(pico9918_t *tms9918)
Initialize the TMS9900 GPU.
uint32_t pico9918_gpu_mem_size(void)
the size of that space, so a memory view knows where to stop
void pico9918_gpu_step(pico9918_t *tms9918)
One pass of that loop: run a pending trigger to completion, then dispatch any flash and config-action...
void pico9918_gpu_loop(pico9918_t *tms9918)
GPU main loop - call from a dedicated core/thread.
void pico9918_gpu_rearm_palette_guard(pico9918_t *tms9918)
put the palette guard back, from the core that owns the MPU
uint8_t pico9918_gpu_mem_value(pico9918_t *tms9918, uint32_t addr)
a byte of the instance's memory, without disturbing anything
pico9918_flash_result_t
what a flash operation finished as, reported in status register 2
@ PICO9918_FLASH_ERR_SEQUENCE
a block arrived without the one before it
@ PICO9918_FLASH_ERR_FULL
no block is free to allocate
@ PICO9918_FLASH_ERR_VERIFY
what was read back is not what was written
@ PICO9918_FLASH_OK
the operation completed
@ PICO9918_FLASH_ERR_HEADER
the staged block is not one this build takes
@ PICO9918_FLASH_ERR_UNSUPPORTED
no host is listening - see pico9918_gpu_set_flash_callback
@ PICO9918_FLASH_ERR_SIZE
the target is past the region the operation may write
uint16_t pico9918_gpu_reg_value(pico9918_t *tms9918, uint8_t reg)
a GPU workspace register, R0-R15, without disturbing anything
void pico9918_gpu_flash_complete(pico9918_t *tms9918, pico9918_flash_result_t result)
End the flash operation R63 requested, with the result the guest reads back.
uint32_t pico9918_gpu_time(uint32_t totalTime)
Return the GPU's CPU time in microseconds.
bool pico9918_gpu_step_n(pico9918_t *tms9918, uint32_t instructions)
The same pass, capped at instructions, returning true while the program still has work left.
void pico9918_gpu_set_clock(pico9918_t *tms9918, uint32_t instructionsPerSecond)
Hand GPU execution to the library, at this many instructions a second.
void pico9918_gpu_set_config_save_callback(pico9918_t *tms9918, pico9918_gpu_config_save_fn cb, void *userdata)
Register a callback that will be invoked when the GPU loop detects a config action request.
pico9918-core - core interface
#define PICO9918_INST_ARG
declare the instance ahead of other parameters
#define PICO9918_INST_ONLY_ARG
declare the instance as the only parameter
#define PICO9918_DLLEXPORT
the linkage every public entry point carries - see LINKAGE MODES above