Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
lunaark

Doom SNES Hacking Guide/Documentation

Recommended Posts

18 minutes ago, Mattfrie1 said:

A bit of interesting legalese from the back of the US SNES Doom box in the bottom right hand corner states:

 

 

In other words Sculptured Software owned the copyright to the game engine but to nothing Doom related that the engine generates. Sculptured Software was bought out by Acclaim right after the release of SNES Doom in the fall of 1995, and Acclaim themselves went bust in 2004 liquidating all their assets after bankruptcy. I only hope that Randy doesn't need to cut through too much red tape to get the engine out, although it sounds like he has everything sorted out if he's saying the release is coming soon.

 

Ouuuuch. Who would the copyright have gone to?

Share this post


Link to post

Another big revelation, I was fucking around with a memory editor, and I seem to have set off a debug/error handling thing. I have my debugger to break on BRK opcodes in the hopes of finding developer breakpoints, which would imply debug shit.

 

Anyways, this means there's debug shit in the ROM, and I can only imagine the juicy shit you'll see in the source code. I'd imagine shit like a wireframe renderer, coordinate display, fps counter, so much good shit that will help understand the engine. Shit like that would also be great for speedrunners too, to help getting more precision while practicing. I'm fuckin pumped. This source code release will not disappoint, regardless of what can be done in terms of performance optimizations. This is fucking awesome.

Share this post


Link to post
7 hours ago, InDOOMnesia said:

@lunaark So does that mean there will be a second interview video with him?

What's more, is if this will also make the source code release much closer than we're expecting it to be. Of course, he still has to take care of copyright stuff before doing so, but I'm crossing my fingers in this case.

Randy and I have no such thing as a second interview in mind at the moment. We just keep in touch. He’s very kind and loves this community. So once in a while I could ask him some development questions for you guys if it’s absolutely needed. (I don’t want to disturb him too much ya know...)

Share this post


Link to post
1 minute ago, CacodemonTube said:

Randy and I have no such thing as a second interview in mind at the moment. We just keep in touch. He’s very kind and loves this community. So once in a while I could ask him some development questions for you guys if it’s absolutely needed. (I don’t want to disturb him too much ya know...)

Yeah, I also mistook what lunaark said back then, before re-reading it. My bad.

Share this post


Link to post
Posted (edited)

SNES Doom 2 Testing Update:

 

Someone on YouTube challenged me to port Doom II MAP13 - Downtown to SNES. And after a lot of tedious porting and trial and error. It works and without any major changes to the map. (There’s also a download link in the video for a patch)

 

Also I’ve been working on porting the infamous Map24 - Chasm to SNES.

It’s far from perfect. Only the big area I’ve managed to get kind of working. (Although some tight rope sections crash the game still...)

The other areas need to be optimised some more because otherwise the level wouldn’t load.

and yes, it is a pain to play in SNES framerates... So I might consider changing the width of the tight ropes...

 

Previews:

 

 

 

8010F18C-B02B-474C-995C-F00C2EFF0DCA.png

692CEEFC-66D6-420B-8D14-23B110373A67.png

5D3FFCDD-ECD3-4B94-9D86-B3854F32CFF4.png

21CE1245-F5AE-4E0F-BE2E-4DE89A2853DB.png

A7E74251-003D-402C-B2CD-02C75C42F8C5.png

4E5FCB90-4970-44C8-A29C-CCE4BE3A807F.png

Share this post


Link to post
3 hours ago, Mattfrie1 said:

A bit of interesting legalese from the back of the US SNES Doom box in the bottom right hand corner states:

 

 

In other words Sculptured Software owned the copyright to the game engine but to nothing Doom related that the engine generates. Sculptured Software was bought out by Acclaim right after the release of SNES Doom in the fall of 1995, and Acclaim themselves went bust in 2004 liquidating all their assets after bankruptcy. I only hope that Randy doesn't need to cut through too much red tape to get the engine out, although it sounds like he has everything sorted out if he's saying the release is coming soon.

Considering Randy himself was the port's architect and such, I'm pretty sure ultimately the copyright lies with him, and even then arguably it's kind of a moot thing anyway - to enforce the copyright you'd really need to argue the SNES is still somehow commercially viable for one, and two, you'd need a source of SuperFX chips.

 

Even then, that particular engine isn't going to exactly be in large demand - it's a SuperFX-accelerated game engine for a SNES game, sans assets it does nothing. And obviously those assets are still with id (and still actively enforced, seeing as Doom is still sold).

 

