Add SDL, joystick, serial, docs. remove GTK/DGA
Status: Beta
Brought to you by:
wsxyz
Add support for SDL graphics; Remove support for
GTK and DGA,
SDL can apparently display in DGA mode as well as in an X11 window, so I assume removing support for GTK and direct DGA is warrented.
Replace rasterizers with full frame updates
As part of this change, I've changed the model of updating the screen away from using rasterizers. Instead, writes to apple's video memory are almost entirely like other memory writes \(they mostly just update the right memory\[\] array; there's no longer a bits\[\] array\) and then the event loop repeatedly \(up to 30 times per second\) redraws an entire frame by walking the apple's video memory and drawing the corresponding blocks of pixels. Each character of text or byte worth of high-res graphics is blitted from other SDL surfaces created at initialization time. Lo-res blocks are drawn using the appropriate Fill routine. The assumption is that modern graphics \(SDL or X or accelerated video cards\) are very efficient at copying large blocks of pixel data which have already been converted to a more native representation, enough so that invoking them will be much faster than being smart about updating only the pixels which have changed and only a few at a time. This seems to be the case: it's a little faster in the usual case, and definitely faster in the worst cases such as when scrolling, where it has to update most of the screen. I tried Prince of Persia; it looks like it runs without glitches. Unfortunately, I've introduced and haven't yet tracked down a bug which affects some programs which use double wide graphics \(COLUMNS using DHGR, ProTerm using 80 column text\), where it looks like the other page of text or graphics makes a very brief appearance when it's not wanted. Drawing only when VBL is true or only when VBL is false doesn't help \(for COLUMNS at least, didn't try the others\).
Add joystick support
The keypad arrow keys control the analog inputs, providing a rather digital joystick. \(I've found that games aren't actually very playable this way. I'd like to add support for real joysticks once I have a Linux system that has one. It looks like SDL makes adding support easy\)
Add serial port support
I've added partial support for a serial port card in slot 2. \(Just register support, no ROMs, interrupts not supported\) There is a mode where an emulator can create a pty for another emulator to use as though it were a serial port, so two emulators on the same machine can talk to each other as though connected by a serial line. \(I hope to write and debug an Apple-Disk-Transfer-like application this way someday maybe\)
README and manpage
I've created a README file and a manapage, since I noticed those were missing. I've tried to describe how one should go about getting cxrom.rom and applesoft.rom. I've included two perl scripts, one of which converts the ROM file which comes with AppleWin into one of those two files, and another which converts the output of doing "C100.FFFF" in the system monitor into those two files. I find that the cxrom.rom file which is produced by converting C100.CFFF on my Apple IIe is unusable \(the resulting emulator doesn't boot\), but the applesoft.rom produced that way works well with the cxrom.rom extracted from the ROM file that comes with AppleWin. So the cxrom.rom must not just be the output of "C100.CFFF"? How did you create your cxrom.rom file?
Diskette Lists:
Now that GTK is no longer used, there are no file dialog boxes, and I haven't gotten to implementing a replacement. Instead, the filenames of all disks are listed on the command line when openapple is invoked, and there are keys to cycle through which of those disks is currently in the drive. This is more convenient than a dialog box for games \(I can switch between the Britannia and Underword disks in Ultima 4 with a touch of a button\) but naturally less so for other uses. \(Ultimately, I'd like to have commands or settings in a similar way to emacs or vi or Quake, where there is a command prompt to enter commands such as disk change commands, but one can bind such commands to particular keys\)
Status Line:
There is always a line 25 of 80-column text, aqua on black, showing the current diskette files being used and the most recent speed of the emulator. Now that the speed is in the window, I removed the "Speed: " printf. I intended to remove other printfs and put them in the status bar as well, in particular showing whether the diskette chosen was DOS order or Prodos order, but didn't get that far.
Color/Mono and Full/Half line support:
I haven't implemented these again, the display is currently always color and displayed on all scanlines.
Mouse support:
I've probably broken mouse support, but I'm not sure how to test it \(I'm not sure what programs to try\)
Isolate non-existent audio support
I moved the commented out audio routines from apple.c into "audio.c". Still commented out.
Native key repeat
I've used SDL's calls to change key repeat rate instead of implementing key repeat within openapple.
Individual Patches
descriptions of each patch