English Amiga Board


Go Back   English Amiga Board > Other Projects > project.WHDLoad

 
 
Thread Tools
Old 22 March 2022, 12:14   #1
Sim085
Registered User
 
Join Date: Apr 2009
Location: N/A
Posts: 962
Can I redirect memory with WHDLoad and other questions

Some years ago I started a project in relation to the game named Colonization which is a favorite of mine. There are many things I loved about this game but also a small number of things which I did not like.

One of these things was the max units limit.

I have used WinUAE debugger to see how this is applied. Thank to people on these forums I started going through the ASM being executed and finally have identified the conditions. I have found the instructions in the executable, patched these, and I managed to increase the max units limit from 300 to something around 500. But...

It seems this data was stored in memory as a fixed size array. Having one unit or 300 unit in the game still results in the same amount of memory being assigned to store units on the map. This means that once you jump the 300 limit you are now overriding memory used for other parts of the game.

I have thought how I could get around this problem. Any advice in relation to patching the executable is welcome as that was always my initial target.

I however suspect this might not be possible as I have the impression that the instructions that access the other memory locations would have the addresses calculated at compile time (base address + some fixed value) rather than calculated at runtime. I have not done this a lot and really new to all this. The above is just an impression I got from what I saw so far. So please let me know if this is the wrong assumption.

The other alternative I thought of is to see if WHDLoad could be used to go round the problem. Again I have never done anything with WHDLoad in my life which is why I am asking if it is possible to do this here.

What I thought is this; with WHDLoad the address where the units are going to be stored will always be the same. Therefore, is it possible to create like a "check" so that when the game reads/writes data from memory location X, WHDLoad automatically maps this to some other memory location?

Is this possible with WHDLoad?
Sim085 is offline  
Old 22 March 2022, 16:35   #2
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,207
No need to remap memory or whatever. You want to add a trainer option to the whdload colonization slave.

Using whdload s probably the simplest way of doing that.

How I proceed is that I have a debug whdload slave setup where the executable is mapped at a fixed address location (rounded, ex $20000). One segment is best, but can be worked out with more.

That and work with a mix of WinUAE real-time debug and the disassembly as a text file. Disassembly gives you offsets of the segments. WinUAE can help you recognize the parts of the code in the exe, using the address or just the sequence of instructions if they're specific enough.

Once you have the offsets to change from, it's easy with whdload Patch/PatchSeg

I've been doing that for the last 20+ years believe me that method works.

For starters set up a build chain with whdload, either native with basm or windows/linux with vasm. And get my whdload slave sources on github.
jotd is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Add http redirect to https Anubis project.EAB 27 29 May 2023 22:34
CD32 NVRAM redirect BigMacDaddy New to Emulation or Amiga scene 17 17 March 2021 21:18
Old big memory expansion questions Ridrok Hardware mods 9 30 January 2019 16:50
How to redirect the output of IconX to a file tygre support.Apps 8 10 July 2011 05:29
A4000 chip memory and other questions T_hairy_bootson support.Hardware 23 09 August 2006 17:58

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 20:48.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06743 seconds with 15 queries