In short, either he has the rights, or on the very small chance he doesn't, there's almost no viable commercial way to exploit/enforce it. While homebrew gets made for the SNES all the time, very little of it is attempted to be sold commercially, and certainly nobody has the capability of fabbing a SuperFX-accelerated game anymore; it'd all be via donor carts that have new ROMs burned on them. (Though I suppose theoretically someone could make an FPGA-based version of it or something.)

Share this post


Link to post
1 minute ago, Dark Pulse said:

Considering Randy himself was the port's architect and such, I'm pretty sure ultimately the copyright lies with him, and even then arguably it's kind of a moot thing anyway - to enforce the copyright you'd really need to argue the SNES is still somehow commercially viable for one, and two, you'd need a source of SuperFX chips.

 

Even then, that particular engine isn't going to exactly be in large demand - it's a SuperFX-accelerated game engine for a SNES game, sans assets it does nothing. And obviously those assets are still with id (and still actively enforced, seeing as Doom is still sold).

 

In short, either he has the rights, or on the very small chance he doesn't, there's almost no viable commercial way to exploit/enforce it. While homebrew gets made for the SNES all the time, very little of it is attempted to be sold commercially, and certainly nobody has the capability of fabbing a SuperFX-accelerated game anymore; it'd all be via donor carts that have new ROMs burned on them. (Though I suppose theoretically someone could make an FPGA-based version of it or something.)

It's a little tricky still, he's going for the GPLv3 license, for the entire engine and game data. The data itself is the hard part, as ZeniMax are quite trigger happy with lawsuits, especially compared to the old id.

Share this post


Link to post
5 minutes ago, lunaark said:

It's a little tricky still, he's going for the GPLv3 license, for the entire engine and game data. The data itself is the hard part, as ZeniMax are quite trigger happy with lawsuits, especially compared to the old id.

Definitely, but in case they balk, the backup plan would be essentially to release the engine, and someone would have to make a program that would take a SNES Doom ROM and it would output a valid ROM image. That worked for Doom 64 EX.

 

Of course, making a ROM that could simply be compiled and run would be another thing entirely. Then it'd probably be a case where the engine is all ready to go, but without the game data it can't be built, and said data is supplied via a ROM in the directory or something.

 

Then again, it's also possible he could get away with it - Burger Becky has assets released with her version, after all, and Zenimax certainly didn't come after her.

Share this post


Link to post
1 minute ago, Dark Pulse said:

Definitely, but in case they balk, the backup plan would be essentially to release the engine, and someone would have to make a program that would take a SNES Doom ROM and it would output a valid ROM image. That worked for Doom 64 EX.

 

Of course, making a ROM that could simply be compiled and run would be another thing entirely. Then it'd probably be a case where the engine is all ready to go, but without the game data it can't be built, and said data is supplied via a ROM in the directory or something.

 

Then again, it's also possible he could get away with it - Burger Becky has assets released with her version, after all, and Zenimax certainly didn't come after her.

Fair point.

Share this post


Link to post
14 minutes ago, Dark Pulse said:

Then again, it's also possible he could get away with it - Burger Becky has assets released with her version, after all, and Zenimax certainly didn't come after her.

Carmack himself did it for the iPhone port of Wolf 3D back in the days...

https://github.com/id-Software/Wolf3D-iOS/tree/master/wolf3d/base

 

Not for the iOS port of Doom, though.

Share this post


Link to post
Posted (edited)
10 minutes ago, Gez said:

Carmack himself did it for the iPhone port of Wolf 3D back in the days...

https://github.com/id-Software/Wolf3D-iOS/tree/master/wolf3d/base

 

Not for the iOS port of Doom, though.

Carmack was still working at id/Zenimax at that time though, so he most definitely had some pull - pull that'd probably be gone now given the blowup over the Oculus Rift.

 

Guess we'll wait and see. Not much can be done until Randy releases the code either way, since right now the only known source code is an uncompiled snippet that snuck its way into the final ROM:

mov tempword,A            ; save ID code
mov PlayChan+X,A
mov PlayCurVelocity+

 

Share this post


Link to post

Perhaps he could use Freedoom instead of Doom, as a data source?

Share this post


Link to post
1 minute ago, Gez said:

Perhaps he could use Freedoom instead of Doom, as a data source?

That would be a fair alternative, I'd think. Of course, that would produce a different game of sorts.

 

And either way the ultimate goal would still be to get Doom as close as possible, but obviously once the code is out there that can be handled by whoever is modding the code or whatever.

Share this post


Link to post

I've done a little digging and I think I'm starting to understand why the source code release is taking so long.

 

Basically, Acclaim owned the rights to the Reality engine, Acclaim went bust, and when their properties were put up for auction, a bunch of companies took their slice of the pie. To paraphrase wikipedia,

