2 // Apple 2 SDL Portable Apple Emulator
\r
4 // by James L. Hammons
\r
5 // (C) 2005 Underground Software
\r
7 // Loosely based on AppleWin by Tom Charlesworth which was based on AppleWin by
\r
8 // Oliver Schmidt which was based on AppleWin by Michael O'Brien. :-) Parts are
\r
9 // also derived from ApplePC. Too bad it was closed source--it could have been
\r
10 // *the* premier Apple II emulator out there.
\r
12 // JLH = James L. Hammons <jlhamm@acm.org>
\r
15 // --- ---------- ------------------------------------------------------------
\r
16 // JLH 11/12/2005 Initial port to SDL
\r
17 // JLH 11/18/2005 Wired up graphic soft switches
\r
18 // JLH 12/02/2005 Setup timer subsystem for more accurate time keeping
\r
19 // JLH 12/12/2005 Added preliminary state saving support
\r
24 // - Port to SDL [DONE]
\r
26 // - Weed out unneeded functions [DONE]
\r
27 // - Disk I/O [DONE]
\r
28 // - 128K IIe related stuff
\r
29 // - State loading/saving
\r
45 #include "settings.h"
\r
47 #include "applevideo.h"
\r
50 #include "firmware.h"
\r
52 #include "gui/gui.h"
\r
53 #include "gui/window.h"
\r
54 #include "gui/draggablewindow2.h"
\r
55 #include "gui/textedit.h"
\r
57 using namespace std;
\r
61 uint8 ram[0x10000], rom[0x10000]; // RAM & ROM spaces
\r
62 uint8 diskRom[0x100]; // Disk ROM space
\r
64 uint8 appleType = APPLE_TYPE_II;
\r
68 static uint8 lastKeyPressed = 0;
\r
69 static bool keyDown = false;
\r
71 static FloppyDrive floppyDrive;
\r
73 enum { LC_BANK_1, LC_BANK_2 };
\r
75 static uint8 visibleBank = LC_BANK_1;
\r
76 static bool readRAM = false;
\r
77 static bool writeRAM = false;
\r
79 static bool running = true; // Machine running state flag...
\r
80 static uint32 startTicks;
\r
82 static GUI * gui = NULL;
\r
84 // Local functions (technically, they're global...)
\r
86 bool LoadImg(char * filename, uint8 * ram, int size);
\r
87 uint8 RdMem(uint16 addr);
\r
88 void WrMem(uint16 addr, uint8 b);
\r
89 static void SaveApple2State(const char * filename);
\r
90 static bool LoadApple2State(const char * filename);
\r
92 // Local timer callback functions
\r
94 static void FrameCallback(void);
\r
95 static void BlinkTimer(void);
\r
97 // Test GUI function
\r
99 Element * TestWindow(void)
\r
101 Element * win = new DraggableWindow2(10, 10, 128, 128);
\r
102 // ((DraggableWindow *)win)->AddElement(new TextEdit(4, 16, 92, 0, "u2prog.dsk", win));
\r
107 Element * QuitEmulator(void)
\r
116 Small Apple II memory map:
\r
118 $C010 - Clear bit 7 of keyboard data ($C000)
\r
119 $C030 - Toggle speaker diaphragm
\r
120 $C051 - Display text
\r
121 $C054 - Select page 1
\r
122 $C056 - Select lo-res
\r
123 $C058 - Set annuciator-0 output to 0
\r
124 $C05A - Set annuciator-0 output to 0
\r
125 $C05D - Set annuciator-0 output to 1
\r
126 $C05F - Set annuciator-0 output to 1
\r
127 $C0E0 - Disk control stepper ($C0E0-7)
\r
128 $C0E9 - Disk control motor (on)
\r
129 $C0EA - Disk enable (drive 1)
\r
131 $C0EE - Disk set read mode
\r
135 // V65C02 read/write memory functions
\r
138 uint8 RdMem(uint16 addr)
\r
143 if (addr >= 0xC000 && addr <= 0xC0FF)
\r
144 WriteLog("\n*** Read at I/O address %04X\n", addr);
\r
147 if (addr >= 0xC080 && addr <= 0xC08F)
\r
148 WriteLog("\n*** Read at I/O address %04X\n", addr);
\r
151 if ((addr & 0xFFF0) == 0xC000)
\r
153 return lastKeyPressed | (keyDown ? 0x80 : 0x00);
\r
155 else if ((addr & 0xFFF0) == 0xC010)
\r
157 //This is bogus: keyDown is set to false, so return val NEVER is set...
\r
159 //Also, this is IIe/IIc only...!
\r
160 uint8 retVal = lastKeyPressed | (keyDown ? 0x80 : 0x00);
\r
164 else if ((addr & 0xFFF0) == 0xC030)
\r
166 ToggleSpeaker(GetCurrentV65C02Clock());
\r
167 //should it return something else here???
\r
170 else if (addr == 0xC050)
\r
174 else if (addr == 0xC051)
\r
178 else if (addr == 0xC052)
\r
182 else if (addr == 0xC053)
\r
186 else if (addr == 0xC054)
\r
188 displayPage2 = false;
\r
190 else if (addr == 0xC055)
\r
192 displayPage2 = true;
\r
194 else if (addr == 0xC056)
\r
198 else if (addr == 0xC057)
\r
203 //Note that this is a kludge: The $D000-$DFFF 4K space is shared (since $C000-$CFFF is
\r
204 //memory mapped) between TWO banks, and that that $E000-$FFFF RAM space is a single bank.
\r
205 //[SHOULD BE FIXED NOW]
\r
206 //OK! This switch selects bank 2 of the 4K bank at $D000-$DFFF. One access makes it
\r
207 //visible, two makes it R/W.
\r
209 else if ((addr & 0xFFFB) == 0xC080)
\r
211 //$C080 49280 OECG R Read RAM bank 2; no write
\r
212 visibleBank = LC_BANK_2;
\r
216 else if ((addr & 0xFFFB) == 0xC081)
\r
218 //$C081 49281 ROMIN OECG RR Read ROM; write RAM bank 2
\r
219 visibleBank = LC_BANK_2;
\r
223 else if ((addr & 0xFFFB) == 0xC082)
\r
225 //$C082 49282 OECG R Read ROM; no write
\r
226 visibleBank = LC_BANK_2;
\r
230 else if ((addr & 0xFFFB) == 0xC083)
\r
232 //$C083 49283 LCBANK2 OECG RR Read/write RAM bank 2
\r
233 visibleBank = LC_BANK_2;
\r
237 else if ((addr & 0xFFFB) == 0xC088)
\r
239 //$C088 49288 OECG R Read RAM bank 1; no write
\r
240 visibleBank = LC_BANK_1;
\r
244 else if ((addr & 0xFFFB) == 0xC089)
\r
246 //$C089 49289 OECG RR Read ROM; write RAM bank 1
\r
247 visibleBank = LC_BANK_1;
\r
251 else if ((addr & 0xFFFB) == 0xC08A)
\r
253 //$C08A 49290 OECG R Read ROM; no write
\r
254 visibleBank = LC_BANK_1;
\r
258 else if ((addr & 0xFFFB) == 0xC08B)
\r
260 //$C08B 49291 OECG RR Read/write RAM bank 1
\r
261 visibleBank = LC_BANK_1;
\r
265 else if ((addr & 0xFFF8) == 0xC0E0)
\r
267 floppyDrive.ControlStepper(addr & 0x07);
\r
269 else if ((addr & 0xFFFE) == 0xC0E8)
\r
271 floppyDrive.ControlMotor(addr & 0x01);
\r
273 else if ((addr & 0xFFFE) == 0xC0EA)
\r
275 floppyDrive.DriveEnable(addr & 0x01);
\r
277 else if (addr == 0xC0EC)
\r
279 return floppyDrive.ReadWrite();
\r
281 else if (addr == 0xC0ED)
\r
283 return floppyDrive.GetLatchValue();
\r
285 else if (addr == 0xC0EE)
\r
287 floppyDrive.SetReadMode();
\r
289 else if (addr == 0xC0EF)
\r
291 floppyDrive.SetWriteMode();
\r
295 if (addr >= 0xC100 && addr <= 0xCFFF) // The $C000-$CFFF block is *never* RAM
\r
297 else if (addr >= 0xD000)
\r
301 if (addr <= 0xDFFF && visibleBank == LC_BANK_1)
\r
302 b = ram[addr - 0x1000];
\r
317 APPENDIX F Assembly Language Program Listings
\r
319 1 *PRIMARY ROUTINES
\r
326 6 ORB EQU $C400 ;PORT B
\r
327 7 ORA EQU $C401 ;PORT A
\r
328 8 DDRB EQU $C402 ;DATA DIRECTION
\r
330 9 DDRA EQU $C403 ;DATA DIRECTION
\r
335 11 ORB2 EQU $C480 ;PORT B
\r
336 12 ORA2 EQU $C481 ;PORT A
\r
337 13 DDRB2 EQU $C482 ;DATA DIRECTION
\r
339 14 DDRA2 EQU $C483 ;DATA DIRECTION
\r
342 void WrMem(uint16 addr, uint8 b)
\r
345 //extern V6809REGS regs;
\r
346 //if (addr >= 0xC800 && addr <= 0xCBFE)
\r
347 //if (addr == 0xC80F || addr == 0xC80D)
\r
348 // WriteLog("WrMem: Writing address %04X with %02X [PC=%04X, $CB00=%02X]\n", addr, b, regs.pc, gram[0xCB00]);//*/
\r
351 if (addr >= 0xC000 && addr <= 0xC0FF)
\r
352 WriteLog("\n*** Write at I/O address %04X\n", addr);
\r
355 Check the BIKO version on Asimov to see if it's been cracked or not...
\r
357 7F3D: 29 07 AND #$07 [PC=7F3F, SP=01EA, CC=---B-I--, A=01, X=4B, Y=00]
\r
358 7F3F: C9 06 CMP #$06 [PC=7F41, SP=01EA, CC=N--B-I--, A=01, X=4B, Y=00]
\r
359 7F41: 90 03 BCC $7F46 [PC=7F46, SP=01EA, CC=N--B-I--, A=01, X=4B, Y=00]
\r
360 [7F43: 4C 83 7E JMP $7E83] <- Skipped over... (Prints "THANK YOU VERY MUCH!")
\r
361 7F46: AA TAX [PC=7F47, SP=01EA, CC=---B-I--, A=01, X=01, Y=00]
\r
363 ; INX here *ensures* 1 - 6!!! BUG!!!
\r
364 ; Or is it? Could this be part of a braindead copy protection scheme? It's
\r
365 ; awfully close to NOP ($EA)...
\r
366 ; Nothing else touches it once it's been written... Hmm...
\r
368 7F47: E8 INX [PC=7F48, SP=01EA, CC=---B-I--, A=01, X=02, Y=00]
\r
369 7F48: F8 SED [PC=7F49, SP=01EA, CC=---BDI--, A=01, X=02, Y=00]
\r
370 7F49: 18 CLC [PC=7F4A, SP=01EA, CC=---BDI--, A=01, X=02, Y=00]
\r
371 7F4A: BD 15 4E LDA $4E15,X [PC=7F4D, SP=01EA, CC=---BDI--, A=15, X=02, Y=00]
\r
374 ; 4E15: 25 25 15 15 10 20
\r
375 ; 4E1B: 03 41 99 99 01 00 12
\r
378 7F4D: 65 FC ADC $FC [PC=7F4F, SP=01EA, CC=---BDI--, A=16, X=02, Y=00]
\r
379 7F4F: 65 FC ADC $FC [PC=7F51, SP=01EA, CC=---BDI--, A=17, X=02, Y=00]
\r
380 7F51: 65 FC ADC $FC [PC=7F53, SP=01EA, CC=---BDI--, A=18, X=02, Y=00]
\r
381 7F53: 65 FC ADC $FC [PC=7F55, SP=01EA, CC=---BDI--, A=19, X=02, Y=00]
\r
383 ; NO checking is done on the raised stat! Aarrrgggghhhhh!
\r
385 7F55: 9D 15 4E STA $4E15,X [PC=7F58, SP=01EA, CC=---BDI--, A=19, X=02, Y=00]
\r
386 7F58: D8 CLD [PC=7F59, SP=01EA, CC=---B-I--, A=19, X=02, Y=00]
\r
388 ; Print "ALAKAZAM!" and so on...
\r
390 7F59: 20 2C 40 JSR $402C [PC=402C, SP=01E8, CC=---B-I--, A=19, X=02, Y=00]
\r
393 if (addr == 0x7F47)
\r
394 WriteLog("\n*** Byte %02X written at address %04X\n", b, addr);
\r
397 CLR80STORE=$C000 ;80STORE Off- disable 80-column memory mapping (Write)
\r
398 SET80STORE=$C001 ;80STORE On- enable 80-column memory mapping (WR-only)
\r
400 CLRAUXRD = $C002 ;read from main 48K (WR-only)
\r
401 SETAUXRD = $C003 ;read from aux/alt 48K (WR-only)
\r
403 CLRAUXWR = $C004 ;write to main 48K (WR-only)
\r
404 SETAUXWR = $C005 ;write to aux/alt 48K (WR-only)
\r
406 CLRCXROM = $C006 ;use ROM on cards (WR-only)
\r
407 SETCXROM = $C007 ;use internal ROM (WR-only)
\r
409 CLRAUXZP = $C008 ;use main zero page, stack, & LC (WR-only)
\r
410 SETAUXZP = $C009 ;use alt zero page, stack, & LC (WR-only)
\r
412 CLRC3ROM = $C00A ;use internal Slot 3 ROM (WR-only)
\r
413 SETC3ROM = $C00B ;use external Slot 3 ROM (WR-only)
\r
415 CLR80VID = $C00C ;disable 80-column display mode (WR-only)
\r
416 SET80VID = $C00D ;enable 80-column display mode (WR-only)
\r
418 CLRALTCH = $C00E ;use main char set- norm LC, Flash UC (WR-only)
\r
419 SETALTCH = $C00F ;use alt char set- norm inverse, LC; no Flash (WR-only)
\r
421 if (addr == 0xC00E)
\r
423 alternateCharset = false;
\r
425 else if (addr == 0xC00F)
\r
427 alternateCharset = true;
\r
429 else if ((addr & 0xFFF0) == 0xC010) // Keyboard strobe
\r
433 else if (addr == 0xC050)
\r
437 else if (addr == 0xC051)
\r
441 else if (addr == 0xC052)
\r
445 else if (addr == 0xC053)
\r
449 else if (addr == 0xC054)
\r
451 displayPage2 = false;
\r
453 else if (addr == 0xC055)
\r
455 displayPage2 = true;
\r
457 else if (addr == 0xC056)
\r
461 else if (addr == 0xC057)
\r
465 else if ((addr & 0xFFF8) == 0xC0E0)
\r
467 floppyDrive.ControlStepper(addr & 0x07);
\r
469 else if ((addr & 0xFFFE) == 0xC0E8)
\r
471 floppyDrive.ControlMotor(addr & 0x01);
\r
473 else if ((addr & 0xFFFE) == 0xC0EA)
\r
475 floppyDrive.DriveEnable(addr & 0x01);
\r
477 else if (addr == 0xC0EC)
\r
479 //change this to Write()? (and the other to Read()?) Dunno. Seems to work OK, but still...
\r
480 floppyDrive.ReadWrite();
\r
482 else if (addr == 0xC0ED)
\r
484 floppyDrive.SetLatchValue(b);
\r
486 else if (addr == 0xC0EE)
\r
488 floppyDrive.SetReadMode();
\r
490 else if (addr == 0xC0EF)
\r
492 floppyDrive.SetWriteMode();
\r
494 //Still need to add missing I/O switches here...
\r
496 if (addr >= 0xD000)
\r
500 if (addr <= 0xDFFF && visibleBank == LC_BANK_1)
\r
501 ram[addr - 0x1000] = b;
\r
513 // Load a file into RAM/ROM image space
\r
515 bool LoadImg(char * filename, uint8 * ram, int size)
\r
517 FILE * fp = fopen(filename, "rb");
\r
522 fread(ram, 1, size, fp);
\r
528 static void SaveApple2State(const char * filename)
\r
532 static bool LoadApple2State(const char * filename)
\r
540 int main(int /*argc*/, char * /*argv*/[])
\r
542 InitLog("./apple2.log");
\r
544 srand(time(NULL)); // Initialize RNG
\r
547 //Need to bankify this stuff for the IIe emulation...
\r
548 memset(ram, 0, 0x10000);
\r
549 memset(rom, 0, 0x10000);
\r
551 // Set up V65C02 execution context
\r
552 memset(&mainCPU, 0, sizeof(V65C02REGS));
\r
553 mainCPU.RdMem = RdMem;
\r
554 mainCPU.WrMem = WrMem;
\r
555 mainCPU.cpuFlags |= V65C02_ASSERT_LINE_RESET;
\r
557 if (!LoadImg(settings.BIOSPath, rom + 0xD000, 0x3000))
\r
559 WriteLog("Could not open file '%s'!\n", settings.BIOSPath);
\r
563 //This is now included...
\r
564 /* if (!LoadImg(settings.diskPath, diskRom, 0x100))
\r
566 WriteLog("Could not open file '%s'!\nDisk II will be unavailable!\n", settings.diskPath);
\r
570 //Load up disk image from config file (for now)...
\r
571 floppyDrive.LoadImage(settings.diskImagePath1, 0);
\r
572 floppyDrive.LoadImage(settings.diskImagePath2, 1);
\r
573 // floppyDrive.LoadImage("./disks/temp.nib", 1); // Load temp .nib file into second drive...
\r
575 //Kill the DOS ROM in slot 6 for now...
\r
577 memcpy(rom + 0xC600, diskROM, 0x100);
\r
579 WriteLog("About to initialize video...\n");
\r
582 cout << "Aborting!" << endl;
\r
586 // Have to do this *after* video init but *before* sound init...!
\r
587 //Shouldn't be necessary since we're not doing emulation in the ISR...
\r
588 if (settings.autoStateSaving)
\r
590 // Load last state from file...
\r
591 if (!LoadApple2State(settings.autoStatePath))
\r
592 WriteLog("Unable to use Apple2 state file \"%s\"!\n", settings.autoStatePath);
\r
598 if (!LoadImg("./BT1_6502_RAM_SPACE.bin", ram, 0x10000))
\r
600 cout << "Couldn't load state file!" << endl;
\r
601 cout << "Aborting!!" << endl;
\r
606 //-- -- -- -- ----- -----
\r
607 //00 75 3B 53 FD 01 41 44
\r
609 mainCPU.cpuFlags = 0;
\r
615 mainCPU.pc = 0x4441;
\r
619 displayPage2 = false;
\r
626 memcpy(ram + 0xD000, ram + 0xC000, 0x1000);
\r
629 WriteLog("About to initialize audio...\n");
\r
631 SDL_EnableUNICODE(1); // Needed to do key translation shit
\r
633 gui = new GUI(surface); // Set up the GUI system object...
\r
634 gui->AddMenuTitle("Apple2");
\r
635 gui->AddMenuItem("Test!", TestWindow/*, hotkey*/);
\r
636 gui->AddMenuItem("");
\r
637 gui->AddMenuItem("Quit", QuitEmulator, SDLK_q);
\r
638 gui->CommitItemsToMenu();
\r
640 SetupBlurTable(); // Set up the color TV emulation blur table
\r
641 running = true; // Set running status...
\r
643 InitializeEventList(); // Clear the event list before we use it...
\r
644 SetCallbackTime(FrameCallback, 16666.66666667); // Set frame to fire at 1/60 s interval
\r
645 SetCallbackTime(BlinkTimer, 250000); // Set up blinking at 1/4 s intervals
\r
646 startTicks = SDL_GetTicks();
\r
648 WriteLog("Entering main loop...\n");
\r
651 double timeToNextEvent = GetTimeToNextEvent();
\r
652 Execute65C02(&mainCPU, USEC_TO_M6502_CYCLES(timeToNextEvent));
\r
653 //We MUST remove a frame's worth of time in order for the CPU to function... !!! FIX !!!
\r
654 //(Fix so that this is not a requirement!)
\r
655 mainCPU.clock -= USEC_TO_M6502_CYCLES(timeToNextEvent);
\r
659 if (settings.autoStateSaving)
\r
661 // Save state here...
\r
662 SaveApple2State(settings.autoStatePath);
\r
664 floppyDrive.SaveImage();
\r
678 Key Aln CTL SHF BTH
\r
679 -----------------------
\r
680 space $A0 $A0 $A0 $A0 No xlation
\r
681 RETURN $8D $8D $8D $8D No xlation
\r
682 0 $B0 $B0 $B0 $B0 Need to screen shift+0 (?)
\r
683 1! $B1 $B1 $A1 $A1 No xlation
\r
684 2" $B2 $B2 $A2 $A2 No xlation
\r
685 3# $B3 $B3 $A3 $A3 No xlation
\r
686 4$ $B4 $B4 $A4 $A4 No xlation
\r
687 5% $B5 $B5 $A5 $A5 No xlation
\r
688 6& $B6 $B6 $A6 $A6 No xlation
\r
689 7' $B7 $B7 $A7 $A7 No xlation
\r
690 8( $B8 $B8 $A8 $A8 No xlation
\r
691 9) $B9 $B9 $A9 $A9 No xlation
\r
692 :* $BA $BA $AA $AA No xlation
\r
693 ;+ $BB $BB $AB $AB No xlation
\r
694 ,< $AC $AC $BC $BC No xlation
\r
695 -= $AD $AD $BD $BD No xlation
\r
696 .> $AE $AE $BE $BE No xlation
\r
697 /? $AF $AF $BF $BF No xlation
\r
710 M $CD $8D $DD $9D -> ODD
\r
711 N^ $CE $8E $DE $9E -> ODD
\r
713 P@ $D0 $90 $C0 $80 Need to xlate CTL+SHFT+P & SHFT+P (?)
\r
726 ESC $9B $9B $9B $9B No xlation
\r
729 static void FrameCallback(void)
\r
733 while (SDL_PollEvent(&event))
\r
735 switch (event.type)
\r
738 if (event.key.keysym.unicode != 0)
\r
740 //Need to do some key translation here, and screen out non-apple keys as well...
\r
741 if (event.key.keysym.sym == SDLK_TAB) // Prelim key screening...
\r
744 lastKeyPressed = event.key.keysym.unicode;
\r
746 //kludge: should have a caps lock thingy here...
\r
747 //or all uppercase for ][+...
\r
748 if (lastKeyPressed >= 'a' && lastKeyPressed <='z')
\r
749 lastKeyPressed &= 0xDF; // Convert to upper case...
\r
752 // CTRL+RESET key emulation (mapped to CTRL+`)
\r
753 // This doesn't work...
\r
754 // if (event.key.keysym.sym == SDLK_BREAK && (event.key.keysym.mod & KMOD_CTRL))
\r
755 // if (event.key.keysym.sym == SDLK_PAUSE && (event.key.keysym.mod & KMOD_CTRL))
\r
756 if (event.key.keysym.sym == SDLK_BACKQUOTE && (event.key.keysym.mod & KMOD_CTRL))
\r
757 //NOTE that this shouldn't take place until the key is lifted... !!! FIX !!!
\r
758 //ALSO it seems to leave the machine in an inconsistent state vis-a-vis the language card...
\r
759 mainCPU.cpuFlags |= V65C02_ASSERT_LINE_RESET;
\r
761 if (event.key.keysym.sym == SDLK_RIGHT)
\r
762 lastKeyPressed = 0x15, keyDown = true;
\r
763 else if (event.key.keysym.sym == SDLK_LEFT)
\r
764 lastKeyPressed = 0x08, keyDown = true;
\r
766 // Use ALT+Q to exit, as well as the usual window decoration method
\r
767 if (event.key.keysym.sym == SDLK_q && (event.key.keysym.mod & KMOD_ALT))
\r
770 if (event.key.keysym.sym == SDLK_F12)
\r
771 dumpDis = !dumpDis; // Toggle the disassembly process
\r
772 else if (event.key.keysym.sym == SDLK_F11)
\r
773 floppyDrive.LoadImage("./disks/bt1_char.dsk");//Kludge to load char disk...
\r
774 else if (event.key.keysym.sym == SDLK_F9)
\r
776 floppyDrive.CreateBlankImage();
\r
777 // SpawnMessage("Image cleared...");
\r
779 else if (event.key.keysym.sym == SDLK_F10)
\r
781 floppyDrive.SwapImages();
\r
782 // SpawnMessage("Image swapped...");
\r
785 if (event.key.keysym.sym == SDLK_F2)// Toggle the palette
\r
787 else if (event.key.keysym.sym == SDLK_F3)// Cycle through screen types
\r
788 CycleScreenTypes();
\r
790 // if (event.key.keysym.sym == SDLK_F5) // Temp GUI launch key
\r
791 if (event.key.keysym.sym == SDLK_F1) // GUI launch key
\r
792 //NOTE: Should parse the output to determine whether or not the user requested
\r
793 // to quit completely... !!! FIX !!!
\r
802 HandleSoundAtFrameEdge(); // Sound stuff... (ick)
\r
803 RenderVideoFrame();
\r
804 SetCallbackTime(FrameCallback, 16666.66666667);
\r
806 while (SDL_GetTicks() - startTicks < 16); // Wait for next frame...
\r
807 startTicks = SDL_GetTicks();
\r
810 static void BlinkTimer(void)
\r
813 SetCallbackTime(BlinkTimer, 250000); // Set up blinking at 1/4 sec intervals
\r