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