English Amiga Board


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

 
 
Thread Tools
Old 21 February 2007, 06:09   #1
BippyM
Global Moderator

BippyM's Avatar
 
Join Date: Nov 2001
Location: Nottingham, UK
Age: 42
Posts: 8,619
First Slave problem

Hey guys

I decided to try and do a simle (for you experts) slave for the amiga action coverdisk demo of zonewarrior.

I followed Codetappers excellent tutorial on his site and this game is very similar, simple rob northern trackloader etc.

Well the problem is the patch seems to overwrite the robd loader and the slave fails.

Can someone have a look and give me some advice please

Thanks

(Attached is lzx containing slave, source and disk image)

Last edited by BippyM; 01 November 2008 at 19:14.
BippyM is offline  
AdSense AdSense  
Old 21 February 2007, 09:26   #2
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 44
Posts: 6,578
Anything but LZX!!!
Galahad/FLT is offline  
Old 21 February 2007, 10:11   #3
Codetapper
2 contact me: email only!

Codetapper's Avatar
 
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,135
I'm not sure what the hell Galahad is going on about, LZX is the best and most suitable archiver on the Amiga...

Anyway Bippy first impressions are that it is OK (except it's all space indented not tabs, and has double return characters here!)

The boot operation loads the first part to anywhere in memory, then relocates itself (from offset $56) to $60000, so I would start by loading the game directly into where it wants it so you can skip all that copying junk. Not critical but speeds up the loader ever so slightly!

ie. Load the first file to $60000-$56 (write it like that in code rather than $5ffaa as that's another random looking number) instead of $a4a2 (was that a random value you picked?), then you can skip the copying stuff in the loop at around offset $46.

Your main problem however is you are overwriting jmp ($1d00).w (which is 4 bytes) with a patch (6 bytes) which destroys the first 2 bytes of the Rob Northen loader patch. You've overwritten the $4ef9 jump!

Patch the jmp ($1d00).w at offset $84 instead of $8a since it's just testing for a load failure which will never occur with WHDLoad. If the disk image is broken or corrupt, WHDLoad will just quit, not return from the loader.

That'll get you going a bit further, don't want to spoil the fun so I will stop here! Yell if you need more hints later...

Oh yeah, one more thing, your keyboard patch will not work correctly. $bfec01 contains the raw key code, but you must convert it before comparing with the quit key:

move.b $bfec01,d0
ror.b #1,d0
not.b d0
cmp.b _keyexit(pc),d0
beq _quit

Obviously if you change d0 (as I have done) you will have to put it back to the original value if the user did not press the quit key, or patch the keyboard routine in a different place.

Last edited by Codetapper; 21 February 2007 at 10:21.
Codetapper is offline  
Old 21 February 2007, 10:57   #4
BippyM
Global Moderator

BippyM's Avatar
 
Join Date: Nov 2001
Location: Nottingham, UK
Age: 42
Posts: 8,619
Thanks codetapper

That gets me a little further but alas there is another loader to patch it seems

I'll get right on it.
BippyM is offline  
Old 21 February 2007, 13:07   #5
BippyM
Global Moderator

BippyM's Avatar
 
Join Date: Nov 2001
Location: Nottingham, UK
Age: 42
Posts: 8,619
Right update:

Made the alterations suggested to get the slave to boot the game, patched the other 2 loaders in the main file but for some reason the fire-button is not recognised.

i'll look into this more, but obviously my asm knowledge is limited but let's see
BippyM is offline  
Old 21 February 2007, 13:09   #6
killergorilla
Lesser Talent
killergorilla's Avatar
 
Join Date: Jan 2003
Location: UK
Age: 35
Posts: 7,924
Good luck sir

And nice work!
killergorilla is offline  
Old 21 February 2007, 19:42   #7
BippyM
Global Moderator

BippyM's Avatar
 
Join Date: Nov 2001
Location: Nottingham, UK
Age: 42
Posts: 8,619
Okay I can't find the routine that loads the third load-routine.

[I know where it is in memory ($16670) but for the life of me i can't find the routine that loads or jumps to the file so I can intercept it.

Help please
BippyM is offline  
Old 21 February 2007, 21:32   #8
Joe Maroni
Moderator

Joe Maroni's Avatar
 
Join Date: Feb 2003
Location: Germany
Age: 38
Posts: 1,278
Send a message via MSN to Joe Maroni
damn...bippy...did you try to write a slave before i do ??



Joe Maroni is offline  
Old 21 February 2007, 22:05   #9
Codetapper
2 contact me: email only!

Codetapper's Avatar
 
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,135
Bippy: If you are using a real Amiga to patch this should be an easy job as WHDLoad will quit when disk access is attempted if you use the SNOOP functions with an accelerator with MMU built in.

If you are using WinUAE can you not just set a breakpoint in the debugger or alter the RN loader in your slave so once it has loaded that bit it bails out at that point and you can look around?
Codetapper is offline  
Old 21 February 2007, 22:16   #10
BippyM
Global Moderator

BippyM's Avatar
 
Join Date: Nov 2001
Location: Nottingham, UK
Age: 42
Posts: 8,619
Well my real amiga is packed away but maybe i should find it out.

As for winuae, i know where the routine is I just don't know where it is called from.. i'm currently following the code thru line by line checking the memory range as i go to see when data starts to appear there.
BippyM is offline  
Old 21 February 2007, 23:59   #11
BippyM
Global Moderator

BippyM's Avatar
 
Join Date: Nov 2001
Location: Nottingham, UK
Age: 42
Posts: 8,619
I think I might have figured it out!

Game jumps to $14F32 which then jumps to the new loader.

Just got to find the routine which loads the data which jumps. Tomorrow now
BippyM is offline  
Old 22 February 2007, 04:00   #12
Retro-Nerd
Missile Command Champion

Retro-Nerd's Avatar
 
Join Date: Aug 2005
Location: Germany
Age: 45
Posts: 10,738
Or the more comfortable lzx plugin for the Total Commander.

http://www.ghisler.com/dplugins.htm
Retro-Nerd is offline  
Old 22 February 2007, 05:40   #13
Anubis
Maj. Voodoo

Anubis's Avatar
 
Join Date: Jan 2005
Location: #DrainTwitterSpam
Age: 45
Posts: 2,284
Quote:
Originally Posted by Codetapper
I thought an "elite" such as yourself would know these things!
Every great hero has his weak point.

Bippy, how about those programs needed to follow instructions?
Anubis is offline  
Old 22 February 2007, 22:33   #14
BippyM
Global Moderator

BippyM's Avatar
 
Join Date: Nov 2001
Location: Nottingham, UK
Age: 42
Posts: 8,619
thread cleaned
BippyM is offline  
Old 25 February 2007, 19:06   #15
Asman
68k

Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 627
Hi

First I agree with Codetapper remarks but ... . Now my few remarks. Better place for patch jmp $1d00 is offset $84 ( not $8a, now you know why ( magic 6 bytes ) ). Second, please dont jump exactly $1d00. choose other ( like $1d0c or after stupid dummy set intCOPER and intPORTS ($1d20)
I found bug in your patch. In your source you use lea $2446,a0 for patch keyboard, but the correct address is $1d00 + $2446, always remember where you are ( jmp $1d00 mean you are at $1d00 ). Please check all addresses in source ( i do that now ).

You want patch keyboard in PORTS int, better way is find and overwrite place where PORTS int is set ( look in $1d00 + $23d8 ).
You can use int PORTS in whdload sources ( keyboard.s ). Another reason for that way is little easy add support to emulate joystick.

Final remark. Remember that game with custom trackloader may be harder to fix then one file game. And don't give up. Every game is possible to fix ( but this may take some time ).

Any comments and question are welcome.

Last edited by Asman; 25 February 2007 at 20:07.
Asman is offline  
Old 25 February 2007, 20:12   #16
Retro1234
5150

Retro1234's Avatar
 
Join Date: Jun 2006
Location: Sycophantazia
Posts: 3,743
Retro1234 is offline  
Old 25 February 2007, 20:15   #17
BippyM
Global Moderator

BippyM's Avatar
 
Join Date: Nov 2001
Location: Nottingham, UK
Age: 42
Posts: 8,619
The offsets I use are the offsets that are used in game!

so the $2446 is where in memory the game uses (from offset 0 not 1d00) tho I know it is wrong anyway

I cannot figure this out just yet, the third loader is an absolute bitch and my asm knowledge isn't quite there yet!
BippyM is offline  
Old 25 February 2007, 21:01   #18
Joe Maroni
Moderator

Joe Maroni's Avatar
 
Join Date: Feb 2003
Location: Germany
Age: 38
Posts: 1,278
Send a message via MSN to Joe Maroni
Quote:
Final remark. Remember that game with custom trackloader may be harder to fix then one file game. And don't give up. Every game is possible to fix ( but this may take some time ).
please show us some examples...the only tutorials i know use their own trackloaders.

it would be very helpful to get some easier tutorials...

or better a tutorial where nothing needs to be patched...
Joe Maroni is offline  
Old 26 February 2007, 13:10   #19
Asman
68k

Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 627
Quote:
Originally Posted by x_to
please show us some examples...the only tutorials i know use their own trackloaders.

it would be very helpful to get some easier tutorials...
Ok, I will prepare tutorial for one file games as soon as possible.

Gretz
Asman is offline  
Old 26 February 2007, 14:16   #20
Joe Maroni
Moderator

Joe Maroni's Avatar
 
Join Date: Feb 2003
Location: Germany
Age: 38
Posts: 1,278
Send a message via MSN to Joe Maroni
wonderful...

please write it as understandable as possible for us newbies...
Joe Maroni is offline  
AdSense AdSense  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using octamed as a slave Kola New to Emulation or Amiga scene 1 01 February 2010 21:44
Megatraveller slave BlueAchenar project.WHDLoad 157 03 May 2009 19:59
Slave for WorkBench Retro1234 project.WHDLoad 35 03 October 2008 15:16
Dogfight Slave.... killergorilla project.WHDLoad 63 28 July 2007 15:33

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 06:26.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.24596 seconds with 13 queries