The settings code now actually saves updated settings to the config
file. Also wrote the beginnings of a proper Config window, and a few
of the options actually work (which ones work is left as an exercise
for the reader).
This means that you can now connect hard drive images to the emulator,
and, with the addition of the AHSSC emulation, connect up to seven of
them to one system (technically, with 8 LUNs per SCSI ID, you could in
theory connect 56 of them, but that's just crazy). The emulation of
the card is still in an early state, but it currently seems to work
properly with the "Pitch Dark" hard drive image by 4am. Still needs
some work to expose it properly to the GUI, but hey, that's just
details. :-)
It will read/write WOZ 2, though internally it doesn't obey the "optimal
bit timing" value yet; support for that is coming. :-) It will also
silently upconvert WOZ 1 images, though that will only matter if the
disk is writable and is written to.
It's not very accurate as it's set to zap the head instantly to where
the phase solenoids indicate, as opposed to moving from the start
position to the destination position in a finite amount of time (which
wouldn't be all that difficult to emulate). But most things tend to be
pretty well behaved and so this approach seems to work OK.
Also added preliminary hard disk emulation.
- Refactored old MMU slot code to be more flexible
- Moved all Mockingboard related code to its own compilation unit
- Refactored old 6522 & AY-3-8910 code into v6522VIA & vAY8910 :-)
- Fixed BCD mode for ADC and SBC in v65C02
- Finally fixed text mode characters in both ALTCHARSET and regular
modes
- Added new floppy disk controller Logic State Sequencer emulation
- Fixed v65C02 to be cycle exact (as far as I can tell)
- Fixed a bunch of bugs in v65C02
- Dropped NIB support
- Added WOZ 1.0 file support
That last item is a bit of a big deal, as I had been thinking about
writing a new file format that would be bit-based--since the NIB nybble
format, while better than pretty much all the other formats out there,
fails hard in things like extra sync bits and half tracks. So, somewhat
serendipitously, I stumbled upon the Applesauce project and found out
that not only had other people been thinking in more or less the same
direction, they had created it and had made disk images to try!
So now, because of this, WOZ is the internal format used by the floppy
emulation (as opposed to NIB) which, along with the new disk Logic State
Sequencer emulator, makes it possible to format floppy disks correctly
for the first time. :-)
One ironic consequence of this is that NIB format can no longer be
properly supported. The irony comes from the fact that before there was
LSS emulation, NIB was the most accurate format you could get to
represent the low level format of a disk, but now, with proper LSS
emulation, it's the worst format for representing a floppy disk. And
the main reason for this is that NIB doesn't contain sync bits, and has
no mechanism to represent them--so when feeding them to the new LSS
emulation, they will fail horribly because without sync bits, the
bitstream represented by a NIB formatted disk can and will be
misinterpreted by the LSS. And since there is now a format that
properly represents the bitstream on a floppy disk (WOZ), there's
absolutely no reason to keep NIB around or support it anymore. While it
was a nice interim format to have around (when the emulation of the disk
was "imperfectly perfect"), it now no longer has a place in disk
preservation and/or emulation.
Another consequence of this new format is that Apple2 only supports
writing of WOZ images--it will no longer support writing of DSK and its
bretheren. However, since those formats are extremely limited in their
scope (they literally only represented the contents of the sectors on a
disk) we still support reading them; Apple2 will automagically upconvert
them and save them as WOZs (it will use the same filename but substitute
"woz" for the old extension). So if you're wondering why your DSKs are
unchanged when saving to them, you now know why. :-)
Big, big thanks to the Applesauce guys and everyone who contributed and
continues to contribute to that project; your efforts are very much
appreciated--you guys are awesome!
Currently only supports one Mockingboard in slot 4, but it should be
fairly trivial to add another in slot 5. Tested with Ultima 3, 4 & 5,
and Mockingboard disk #1. Also, added some fixes to correct the timing
of the 6502 and sound; I believe I have a good understanding of it now,
even though there's still work to do to keep the main CPU thread from
starving the audio thread (which still happens, but less often now).
Having taken a good look at "Understanding the Apple IIe", I've fixed
the timing of one frame now that I know how much time it's supposed to
take. Also added the ability to recurse into subdirectories of the disks
directory, and the ability to page through the disk list when there are
more than three columns of disks. Another thing I did not know about was
Double LoRes, that has been added as well; also, did not know that the
video bus appeared at memory mapped locations that weren't attached to
anything. This quirk is now properly emulated.
The keyboard handler now properly emulates the //e's 2-key rollover.
However, we might have to add in a key repeat delay if it makes it so
that you can't type on the console anymore. This had to be done because
SDL will throw in key delay if you rely on it's SDL_KEYDOWN message and
this caused many games with keyboard input to be unplayable. Also, we
consolidated the video handling files, as there was very little in
video.cpp and so we moved it into applevideo.cpp and renamed that file
to video.cpp. Things are a lot cleaner as a result of this merge. :-)
The idea is to present icons for the most commonly used functions that
will pop up on the screen when moused over, then go away once the mouse
is not over them anymore. Hopefully this will actually be usable, unlike
the previous clusterfuck that I attempted. It was a good idea, but SDL
just wasn't up to the heavy lifting required.
There was one bug that went undetected in the v65C02 core (in STX ZP,Y)
and another in the 80STORE handling (80STORE doesn't affect reading).
Also added a pause mode (bound to the Pause key), for those times when
you need to walk away from the emulation for a bit.
This involved fixing V65C02 (by subtracting out cycle overruns) and fixing
the main thread callback wait loop. As someone once said, "Threading is
hard." :-P
Before it was doing some complex timestamp thing, now it simple runs the
CPU for ~21 cycles and then stuff the sample into the sound buffer.
Sound still lags behind by several frames though, just like with the
previous sound setup. Still not sure why. :-/