0 Members and 5 Guests are viewing this topic.
Two because my idea was to make each of the hardware devices its own thread so they can operate simultaneously.
The importance with threads is that many parts of the Prizm run in parrellel(mainly the lcd, but also stuff like the serial port and clock)
void mainloop() { while (true) { // Handle any hardware events that need to be done now for (HWEvent ev : allHWEvents) if (ev.time < curTime) ev.doIt(); normalizeSchedule(); // Handle CPU while (curTime < 0) { int instruction = readWord(pc); pc += 2; // ...execute instruction and increase curTime appropriately... } }}// Adjust times so that the next the next event that will happen is at time 0void normalizeSchedule() { int next = Integer.MAX_VALUE; for (HWEvent ev : allHWEvents) if (ev.time < next) next = ev.time; for (HWEvent ev : allHWEvents) ev.time -= next; curTime -= next;}
Cool to hear , good luck with it! On a side note it migth be nice if someone eventually made a Casio FX-9860G and FX 1.0/AFX emu, because the current existing ones have questionable grayscale/LCD emulation. First of all, it might be best to have a Prizm one, though, so it's easier to debug the stuff you guys are working on.