English Amiga Board


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

 
 
Thread Tools
Old 22 November 2020, 17:27   #21
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 667
Quote:
Originally Posted by Galahad/FLT View Post
If they are already dealing with data that is already set to an absolute address, they don't have many options but to be constrained by that.

If you depend on data compiled/assembled to absolute addresses on the Amiga, you do something wrong in first place. The above programs are designed to take graphics/images and convert them into a format where you could include them directly into your program sources. The compiler/assembler will then generate the relocation information if necessary.
Thomas Richter is offline  
Old 22 November 2020, 17:40   #22
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 47
Posts: 7,860
Quote:
Originally Posted by Thomas Richter View Post
If you depend on data compiled/assembled to absolute addresses on the Amiga, you do something wrong in first place. The above programs are designed to take graphics/images and convert them into a format where you could include them directly into your program sources. The compiler/assembler will then generate the relocation information if necessary.
You're still not getting it. This is how lots of Amiga programs were done back in the day on A500, intros, demos, games.

If they are dealing with stuff from that era, they are constrained by the absolute nature of those files.

Everyone knows thats not ideal today, doesn't solve the problem of dealing with files that were made absolute by someone else and having to deal with that.
Galahad/FLT is online now  
Old 22 November 2020, 18:21   #23
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 49
Posts: 4,604
ok, looks like the program is still needed. And I have started coding it and not far from completing it.

I would seem that the boot code could be destroyed by relocating onto itself, which is pretty tricky to handle. A proper reloc routine would start by setting a routine in high memory, then this routine copies the data (respecting the direction of the copy depending on how the source & destination are in memory).
But prior to that it would have to disable all interrupts, because the OS could use this memory and crash.

So it's not that trivial to code if you want it to run on a 1MB chipmem / no fast machine.
jotd is online now  
Old 22 November 2020, 18:24   #24
chip
Registered User
 
Join Date: Oct 2012
Location: Italy
Age: 46
Posts: 2,125
Nice
chip is offline  
Old 22 November 2020, 18:34   #25
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 47
Posts: 7,860
Quote:
Originally Posted by jotd View Post
ok, looks like the program is still needed. And I have started coding it and not far from completing it.

I would seem that the boot code could be destroyed by relocating onto itself, which is pretty tricky to handle. A proper reloc routine would start by setting a routine in high memory, then this routine copies the data (respecting the direction of the copy depending on how the source & destination are in memory).
But prior to that it would have to disable all interrupts, because the OS could use this memory and crash.

So it's not that trivial to code if you want it to run on a 1MB chipmem / no fast machine.
Either have an option to copy from low memory or run your routine off the current stack
Galahad/FLT is online now  
Old 22 November 2020, 18:41   #26
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 49
Posts: 4,604
current stack which could very well be in the destination zone...

A generic approach that works 100% of the time isn't that trivial (decruncher or not)
jotd is online now  
Old 22 November 2020, 19:20   #27
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 47
Posts: 7,860
Quote:
Originally Posted by jotd View Post
current stack which could very well be in the destination zone...

A generic approach that works 100% of the time isn't that trivial (decruncher or not)
Just not likely is it?

System sets the stack at the top of 512k chip mem or top of 1 meg chip ram, or at the top of whatever external memory is present.

The most important thing is to get the file into memory.

If the load address is less than $100, then use the stack to put your copy routine, you're going to know this when the user inputs the details for the file to be created.

At no point will the file that gets loaded interfere with the stack, because your main concern is getting it into memory, and then transferring it afterwards.

If by some miracle the file interferes with the stack on final copy, then obviously you would need a low mem copy routine.

There can't be a file in 512K that will stop both options, because the file simply won't load because of AmigaDOS, CLI screen, trackbuffers, so in a 512K machine, the largest file size is probably going to be around 440K before you run out of memory.

Seems pretty trivial to me

The way I do it is 99.99% of the time, let AmigaDOS locate the file, then pass parameters to a low mem copy routine.

