[GOODIE] A2Emulator

Duane Maxwell dmaxwell at san.rr.com
Tue Nov 20 18:38:01 UTC 2001


> Upon trying HGR mode -- before I realized that the A2Morph leaves HiRes as
> an exercise for the reader -- I hit upon an undocumented instruction ($FF
> at PC $F5BA and $F5CA) when issuing a HPLOT 10,10 TO 20,20.

Yeah, I didn't get around to hires graphics - not sure anyone wanted to wait
around for anything to show up on the display, plus I couldn't find
*definitively correct* documentation of the rather bizarre mapping of
scanlines and colors.  Lores graphics work fine, though.

I'm suprised you got something illegal - the BBS7 instruction is a 65C02
instruction, but the ROM specified is for a II+, which used a 6502.  Perhaps
some other instruction is busted.  I included methods but not
implementations for RMBn, SMBn, TSB, TCB and BBSn instructions.

> That is, a combination of INC and SBC (sometimes called "ISB").

Actually, BBSn zp, adr is BranchOnBitSet, which tests bit n of the zeropage
location zp, and branches to relative address adr if it's set.

> Perhaps
> modulo *not* recognizing the D flag for the SBC, but I'll have to dig
> deeper for this.  And I have no way to tell before somebody beats me to
the
> HiRes display methods.

I don't handle the 'D' flag - nothing in the ROMs uses it, but the
appropriate code would go in CPU6502>>adc: and CPU6502>>sbc:.

Note that it's possible to accelerate common ROM routines by adding stuff to
CPU6502>>handleSpecial.  I already accelerate portions of scrolling, delays,
and capture the system beep (though it does a sine wave rather than a proper
square wave).  If someone feels like coming up with something to respond to
paddle calls (mouse?), one should hack the appropriate routine. Hires
graphics is also a good candidate.

I actually dug my 1978-vintage Apple II from the garage to do this. It runs
for about an hour before going bonkers, the '/' key doesn't work, the 'Z'
key bounces horribly, but it ran well enough to test the behavior of a
couple of the more poorly documented instructions, etc.

Note also that this stuff is painfully close to Slang....

Enjoy!

-- Duane







More information about the Squeak-dev mailing list