This file is provided for the general amusement of me and anybody who is
interested in what problems I had in getting this Apple II emulator running.
Other writers of Apple II emulators can probably benefit from this; learn
from my mistakes.

0.	Initial Build
	
	Apple II will not boot.

1.	Fixed JSR, branches, one addressing mode.
	
	Apple II boots, but displays random pseudo-garbage when printing a number
	number and fails with a zero divide error on floating-point operations.

2.	Fixed overflow and carry flags in ADC and SBC.
	Carry is set if the result < 0 or > 255, cleared otherwise.
	Overflow is set if the result < -128 or > 127, cleared otherwise.
	This is documented in a tutorial on the V flag at www.6502.org, but is
	not well-documented elsewhere.
	
	Apple II boots and does math correctly. Self-test fails with RAM error.

3.	Added paddle input support.
	
	Paddles do not work. 65C02 clock is not advancing outside of main().

4.	Removed 'static' keywords from a2vars.h.
	I was initializing all the variables in a2vars.h, and the linker was
	complaining about duplicate symbols. Making the variables static stopped
	it from complaining, but the values never changed. The REAL way to fix it
	was NOT to make them static, but to NOT INITIALIZE THEM.
	
	Paddles work. Now back to solving: Self-test fails with RAM error.

5.	Fixed bank-switched memory soft switches.
	Check for double memory accesses (for the odd-numbered BSR soft switches)
	only inside the I/O space; otherwise the processor grabbing the next
	instruction will reset your double memory access check.
	
	Apple II boots. Self-test fails with IOU error.

6.	Fixed $C01A (RDTEXT).
	I keep track of whether or not we're in a GRAPHICS mode, but the soft
	switch keeps track of whether or not we're in a TEXT mode. So if your
	variable is set in a graphics mode and clear in a text mode, $C01A has to
	return the INVERSE of the variable.
	
	Apple II boots. Self-test passes. PR#3 crashes.

7.	Fixed implementation of $C800-$CFFF memory area.
	Access to $Cnxx where n is from 1 to 7 swaps in the $C800-$CFFF ROM for
	that peripheral card. In the case of $C3xx this is the Apple II's internal
	ROM. Access to $CFFF swaps out any $C800-$CFFF ROM. I just swap in the
	internal ROM again.
	
	Apple II boots. Self-test passes. PR#3 enters 80-columns successfully.

8.	Added Disk II support.
	I used the Disk II code from Rich Skrenta's Apple II emulator. It has no
	write support but it's easier to read than other Apple II emulators'
	sources and I can probably add it later.
	
	Apple II gets to 'Apple //e' screen, does not go any further.

9.	Fixed one bug in Disk II support.
	
	Apple II attempts to boot disk fine. DOS 3.3 crashes at $9D86, ProDOS
	fails with a Relocation/Configuration Error.

10.	Fixed nibblization routine in Disk II support.
	Rich Skrenta was wrong. His nibblization routine was missing a few bytes
	and inserting some in other places. I changed it to reflect a NIB image I
	created.
	
	DOS 3.3 and ProDOS boot. Programs load and execute perfectly.
	**BUT**: ProDOS crashes when accessing auxiliary memory as RAM disk in
	80-column mode.

