Skip to content

apple2gs: more accurate address map#15335

Open
arekkusu42 wants to merge 1 commit into
mamedev:masterfrom
arekkusu42:apple2-map
Open

apple2gs: more accurate address map#15335
arekkusu42 wants to merge 1 commit into
mamedev:masterfrom
arekkusu42:apple2-map

Conversation

@arekkusu42
Copy link
Copy Markdown
Contributor

This commit implements more accurate emulation of apple2gs memory banks, with and without a memory expansion card:

  • Banks beyond the populated expansion RAM are ghosted for reads and writes, per the Hardware Reference Figure 3-9
  • Banks 80+ (or, without expansion RAM, all unpopulated banks) read the 65816 bank register from the floating bus
  • With a memory expansion card, any missing banks in "not recommended" memory sizes (like 3MB or 768kB) and expansion ROM banks F0...Fx read as FF (on ROM3) or the bank register (on ROM1)

Previously, this was only partially implemented by bfb18d1. Most software won't attempt to use memory beyond the installed amount, so is not affected. But the edge-case behaviors are now accurately emulated, i.e. with -ramsize 4M, writes to 50/0005 are visible at 10/0005.

Testing:

Details
A new BANKMAP test visualizes the power-on memory detection results, by drawing a grid of the first byte of each bank. (On my 37-year old PCB, the bank register via the floating bus is noisy, so each byte is read 100 times to report the noise %.) The results are compared to pass/fail expectations, computed by the test according to the detected memory amount and motherboard ROM version.
BankMap_260512.zip

Before this PR, MAME 0.287 does not implement ghosting, or handle the floating bus correctly for banks > E1:
BANKMAP_287_4M_before

After this PR it matches hardware results (here, a ROM3 with an OctoRAM using jumpers set for 4MB but the last 1MB removed to create a "not recommended" odd memory size):
BANKMAP_gs_4M

And similarly for all other supported -ramsize configurations (thanks to @jawaidbazyar2 and Kelvin Sherlock for testing ROM1 behavior.)


Note: MAME currently does not emulate any apple2gs-specific memory cards, but there exist cards (one, two) with expansion ROM sockets (for booting ROMdisk debug tools). The way that I "unmap empty ROM banks" here might not work for those...

* revisit 2fb9b7c, restore direct r/w of expansion RAM
* fix reads of unpopulated RAM/ROM banks
* implement expansion RAM ghosting, per Hardware Ref
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