10 January 2016, 13:56 | #1 |
Posts: n/a
|
Help with creating Slave (for Journey to the center of the earth).
I'm working on a slave for "Journey to the Center of the Earth".
The problem I'm having right now is all paths are hardcoded to df0: in a lot of places in the binary and I was hoping there is a better way than to patch all those places? The game uses a lot of OS calls so I'm using kick13.s. I tried _dos_assign with df0: but that didn't work. Is there a way to "unassign" it from inside my slave? Or is there another way? Best regards, Puppe |
10 January 2016, 16:31 | #2 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Just patch Open() in dos.library and skip the first 4 bytes in the file name if they contain "df0:".
|
10 January 2016, 22:01 | #3 |
Posts: n/a
|
Clever, I'll try that.
|
12 January 2016, 19:49 | #4 |
Moderator
Join Date: Nov 2001
Location: Germany
Posts: 866
|
|
16 January 2016, 20:08 | #5 |
Posts: n/a
|
How do I use it? I tried calling it like this first in _cb_dosLoadSeg:
Code:
_cb_dosLoadSeg: lea diskname(pc),a0 sub.l a1,a1 bsr _dos_assign Code:
diskname: dc.b "fd0", 0 I also tried it in bootearly like this: Code:
IFD BOOTEARLY _bootearly ;assigns lea diskname(pc),a0 sub.l a1,a1 bsr _dos_assign rts diskname dc.b "df0",0 ENDC I managed to patch Open (thanks stingray) by modifying kick13.s and this works. But I guess I should be able to patch it from within my slave, but I can't figure out how to get the address of Open() from within my slave. Any ideas? Last edited by puppe; 16 January 2016 at 20:16. |
16 January 2016, 20:42 | #6 | ||||
Moderator
Join Date: Nov 2001
Location: Germany
Posts: 866
|
Quote:
This makes not much sense because it will add this assign multiple times for every LoadSeg call. Normally you would use _bootdos which replaces the startup-sequence. In rare cases it may be feasible to use _cb_dosLoadSeg instead if there is a lot of logic in the startup-sequence and you don't want to rebuild that in the Slave. But then you should make sure _dos_assign is called only one time. Quote:
Quote:
Quote:
dos.library cannot be patched easily under 1.x because it's written in BCPL and doesn't use a standard jump table. Try to use _bootdos and _dos_assign. If it doesn't work post your source. |
||||
16 January 2016, 20:56 | #7 | |||
Posts: n/a
|
Quote:
Yes, it's "df0" in my source file. Quote:
Quote:
Thanks for your help. |
|||
16 January 2016, 21:16 | #8 |
Posts: n/a
|
Using _bootdos and _dos_assign (used the kick13.asm example) it now works.
Now on to making the game compatible with whdload. |
16 January 2016, 21:53 | #9 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,200
|
It is possible to patch 1.3 doslib I ve written a generic macro (see AnotherWorld whdload slave source for full example).
Code:
; A6: DosBase ; you must define your own new_Read or new_Lock and somewhere / in the end you must ; move.l old_Lock(pc),-(A7) ; rts ; if you want to jump to the old routine PATCH_DOSLIB_OFFSET:MACRO movem.l d0-d1/a0-a1,-(a7) move.l A6,A1 add.l #_LVO\1,A1 moveq #0,D0 move.w 4(A1),D0 addq.l #4,D0 add.l D0,A1 lea old_\1(pc),a0 move.l A1,(A0)+ move.l A6,A1 add.l #_LVO\1,A1 move.b 1(A1),D0 ext.w D0 ext.l D0 move.l D0,(A0) ; moves to d0_value_xxx move.w #$4EF9,(A1)+ pea new_\1_init(pc) move.l (A7)+,(A1)+ bra.b end_patch_\1 new_\1_init move.l d0_value_\1(pc),d0 bra new_\1 old_\1: dc.l 0 d0_value_\1 dc.l 0 end_patch_\1: movem.l (a7)+,d0-d1/a0-a1 ENDM A normal lib patch would look like this Code:
PATCH_XXXLIB_OFFSET:MACRO movem.l d0-d1/a0-a1,-(a7) move.l A6,A1 add.l #_LVO\1,A1 lea old_\1(pc),a0 move.l 2(A1),(A0) move.w #$4EF9,(A1)+ pea new_\1(pc) move.l (A7)+,(A1)+ bra.b end_patch_\1 old_\1: dc.l 0 end_patch_\1: movem.l (a7)+,d0-d1/a0-a1 ENDM But assigning df0 has always worked. I used the patch - on a open in write mode to write the final size of the file which avoids flashing - on a read to patch protections in bytecode (another world, monkey I and i,...) Last edited by jotd; 16 January 2016 at 22:09. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Journey To The Center Of The Earth en ger fr | turrican3 | Games images which need to be WHDified | 0 | 15 April 2015 02:59 |
Z-Out with a center Adventec logo | Vollldo | support.Games | 5 | 06 September 2010 22:36 |
Automatic center problem | bagpipes | support.WinUAE | 2 | 20 August 2010 13:02 |
Anyone seen this? Emu Control Center | MrX_Cuci | project.GameBase Amiga | 83 | 22 July 2008 22:44 |
|
|