Web re-rewrite

This commit is contained in:
2023-03-08 11:10:33 -06:00
parent 7d31c55391
commit 17277bb354
78 changed files with 9571 additions and 9496 deletions
BIN
View File
Binary file not shown.
+1 -48
View File
@@ -1701,51 +1701,4 @@ static int cpuEmulate(VB *sim, uint32_t clocks) {
}
/* Simulate a hardware reset */
static void cpuReset(VB *sim) {
int x; /* Iterator */
/* Registers */
vbSetProgramCounter(sim, 0xFFFFFFF0);
vbSetSystemRegister(sim, VB_ECR, 0x0000FFF0);
vbSetSystemRegister(sim, VB_PSW, 0x00008000);
/* Cache */
vbSetSystemRegister(sim, VB_CHCW, 0x00000000);
/* Other state */
for (x = 0; x < 5; x++)
sim->cpu.irq[x] = 0;
/* Other registers (the hardware does not do this) */
for (x = 0; x < 32; x++)
sim->cpu.program[x] = 0x00000000;
sim->cpu.adtre = 0x00000000;
sim->cpu.eipc = 0x00000000;
sim->cpu.eipsw = 0x00000000;
sim->cpu.fepc = 0x00000000;
sim->cpu.fepsw = 0x00000000;
sim->cpu.sr29 = 0x00000000;
sim->cpu.sr31 = 0x00000000;
}
/* Determine the number of clocks before a break condititon could occur */
static uint32_t cpuUntil(VB *sim, uint32_t clocks) {
/* Cannot break */
if (
sim->cpu.state == CPU_HALTED ||
sim->cpu.state == CPU_FATAL || (
sim->onException == NULL &&
sim->onExecute == NULL &&
sim->onFetch == NULL &&
sim->onRead == NULL &&
sim->onWrite == NULL
)) return clocks;
/* Will not break before next operation */
return sim->cpu.clocks < clocks ? sim->cpu.clocks : clocks;
}
#endif /* WSAPI */
static void cpuReset(VB *sim)
+1 -22
View File
@@ -284,25 +284,4 @@ int vbSetROM(VB *sim, void *rom, uint32_t size) {
}
/* Supply an SRAM buffer */
int vbSetSRAM(VB *sim, void *sram, uint32_t size) {
/* Check the buffer size */
if (size == 0 || ((size - 1) & size) != 0)
return 0;
/* Configure the SRAM buffer */
sim->cart.sram = (uint8_t *) sram;
sim->cart.sramSize = size;
return 1;
}
/* Specify a new value for a system register */
uint32_t vbSetSystemRegister(VB *sim, int id, uint32_t value) {
return cpuSetSystemRegister(sim, id, value, 1);
}
/* Write a data unit to the bus */
void vbWrite(VB *sim, uint32_t address, int type, int32_t value, int debug) {
if (type >= 0 && type < (int32_t) sizeof TYPE_SIZES)
busWrite(sim, address, type, value, debug);
}
int vbSetSRAM(VB *sim, void *sram, uint32_t size)
BIN
View File
Binary file not shown.