Quote

In 2005, Acclaim's former IPs were put up for sale and were sold in auction. The Dave Mirra Freestyle BMX and ATV: Quad Power Racing series were purchased by Crave Entertainment. Juiced was purchased by THQ, Emergency Mayhem was purchased by Codemasters, Interview with a Made Man was purchased by former employees of Acclaim Studios Manchester and The Red Star was purchased by budget publisher XS Games.

 

In 2006, Throwback Entertainment purchased more than 50 of Acclaim's games, and vowed to bring such titles as Re-Volt, Extreme-G, Gladiator: Sword of Vengeance, Vexx, Fur Fighters and many other franchises into the next generation and beyond.[20] Acclaim's headquarters were sold to Anthony Pistilli of Pistilli Realty Group for $6 million in November 2004.[21]

 

In July 2010, South Korean based company We Go Interactive purchased Re-Volt, RC Revenge, and RC De Go! (developed and owned by Taito) from Throwback.[22]

 

In October 2018, Liquid Media Group purchased 65 ex-Acclaim titles from Throwback for $1 Million. This mainly consisted of installments in the NBA Jam, AFL Live, All-Star Baseball and NFL Quarterback Club franchises, as well as some Taito titles that Acclaim published outside of Japan.[23]

 

Yeah... so it's a matter of hunting down who the rights went to, negotiating with them to get the rights back, which could involve alot of money and/or compromises, especially given Randy is trying to release the game under the GPL, and these companies might not be willing to budge so easily. Fuck. I have high hopes for Randy to get the rights back etc, but I don't really think Randy owns the engine as much as people would like to believe. No fuckin clue.

Share this post


Link to post
Posted (edited)
17 hours ago, lunaark said:

I've done a little digging and I think I'm starting to understand why the source code release is taking so long.

 

Basically, Acclaim owned the rights to the Reality engine, Acclaim went bust, and when their properties were put up for auction, a bunch of companies took their slice of the pie. To paraphrase wikipedia,

 

Yeah... so it's a matter of hunting down who the rights went to, negotiating with them to get the rights back, which could involve alot of money and/or compromises, especially given Randy is trying to release the game under the GPL, and these companies might not be willing to budge so easily. Fuck. I have high hopes for Randy to get the rights back etc, but I don't really think Randy owns the engine as much as people would like to believe. No fuckin clue.

I don't think it's anything to do with that - Randy wouldn't have put up a placeholder repository if he wasn't pretty damn sure he could release it.

 

It's probably that it's going to take some work to put it up in a presentable state. Doom's code was cleaned of cruft before it was released, and you're talking the original development kit for SNES Doom was some weird frankenstein thing of needing an Amiga along with an SNES and extra controller ports.

 

The Reality Engine was only ever used in one game - SNES Doom. Obviously in terms of asset data, id would retain the rights to those; the engine part itself is also only useful with a SuperFX chip (as it's coded for that particular chip). No SuperFX? That's like running Windows without a CPU. Best of luck, matey!

 

And lastly, obviously Randy has whatever work he currently performs as his main job. It's not like he's got every minute of his day to spend going back and cleaning up code he wrote nearly 30 years ago.

 

In short, calm your tits. Especially as even if that WAS somehow the case, literally nothing is stopping anyone from reverse-engineering the engine. It's not like it's particularly hard to disassemble a 30 year-old game for the most part, if someone were interested enough - just time-consuming.

Edited by Dark Pulse

Share this post


Link to post
Posted (edited)

I've just made E2M2 Containment Area, one of the best missing level, using the tools from Mopoz and Cacodemontube:


If you skip at 8:29, it's interesting to see that the monsters can actually get crushed to death even on this port. I've been playing it for years and I never witnessed it before. I wanted to showcase it even more at 9:00 but I just got my ass handed :D

As you'll see, I had to simplified the level a lot in order to make it fully playable. Therefore, the second yellow room has been completely scrapped and some rooms shorten so the engine wouldn't crash. If you want to test it by yourself, here's the IPS file so you can patch it to the rom:

https://drive.google.com/open?id=1Iixlm8lqT5LrN0ACad_H-KaQrCMkhzni

 

Thanks to Cacodemontube for creating the patch :)

Share this post


Link to post
35 minutes ago, theretromike said:

I've just made E2M2 Containment Area, one of the best missing level, using the tools from Mopoz and Cacodemontube:


If you skip at 8:29, it's interesting to see that the monsters can actually get crushed to death even on this port. I've been playing it for years and I never witnessed it before. I wanted to showcase it even more at 9:00 but I just got my ass handed :D