In the very few cases where a low mem copy routine would clash with the file in question, I still copy the file to near the postion it needs to be, and then have a secondary copy routine that is now copied to the top of memory (because now I know the file has been moved low enough that it won't be corrupted) and executed which then copies the file to its final lower destination.

For your routine to to know this stuff, I would say that should a file exceed 350K, and its load address is above $1000, I would use the double copy approach, i.e. copy routine to low mem, move file close to final position, copy routine in high mem, copy file to final destination.

If the load address is below $100, use the stack copy approach

If the load address is above $100 and file is less than 350K, then low memory copy will suffice.

All this information will be given to your program by the user, so there is literally NO guesswork on your part.

Last edited by Galahad/FLT; 22 November 2020 at 19:27.
Galahad/FLT is online now  
Old 22 November 2020, 21:02   #28
Bruce Abbott
Registered User

Bruce Abbott's Avatar
 
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 380
Quote:
Originally Posted by Radertified View Post
I'd prefer something generic. A quick tool where I pass in some parameters and it's done.
For what purpose?
Bruce Abbott is offline  
Old 22 November 2020, 22:23   #29
Radertified
Registered User
 
Join Date: Jan 2011
Location: -
Posts: 357
I've got to start explaining things better because I think I've confused some people

The whole bin2exe thing was for training/patching games. I save the raw data from the game right before it starts and then do one of the following:

- If the game needs no patching, I run the data directly through a cruncher like StoneCracker which is able to do everything I need. Load, JMP, etc.
- Write my own loader if the game needs patching. The loader loads the raw data into memory, patches where needed, and then JMP's to the required address. Game starts and all is good.
- At times (like with Hong Kong Phooey), I run it through StoneCracker and then deal with decrunching and patching afterwards. A little more difficult than uncrunched data.

So:

- I do not need to deal with turning off the OS because the game deals with all of that.
- The loader needs to be absolute addressed because games generally require it.

Why generic? Because I'm lazy. Everytime I patch a game, I generally take my old loader asm source, copy and paste, alter accordingly and assemble. A generic loader that does that all of that via command line is much simpler.

It feels like things have gotten way out of hand just because I don't want to add the extra minute or two of altering previous source code

@jotd: I appreciate you taking the time to do this but it's sounding like a much more difficult task than I had imagined :/

Last edited by Radertified; 22 November 2020 at 22:29.
Radertified is online now  
Old 22 November 2020, 22:42   #30
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 49
Posts: 4,604
learning how to create/update whdload slaves would probably be time better invested after all

Seems that you want to create something like whdload, but less powerful

- no extra resource loading (all must be in RAM)
- no display/VBR/cache degrading
- no quit after playing
jotd is online now  
Old 22 November 2020, 22:48   #31
Radertified
Registered User
 
Join Date: Jan 2011
Location: -
Posts: 357
WHDLoad is definitely better to learn. I've already got a bunch of slaves written in varying stages of completion. See my point about being lazy as to why I haven't finished them

The more this thread goes on, the more I sound like a jerk
Radertified is online now  
Old 22 November 2020, 22:57   #32
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 49
Posts: 4,604
Quote:
The more this thread goes on, the more I sound like a jerk
no, because you just admitted that whdload was better.

Quote:
I've already got a bunch of slaves written in varying stages of completion.
That's interesting. Do you have a list? Maybe we can help you finishing those?
jotd is online now  
Old 22 November 2020, 23:02   #33
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 47
Posts: 7,860
Quote:
Originally Posted by Radertified View Post
WHDLoad is definitely better to learn. I've already got a bunch of slaves written in varying stages of completion. See my point about being lazy as to why I haven't finished them

The more this thread goes on, the more I sound like a jerk
I used to do what you want to do, did quite a few HD installs with quit to dos etc, but once WHDLoad got good enough, I saw little point doing it my way when the WHDLoad way was far quicker.
Galahad/FLT is online now  
Old 22 November 2020, 23:08   #34
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 49
Posts: 4,604
I used to write a concurrent tool to whdload, did 100+ HD installs with quit to dos etc, but once WHDLoad got good enough, I saw little point doing it my way when the WHDLoad way was far quicker.
jotd is online now  
Old 22 November 2020, 23:19   #35
Radertified
Registered User
 
Join Date: Jan 2011
Location: -
Posts: 357
I only continue to patch disks because I'd like to see working ADFs for everything. Not that I use them because WHDLoad is far superior in every way, but for completeness.

Off the top of my head, the slaves that I'm working on:

- Karate Kid 2 - Just need to finish the level skip for Myagi bonus level and fix the ending problem as outlined here. I've got the trainer done everywhere else and fixed up timing problems for in-between text screens.
- Who Framed Roger Rabbit - I began supporting more versions and better bypassing of the manual check. I think I also added some trainer options?
- The Surgeon - Honestly can't remember what I've done here.
- A bunch of PD games.

I haven't touched any of the slaves for months. Everything's straightforward so I don't think I need any assistance just yet. It's just a matter of getting off my butt and finishing them.
Radertified is online now  
Old 22 November 2020, 23:38   #36
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 49
Posts: 4,604
- Who Framed Roger Rabbit - I began supporting more versions and better bypassing of the manual check. I think I also added some trainer options?

damn, unfinished slave right here with trainer for first stage (skip actually) and 2 versions supported + protection crack
Quote:
It's just a matter of getting off my butt and finishing them.
exactly what I'm saying to myself for the Rabbit game. Maybe we could collaborate for that one...
jotd is online now  
Old 23 November 2020, 00:02   #37
Radertified
Registered User
 
Join Date: Jan 2011
Location: -
Posts: 357
What do you need done? I think I only had 2 versions supported so it sounds like all you need is trainer stuff?
Radertified is online now  
Old 23 November 2020, 00:56   #38
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 49
Posts: 4,604
I had to rewrite the slave completely, now using files, no longer diskfiles. Also fixed blitter errors. I wanted to add trainers to be able to fully test the game, yeah that's pretty much it.
jotd is online now  
Old 23 November 2020, 01:39   #39
Radertified
Registered User
 
Join Date: Jan 2011
Location: -
Posts: 357
You've definitely done more than I had. I kept everything as disks and didn't do any other fixes.

If it's something that's going to sit around for a while and you don't care about waiting, I'll try to finish up trainer stuff, but as always, no clue when I'll sit down to do that
Radertified is online now  
Old 23 November 2020, 07:37   #40
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 49
Posts: 4,604
this is drifting completely off-topic (my bad). I'll release the patch with source, and see if you can figure out how to improve / add trainer afterwards
jotd is online now  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to read file from executable directory? Sim085 Coders. C/C++ 21 08 June 2020 19:27
windows tool to convert ipf to wwp / normal adf file jotd Coders. General 12 08 May 2014 10:02
Tool to convert NewIcon to normal icons Leandro Jardim request.Apps 9 23 November 2013 16:18
File not executable amigapd support.Apps 3 22 February 2011 18:59
File not executable ancalimon support.WinUAE 8 15 February 2008 18:18

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 23:40.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.16572 seconds with 14 queries