11.	Fixed 80STORE soft switch.
	80STORE *only* applies to accesses to text page 1 (and hires page 1 if
	we're in hi-res graphics mode). If 80STORE is ON and we're accessing text
	page 1 (or hires page 1 in hi-res graphics mode), PAGE2 determines main
	or aux memory. OTHERWISE, RDAUX and WRAUX determine main or aux memory.
	
	Now ProDOS accesses RAM disk in 80-column mode correctly.

12.	Added Disk II write support for .nib images.
	I figured writing is done the same way as reading, so when the drive is in
	write mode assign the current byte to the write register instead of just
	returning it.
	
	ProDOS appears to write OK, but attempting to catalog the disk after
	writing to it throws an I/O ERROR. Not entirely unexpected.
	
13.	Fixed one bug in Disk II write support.
	When write mode is first activated for each sector, the write register
	sometimes contains zero. My routine was writing this zero to the nibble
	image. THIS IS VERY BAD. No zeroes are ever actually written to a disk!
	A zero in the write register means no writing is currently happening.
	
	ProDOS successfully writes to the disk. No corruption is apparent. LOCK,
	UNLOCK, DELETE, CREATE, BSAVE, BLOAD are all confirmed to be working.
	
14.	Added Disk II write support for .dsk images.
	I created a new function a2_disk_decode, and essentially tried to reverse
	the process of a2_disk_encode. Of course I knew I would completely fail
	at my first attempt....
	
	ProDOS appears to write OK, but attempting to catalog the disk after
	writing to it throws an I/O ERROR. Completely expected.
	
15.	Fixed a bunch of problems with Disk II write support.
	Too much to go into much detail. To put it as short as possible: the
	rippling XOR step needed to go from 0 to 63, not 63 to 0; the do while
	loop DOES do something useful; the lower two bits of every byte of data
	in the nibble image get chopped off (that's what the do while loop is for,
	to preserve them); the data can start anywhere; make sure to start AFTER
	the data mark (D5 AA AD).
	
	ProDOS successfully writes to the disk. No corruption is appearent. LOCK,
	CREATE, RENAME, DELETE are all confirmed to be working. DOS 3.3 also
	successfully writes to the disk. UNLOCK and DELETE are confirmed to be
	working. I know a lot more about Disk II nibble encoding now.
	**BUT**: ProDOS File Navigator isn't working!!!??!!! In other emulators it
	works on .dsk images but not .nib images, but on my emulator it works on
	neither. What the heck is the freakin' difference among all those things???
	And why is it happening at all!?!? I'm just calling the ProDOS MLI!!!
	BASIC.SYSTEM knows something I don't....
	
16.	Added support for hard disk images.
	I used the hard disk driver and emulation code from AppleWin 1.12.6.0.
	AppleWin is written in C++ but I ported it over to work the way I like
	it.
	
	Apple II crashes at $0801.
	
17.	Fixed bug with hard disk support in IOU.
	Turns out I was poking to the hard drive correctly, but I was only peeking
	to it if it was in slot 6. Of course it never would be because Disk II is
	in that slot. Oops.
	
	ProDOS boots, then attempts to load ProDOS File Navigator. Apple II
	emulator crashes with bus error!!! This is reproducable! Congratulate me
	on my first host-side runtime error!
	
18.	Added check to see if hard disk buffer pointer is valid.
	
	I don't get a bus error anymore, but there's still weird stuff going on.
	ProDOS File Navigator doesn't work but BASIC.SYSTEM does (no surprise).
	At *some* point the pointer goes invalid, but I don't know where. All I
	know is that the read address never gets called with an invalid block
	number, yet the pointer goes invalid anyway.
	
	
	
Reference Material:

Here is a list of the web sites I have used in the process of creating this
emulator that have been very useful to me.

Jon Relay's Apple II Info Archives -
	http://kreativekorp.cjb.net/apple2/infoarchives.html
	
	Yes, this is my own web page. The extensive list of zero page locations
	and I/O memory addresses was an invaluable reference.

ProDOS 8 Technical Reference Manual -
	http://luddite.ca/misc/a2docs/PDOS8TRM.HTM
	
	This helped me understand some of the internal workings of ProDOS, which
	came in very useful for debugging and accurate emulation of auxiliary
	memory, the Disk II drives, the hard drives, and the real-time clock.

65C02 Reference -
	http://www.obelisk.demon.co.uk/65C02/reference.html
	
	This provided my definitive reference to the 65C02 instruction set. In
	particular this helped me get the processor status bits set correctly and
	cleared up exactly what some of the instructions did (BIT and CMP in
	particular, and the extra bit-manipulation instructions like TSB, TRB,
	BBS0, SMB0, etc.).

6502.org Tutorials & Primers -
	http://www.6502.org/tutorials/
	
	This helped me immensely by finally clearing up once and for all how the
	carry and overflow bits are affected by the ADC and SBC opcodes, and how
	interrupts are handled on the 65C02.

C++ Reference Project -
	http://www.cplusplus.com/ref/indexr.html
	
	Nothing to do with the Apple II, but this is one of my most frequently
	used C/C++ references.

Apple II Emulator in C -
	http://www.skrenta.com/a2/
	
	I used the Disk II code from Rich Skrenta's Apple II emulator as the
	basis of my Disk II code. His was the easiest to understand compared to
	other Apple II emulation sources I have found.

Apple II Disk Drive Article -
	http://www.doc.ic.ac.uk/~ih/doc/stepper/others/example3/diskii_specs.html
	
	Rich Skrenta's code had no write support, so I had to write that myself.
	This article came in useful for understanding what the heck I was doing
	(and what the Apple II thought the Disk II was doing) and making sure I
	was emulating it accurately.

AppleWin -
	http://www.tomcharlesworth.pwp.blueyonder.co.uk/
	
	I used AppleWin's driver and emulation code for implementing hard drive
	support. Other parts of the code may prove useful to me as well.