As you'll see, I had to simplified the level a lot in order to make it fully playable. Therefore, the second yellow room has been completely scrapped and some rooms shorten so the engine wouldn't crash. If you want to test it by yourself, here's the IPS file so you can patch it to the rom:

https://drive.google.com/open?id=1Iixlm8lqT5LrN0ACad_H-KaQrCMkhzni

 

Thanks to Cacodemontube for creating the patch :)

Damn nice job, and a surprisingly good conversion as well! Texturing aside, you only had to do relatively slim compromises it seems.

 

Some things I did note:

  • The rising texture pool (for the yellow key) definitely shows there is no way to change the color once the floor rises - unsurprising, as there aren't any flat textures. Or is this a limitation of tools? (There is at least one case in the original game where a floor color does change - see a few points below).
  • The circular lifts got cut down (expected that) but they're definitely not moving by themselves anymore. SNES Doom presumably has some more stringent lift/plat limits? In that case preserving the crushers is probably better than these platforms.
  • Any reason you didn't use a donut for the chaingun behind the yellow door? It definitely is in the game; E1M2's secret (for the chainsaw) is definitely a donut.
  • Can you still flip the switch behind the red door early?

Share this post


Link to post
Posted (edited)
14 hours ago, Dark Pulse said:

Some things I did note:

  • The rising texture pool (for the yellow key) definitely shows there is no way to change the color once the floor rises - unsurprising, as there aren't any flat textures. Or is this a limitation of tools? (There is at least one case in the original game where a floor color does change - see a few points below).
  • The circular lifts got cut down (expected that) but they're definitely not moving by themselves anymore. SNES Doom presumably has some more stringent lift/plat limits? In that case preserving the crushers is probably better than these platforms.
  • Any reason you didn't use a donut for the chaingun behind the yellow door? It definitely is in the game; E1M2's secret (for the chainsaw) is definitely a donut.
  • Can you still flip the switch behind the red door early? 
  • That rising floor for the yellow key was a pain indeed. Not only the red texture wasn't changing, but it was still lethal even after. I've tried many others actions in order to make it work just like on PC, but to no avail. In the end, I've decided to make the right path non-lethal.
  • Yes I had to remove two circular lifts due to Reality engine's limitation. As it turn out, when I did the conversion, I wasn't able to make the lifts to go up and down properly, so I've basically just gave up and left the whole thing stationary.
  • The donut action doesn't work at the moment (or at least I wasn't able to make it work with the tools)
  • Yes you can still flip it, but it is totally useless in this case since you will get stuck in acid due to the half raised bridge nearby.
Edited by theretromike

Share this post


Link to post

You know how Randy was talking about all the improvements you could make to the engine, given Super FX overclocking, especially in emulators?

 

Well, I just wrote a patch to get the game to overclock much better than before. I got the game running at 85.6mhz with a patch I wrote (in an emulator of course)

 

It was actually quite a simple patch. I saw a video of star fox running at 60mhz on real hardware, even though the limit was thought to be much lower, at like 30 or 40mhz. 

 

Well, it turns out that the Super FX has quite a few hardware flags, and setting them correctly can result in a more stable experience when overclocking.

 

Essentially, setting the CLSR register's clock bit to 0, and setting IRQ to 0x80, which is No IRQ/Standard Timings, you can get much better results out of your overclocks.

 

The person who did the Star Fox overclocks seemed to test Doom a little, and they said they got it running better. Apparently, the GSU on the Doom cart sucks and when they swapped it for one.

 

But CLSR set to 0 sets the game to 10.7mHz, which is the same abyssmal performance Randy talked about on his hacked up Star Fox cartridge used for development. However, for some reason, setting the Super FX to this lower frequency allows it to achieve much higher overclocks, and the IRQ removal fixes many glitches and crashes, for reasons I do not know. Removing IRQ does adversely affect the game, notably pausing takes longer and there seems to be very small stutters occasionally, but overall my experience has been great. Setting the clocks lower may help. The game doesn't run maybe as good as an equivalent overclock with the default IRQ and CLSR, but it can definitely push higher, but further testing will be needed. However, this should all work, and greatly benefit both emulators, and people who wish to solder on a new EEPROM to an old Super FX cart, or even overclock a GSU compatible flashcart (if that's even possible)

 

The game appears to run much more consistently and stable compared to typical overclocks, things like weapon sway and movement also seem to more closely mirror the original in terms of pace, etc.

 

