Quantcast

Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: The Adventures of DMA David

  1. #1
    Comrade as in friend. Master of Shinobi ComradeOj's Avatar
    Join Date
    Dec 2012
    Location
    New Mexico, USA
    Age
    26
    Posts
    1,440
    Rep Power
    62

    Default The Adventures of DMA David

    What is it?
    The Adventures of DMA David is a multiple choice adventure. Choose one of three options to progress. Choose wrong and get sent back to the start. The game uses the Genesis's direct color DMA display trick. Basically, less resolution but more colors is the tradeoff.

    The game is very short and can be beaten in seconds if you mash the correct answer buttons fast enough. To be honest, I was more interested in playing around with direct color DMA than making a good long multiple choice adventure game. Direct color DMA locks the CPU while drawing, and I wanted to see if there was enough CPU time left to do simple game logic. There is enough time between VBLANKs to poll controllers, play music, AND do simple game logic. The images aren't full screen, so that left enough time.

    Direct color DMA works through overscan. You can only really see it on displays that don't crop the image, such as HDTVs. Normally the overscan area is a blank solid color. With color DMA it actually contains graphics! Because of this, you can see more of the left and right of the photos on an HDTV. Some images looked okay with direct color DMA. Others looked awful. I tried experimenting with different downsampling and dithering methods, so the "look" of the images varies. Bright colorful images seem to work a lot better with direct color DMA than dark moody ones.

    The music is mostly stuff that I started, but either never finished or never used. Because of this, it's a lot of short loops. At least those orphaned songs have a home now. The ending music is pretty cool in my opinion though.

    Here is a video showing the game from start to finish. I only picked the correct answers.


    Caveats (there are a few):

    This game has serious issues with almost all emulators due to using direct color DMA. The only two that I know of that can run it are Exodus
    and BlastEm. Exodus ran it, but only at 15FPS when most games run full speed for me. The image was also shakey in exodus. BlastEm ran it at full
    speed without any issues. If you don't own a flash cart, I would only recommend running the game in BlastEm. I don't know of any mobile/console
    emulators that support direct color DMA. You can download BlastEm here.

    The screen will shake left and right on an overclocked system.

    I don't own a PAL system to test this on. It worked in BlastEm as PAL though

    Download link: Download.
    Modded consoles:
    Master System (v7040) with s-video & direct AV out
    Model 1 with 10mhz overclock & halt switches
    Model 1 with 10mhz 68010
    Model 2 VA2.3 with unfiltered Mega Amp, & s-video
    Model 3 VA1 with compatibility fixes & s-video
    32X with s-video
    Visit my web site at www.mode5.net
    Or my collection of homebrew Genesis games, programs, and music on SEGA-16!

  2. #2
    WCPO Agent EPSYLON EAGLE's Avatar
    Join Date
    Aug 2013
    Posts
    757
    Rep Power
    20

    Default

    You must spread some Reputation around before giving it to ComradeOj again.

  3. #3
    Hedgehog-in-Training Hedgehog-in-TrainingWildside Expert
    Join Date
    Oct 2015
    Posts
    174
    Rep Power
    7

    Arrow

    Notes for Mobile Emulator Tests: MD.emu shows glitched graphics, RetroArch with Genesis GX Plus Core also shows glitched graphics, while PicoMD Core shows no graphics at all. Text, music and controller input work on all 3 emulators MD.emu is 1.5.28 and RetroArch is build Jan 16, 2016 latest cores. Also "You must spread some Reputation around before giving it to ComradeOj again.".

    Signed,

    Scorpion Illuminati
    Last edited by Scorpion Illuminati; 02-23-2016 at 03:02 PM.
    Scorpion Illuminati - An Open Source Rhythm Game For The Sega Genesis
    https://www.scorpionilluminati.tk

  4. #4
    WCPO Agent
    Join Date
    Aug 2014
    Location
    France
    Posts
    807
    Rep Power
    37

    Default

    You must spread some Reputation around before giving it to ComradeOj again.

  5. #5
    Underground Sega Nut BonusKun's Avatar
    Join Date
    Sep 2013
    Location
    San Antonio, Texas
    Age
    49
    Posts
    1,887
    Rep Power
    70

    Default

    Quote Originally Posted by tryphon View Post
    You must spread some Reputation around before giving it to ComradeOj again.
    I took care of that for you.~
    05/05/15

  6. #6
    Raging in the Streets Sik's Avatar
    Join Date
    Jan 2011
    Posts
    4,166
    Rep Power
    77

    Default

    Just how much memory in ROM is spent on images? o_o

    Quote Originally Posted by ComradeOj View Post
    I don't own a PAL system to test this on. It worked in BlastEm as PAL though
    Horizontal timing is the same in both NTSC and PAL, so that isn't much of a problem. The biggest problem would be probably timing properly to the start of the screen if you aren't careful with the HV counter (as lines will be counted differently), unless you just skip some lines at the top =P

  7. #7
    Comrade as in friend. Master of Shinobi ComradeOj's Avatar
    Join Date
    Dec 2012
    Location
    New Mexico, USA
    Age
    26
    Posts
    1,440
    Rep Power
    62

    Default

    Quote Originally Posted by Sik View Post
    Just how much memory in ROM is spent on images? o_o



    Horizontal timing is the same in both NTSC and PAL, so that isn't much of a problem. The biggest problem would be probably timing properly to the start of the screen if you aren't careful with the HV counter (as lines will be counted differently), unless you just skip some lines at the top =P

    Lots of memory for images. The total ROM is Juuuust under 1 megabyte. All of the images are 16 bit BMP files. They're unaltered, and the Genesis does all of the conversion work. Each image is 65kbyte. The code and text font aren't too big. The music takes up about 70kbytes total. The rest is all raw BMP images.
    Modded consoles:
    Master System (v7040) with s-video & direct AV out
    Model 1 with 10mhz overclock & halt switches
    Model 1 with 10mhz 68010
    Model 2 VA2.3 with unfiltered Mega Amp, & s-video
    Model 3 VA1 with compatibility fixes & s-video
    32X with s-video
    Visit my web site at www.mode5.net
    Or my collection of homebrew Genesis games, programs, and music on SEGA-16!

  8. #8
    WCPO Agent Mad Moham's Avatar
    Join Date
    Dec 2014
    Posts
    924
    Rep Power
    31

    Default

    This is a great idea, you get cool points for the Lego figure too (Lego is my other hobby outside of gaming).

    Now I may be asking a stupid question here, but is this demo using a similar principle to the one described between 2:00 and 3:30 in this video?

  9. #9
    Bite my shiny, metal ***! Hero of Algol retrospiel's Avatar
    Join Date
    Mar 2008
    Location
    Cologne, FRG
    Posts
    7,816
    Rep Power
    93

    Default

    You mention that it offers lower resolution and more colors. - Do you know how many colors exactly ?

    If the sound was to be generated on the Z80 would that allow this to become more usable in games?
    The Mega Drive was far inferior to the NES in terms of diffusion rate and sales in the Japanese market, though there were ardent Sega users. But in the US and Europe, we knew Sega could challenge Nintendo. We aimed at dominating those markets, hiring experienced staff for our overseas department in Japan, and revitalising Sega of America and the ailing Virgin group in Europe.

    Then we set about developing killer games.

    - Hayao Nakayama, Mega Drive Collected Works (p. 17)

  10. #10
    Master of Shinobi LinkueiBR's Avatar
    Join Date
    Oct 2013
    Posts
    1,054
    Rep Power
    46

    Default

    Nice!

    OFF: Toy Story cutscenes reached 150+ colors with Direct color DMA?
    VISUAL SHOCK!
    SPEED SHOCK!
    SOUND SHOCK!
    NOW IS TIME TO THE 68000 HEART ON FIRE!


    Prince of Persia 2 - The Shadow and the Flame Remastered Edition v1.5

  11. #11
    WCPO Agent
    Join Date
    Aug 2014
    Location
    France
    Posts
    807
    Rep Power
    37

    Default

    Quote Originally Posted by retrospiel View Post
    You mention that it offers lower resolution and more colors. - Do you know how many colors exactly ?

    If the sound was to be generated on the Z80 would that allow this to become more usable in games?
    The 512 colors of the MD (basically it gives a bitmap mode). But there are artifacts (some columns are doubled) so it's unusable in games.

  12. #12
    Comrade as in friend. Master of Shinobi ComradeOj's Avatar
    Join Date
    Dec 2012
    Location
    New Mexico, USA
    Age
    26
    Posts
    1,440
    Rep Power
    62

    Default

    Quote Originally Posted by Mad Moham View Post
    This is a great idea, you get cool points for the Lego figure too (Lego is my other hobby outside of gaming).

    Now I may be asking a stupid question here, but is this demo using a similar principle to the one described between 2:00 and 3:30 in this video?
    Not really. I'm not so sure what effect they are describing in the video. Direct color DMA works by telling the VDP(graphic chip) to to a Direct Memory Access transfer from RAM/ROM to Color memory. A color palette is sent to the first color memory slot just as the TV is drawing that part of the image. The TV's drawing position moves a little more to the right by the time the next color is sent over. A 198px wide image is just right so that every line drawn lines up straight.

    Your basically manipulating the background color just as the TV is drawing that part of the screen.

    Quote Originally Posted by LinkueiBR View Post
    Nice!

    OFF: Toy Story cutscenes reached 150+ colors with Direct color DMA?
    Toy story used normal graphics, but with shadow/highlight mode to boost color and quality. I don't think any commercial games used direct color DMA. It's more of a hack than a real display mode.
    Modded consoles:
    Master System (v7040) with s-video & direct AV out
    Model 1 with 10mhz overclock & halt switches
    Model 1 with 10mhz 68010
    Model 2 VA2.3 with unfiltered Mega Amp, & s-video
    Model 3 VA1 with compatibility fixes & s-video
    32X with s-video
    Visit my web site at www.mode5.net
    Or my collection of homebrew Genesis games, programs, and music on SEGA-16!

  13. #13
    Raging in the Streets Sik's Avatar
    Join Date
    Jan 2011
    Posts
    4,166
    Rep Power
    77

    Default

    Apparently somebody had attempted back in the '90s, but couldn't get the timing right so he gave up.

    Also stupid question: what is the game doing between scenes that takes so long?

  14. #14
    Master of Shinobi Pyron's Avatar
    Join Date
    Jan 2013
    Posts
    1,954
    Rep Power
    66

    Default

    Very cool Comraj, congratulations. Finally i can see that trick used outside of demos i hope see more of that stuff in future projects

    You must spread some Reputation around before giving it to ComradeOj again.

    Visit my youtube channel Pyron's Lair
    Take here all my hacks made with love for all of us here
    Want to help me? Here is my Patreon!

  15. #15
    Comrade as in friend. Master of Shinobi ComradeOj's Avatar
    Join Date
    Dec 2012
    Location
    New Mexico, USA
    Age
    26
    Posts
    1,440
    Rep Power
    62

    Default

    Quote Originally Posted by Sik View Post
    Apparently somebody had attempted back in the '90s, but couldn't get the timing right so he gave up.

    Also stupid question: what is the game doing between scenes that takes so long?
    Converting bitmaps.
    The data for the images included in the ROM is just regular .BMP files. You can view them on your PC and everything. The Genesis is converting the images to a format it can use for direct DMA.

    It works like:

    Grab a pixel from the BMP
    Copy pixel data to two other data registers
    AND out the red/green/blue data from each register
    Shift the values around to get them in the correct place
    Combine the three data registers
    Write output to memory where it will later be DMAed from

    Here is the actual code:
    Looking at it again, I think I can eliminate some of the shifts. I was just being lazy when I wrote it, and only really needed it to just work.

    Code:
    convert_image:
            move.b -(a5),d5  ;first byte
            move.b -(a5),d0  ;second byte
    	lsl.w #$08,d5	 ;position it!
    	add.w d5,d0       ;smash them together. (Can't use .W, because of odd numbered address)
    	move.w d0,d1	 ;save a copy of the data in d1 and d2
    	move.w d0,d2
    	andi.w #$7C00,d0 ;get red channel
    	andi.w #$03E0,d1 ;green
    	andi.w #$001F,d2 ;blue
    	lsr.w #$08,d0	   ;get correct value (11 shifts for red)
    	lsr.w #$03,d0
    	lsr.w #$06,d1
    	lsr.w #$01,d2	
    	lsl.w #$08,d2	  ;shift color bits into correct places.
    	lsl.w #$04,d1	
    	eor.w d0,d2	  ;add red to finished product
    	eor.w d1,d2	  ;add green
            move.w d2,(a0)+ ;write finished product in to memory.
            dbf d4,convert_image
            rts
    Quote Originally Posted by Pyron View Post
    Very cool Comraj, congratulations. Finally i can see that trick used outside of demos i hope see more of that stuff in future projects
    Thank you!
    Modded consoles:
    Master System (v7040) with s-video & direct AV out
    Model 1 with 10mhz overclock & halt switches
    Model 1 with 10mhz 68010
    Model 2 VA2.3 with unfiltered Mega Amp, & s-video
    Model 3 VA1 with compatibility fixes & s-video
    32X with s-video
    Visit my web site at www.mode5.net
    Or my collection of homebrew Genesis games, programs, and music on SEGA-16!

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
  •