English Amiga Board


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

 
 
Thread Tools
Old 14 June 2022, 17:03   #1
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,337
Ambermoon WHDLoad

Ambermoon for the Amiga is being developed once again (in conjunction with Ambermoon.net for other platforms) to add new content and fix remaining bugs.

The code has been re-sourced using Ghidra and can be re-assembled. It has had various functional bugs patched and has been changed to be able to be built as a single binary (down from 4 separate binaries).

I'm just taking a look at what AmigaOS/CPU compatibility bugs the WHDload script for Ambermoon tries to fix.

It tries to patch the following files

Ambermoon_intro
Ambermoon_extro
Fantasy_intro

The notes say "fixed access fault due vbr access"

Can a WHDLoad "expert" describe to be what I am reading in the slave source?

Code:
_pde4en_fantasy_x PL_START
		PL_W	$fe,$4e71	;skip getting vbr
		PL_P	$ff2,_intack
		PL_P	$1010,_intack20
		PL_END
Is it trying to replaces the WORD (16-bits) at file-offset $fe (within the depacked Fantasy_intro file) with the value $4e71 (NOP)?

If I depack the original file Fantasy_intro and look at file-offset $fe it has the opcode $4e75 (RTS) which is not what I was expecting.

So I am I reading the slave ASM wrong?

Last edited by alexh; 14 June 2022 at 17:16.
alexh is offline  
Old 14 June 2022, 17:29   #2
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,959
I dont coded long time slave for WHDload, but this is offset to first hunk start code, not to begining of exe file. Then you must skip some extra bytes, minimum 36 bytes, if this is exe with only one hunk.
Don_Adan is offline  
Old 14 June 2022, 20:08   #3
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,337
Good call
alexh is offline  
Old 14 June 2022, 20:43   #4
Wepl
Moderator
 
Wepl's Avatar
 
Join Date: Nov 2001
Location: Germany
Posts: 866
Yes, the given offset is the offset of the relocated binary. If you load it in ReSource or process via IRA it will show you this offset.
There is a short description of the patch commands here: https://whdload.de/docs/autodoc.html#resload_Patch
Wepl is offline  
Old 15 June 2022, 06:35   #5
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,337
Quote:
Originally Posted by Wepl View Post
Yes, the given offset is the offset of the relocated binary. If you load it in ReSource or process via IRA it will show you this offset.
Thanks I'll try that.

Another question: Are all the "skip getting vbr" patches a consequence of using WHDload? They are not compatibility fixes but necessary to run WHDload without the NoVBRMove option?

Quote:
By default WHDLoad moves the vector table using the VBR (Vector Base Register) to a different memory location. This has the advantage that the installed program cannot change the vector table, which increases security and stability of WHDLoad greatly. Some installed programs will not correctly work with a moved vector table. The reason for this may be that the installed program uses processor exceptions or is doing other strange stuff.
I don't quite know what Ambermoon is doing when it reads the VBR, I think it is part of it's 68000 / 68010+ detection routine.
alexh is offline  
Old 15 June 2022, 11:07   #6
Wepl
Moderator
 
Wepl's Avatar
 
Join Date: Nov 2001
Location: Germany
Posts: 866
Quote:
Originally Posted by alexh View Post
Another question: Are all the "skip getting vbr" patches a consequence of using WHDload? They are not compatibility fixes but necessary to run WHDload without the NoVBRMove option?
Yes, running under WHDLoad it should not read/change the vbr.
Quote:
Originally Posted by alexh View Post
I don't quite know what Ambermoon is doing when it reads the VBR, I think it is part of it's 68000 / 68010+ detection routine.
Maybe it's setting interrupt vectors directly?
Wepl 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
Ambermoon frikilokooo Retrogaming General Discussion 681 08 May 2023 10:16
Ambermoon whdload ? Tony Landais project.WHDLoad 125 06 June 2020 15:46
Ambermoon? esc Retrogaming General Discussion 4 10 February 2017 12:16
Ambermoon help Claz support.Games 26 15 June 2014 20:06
Ambermoon rmcin329 support.Games 17 27 December 2010 22:59

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 22:51.

Top

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