Skip to content

Implement bank switched RAM + ROM at 0xD000-0xFFFF - #6

Open
kjaget wants to merge 1 commit into
tmikov:masterfrom
kjaget:language_card_banks
Open

kjaget wants to merge 1 commit into
tmikov:masterfrom
kjaget:language_card_banks

Conversation

@kjaget

@kjaget kjaget commented Oct 28, 2026

Copy link
Copy Markdown

Move this out of ram_ by expanding IO space into 0xD000 to 0xFFFF. Implement IO code which includes RAM & ROM buffers for this space as well as hooks to peek $C080-$C08F calls which switch between RAM and ROM access along with bank switching the lower 0x1000 of this range. See http://www.applelogic.org/files/AIIETECHREF2.pdf, "Banked Memory" section for details.

This PR isn't ready to go, but is a work in progress with the hope of getting some feedback. I initially hoped to just do this with a hack to to the emu->ram_[] array somehow so the remainder of the code which accessed ram_ would continue to just work. But I didn't see a good way to handle the mix of reading from ROM / writing to RAM unconditionally. There also wasn't a path to feed a2 IO handling back into the emu part of the code. So moving peeks and pokes starting from $C000 into the IO layer seemed like it was the best fit.

Test case was Earth Orbit Stations
(https://archive.org/details/EarthOrbitStations4amCrack) which uses this early on in the intro screen to draw graphics. Still doesn't work - blue sky is drawn then cleared and shuttle isn't drawn. But it does then draw the smoke circles and moves on to the main menu before immediate crashing. But previously crashed just after the EOA splash screen so it is a step in the right direction.

I'll continue to debug this but wanted to see if you might have ideas to help fix the graphics issue as well as the subsequent crash. My plan is to find an open source emulator which it does run on and see if I can get an instruction / register trace of a good run to compare against. That might help with the crash, but for the graphics I was hoping maybe you knew of something not implemented in a2emu that might be at play.

Move this out of ram_ by expanding IO space into 0xD000 to 0xFFFF.
Implement IO code which includes RAM & ROM buffers for this space as
well as hooks to peek $C080-$C08F calls which switch between RAM and ROM
access along with bank switching the lower 0x1000 of this range

Test case was Earth Orbit Stations
(https://archive.org/details/EarthOrbitStations4amCrack) which uses this
early on in the intro screen to draw graphics.  Still doesn't work - blue
sky is drawn then cleared before drawing smoke, but it previously
crashed just after the EOA splash screen so it is a step in the right
direction.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant