Register - Login
Views: 99792144
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
05-03-22 04:44:43 AM
Jul - General Game/ROM Hacking - Lemmings Revolution - Compatibility Patch New poll - New thread - New reply
Next newer thread | Next older thread
GuyPerfect
Catgirl
Level: 68


Posts: 697/1096
EXP: 2665648
For next: 63152

Since: 07-23-07


Since last post: 1.7 years
Last activity: 219 days

Posted on 04-26-12 08:49:26 PM Link | Quote
It's a compatibility hack I've been working on. Not a ROM, exactly, but it still falls under the category of "video games being hacked," so I'm tossing it in here.

Over the years, Lemmings Revolution has been degrading. It started in Windows XP with some funky colors going on in spots, but on Windows 7 it really devolves into an experience that's only marginally enjoyable. The problems were caused, unsurprisingly, by the game being programmed incorrectly in a few key areas relating to DirectX. It doesn't fully conform to the spec, and some of the results are arguably catastrophic from the publisher's point of view.

The moral of the story is that even though your code might work on a given system or architecture, it doesn't mean it's correct. As developers, we all need to make sure any code we write that uses external libraries fully conforms to the expectations of those libraries.

The patch, though still in development, can be found here:

http://www.lemmingsforums.com/index.php?topic=615.msg13684#msg13684
__________

The Problems

#1 - When initializing DirectSound, the game will enumerate a list of devices and presumably pick the first one returned. This worked on Windos 98 and XP, but on Windows 7, the first device is the sound card driver and not the system mixer output. The result is that on Windows 7, Lemmings Revolution has no sound.

#2 - While processing textures with alpha masks, the game will use BitBlt() to copy color data, then call IDirectDrawSurface::Lock() and write only the alpha bytes into video memory. This worked fine on Windows 98, though XP had some color errors, and Windows 7 just makes everything black. The culprit? Lock() expects every byte to be written to in the specified range. Lemmings Revolution was crossing its fingers and hoping the RGB channels would be preserved, which nowadays they aren't.

#3 - On the main menu, but only when you first launch the game, the cursor and all the text are just black rectangles if you're on Windows 7. After playing a level, this corrects itself. This is due to the Direct3D object not being configured to work with alpha blending on textures--something that apparently works out of the box on Windows 98 and XP. It's something that should explicitly be done in all cases, but since it didn't cause problems in development, it was probably overlooked.


The Solutions

#1 - Unless a program intends to prompt the user to select their audio output device, it should use whatever device is selected as the default by the system. You can do this with DirectSound by passing a driver ID of NULL. This is a simple patch of the instruction in the EXE by changing the value loaded into a register to 0 before the DirectX function is called.

#2 - The textures need to be processed and initialized correctly, and the existing function in the game isn't equipped to handle that scenario. What I wound up doing was crafting a DLL with a new texture loader in it, then swapping it out to impersonate DDRAW.dll (of which only 2 functions are imported by the EXE). When calling one of the DirectDraw functions with special arguments, my DLL will return the address of the texture loader function. So a simple patch to the texture loader in the EXE was made to redirect the program into my DLL instead.

#3 - The handful of function calls needed to configure the texture stage for blending with textures are run once by the DLL the first time the texture loader is called.
__________

Let's take a quick tour of the history of Lemmings Revolution falling apart over the years as Windows saw its various updates!

Click any thumbnail for the full image. For each triplet of images, the systems represented are in this order:

Windows XP, Windows 7, and either system with the patch applied.


Title Screen / Main Menu


Level Select


In-Game


Level Results


This last one's kinda hard to see, but the text on XP is barely visible. It's dark red.
GuyPerfect
Catgirl
Level: 68


Posts: 698/1096
EXP: 2665648
For next: 63152

Since: 07-23-07


Since last post: 1.7 years
Last activity: 219 days

Posted on 04-28-12 05:10:02 PM Link | Quote
IRC told me to post this here. (-:

[11:02:46] <+GuyPerfect> So I have this patch fix for Lemmings Revolution pretty much ready to go, and I've got a guy in the gaming industry press doing a write-up on it.
[11:03:00] <+GuyPerfect> However, I need a place to host it so the world can get to it. Any suggestions?
[11:03:19] <+GuyPerfect> Preferably, I'd like an applicable site and not just some "put your files here!" bucket.
Darkdata
Ruins!? ♥
Level: 103


Posts: 2617/2892
EXP: 11445952
For next: 25454

Since: 07-04-07


Since last post: 202 days
Last activity: 10 days

Posted on 04-29-12 04:56:32 PM Link | Quote
I can throw your files on http://darkdata.rustedlogic.net/guyperfect/Lemmings until you find a spot.

As for more permanent hosting? I have no clue.

____________________
Nksor

Beezo
Level: 46


Posts: 433/478
EXP: 662942
For next: 48832

Since: 04-27-11

Pronouns: they/them
From: olympia, wa

Since last post: 3.6 years
Last activity: 3.6 years

Posted on 04-29-12 05:58:42 PM Link | Quote
Originally posted by GuyPerfect
[11:03:00] <+GuyPerfect> However, I need a place to host it so the world can get to it. Any suggestions?


Similar to Darkdata's offer, I can host your files along with a place for you to set up a website at my domain, nksor.net. Your URL would be something along the lines of lemmings.nksor.net, or anything else you want (the format being chosennamehere.nksor.net). It'd be as permanent as you want it to be; I have no plans of ever getting rid of the domain and I'm open to hosting for others.

However, I'd also ask Xkeeper about hosting your files/website, as I'd think that he'd be a wise choice to host under.
Sails
2800
as a video game‎‎‎‏‏‎ grows old its content and‏‏‎ internal logic‏‏‎ deteriorateÿ
Level: 102


Posts: 2672/2803
EXP: 10922254
For next: 167713

Since: 07-04-07

Pronouns: He/Him
From: MA

Since last post: 120 days
Last activity: 28 days

Posted on 05-01-12 02:10:29 AM Link | Quote
I have no clue on helping you with hosting, but I wish to add that I had this game as a kid and even though I didn't play it many times, I enjoyed it because it was Lemmings! Thus, your work will more than likely make me want to play this again, even though I have no idea where my disc ran off to...

____________________
Next newer thread | Next older thread
Jul - General Game/ROM Hacking - Lemmings Revolution - Compatibility Patch New poll - New thread - New reply


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

29 database queries, 1 query cache hits.
Query execution time: 0.088425 seconds
Script execution time: 0.014441 seconds
Total render time: 0.102866 seconds