[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apple II Emulation in HyperCard



>I'm writing my own Apple II emulator in HyperCard. I have most everything
>working except peripheral cards, vertical blanking, analog game input, and
>hi-res graphics. When I start it up, the emulated processor enters an
>infinite loop:
>
>$D4F0- D0 F8      BNE -8
>$D4EA- B9 FB 01   LDA $01FB,Y
>$D4ED- 88         DEY
>$D4EE- 91 9B      STA ($9B),Y
>$D4F0- D0 F8      BNE -8
>
>I jumped to this address in ApplePC and it is a real infinite loop. I think
>there's something wrong with how I initialize something or with the
>processor emulation.

No idea what you are trying to do here. Is this your code or something else.

>What generates the other 7 bits when you access an I/O memory location
where
>only the most significant bit is used?

I think I can help here. The other bits are just random because they could
be floating inputs, so they could be hi or lo. Whether this is the same in
an emulator is irrelevant, treat it as if it was. To get around this a few
methods are available. Normally bit 7 is used so a BMI could be used to test
the 7th bit straight after it is read with a LDA opcode. Alternatively you
can mask off the other bits with AND #$80, this will have the effect of
zeroing bits 0-6. You can then use the test BNE or BEQ to branch to test
that bit. A third way is to roll the 7th bit into the carry and test that.
For example ROL, or ASL followed by BCC or BCS.

>
>What are all the I/O memory locations for disk images, mouse cards, clock
>cards, and so on and what _exactly_ does each do? (In English please; I
>don't know C [yet :)].)

If you are talking about an emulator, I don't know, otherwise get a few A2
reference books.

Mark