Cleanup adjustments

This commit is contained in:
Guy Perfect 2024-11-17 12:31:37 -06:00
parent 7e31fbd582
commit e97b52e944
3 changed files with 14 additions and 15 deletions

View File

@ -91,11 +91,6 @@
#define CPU_XORBSU 82 #define CPU_XORBSU 82
#define CPU_XORNBSU 83 #define CPU_XORNBSU 83
/* Functional operand types */
#define CPU_LITERAL 0
#define CPU_MEMORY 1
#define CPU_REGISTER 2
/* Bit string operations */ /* Bit string operations */
#define CPU_AND_BS 0 #define CPU_AND_BS 0
#define CPU_ANDN_BS 1 #define CPU_ANDN_BS 1

View File

@ -643,6 +643,7 @@ VBAPI vbOnWrite vbGetWriteCallback(VB *sim) {
VBAPI VB* vbInit(VB *sim) { VBAPI VB* vbInit(VB *sim) {
sim->cart.ram = NULL; sim->cart.ram = NULL;
sim->cart.rom = NULL; sim->cart.rom = NULL;
sim->ph.enabled = 0;
sim->vsu.out.samples = NULL; sim->vsu.out.samples = NULL;
sim->onExecute = NULL; sim->onExecute = NULL;
sim->onFetch = NULL; sim->onFetch = NULL;
@ -652,7 +653,7 @@ VBAPI VB* vbInit(VB *sim) {
sim->onSamples = NULL; sim->onSamples = NULL;
sim->onWrite = NULL; sim->onWrite = NULL;
sim->peer = NULL; sim->peer = NULL;
sim->ph.enabled = 0; sim->tag = NULL;
vbReset(sim); vbReset(sim);
return sim; return sim;
} }
@ -774,6 +775,8 @@ VBAPI int vbSetOption(VB *sim, int key, int value) {
VBAPI void vbSetPeer(VB *sim, VB *peer) { VBAPI void vbSetPeer(VB *sim, VB *peer) {
if (sim->peer == peer) if (sim->peer == peer)
return; return;
if (sim->peer != NULL)
sim->peer->peer = NULL;
sim->peer = peer; sim->peer = peer;
if (peer == NULL) if (peer == NULL)
return; return;
@ -784,6 +787,7 @@ VBAPI void vbSetPeer(VB *sim, VB *peer) {
/* Specify a new value for the program counter */ /* Specify a new value for the program counter */
VBAPI uint32_t vbSetProgramCounter(VB *sim, uint32_t value) { VBAPI uint32_t vbSetProgramCounter(VB *sim, uint32_t value) {
sim->cpu.clocks = 0;
sim->cpu.operation = CPU_FETCH; sim->cpu.operation = CPU_FETCH;
sim->cpu.pc = sim->cpu.nextPC = value & 0xFFFFFFFE; sim->cpu.pc = sim->cpu.nextPC = value & 0xFFFFFFFE;
sim->cpu.step = 0; sim->cpu.step = 0;

View File

@ -345,7 +345,7 @@ static void vsuEmulate(VB *sim, uint32_t clocks) {
/* Wait for the current sample to finish */ /* Wait for the current sample to finish */
if (sim->vsu.clocks != 0) if (sim->vsu.clocks != 0)
continue; return;
/* Compute the output sample */ /* Compute the output sample */
output[0] = output[1] = 0; output[0] = output[1] = 0;