don't click here

DOOM 32X Resurrection

Discussion in 'General Sega Discussion' started by saxman, Oct 23, 2021.

  1. saxman

    saxman

    Oldbie Tech Member
    This deserves attention. The original thread is here: DOOM 32X Resurrection (sega-16.com)

    I've been following progress of getting the Jaguar DOOM source code to compile for the 32X. Lots of past discussions on that subject. I was stunned to see this result. This is what DOOM *could* have looked like on the 32X. Quite impressive I think.

    Despite the comment in the original thread, I had nothing directly to do with this. I wrote the WAD conversion tool about 12 years ago, and I had used that tool to add the Jaguar levels to the 32X version of DOOM. But that's it. The rest of the credit goes elsewhere.

    Download: Romhacking.net - Hacks - Doom 32X Resurrection
    Source: GitHub - viciious/d32xr: Sega 32X port of Doom

     
    • Like Like x 6
    • Informative Informative x 1
    • List
  2. Black Squirrel

    Black Squirrel

    no reverse gear Wiki Sysop
    8,543
    2,465
    93
    Northumberland, UK
    steamboat wiki
    Yes this came up the other day and it's very impressive.

    At least I think it is - Doom's probably been ported to your average garden potato at this point.


    It would have been nice to see the PC levels though, even if you had to sacrifice full screen to get there. That seems to have been the original intention, judging from the prototypes we have.
     
  3. Fadaway

    Fadaway

    Member
    416
    131
    43
    I've been playing this a lot since it was released. It is a huge improvement.
     
  4. nineko

    nineko

    I am the Holy Cat Tech Member
    6,298
    475
    63
    italy
    Sorry for the bump, but I finally found the time to try this. For some reason, the sound effects work fine in Fusion, but they don't work in Gens, do you think it would be possible to fix this?
     
  5. Chilly Willy

    Chilly Willy

    Tech Member
    751
    11
    18
    Doom 32X
    What version are you using? Gens r7 requires patches for DMA PWM audio. I posted patches for that some years back (on the Assembler board, IIRC). If it's a different version, you might post a bug report on the emulator main site. Old 32X emulators didn't support DMA PWM because no commercial 32X game used it. To ask homebrew to not use DMA PWM because an older emulator doesn't support it isn't going to fly. Fusion supports it, Picodrive supports it. New versions of Gens should as well.
     
    • Informative Informative x 3
    • List
  6. nineko

    nineko

    I am the Holy Cat Tech Member
    6,298
    475
    63
    italy
    Thanks for your reply.

    Please don't misread me, I couldn't know the cause of this issue, I actually hoped it could be an easy fix such as altering one byte in the rom header or so, but now that you explained it, I agree with you, it would make no sense not to use such an advanced and useful technique. As a fellow programmer, please don't ever think that I would ever ask for such a thing, or even consider it.

    For the record, as I said, I knew that it worked fine in Fusion, but I tried to use Gens ReRecording, because I like this hack, and I wanted to make a video of it.

    Now I can see that it's not going to happen, because I don't think that your patch would be compatible with a different Gens branch, and I'm not skilled enough to personally alter its source code. Oh well.
     
  7. Billy

    Billy

    RIP Oderus Urungus Member
    2,118
    178
    43
    Colorado, USA
    Indie games
    Apparently this now supports multiplayer using the Zero Tolerance cable:

     
  8. saxman

    saxman

    Oldbie Tech Member
    Why did I not know about this cable?? I would have put this support in a Sonic ROM hack a long time ago if I had known about it.

    Amazing stuff.
     
  9. Yuzu

    Yuzu

    Member
    2,548
    51
    28
    This is really cool! Amazing that this has happened. Really didn’t expect to see DOOM 32X getting this level of love from the hacking community.

    Would love to try network multiplayer out on hardware if I ever get the opportunity.
     
  10. Chilly Willy

    Chilly Willy

    Tech Member
    751
    11
    18
    Doom 32X
    It was serendipity that I just happened to have a ZT system link cable AND two complete 32X systems. My normal system is a Model 2 Genesis, Model 2 CD, and a launch 32X. I've had it since '93 or so, and it's still going strong. At some point later on, I picked up a CDX on ebay. Even later I picked up another 32X for about $25. I use that 32X in the CDX where it works... mostly. Every couple of years I have to take it apart and clean the ribbon cables inside. It also doesn't like Knuckles Chaotix.

    So I dug out my ZT cable and started hacking some mostly working serial code Vic had someone else working on. The serial support is still in there, but you can't access it from the menu right now. Given that you can buy ZT cables online, but not serial cables, Vic figured ZT cable or split screen would be the choices you get in the menu for multi-player.

    Anywho, it's been a while since v2.1 was released. We're rather close to releasing v2.2. Lot's of bug fixes and some improvements. We've started working towards v2.3. That will finish off Doom 1 before we move on to Doom 2. Part of that meant getting the Sega Standard Mapper working in the D32XR code. See, we've been missing the cyberdemon and spider mastermind. Those were removed from console versions of Doom 1 because they're too big. Without them, JagDoom and D32XR are 4MB roms. Adding back the cd and smm pushes that to almost 6MB. The Jaguar actually has space for 6MB of rom directly, but the 32X needs roms larger than 4MB to use the standard mapper. So me and vic spent a bunch of time working on the mapper support. Here's a the latest from the moressf branch of the git repo.



    Just for testing, zombies were replaced with cyberdemons, and shotgunners were replaced with spider masterminds. For v2.3, they'll be added back to the proper places in the proper levels. We're looking at a 6MB rom, which is the limit for Fusion. To go beyond that in size, you need picodrive. It should also work on most flash carts. I've tested it on the NeoMyth and the old MegaEverDrive. Vic tested on the MED Pro, and another person tested on the MegaSD.
     
  11. saxman

    saxman

    Oldbie Tech Member
    Nice to see the progress on this as always. The mass quantity of Cyberdemons looks... scary! One was always enough.

    Regarding the mapper, I'm curious what is challenging about getting that working for this project? While I understand that it effectively shifts the read window of a section of ROM, normally in assembly language, this could be maintained fairly well if done with care. In your case, you're using mostly C. Is there something about that that makes it tricky? Whenever I read mention of it for D32XR in the past, it was always made to sound difficult.
     
  12. Aerosol

    Aerosol

    Not here. Moderator
    11,163
    573
    93
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    Give me a reason to get a 32X why don't you.
     
  13. Chilly Willy

    Chilly Willy

    Tech Member
    751
    11
    18
    Doom 32X

    The SH2 processors in the 32X have no ability to write to the cart... at all. This means that if any part of the cart needs writing (the mapper, save ram), the 68K side has to do it. If that were the only issue, it wouldn't be that bad. The problem is that for the 68K to write the cart area, the SH2 processors have to be kept from trying to access the cart at the same time. Normally, the SH2s get priority over the 68K, but that is done by having the 68K access the cart through an area in the map that allows the 32X IO chip to delay the 68K via a new DTACK signal. Hence why the 68K accesses the 32X via 0x880000 to 0x9FFFFF and 0xA15xxx. Those areas don't assert DTACK in the MD under normal conditions, so the 32X can use DTACK to hold off the 68K when it does access them. However, writes (and some reads, like save ram) don't allow the 32X to hold off the 68K via DTACK and hence need the 32X to be halted during said accesses. This is done with a control bit in the 32X IO chip (RV) that when set, will halt either SH2 if they try to access the cart. So the 68K must disable ints, set the RV bit, read/write the mapper or save ram, clear the RV bit, and enable ints.

    Now if THAT were the only issue, it wouldn't be that bad. Like I said, the 68K would disable ints, set RV, do its thing, and clear RV. The problem is that the SH2 can hang/crash when it accesses the cart when RV is set under some circumstances. The work around is to make sure that SH2s are running from SDRAM or the internal CACHE scratchpad RAM while RV is set. So this is what we do to change the mapper in the 32X:

    68K disables ints
    68K asserts COMMAND INT to both SH2 processors
    SH2s signal the 68K that they are responding to the CMD INT and are awaiting a command (the CMD INT handler is in SDRAM, so we know the SH2s are running in SDRAM with the irqs disabled as they are in the CMD IRQ handler)
    68K sets RV bit, read/writes mapper, then clears RV
    68K then sends a command to the SH2s saying "Sorry, my bad. Just exit and continue what you were doing."
    68K enables ints

    It's all in nice tight assembly, so it all runs very fast, but this is fortunately not something that occurs in a tight inner loop. Note that BOTH SH2s must be looping in SDRAM during the read/write to cart hardware (unless one is doing nothing and just looping in SDRAM to begin with... like if you weren't using the Secondary SH2). This process works on every cart that supports the mapper that we've tested so far. Note that some older flash carts (NeoMyth, ED, MED (old versions)) aren't entirely stable when RV is set in 32X games, and will crash no matter what if the code takes too much time with RV set. I spent quite a bit of time optimizing the assembly on the 68K and SH2 sides to make that code as fast as possible to get those older carts working. The newer MED Pro and the MegaSD seem to be much more lenient on this matter - they seem to be quite a bit more stable in 32X mode. I had noticed that the MED Pro (and some of the other newer MED models) removed the 32X bit from the custom mapper in the cart. I guess they realized they didn't need it anymore.


    Have you seen the videos of OpenLara on the 32X? No sound or music yet, but it's looking very good. Using just one SH2, it runs at about 8 to 20 FPS depending on the level detail and enemies onscreen.
     
    Last edited: Aug 27, 2022
    • Informative Informative x 2
    • List
  14. Bobblen

    Bobblen

    Member
    373
    187
    43
    What a fantastic project, I love that you're targeting any peripheral that can help make the conversion better regardless of rarity (zero tolerance cable! sega mouse!). It's basically as close as I'm ever going to get to playing Doom on my beloved mega drive (yeah I know about the released 32x version, too many corners cut for it to really count as far as I'm concerned). I'm tempted to pick up a 32x just to see it on real hardware for myself!
     
  15. Jason

    Jason

    *Results not lab tested. Member
    With the mapper, will the Everdrive X5 still work? Last check it only has partial support. I imagine a CD 32X version would be a bridge too far.
     
  16. Bobblen

    Bobblen

    Member
    373
    187
    43
    Completely untested on my part but the latest release notes say it works with a v1 everdrive (as well as a whole bunch of other configurations), so I'd imagine an X5 would work. I'd wait for confirmation from one of the actual devs before buying a bunch of stuff though!
     
  17. Chilly Willy

    Chilly Willy

    Tech Member
    751
    11
    18
    Doom 32X
    It looks like it would work for roms up to 8MB, but we won't know for certain until we get to testing roms more widely. As Bobblen mentions above, I would probably wait a bit more before committing to a more limited cart. And yes, a CD32X version is not something we're looking at any time soon as there's no mass-storage on the 32X side of things. It's bad enough trying to work with 4MB - now take away that 4MB. :(
     
  18. Chilly Willy

    Chilly Willy

    Tech Member
    751
    11
    18
    Doom 32X
    v2.2 of Doom 32X Resurrection is now out: https://www.romhacking.net/hacks/6269/

    Updated features
    • New exclusive port of the original map "Slough of Despair" (MAP18) by Wavy.
    • Ported the "skinface" intermission background from the original game.
    • Added support for playback of uncompressed 8-bit and IMA ADPCM-compressed 4-bit WAV files.
    • The ZGM music file format has been upgraded to support PCM samples (reserved for future use) and is now part of SGDK's XGM toolset.
    • Fixed bug in the sound mixer which resulted in stereo channels being swapped around occasionally.
    • Added CD/32X+ volume slider to the audio menu.
    • Tweaked MegaSD detection timeout - fixes compatibility issues with MD+ on the MegaEverdrive Pro.
    • The status bar now displays the "mowdown" face upon taking damage from environmental hazards.
    • The 252 pixels-wide screen mode has been widened to 256 pixels.
    • Fixed spectre's position being off on the finale screen.
    • The punch impact sound has been re-added to the game.
    • A different tile is now used for the final text briefing background.
    • Improved framerate in the menus.
    • Added 100% completion color indication to the kills/items/secret counters on the automap.
     
  19. LockOnRommy11

    LockOnRommy11

    Member
    2,708
    225
    43
    Doom Resurrection is amazing. I’m playing on real hardware (MD1 + 32X & Mega Everdrive X5) and it runs like a dream. It really goes to show what the 32X is capable of. If SEGA had utilised it better back in the day, it may have been more desirable and thus, a better sold add-on.

    One thing I am having issues with is playing via my infrared 3-button WKK controllers. The original 32x Doom works fine, but this version doesn’t allow strafe and fire to be held at the same time, nor does it work when pressing START + (C) (or whatever button you’ve assigned) to access the map. After spamming it multiple times (sometimes 20-30) it accesses the map but then you have to do the same thing to exit it.

    Oddly, it works via wired 3-button controllers, so I have no idea what’s going on ¯\_(ツ)_/¯
     
  20. Bobblen

    Bobblen

    Member
    373
    187
    43
    I hope @Chilly Willy doesn't mind me beating him to the punch but version 3.1 is out now, including the debut of the Cyber Demon and Spider Mastermind on the 32x. Another outstanding achievement for the team.

    Good job I didn't buy a 32x in the end as it turns out the flavour of Everdrive I have doesn't support the rom banking required for this version, but it doesn't matter, it's still awesome under emulation as well!