English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 06 September 2012, 21:02   #1
Herpes
... aka Amix73

Herpes's Avatar
 
Join Date: Jan 2009
Location: Austria
Posts: 87
Question ATT: potential lamer question @ "program relocation"

Maybe it is very stupid question - and one can find the answer in every basic assembler book. I have to ask it anyway since I have obviously not the right book

I have resourced a loader of a game to added some patches since I debugged the game to change some features of the game (at least that was fun). Anyway the loader is horribly written and it loads its game (the main part) to an absolute address - namely $100000 which is the start of the mirrored chip afaik.

So my question is how to relocate the loader in a meaningful way that it will not interfere with the loaded program? I mean is there another way than using an ugly "org $50000" statement - don't want to be forced by the loader to be nasty...

Well to be honest up until now it did not interfere - but who knows when I try on different machines with different ram configurations?

Shall I "AllocAbs" and copy the loader out of range of the loaded game to ensure it is not overwritten after loading the second part?

I think I have to stay in chip mem since I can not hope that there will be fast ram.

Any hint is highly appreciated.
Herpes is offline  
Old 06 September 2012, 21:06   #2
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,601
Check which memory area the game needs (most games set up their memory very early) and then find some space for your loader. Then just simply copy it to that very location and you're done. The loader needs to be 100% pc relative for this to work or otherwise you'll have to relocate all absolute address accesses. Which is (depends on the code of curse) not too trivial (but fun).
StingRay is offline  
Old 06 September 2012, 21:21   #3
Herpes
... aka Amix73

Herpes's Avatar
 
Join Date: Jan 2009
Location: Austria
Posts: 87
Quote:
Originally Posted by StingRay View Post
Check which memory area the game needs (most games set up their memory very early) and then find some space for your loader. Then just simply copy it to that very location and you're done. The loader needs to be 100% pc relative for this to work or otherwise you'll have to relocate all absolute address accesses. Which is (depends on the code of curse) not too trivial (but fun).
Ah, thanks - for the quick reply!
As I "feared", so I have to do it the "hard" way

Initially I thought there would be something like "Move the crap after the following address-boundary"-HUNK
In a way I am glad it does not exist - wouldn't be the same fun.

Anyway the loader code is ugly and I think I will learn quite a bit... at the moment I am happy that I could make it work and load the game after I resourced and re-assembled it. Hope to have something for the release-section, soon.
Herpes 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
"Lincs Amiga User Group aka "LAG" Meeting Confirmed for Sat 2nd of March" rockape News 2 21 February 2013 22:46
"Reminder "Lincs Amiga User Group aka "LAG" Meet Sat 5th of January 2013" rockape News 4 30 January 2013 00:06
CD32 Image-Name-Bug: "...(bla)[!].zip" -> "...(bla)[" / "...[test].zip" -> "...[tes" cfTrio support.WinUAE 8 18 December 2012 16:31
Cli program to "execute" .info files olesio support.Apps 4 05 September 2010 19:19
Problems with "Thespywholovedme", "Flood", "Shinobi" sareks support.Games 12 03 May 2006 14:52

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 14:04.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.10538 seconds with 13 queries