This could really open the door for much greater things with the source code release. Also, according to the person who developed this method originally, it does run much better on consoles than emulators. If you ever saw the video of Star Fox running at 57mhz, this is exactly the same person. My patch is currently only for the NA ROM, once I do all the ROMs I'll release the patches as IPS for everyone to go wild and test and whatnot. I'm fuckin pumped.

Share this post


Link to post
Posted (edited)

Alright, here are the patches for each region. These are patches specifically to be used for overclocking, running them without any is gonna be unpleasant to say the least. However, if you wanna see how the game ran on Randy's hacked up Star Fox cartridge, running this without any overclocks should be accurate, except for any differences in the release build. This patch disables IRQ and sets the clock register to 10.7mHz, which has been shown to drastically improve overclock potential, especially on real hardware. Refer to above post for more information. Anyways, here you go.

Doom SNES Overclock Patches.zip

 

EDIT: To clarify, you should patch with Lunar IPS, or any other IPS patcher (I made it with Lunar IPS, so no guarantees it will work with another patcher). This isn't a ROM, it simply patches your existing ROM. I wouldn't recommend patching your main ROM, make a separate copy to patch.

Share this post


Link to post

I might've fucked something up in the patches, it doesn't seem to be running like my first test, because I redid everything. Will revisit tommorrow.

Share this post


Link to post
On 5/18/2020 at 1:36 PM, lunaark said:

I might've fucked something up in the patches, it doesn't seem to be running like my first test, because I redid everything. Will revisit tommorrow.

Any news on the re-attempt? As long as the source code release is still on management, I find such attempts necessary.

Share this post


Link to post
On 6/8/2020 at 12:08 PM, InDOOMnesia said:

Any news on the re-attempt? As long as the source code release is still on management, I find such attempts necessary.

 

I gave up tbh, it's kinda pointless. However I have been working hard at reverse engineering whatever bits of the game I can and I'm proud to announce I found a way to swap music on each level (and no there's no unused music, i checked.)

 

I've been learning alot of assembly and I'm putting all the parts together. This is the code that loads the music ID.

image.png.3a75be7e8f58092baf97ee5b08512905.png

 

Basically, at offset $5f3782 there's an array of music ID's that are 2 bytes long, so loading into the accumulator $3782 indexed with X, which stores the level ID (in multiples of 2, so hangar is 00, nuclear plant 02 etc), you basically load that entry, and store it at $6bf, which is a part of the current level's info struct or something.

 

However, modifying $6bf directly will result in the game crashing, presumably because the S-SMP locks up while changing it. So, basically, just modify the music array in the ROM directly. It's at offset 0x1F3782 in the ROM (i think it's the same in all version), and spans from 1F3782 to 1F37B8, coincidentally where the level's Automap strings appear.

 

image.png.4f45b2a20fe1a086e65f0bb5f886d4a7.png

 

Remember, each music ID is 2 bytes long, so to get the offset of the level's music you want to take or replace, do 1F3782 + (level number * 2).

 

I'm sure there's a better way to do this, but patching the routine to change the X register when music is loaded would break the rest of the level loading code as that code is also a part of the general lump loading code, that stores the pointer to each lump, plus changing it arbitrarily for each level to get the desired music is hacky at best. So, this is the best way to do it for now, maybe write a tool in python to make it a little more intuitive? no clue.

Share this post


Link to post
Just now, Dimon12321 said:

It's just me or copyright file in the repository is now gone?

 

oh no it is fuck

 

cacodemontube also got a DMCA for one of their rom hack videos this isn't good at all

 

on the bright side i've been creating a disassembly of the game that can be assembled with asar but it won't assemble atm bc i dont have everything mapped out properly

Share this post


Link to post
2 minutes ago, lunaark said:

cacodemontube also got a DMCA for one of their rom hack videos this isn't good at all

 

Out of interest - do you know which video got the takedown, and who made the claim?

Share this post


Link to post
Just now, intacowetrust said:

 

Out of interest - do you know which video got the takedown, and who made the claim?

 

The Doom 2 downtown level backport, it was done by this reallly fucking shady company and the description was a huge list of game franchises in all caps

Share this post


Link to post
41 minutes ago, lunaark said:

The Doom 2 downtown level backport, it was done by this reallly fucking shady company and the description was a huge list of game franchises in all caps

 

I see - sounds like the two events might be unrelated then, probably just a DMCA troll? Looks like the video is back up for me also:
https://www.youtube.com/watch?v=-YSHvMt8z9U

Share this post


Link to post
1 hour ago, Dimon12321 said:

It's just me or copyright file in the repository is now gone?

 

Cacodemontube reached out to Randy, everything is ok on his end, he's just deciding which license to use.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×