Establish drawing procedure

This commit is contained in:
2024-10-16 20:14:38 -05:00
parent 7a8cf8952a
commit 3c2c9bb938
3 changed files with 190 additions and 99 deletions
+23 -16
View File
@@ -126,13 +126,20 @@ struct VB {
/* Pixel processor */
struct {
uint8_t f0bsy; /* Drawing into frame buffer 0 */
uint8_t f1bsy; /* Drawing into frame buffer 1 */
uint8_t overtime; /* Drawing extends into display interval */
uint8_t sbcmp; /* Vertical output position compare */
uint8_t sbcount; /* Current vertical output position */
uint8_t sbout; /* Drawing specified vertical output position */
uint8_t xpen; /* Drawing enabled */
/* Hardware state */
uint8_t f0bsy; /* Drawing into frame buffer 0 */
uint8_t f1bsy; /* Drawing into frame buffer 1 */
uint8_t overtime; /* Drawing extends into display interval */
uint8_t sbcmp; /* Vertical output position compare */
uint8_t sbcount; /* Current vertical output position */
uint32_t sbout; /* Drawing specified vertical output position */
uint8_t xpen; /* Drawing enabled */
/* Simulation state */
uint32_t clocks; /* Master clocks to wait */
int frame; /* FRMCYC counter */
int step; /* Processing phase */
uint32_t until; /* Clocks until interrupt condition */
} xp;
/* Control state */
@@ -146,10 +153,10 @@ struct VB {
uint16_t spt[4]; /* Object control */
/* Output frame buffers [buffer index][0=left, 1=right][pixel index] */
uint8_t frames[2][2][384 * 224];
uint8_t frames[2][2][384*224];
/* Other state */
uint8_t ram[0x40000]; /* Video memory */
uint8_t ram[0x40000]; /* Video memory */
} vip;
/* Other state */
@@ -352,13 +359,13 @@ VBAPI vbOnWrite vbGetWriteCallback(VB *sim) {
/* Initialize a simulation instance */
VBAPI VB* vbInit(VB *sim) {
sim->cart.ram = NULL;
sim->cart.rom = NULL;
sim->onExecute = NULL;
sim->onFetch = NULL;
sim->onFrame = NULL;
sim->onRead = NULL;
sim->onWrite = NULL;
sim->cart.ram = NULL;
sim->cart.rom = NULL;
sim->onExecute = NULL;
sim->onFetch = NULL;
sim->onFrame = NULL;
sim->onRead = NULL;
sim->onWrite = NULL;
vbReset(sim);
return sim;
}