clownmdemu - The Greatest Mega Drive Emulator Ever (Someday)

Discussion in 'Showroom' started by Clownacy, Jun 23, 2022.

  1. Dark Shamil Khan

    Dark Shamil Khan TASer lol Member

    Joined:
    Nov 7, 2021
    Messages:
    81
    Location:
    Pakistan
    Okay so interestingly. I am currently using the v0.3 of the emulator. And for some bizarre reason. DualPCM or AMPS driver, doesn't really work with the emulator. It either plays all the FM and psg channels and doesn't play the PCM channel. Or doesn't even play the music at all. Is the sound driver at fault or is it the emulator getting confused of something?
    Oh and the SHC splash screen glitches out. I think that was fixed.
     
    Last edited: Mar 23, 2023
  2. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    982
    The Z80 emulation was very inaccurate in v0.3, so I imagine that it's the emulator's fault. The Z80 emulation was improved in v0.4, so hopefully DualPCM and AMPS work in that version.
     
  3. Techokami

    Techokami For use only on NTSC Genesis Systems. Member

    Joined:
    Oct 29, 2007
    Messages:
    20
    Location:
    LINUX
    Can confirm that AMPS works in v0.4, as I tested my hack project in it and it uses AMPS, and audio playback was correct.
     
  4. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    982
    Yaaaay - I was hoping all that work on the Z80 emulator would pay off!
     
  5. Devon

    Devon Well-Known Member Member

    Joined:
    Aug 26, 2013
    Messages:
    1,249
    Want some stuff to test with when you decide to implement the H/V counter?

    I recently made a quick demo that displays high color images, and unfortunately, it doesn't work at all with your emulator.

    [​IMG]

    Basically, the demo DMAs 30 colors every 2 lines (or 15 colors every line). The palette is double buffered, so it also swaps between lines 0-1 and 2-3 every 2 lines as well. To maximize the timing for DMAing the colors without CRAM dots, I manually timed it using the H/V counter, since m68k interrupts are too slow, which is the root of why it doesn't work: the emulator doesn't support the H/V counter yet! I also disabled display while transferring the colors to make them go must quicker.

    For reference, it's supposed to look like this:
    [​IMG]

    I also have this older demo I made that does something similar, and I get the same result really, just all black, since the first colors to be copied are all black. For reference, it's supposed to look like this:
    [​IMG]

    So, here are the ROMs you can test with for whenever you feel like implementing the H/V counter:
    High Color Ronald McDonald
    Distorted Red Cat + Text

    Also, by the way, at least on a US Model 2 Genesis, reading from PSG causes it to lock up. No error handler, just a freeze. You are also correct in that the Z80 bank is a window into the m68k address space. I have successfully read things like the hardware version register using it on hardware. My memory is also fuzzy, but I also think I managed to also successfully request Z80 bus access too... from the Z80... lol (should double check that).
     
    Last edited: Mar 31, 2023
    ProjectFM, Clownacy and DeltaWooloo like this.
  6. MemeMaster9000

    MemeMaster9000 Newcomer Prospect

    Joined:
    Feb 12, 2023
    Messages:
    10
    The distorted red cat could be used for an intro similar to Star Wars. As for the high-color images, you could make some FMVs (that is if you don't care about cartridge space.)
     
  7. Devon

    Devon Well-Known Member Member

    Joined:
    Aug 26, 2013
    Messages:
    1,249
    Been there, done that :p


    Audio not in ROM. Unfortunately, fitting more characters per line would require more palette entries, and realistically, I only have 61 to work with per scanline anyways, so rendering text with just this method wouldn't do.

    It's not that simple I'm afraid. I'm using 2 layers to display the 30 colors (since there's only 15 colors per tile + transparency/background color). I am using the VAST MAJORITY of VRAM just for the tiles alone, which means I have no room to double buffer loading new frames. I would need to be able to load in new tiles into a separate area in VRAM while the current frame is displayed and then swap to it in order to keep the video glitchless. Maybe if I limited it to 15 colors per line an only used 1 layer, then it might be possible (provided that I even have ROM space).
     
    Last edited: Mar 31, 2023
    ProjectFM and GenesisDoes like this.
  8. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    982
    Awesome - it's great to have a proper test for the H/V counters! I know next to nothing about what they're set to and when, so having proper tests like these helps a lot!
     
  9. Dark Shamil Khan

    Dark Shamil Khan TASer lol Member

    Joined:
    Nov 7, 2021
    Messages:
    81
    Location:
    Pakistan
    Now, correct me if it has been presented before. But yesterday I was playing Sonic 3 and Knuckles in Clownmdemu on yet again v0.3. And interestingly, the data save select screen's background image was kinda... Corrupted or at least squished and then corrupted. Not sure why that happened. I would present a screenshot but I'm currently on my phone and can't be bothered to go on my PC.
    But yeah. That's the only oddity I found. Still haven't tried 0.4. Will do today!
    Edit: I got this. It's doing it even in 0.4 for some reason.
    Basically plane A is kinda corrupted. Not sure if my actual S3K ROM is doing that. Or the emulator is doing that.
    Will edit it if I found anything else. wtf.PNG
     
    Last edited: May 1, 2023
    RealMalachi likes this.
  10. RealMalachi

    RealMalachi Newcomer Member

    Joined:
    Oct 16, 2022
    Messages:
    12
    Location:
    Australia
    So here's some bugs and oddities I found. These are all on 0.4.2

    Bugs
    Recent builds of Hellfire Saga and SGDK projects just display a black screen, and the emulator lags quite a bit until you load something it can boot up. It's just a laggy black screen, not much I can add.

    Window plane bugs
    The Window Plane has two bugs of note:
    1. It doesn't actually cut through Plane A, instead acting more like another plane layer above A. This makes stock SCEs lagometer kind of useless, since it's almost completely transparent. The video shows the Window plane displaying a single blue pixel


    2. A more important issue, and one I'm more clueless on. Castlevania Bloodlines' intro doesn't render its text, which is on the window plane. Maybe it's a timing issue?

    Ecco the Dolphin sound issues
    Ecco 1 and 2 both have an issue with the dash attack sound
    Ecco 2 has a glaring music pausing issue, seemingly related to the 68K bug flag. This also happens in gameplay, though to a lesser extent

    SHIMAs Hint issue
    No idea what's causing this one, honestly

    Oddities
    Despite not having proper 6-button controller support yet, it does properly emulate a bug when pressing up and down, where most controller code will incorrectly interpret joypad input as 6 button input

    Like many emulators it inaccurately supports V30 60Hz, though I see that as an advantage

    According to Devons emulator detector, it's detected as a Mega SG console. Basically, that means Z80 accurately waits for DMA to end when it's reading 68K data, but the VDP debug register doesn't work at all. The VDP debug register "return(s) the 68000 instruction prefetch", and a lot of emulators don't emulate it right, usually returning 0. Not much practical use from what I can gather, beyond emulator detection
    Once I find a method to detect clownmdemu specifically (ignoring things that simply aren't implemented), I'll inform you about that

    Requests
    MD+ Support. Basically, the MegaSD and Everdrive Pro have this MSU-like function that bankswitches into ROM, but allows you to handle properly looping WAV files, among other things. GPGX partially supports it. I'd say only do it once you begin MegaCD and mapper emulation, since they're kind of linked together
    If you need the development doc, here's a mirror
    MSU-MD is just a basic Mode 1 CD player (ironic), so basic Mode 1 emulation should handle that just fine
     
    Clownacy and ProjectFM like this.
  11. Mega De Glitcher

    Mega De Glitcher Newcomer Trialist

    Joined:
    May 20, 2023
    Messages:
    5
    Location:
    Secret Jungle Zone
    I decided to give this emulator a shot on a simple sonic 1 rom hack i made and the game seems to crash everytime i jump, thats wacky!

    upload_2023-5-23_12-43-52.png

    ps: it works like charm on the kega emulator
     
    Last edited: May 23, 2023
  12. Clownacy

    Clownacy Retired Staff lolololo Member

    Joined:
    Aug 15, 2014
    Messages:
    982
    That sounds like a bug in your hack: that error appears to be an address error, which is caused by accessing words and longwords on odd addresses. Kega ignores these errors while my emulator does not.
     
  13. Hame

    Hame Newcomer Trialist

    Joined:
    Jan 12, 2021
    Messages:
    19
    Location:
    Spain
    Something that has happened to me is that the hack I was doing worked fine on your emulator but on others it didn't work (no, not even on kega) on all the others I always got a black screen because of something I did wrong in the sound of the controller. As I said in yours it worked but in others it didn't.

    Another thing is that I have noticed that the pcm (or the dpcm, they are almost the same) sound with a higher pitch
     

    Attached Files:

    Last edited: May 26, 2023