Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Possible SMSVDP.txt error (for Charles Mac Donald)

Reply to topic
Author Message
Eric
  • Guest
Reply with quote
Possible SMSVDP.txt error (for Charles Mac Donald)
Post Posted: Sun Mar 19, 2000 4:33 am
Charles,

I've been studying your SMS/GG VDP document, and I believe I've found an error.

In section 2, you state that the two CD bits (CD1, CD0) in the command word can be 00b, 01b, or 10b for a VRAM read/write. I don't believe that CD[1:0]=10b is valid.

You will notice that the command for setting a VRAM address 0x0000 through 0x0FFF using CD[1:0]=10b is indistinguishable from a VDP Register write. This cannot be. I believe only 00b and 01b are valid CDx bits for setting VRAM address.

This problem is manifested in the sample code you provide. If a program attempts to set the VRAM address between 0x0000 and 0x0FFF using CD[1:0]=10b, a VDP register will also get overwritten. For example, using your code, if I attempt to set VRAM address to 0x0000 by using the command LSB=0x00 (first byte written), MSB=0x80 (second byte, CD[1:0]=10b). The VDP register 0, will be cleared (and disable the screen). Even though I can still correctly read/write VRAM, I think you'll agree that the corruption of VDP register 0 is incorrect for this operation.

Perhaps you could write a small sample program and run it on your emulator to test if I'm correct (about the screen blanking (SMS only) if you attempt a VRAM write to address 0x0000 using CD bits 10).

Please let me know if I've made a mistake.


Eric Quinn
 
  • Joined: 28 Sep 1999
  • Posts: 1197
Reply with quote
Post Posted: Sun Mar 19, 2000 4:36 pm

Quote
> In section 2, you state that the two CD bits (CD1, CD0) in the command word can be 00b, 01b, or 10b for a VRAM read/write. I don't believe that CD[1:0]=10b is valid.

The Game Gear game 'Ax Battler' uses a setting of '10' to update the sprite table.
It will not work correctly (no sprites) if you don't allow such a setting.
It only uses it to write to areas 3F80 and 3F00.

The reason that this kind of access isn't interpreted as a
register write, is because the upper four bits of the command
word aren't '1000', but '1011'.

You are totally correct about how writing to lower addresses would
be conflicting with a VDP register write. I haven't observed
any games that do this, and Ax Battler only writes to
high addresses in video RAM, so the top four bits will
never be '1000'.

I'd like to chalk this up to another 'quirk' of the VDP. :)


  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 25 Oct 1999
  • Posts: 2029
  • Location: Monterey, California
Reply with quote
Re: Possible SMSVDP.txt error (for Charles Mac Donald) [That explains something...]
Post Posted: Mon Mar 20, 2000 3:52 am
Quote
>
> > In section 2, you state that the two CD bits (CD1, CD0) in the command word can be 00b, 01b, or 10b for a VRAM read/write. I don't believe that CD[1:0]=10b is valid.

> The Game Gear game 'Ax Battler' uses a setting of '10' to update the sprite table.
> It will not work correctly (no sprites) if you don't allow such a setting.
> It only uses it to write to areas 3F80 and 3F00.

Ah, that explains it. I was experiencing an odd bug in a program I've been working on, where everything I write to sprite ram was offset ahead by 1 byte. Turns out I was setting the VRAM to point to $3f00/$3f80 instead of $7f00/$7f80, and although it still accepted the data port writes, it was immediately advancing the vram pointer by one after the address was set, as it it supposed to when you set it to a read address.


  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!