Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06849b54ba | ||
|
|
eef255b507 | ||
|
|
db966c8cb8 |
@@ -1637,6 +1637,7 @@ static void cpuSUBF_S(VB *sim) {
|
|||||||
/* TRAP */
|
/* TRAP */
|
||||||
static void cpuTRAP(VB *sim) {
|
static void cpuTRAP(VB *sim) {
|
||||||
sim->cpu.clocks += cpuClocks(15);
|
sim->cpu.clocks += cpuClocks(15);
|
||||||
|
sim->cpu.pc += 2;
|
||||||
cpuThrow(sim, 0xFFA0 + cpuGetImm5U(sim));
|
cpuThrow(sim, 0xFFA0 + cpuGetImm5U(sim));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -117,7 +117,7 @@ static void tmrWriteControl(VB *sim, uint8_t value) {
|
|||||||
if (
|
if (
|
||||||
!sim->tmr.t_clk_sel &&
|
!sim->tmr.t_clk_sel &&
|
||||||
(value & 0x10) && /* T-Clk-Sel */
|
(value & 0x10) && /* T-Clk-Sel */
|
||||||
sim->tmr.tick20 != 4
|
sim->tmr.tick20 != 0
|
||||||
) {
|
) {
|
||||||
tmrUpdate(sim, sim->tmr.counter == 0 ?
|
tmrUpdate(sim, sim->tmr.counter == 0 ?
|
||||||
sim->tmr.reload : sim->tmr.counter - 1);
|
sim->tmr.reload : sim->tmr.counter - 1);
|
||||||
|
|||||||
+14
-7
@@ -87,11 +87,8 @@ new class Core {
|
|||||||
this.sims.set(sim.pointer, sim);
|
this.sims.set(sim.pointer, sim);
|
||||||
|
|
||||||
// Video
|
// Video
|
||||||
sim.pixels = this.#noalloc(
|
sim.pixels = this.#getPixels(sim);
|
||||||
this.GetExtPixels(sim.pointer),
|
sim.image = new ImageData(sim.pixels, 384, 224);
|
||||||
384*224*4, sim, "pixels", Uint8ClampedArray
|
|
||||||
);
|
|
||||||
sim.image = new ImageData(sim.pixels, 384, 224);
|
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
sim.samples = this.#noalloc(
|
sim.samples = this.#noalloc(
|
||||||
@@ -364,8 +361,10 @@ new class Core {
|
|||||||
this.mallocs.set(buffer.pointer, buffer);
|
this.mallocs.set(buffer.pointer, buffer);
|
||||||
this.#updateTarget(buffer);
|
this.#updateTarget(buffer);
|
||||||
}
|
}
|
||||||
for (let sim of this.sims)
|
for (let sim of this.sims.values()) {
|
||||||
sim.image = new ImageData(sim.pixels, 384, 224);
|
sim.pixels = this.#getPixels(sim);
|
||||||
|
sim.image = new ImageData(sim.pixels, 384, 224);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -436,6 +435,14 @@ new class Core {
|
|||||||
this.Realloc(buffer.pointer, 0);
|
this.Realloc(buffer.pointer, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Register a sim's pixel buffer
|
||||||
|
#getPixels(sim) {
|
||||||
|
return this.#noalloc(
|
||||||
|
this.GetExtPixels(sim.pointer),
|
||||||
|
384*224*4, sim, "pixels", Uint8ClampedArray
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Allocate memory in WebAssembly and register the buffer
|
// Allocate memory in WebAssembly and register the buffer
|
||||||
#malloc(count, target = null, assign = null, type = Uint8ClampedArray) {
|
#malloc(count, target = null, assign = null, type = Uint8ClampedArray) {
|
||||||
return this.#noalloc(
|
return this.#noalloc(
|
||||||
|
|||||||
Reference in New Issue
Block a user