English Amiga Board


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

 
 
Thread Tools
Old 16 April 2020, 10:28   #1
emuola
Registered Whdload user
 
emuola's Avatar
 
Join Date: Oct 2006
Location: Finland
Age: 48
Posts: 532
Problem creating my first Whdload install: empty slave

Decided to try to make my first own install using the new Fred's Journey. The game has only one adf file, so it should be simple to create a whdload install for it.

https://www.pouet.net/prod.php?which=85282

Whdload install script goes through without errors and it seems all is ok. However my .slave file is 0 kb in size and I get:

DOS-Error #235
(bad loadfile hunk)
on loading "Freds.slave"

The disk1 file gets created ok and everything else also seems to be as it should (compared to the files of other simple working whdload installs).
Is there some basic error in my install script, which could cause this? I've tried with different #version settings (DIC and Files), but the slave is always empty.

Any clues?
emuola is offline  
Old 16 April 2020, 10:31   #2
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by emuola View Post
The game has only one adf file, so it should be simple to create a whdload install for it.
The number of files/disks has absolutely nothing to do with the difficulty creating a patch. There can be single file games/demos which take MUCH longer to patch than a trackloaded game with several disks.


Quote:
Whdload install script goes through without errors and it seems all is ok. However my .slave file is 0 kb in size and I get:

DOS-Error #235
(bad loadfile hunk)
on loading "Freds.slave"

Did you copy the correct slave to the install directory? If so, I'd like to see the install script.
StingRay is offline  
Old 16 April 2020, 10:52   #3
emuola
Registered Whdload user
 
emuola's Avatar
 
Join Date: Oct 2006
Location: Finland
Age: 48
Posts: 532
Quote:
Originally Posted by StingRay View Post
The number of files/disks has absolutely nothing to do with the difficulty creating a patch. There can be single file games/demos which take MUCH longer to patch than a trackloaded game with several disks.
Ok, I somehow assumed that the more disks the more complicated Live and learn!

Quote:
Originally Posted by StingRay View Post
Did you copy the correct slave to the install directory? If so, I'd like to see the install script.
I'm not 100% sure what do you mean by "copying the correct slave"? Here's the install script. Sorry, just starting this, so be patient
Attached Files
File Type: txt Install_Freds.txt (39.0 KB, 178 views)
emuola is offline  
Old 16 April 2020, 10:58   #4
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
I'm not 100% sure what do you mean by "copying the correct slave"?
Well, you need to create a slave which contains the patches for the game. This is a normal AmigaDOS executable and needs to be in the same directory where you have the install script.

Quote:
Here's the install script.
The install script looks fine. So I suppose Freds.slave is broken.

Quote:
Sorry, just starting this, so be patient
No problem, we all have to start somewhere.
StingRay is offline  
Old 16 April 2020, 11:56   #5
emuola
Registered Whdload user
 
emuola's Avatar
 
Join Date: Oct 2006
Location: Finland
Age: 48
Posts: 532
Quote:
Originally Posted by StingRay View Post
Well, you need to create a slave which contains the patches for the game. This is a normal AmigaDOS executable and needs to be in the same directory where you have the install script.



The install script looks fine. So I suppose Freds.slave is broken.


No problem, we all have to start somewhere.
Ok, thanks for the input StingRay

Actually I just realized that I'm trying something way beyond my capabilities here... I though that if there aren't any copy protection stuff or something like that, the installer would patch me the files somehow. How wrong I was...

There are some examples supplied with the dev package, let's see.

Last edited by emuola; 16 April 2020 at 12:03.
emuola is offline  
Old 16 April 2020, 18:59   #6
emuola
Registered Whdload user
 
emuola's Avatar
 
