//
void WrMem(uint16 addr, uint8 b)
{
+ extern bool disasm;
extern bool charbase; // Needed for screen. Extern it in it??
//extern uint16 sr, ur, xr, yr; // Needed for tracelog
//extern uint16 pcr;
// cpu1.cpuFlags |= V6809_ASSERT_LINE_IRQ;//wil wok???
// IRQ Ack (may also be frame go...
// cpu1.cpuFlags &= ~V6809_ASSERT_LINE_IRQ;
+#if 1
+ if (disasm)
+ WriteLog("WriteMem: CPU #1 Acknowledging IRQ...\n", b);
+#endif
ClearLineOfCurrentV6809(V6809_ASSERT_LINE_IRQ);
}
}
//
void WrMemB(uint16 addr, uint8 b)
{
+ extern bool disasm;
extern bool charbase;
//extern uint16 sr, ur, xr, yr; // Needed for tracelog
//extern uint16 pcr;
{
// IRQ Ack (may also be frame go...)
// cpu2.cpuFlags &= ~V6809_ASSERT_LINE_IRQ;
+#if 1
+ if (disasm)
+ WriteLog("WriteMem: CPU #2 Acknowledging IRQ...\n", b);
+#endif
ClearLineOfCurrentV6809(V6809_ASSERT_LINE_IRQ);
}
}
}
if (keys[SDLK_d]) // (D) start disassembly
disasm = true;
-#if 1
+#if 0
if (keys[SDLK_k])
gram1[0x5606] = 0x00;
if (keys[SDLK_l])
#endif
-// if (enable_cpu)
- if (true)
+ if (enable_cpu)
+// if (true)
{
-#if 0
-// if (irqGoA)
- cpu1.cpuFlags |= V6809_ASSERT_LINE_IRQ;
-
- Execute6809(&cpu1, 25000);
- cpu1.clock -= 25000; // Remove 25K ticks from clock (in case it overflowed)
-
-// if (irqGoB)
- cpu2.cpuFlags |= V6809_ASSERT_LINE_IRQ;
-
- Execute6809(&cpu2, 25000);
- cpu2.clock -= 25000; // Remove 25K ticks from clock (in case it overflowed)//*/
-#else
// We can do this here because we're not executing the cores yet.
cpu1.cpuFlags |= V6809_ASSERT_LINE_IRQ;
cpu2.cpuFlags |= V6809_ASSERT_LINE_IRQ;
// 1.538 MHz = 25633.333... cycles per frame (1/60 s)
// 25600 cycles/frame
// Setting interleave to 25 and below causes the V6809 core to hang...
+// 32 gets to the title screen before hanging...
// 40 works, until it doesn't... :-P
+// 640 * 40
+// 800 * 32
+// Interesting, putting IRQs at 30 Hz makes it run at the correct speed. Still hangs in the demo, though.
for(uint32 i=0; i<640; i++)
+// for(uint32 i=0; i<1280; i++)
{
// Gay, but what are ya gonna do?
// There's better ways, such as keeping track of when slave writes to master, etc...
Execute6809(&cpu1, 40);
Execute6809(&cpu2, 40);
}
-#endif
} // END: enable_cpu
// if (refresh_++ == 1) // 30 Hz...
// refresh_ = (refresh2 ? 1 : 0); // 60/30 Hz...
// }
+#if 1
//temp, for testing...
BlitChar(screen, chr_rom, gram1);
-
+#endif
// Speed throttling happens here...
while (SDL_GetTicks() - oldTicks < 16) // Actually, it's 16.66... Need to account for that somehow
+// while (SDL_GetTicks() - oldTicks < 32) // Actually, it's 16.66... Need to account for that somehow
SDL_Delay(1); // Release our timeslice...
oldTicks = SDL_GetTicks();