Quantcast

Results 1 to 2 of 2

Thread: Z80 Access When Using Sega CD

  1. #1
    Wildside Expert bgvanbur's Avatar
    Join Date
    Jul 2011
    Location
    NY, USA
    Age
    37
    Posts
    199
    Rep Power
    20

    Default Z80 Access When Using Sega CD

    I made a sample Z80 access test for the Sega CD to see if can really access MAIN 68K CPU RAM or Sega CD Word RAM. It runs a Z80 program that reads and writes to MAIN 68K CPU RAM and Sega CD Word RAM. It outputs the long words at $A00000 (start of Z80 RAM), $FF0000 (start of MAIN 68K CPU RAM), and $200000 (start of Sega CD Word RAM) before the Z80 program runs and after the Z80 program runs. It also this test twice, once when the MAIN 68K CPU is running from MAIN 68K CPU RAM and once when the MAIN 68K CPU is running from Sega CD Word RAM.

    The Z80 program does the following:
    • Reads the first word of the MAIN 68K CPU RAM and stores it at the first word of Z80 RAM.
    • Reads the first word of the Sega CD Word RAM and stores it at the second word of Z80 RAM.
    • Writes $0102 to the second word of the MAIN 68K CPU RAM
    • Writes $0304 to the second word of the Sega CD Word RAM

    The output is:
    • Initial long word of Z80 RAM
    • Initial long word of MAIN 68K CPU RAM
    • Initial long word of Sega CD Word RAM
    • Final long word of Z80 RAM (first word shows results of Z80 attempted read of MAIN 68K CPU RAM and second word shows results of Z80 attempted read of Sega CD Word RAM)
    • Final long word of MAIN 68K CPU RAM (second word shows results of Z80 attempted write of $0102)
    • Final long word of Sega CD Word RAM (second word shows results of Z80 attempted write of $0304)

    The first time it has the MAIN CPU running from MAIN CPU RAM. The second time it has the MAIN CPU running from the Sega CD Word RAM. This was to see if where the 68K was running from had any effect on the Z80 accesses.

    When I run it on my model 2 Genesis model 2 Sega CD, the output indicates that the Z80 gets $FF when reading MAIN 68K CPU RAM, the Z80 can write to MAIN 68K CPU RAM, and the Z80 can both read and write to Sega CD 68K RAM. It also shows no difference in the 68K running from MAIN 68K CPU RAM or Sega CD Word RAM on the z80 accesses. Here is a screenshot of it running on real hardware.


    It is interesting to note that both Gens/GS and Fusion think the Z80 can read MAIN CPU 68K RAM, so here is another difference between real hardware and emulators:


    The Sega CD ISO of this test that includes all of the code source is located at:
    https://dl.dropbox.com/u/26821164/Z80ACCESS.ISO

    So at least the Z80 can potentially use the Word RAM when a Sega CD is used. If anyone would like to try this test on other configurations and let me know about the results that would be great!

  2. #2
    ESWAT Veteran Chilly Willy's Avatar
    Join Date
    Feb 2009
    Posts
    6,744
    Rep Power
    78

    Default

    I've seen tests like this already over at SpritesMind, with the same results other than (IIRC) the value read from work ram by the Z80 can vary on the model, but it still fails.

    It makes sense that SEGA would make sure the Z80 could read word ram on the CD - where else would the Z80 get it's music data from if it couldn't read either work ram or word ram? SEGA probably didn't care about work ram because the Z80 would be reading the cart, but with a CD game, there is no cart, so you only have three areas for z80 info: the work ram, the word ram, and the local ram. The local ram is too small for music/samples. The work ram doesn't work. So we are left with only the word ram as a source for the z80.

    But, it's good to see another test that verifies these things.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •