don't click here

Early MD VDP bug

Discussion in 'General Sega Discussion' started by Tom41, Mar 15, 2010.

  1. Tom41

    Tom41

    Pheer the baby EggRobo! Oldbie
    291
    0
    0
    UK
    Ok, you all know about the 'sprite limit' of the MD's VDP. I've heard that on the earlier models of MD1s, the VDP actually had a bug involving the sprite limit. If there were too many sprites in a certain line, it could actually interfere with some of the Scroll High layers as well!

    The result of this is that if you put a lot of sprites on the screen in, for example, Sonic 1's Marble Zone, you'd get lines of the floating pillars disappearing. This is normal, since the pillars are also on the sprite layer. However, with the older MD1s, you'd also get lines of the Scroll High layer (unmoving ground) disappearing as well, showing the Scroll Low layer through it!

    Neither my MD1 nor my MD2 seems to suffer from this bug though - lines disappear in the sprite layer, but not in the scroll layers. From what I've heard, the bugged VDP lasted until the first revision of MD1s that contained the TMSS, and was then fixed for all future MDs. Has anyone got one of the older MD1s (preferably without TMSS) to try this on? Go to Marble Zone, use debug to create a lot of sprites near one of the floating pillars, and see what layers disappear.
     
  2. TmEE

    TmEE

    Master of OPL3-SA2/3 Tech Member
    1,726
    2
    18
    Estonia, Rapla City
    T-04YBSC-A !
    There's 315-5313 and 315-5313A, most MD's got the A variant.... (its the VDP chip). I'll have to check this out.
     
  3. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    I have an MD1 VA2 with a 315-5313. (No TMSS) I haven't noticed this bug, so I'll have to check it again.
     
  4. LocalH

    LocalH

    roxoring your soxors Tech Member
    I don't know which VDP either of my non-TMSS Genesis consoles has, but I don't think either one of them exhibit this bug. I've got one here with me at the apartment but it's not hooked up or anything, the other one is stored over at my parents' house so I don't have access to it tonight.

    Maybe it was something like the first couple of production runs or something. I don't know the size of the runs they did, but they were probably fairly large.
     
  5. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    I'm going to bet that it would only happen on the early japanese consoles, so you'd have to check those.

    Also what's the source for this? If this was taken from looking at an ad, remember that the development boards are very DMA unfriendly (which is why all those warnings and hacks mentioned in the docs).
     
  6. ICEknight

    ICEknight

    Researcher Researcher
    That never happened in my no-TMSS PAL Mega Drive... Is the source for this reliable?
     
  7. TmEE

    TmEE

    Master of OPL3-SA2/3 Tech Member
    1,726
    2
    18
    Estonia, Rapla City
    T-04YBSC-A !
    I've seen it in a video a friend (Epicenter, the DarkSea guy etc.) showed me some years ago... I never tried it myself... I still haven't.....
     
  8. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    Maybe my memory has failed me, but what are you referring to here? The only warning I recall is the "last word from RAM" business to avoid failure - that does occur on actual hardware, just very, very rarely.

    I'd like to know what the source is for this as well though.
     
  9. Chilly Willy

    Chilly Willy

    Tech Member
    751
    11
    18
    Doom 32X
    Page 106 of the Genesis Software Manual says this about DMA transfers -

    It does not explain why.
     
  10. DigitalDuck

    DigitalDuck

    Arriving four years late. Member
    5,349
    437
    63
    Lincs, UK
    TurBoa, S1RL
    That's... bizarre.

    I mean, why specifically $C00004? It doesn't make sense.
     
  11. Andlabs

    Andlabs

    「いっきまーす」 Wiki Sysop
    2,175
    1
    0
    Writing my own MD/Genesis sound driver :D
    $C00004 is the address you would write to to issue a command to the VDP. $C00000 is where you would write the data. For example:
    Code (ASM):
    1.     move.l #$C0000000,($C00004) ; command to initialize a write to CRAM $0
    2.     move.l #palette,a1
    3.     move.l #63,d0
    4. -
    5.     move.w (a1)+,($C00000) ; each write moves the pointer in CRAM
    6.     dbf d0,-
    would be the code block to load a palette.
     
  12. DigitalDuck

    DigitalDuck

    Arriving four years late. Member
    5,349
    437
    63
    Lincs, UK
    TurBoa, S1RL
    Ah, I see. So it's not just a random RAM bug, then. Please excuse my ignorance.

    It's still a bit strange, though. I can see why only writing a byte rather than a word might cause problems, but "The final write must use work RAM"? Why would it matter?
     
  13. Chilly Willy

    Chilly Willy

    Tech Member
    751
    11
    18
    Doom 32X
    It's probably a cycle termination problem. DMA immediately halts the 68000 until the DMA is done. The "immediately" part of that is probably even worse under certain circumstances, cutting the current 68000 cycle off earlier than normal. The RAM is fast enough that an early terminated cycle still gives the 68000 bus enough setup/hold time on the data that it doesn't lose the data. However, the ROM may or may not be fast enough, and therefore the 68000 loses the data for that last cycle.
     
  14. Bibin

    Bibin

    DON'T LET THE SUN LAUGH AT YOU. Member
    881
    0
    0
    New York City
    Ghost in the Machine
    I will jump to my First-revision non-TMSS Genesis 1 a bit later - what must I do to check for this bug exactly?
     
  15. Quickman

    Quickman

    be attitude for gains Tech Member
    5,595
    18
    18
    :x
    omg porjcet
    Anything which causes sprite overflow. Marble Zone is a frequent offender.
     
  16. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    There are more warnings in the addenums. Also the last page of the main docs show how the board should be set up to prevent the VDP from going insane. The issues are worse with the 32x (those docs have more warnings involving development boards).
     
  17. Chilly Willy

    Chilly Willy

    Tech Member
    751
    11
    18
    Doom 32X
    In my experience working on Wolf32X and talking with Steve Snake, you can just ignore all the 32X warnings when working on 32X homebrew. Which is good - it means we can do things like use the free-running timers. :)
     
  18. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,718
    1
    0
    being an asshole =P
    Except that the hardware we use currently has nothing to do with the development boards Sega used back in the day. Current hardware is designed to gimmick ROM characteristics to the MD, while development boards used crappy DRAM and other components in a pretty hackish way.
     
  19. TmEE

    TmEE

    Master of OPL3-SA2/3 Tech Member
    1,726
    2
    18
    Estonia, Rapla City
    T-04YBSC-A !
    Dev HW was generally only slightly modified retail units ala CPU replaced with emulator terminals for low level debugging... and stuff was run on EPROMs or PSRAM(aka DRAM) boards... nothing hackish about the DRAM stuff, just 32X does not pass the refresh signal through untouched and that will cause some timing related problems which result in peculiar random crashes etc.... which 32X love to do when the ribbons are not tight...
     
  20. Pinkerton

    Pinkerton

    サメジマ・マミミ Oldbie
    I'm not sure if this is even relevant at all since I'm no MD tech wizard or anything, but it sounds kinda like what's going on. I've got a Genesis Model 1/TMSS and whenever I clear virtually any second act in Sonic 2, the flickies leaving the egg container cause the parts of the container they're parallel with to disappear. It looks like there's more or less an eraser moving up and down it, revealing what's behind. IIRC my friend's Genesis 2 doesn't do this, but it's been forever so I'd have to check.