Join Date: Oct 2006
Location: Finland
Age: 48
Posts: 532
I have to say this is way out my league :/ I have to start with something a lot more easier.
emuola is offline  
Old 16 April 2020, 19:43   #7
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,773
Try a Generic Slave but any real patching a good grasp of ASM is required - That's why I don't code Slaves
Retro1234 is offline  
Old 17 April 2020, 09:25   #8
emuola
Registered Whdload user
 
emuola's Avatar
 
Join Date: Oct 2006
Location: Finland
Age: 48
Posts: 532
Quote:
Originally Posted by Retro1234 View Post
Try a Generic Slave but any real patching a good grasp of ASM is required - That's why I don't code Slaves
Yeah, I realized that
emuola is offline  
Old 17 April 2020, 10:03   #9
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
multiple disks => more complicated install script. But install script is only the easy & tedious part (except in some cases where you have to code a RawDIC slave or figure out the layout of bitmap disks.

If you're patching an installable game (with executable), modifying a generic kick slave may do the trick. Sometimes you just need to add some assigns.

But if you want to patch something in the executable, you'll have to disassemble it (with ira -a, see ira tutorial on eab http://eab.abime.net/showthread.php?...l+ira+tutorial), debug the code while it's running and figure out what to change, then relate the code to executable segment offset

If the executable is packed, you have to use xfddecrunch in the install script to decrunch it, or unpack in slave and install a hook to be called back when the code has been unpacked.

There are tons of slaves, most of my slaves have source, Stingray ones too, CFOU! .... I did a lot of DOS-compatible/kickemu ones. For instance Microprose or Sierra, Lucasfilm titles. Check those, and use a working version/disassembly. I can provide enhanced disassembly for most games I've patched.

Then you can create a patchlist and use resload_PatchSeg.

Piece of cake after doing that for 25 years, I know
jotd is online now  
Old 17 April 2020, 10:33   #10
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by emuola View Post
I though that if there aren't any copy protection stuff or something like that, the installer would patch me the files somehow.
It would be nice if that was the case but it's not possible. However, as Fred's Journey is a recently released game I assume the code should be fine (disclaimer: I haven't checked it but as it was made by Cosmos Designs I'd like to assume there aren't any major problems with the code). Hence you could try 2 things:


- use the Kickstart 1.3 emulation code, load the game using LoadSeg and, if you're lucky, the game might already work without any further patches.

- if you might want to have a bit more of a challenge you can also try creating a patch without using the Kickstart emulation code, you would have to load the game using resload_LoadFile, then you need to relocate the executable using resload_Relocate and you also need to patch/remove all OS calls in the code (AllocMem, OpenLibrary etc.). I wouldn't really recommend this for a beginner but it's always worth to try things.

Last edited by StingRay; 17 April 2020 at 10:39.
StingRay is offline  
Old 17 April 2020, 12:36   #11
emuola
Registered Whdload user
 
emuola's Avatar
 
Join Date: Oct 2006
Location: Finland
Age: 48
Posts: 532
Quote:
Originally Posted by jotd View Post
multiple disks => more complicated install script. But install script is only the easy & tedious part (except in some cases where you have to code a RawDIC slave or figure out the layout of bitmap disks.

If you're patching an installable game (with executable), modifying a generic kick slave may do the trick. Sometimes you just need to add some assigns.

But if you want to patch something in the executable, you'll have to disassemble it (with ira -a, see ira tutorial on eab http://eab.abime.net/showthread.php?...l+ira+tutorial), debug the code while it's running and figure out what to change, then relate the code to executable segment offset

If the executable is packed, you have to use xfddecrunch in the install script to decrunch it, or unpack in slave and install a hook to be called back when the code has been unpacked.

There are tons of slaves, most of my slaves have source, Stingray ones too, CFOU! .... I did a lot of DOS-compatible/kickemu ones. For instance Microprose or Sierra, Lucasfilm titles. Check those, and use a working version/disassembly. I can provide enhanced disassembly for most games I've patched.

Then you can create a patchlist and use resload_PatchSeg.

Piece of cake after doing that for 25 years, I know
Thank you jotd Indeed, you made it sound pretty easy Let's see where this leads me.

Quote:
Originally Posted by StingRay
It would be nice if that was the case but it's not possible. However, as Fred's Journey is a recently released game I assume the code should be fine (disclaimer: I haven't checked it but as it was made by Cosmos Designs I'd like to assume there aren't any major problems with the code). Hence you could try 2 things:


- use the Kickstart 1.3 emulation code, load the game using LoadSeg and, if you're lucky, the game might already work without any further patches.

- if you might want to have a bit more of a challenge you can also try creating a patch without using the Kickstart emulation code, you would have to load the game using resload_LoadFile, then you need to relocate the executable using resload_Relocate and you also need to patch/remove all OS calls in the code (AllocMem, OpenLibrary etc.). I wouldn't really recommend this for a beginner but it's always worth to try things.
Ok, will try the GenericKick13.slave example. Thank you StingRay

Last edited by emuola; 17 April 2020 at 12:43.
emuola is offline  
Old 17 April 2020, 13:18   #12
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
Quote:
if you might want to have a bit more of a challenge you can also try creating a patch without using the Kickstart emulation code, you would have to load the game using resload_LoadFile, then you need to relocate the executable using resload_Relocate and you also need to patch/remove all OS calls in the code (AllocMem, OpenLibrary etc.). I wouldn't really recommend this for a beginner but it's always worth to try things.
that is possible only if the game uses dos.library mainly (example: Oscar AGA). If the game uses graphics library and/or intuition or other extensively (to open screens and all), you're not going to be able to emulate those calls easily. I used to do that to some extent when taking on Harry OSEmu but when kickemu came out I gave that up.
jotd is online now  
Old 17 April 2020, 14:04   #13
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by jotd View Post
that is possible only if the game uses dos.library mainly

Not true! Any and all OS functions can be emulated and I have done this in numerous patches as I don't really like patches which require Kickstart emulation. And usually, in the case of games or demos which disable the system, there aren't many OS calls.
StingRay is offline  
Old 17 April 2020, 14:40   #14
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
Stingray, 20 years ago, I have written intuition library & graphics library emulation routines with OSEmu, implemented overlay loading with dos.loadSeg (Try to emulate overlayed executables for instance. it's horrible to do. And resload_Relocate isn't going to help a bit), added fastmemory support, added a lot of stuff, but still some games proved incompatible, and there were sometimes some strange lockups/issues, and endless hours of debugging. It allowed me to learn a lot about the OS, but it was also exhausting and frustrating.

When kickemu came up, it made those patches so much easier it wasn't worth maintaining an alternate and not reliable version like OSEmu. I know Psygore has his own osemu code that he sometimes links to his slaves. But since he never releases his sources it remains a mystery...

My notes about Maniac Mansion switch from OSEmu to kickemu:

Quote:
Game worked almost OK using OSEmu but a bug in some gfx lib emulation routine f***ed up
the scrolling to the left (!). Using original graphics library through KickEmu works.
But I agree, if it's possible to get rid of KickEmu it should. But it's a hell more work. And is that worth the time?

And there are numerous cases where the games open an intuition file selector for instance. Good luck reimplementing that. I agree with you that with most action/arcade games it's more doable (specially ones that kill the OS in the floppy version but use the OS in the CD/AGA version). But frankly I prefer providing more games to people / adding joypad controls to slaves than reducing memory usage by 256kb and spend 5 hours more patching os calls.

Don't worry, we get along very well with Stingray, it's just that we have diverging interests sometimes, and we'll have to agree to disagree on that point.

Last edited by jotd; 17 April 2020 at 14:49.
jotd is online now  
Old 17 April 2020, 15:07   #15
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
I am referring to your "only possible for dos.library mainly" statement and that is, plain and simple, incorrect!

It of course doesn't make sense to emulate OS calls for 100% system-friendly games/demos. For all other cases it just is a matter of how much time one is willing to spend emulating OS stuff. So regarding that, we actually do not disagree at all.

The game in question does kill the system and bangs the hardware directly which was the sole reason I suggested trying to do it without Kickstart emulation.
StingRay is offline  
Old 17 April 2020, 19:18   #16
emuola
Registered Whdload user
 
emuola's Avatar
 
Join Date: Oct 2006
Location: Finland
Age: 48
Posts: 532
Hmm.

I disassembled the game (only one big file really) and found e. g. this in the start.

Code:
ABSEXECBASE	EQU	$4
CIAB_PRA	EQU	$BFD000
CIAA_PRA	EQU	$BFE001
CIAA_SDR	EQU	$BFEC01
HARDBASE	EQU	$DFF000
VPOSR		EQU	$DFF004
VHPOSR		EQU	$DFF006
JOY1DAT		EQU	$DFF00C
POT1DAT		EQU	$DFF014
DIWSTOP		EQU	$DFF090
DMACON		EQU	$DFF096
INTENA		EQU	$DFF09A
INTREQ		EQU	$DFF09C
BPLCON3		EQU	$DFF106
SPR0DATA	EQU	$DFF144
COLOR00		EQU	$DFF180
BEAMCON0	EQU	$DFF1DC
EXT_0011	EQU	$DFF1FC
Would there be something to look for in the code below? I mean related to the load routine or something to that direction. Sorry, I'm really a beginner here
emuola is offline  
Old 17 April 2020, 19:37   #17
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Those are hardware registers which you don't need to care much about except for BEAMCON0 (mostly used to switch between PAL/NTSC) as writes to this register have to be patched/removed for WHDLoad.
StingRay is offline  
Old 17 April 2020, 19:51   #18
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,160
seems that you're using IRA. Good choice. But which version are you using?

because this EXT_0011 EQU $DFF1FC suggests that the version is old (it's FMODE address)

Looks that this is a game which is PAL/NTSC and also AGA aware. But whdload already starts with "degraded" ECS by default.

You may also use my cheapres.py post-processor for IRA (in https://github.com/jotd666/amiga68ktools) to try to put a name on some/most OS calls, and also custom register offsets. Really helps to see what's going on. You need a modern machine with python installed on it. If you can't, send/zone your executable I can try to process it myself.
jotd is online now  
Old 17 April 2020, 22:04   #19
Wepl
Moderator
 
Wepl's Avatar
 
Join Date: Nov 2001
Location: Germany
Posts: 866
I would recommend to use an interactive Reassembler like ReSource. With that you can more easily follow the code paths and learn how a program is working. IRA is good for quickly disassembling a program but less suited to understand a more complex code structure.
Wepl is offline  
Old 18 April 2020, 14:14   #20
emuola
Registered Whdload user
 
emuola's Avatar
 
Join Date: Oct 2006
Location: Finland
Age: 48
Posts: 532
Thanks for the tips and help guys

My IRA version should be the latest available. I also downloaded the demo version of the ReSource. Haven't really tried it seriously yet.

I also started to think about Winuae debugger, that could be a valuable tool? Or am I somehow completely on a wrong track here?

The main game file is in the Zone now (fred).

My appreciation to you Whdload experts has risen at least 1000% in the last few days

Last edited by emuola; 18 April 2020 at 14:33.
emuola 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
Help with creating Slave (for Journey to the center of the earth). puppe project.WHDLoad 8 16 January 2016 21:53
Creating an empty hdf file Harko33 support.WinUAE 1 25 September 2011 23:46
WinUAE WHDLoad Install Problem Kitty project.WHDLoad 97 29 September 2009 04:16
whdload game install problem Unregistered New to Emulation or Amiga scene 4 23 September 2005 22:38
problem install games using whdload Unregistered New to Emulation or Amiga scene 2 16 December 2004 11:17

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:30.

Top

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