![]() |
![]() |
#1 |
Registered User
Join Date: Feb 2019
Location: USA/Texas
Posts: 94
|
Assign floppy’s to different directories WHDLOAD Slave
Hello. I gave a question of assignment for floppys with different names and to call from different subdirectories each one. I have this code:
HTML Code:
_bootdos lea (_saveregs,pc),a0 movem.l d1-d3/d5-d7/a1-a2/a4-a6,(a0) move.l (a7)+,(11*4,a0) move.l (_resload,pc),a2 ;A2 = resload ;open doslib lea (_dosname,pc),a1 move.l (4),a6 jsr (_LVOOldOpenLibrary,a6) lea (_dosbase,pc),a0 move.l d0,(a0) move.l d0,a6 ;A6 = dosbase ;assigns lea _disk1(pc),a0 sub.l a1,a1 bsr _dos_assign lea _disk2(pc),a0 sub.l a1,a1 bsr _dos_assign HTML Code:
_disk1 dc.b "intro",0 ;for Assign _disk2 dc.b "game",0 ;for Assign _program dc.b "mainrun",0 _args dc.b "",10 ;must be LF terminated _args_end |
![]() |
![]() |
#2 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,454
|
load a1 with subdir string
|
![]() |
![]() |
#3 |
Registered User
Join Date: Feb 2019
Location: USA/Texas
Posts: 94
|
|
![]() |
![]() |
#4 |
Registered User
Join Date: Feb 2019
Location: USA/Texas
Posts: 94
|
I tested @JOTD. However, I made this test:
HTML Code:
;assigns lea _disk1(pc),a0 lea _dir1(pc),a1 ;sub.l a1,a1 bsr _dos_assign lea _disk2(pc),a0 lea _dir2(pc),a1 ;sub.l a1,a1 bsr _dos_assign ;assigns ; lea (_disk1,pc),a0 ; sub.l a1,a1 ; bsr _dos_assign lea _df0(pc),a0 sub.l a1,a1 bsr _dos_assign ;;;;;Exe1 ;load exe1 lea _program1(pc),a0 move.l a0,d1 jsr (_LVOLoadSeg,a6) move.l d0,d7 ;D7 = segment beq .program_err ;file not found ;run exe2 move.l d7,a1 add.l a1,a1 add.l a1,a1 lea (_args,pc),a0 move.l (4,a7),d0 ;stacksize sub.l #5*4,d0 ;required for MANX stack check movem.l d0/d7/a2/a6,-(a7) moveq #_args_end-_args,d0 jsr (4,a1) movem.l (a7)+,d1/d7/a2/a6 ;remove exe2 move.l d7,d1 jsr (_LVOUnLoadSeg,a6) ;;;;;Exe1 _disk1 dc.b "LOG",0 ;for Assign _disk2 dc.b "SIM",0 ;for Assign _dir1 dc.b "1_LOG",0 ;for Assign _dir2 dc.b "2_SIM",0 ;for Assign _program1 dc.b "MAIN",0 _args dc.b "",10 ;must be LF terminated _df0: dc.b "DF0",0 *_dir1 and _dir2 are the directories inside the default directory of the SLAVE and that directories are where whdload must go and search the files. For example if AmigaOS when you run MAIN exe it requires the Floppy called ‘LOG’ it will go to _dir1 to grab files from there, in other words the dir ‘1_LOG’, the same for _dir2 if the floppy ‘SIM’ is needed to be inserted by AmigaOS it must call to grab files inside the directory _dir2 in other words the directory ‘2_SIM’. *The routine ‘;load exe1’ I use to load and execute the program called MAIN that is located in the default directory of the slave. *When I run the slave it runs fine and runs the program but at some point exactly when you will be asked for the floppy _disk2, the ‘SIM’ floppy name or at some point around there crash with the error: HTML Code:
Exception "Illegal Instruction" ($10) at $FFDE694 (Task 'Initial CLI', Prg 'ROM trackdisk 34.1 (18 Aug 1987)' Off $1130, ExpMem occurred. Last edited by field3d; 29 June 2024 at 03:57. |
![]() |
![]() |
#5 |
Registered User
Join Date: Feb 2019
Location: USA/Texas
Posts: 94
|
Assembly Code Part of the Crash
I want to add that I detected debugging the assembly code the part that crash. Apparently is a routine involving load or making assignments of the floppy. The part that comes in the program is the insert disk called ‘SIM’ and in the normal floppies this part is wait for the floppy ‘SIM’ to be inserted to continue if you insert done. In the slave and the code I made making the assignment to A1 of that “SIM’ to the directory ‘2_SIM’ that part of the program crash, even never reaches the insert ‘SIM’ message or anything it goes straight to the crash.
Now the code of the program in that part of the crash is: HTML Code:
$0002102C MOVEM.L D0-07/A0-A6,-(A7) $00021030 MOVE.L (4), A6 $00021036 SUBA.L A1, A1 $00021038 JSR?-$126,A6) $0002103C MOVE.L D0,($2112C) $00021042 LEA ($2112C),A1 $00021048 JSR (-$162),A6 $0002104C LEA ($210CC),A1 $00021052 MOVE.L #$2111C,($E,A1) $0002105A MOVE.L ($2113C),D0 $00021060 CLR.L D1 $00021062 LEA ($210BA),A0 $00021068 JSR (-$1BC,A6) $0002106C TST.L D0 $0002106E BNE.W $210AE $00021072 LEA ($210CC),A1 $00021078 MOVE.W ($21140),($1C,A1) $00021080 MOVE.L ($21142),($2C,A1) $00021088 JSR (-$1C8,A6) *********************** $0002108C MOVE.L ($20,A1),($21146) $00021094 LEA ($2111C),A1 $0002109A JSR (-$168,A6) $0002109E LEA ($210CC),A1 $000210A4 JST (-$1C2,A6) $000210A8 MOVEM.L (A7)+,D0-D7/A0-A6 $000210AC RTS at $FFDE694 (Task 'Initial CLI', Prg 'ROM trackdisk 34.1 (18 Aug 1987)' Off $1130, ExpMem occurred.’ This segment code of the program are the vestiges of a routine for assignment, load file or read tracks or sectors? What could cause the crash in that line? Of course I understand is not possible know with exact precision but an idea or tip. In previous lines of the crash line ‘***********************’ what could be happening or what can be missing in the task? |
![]() |
![]() |
#6 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,454
|
JSR (-$1C8,A6) is exec.DoIo. Not related to assign.
but the error is at $FFDE694 not 21088. If it happens when you call there, it means that the program crashed the ROM, which is not good. |
![]() |
![]() |
#7 | |
Registered User
Join Date: Feb 2019
Location: USA/Texas
Posts: 94
|
Quote:
Well, I made test now instead of booting files I used the feature ‘DISKSONBOOT’ and booting from there runs perfect no errors. However, in the program never reaches the part in the same way that says insert the disk ‘SIM’ because is interrupted by this message: “REMOVE Write_Protection and Restart !”. Meaning that is considering the image made by DIC as disk write protected and of course maybe it tries to write and it can’t. In this cases, is there way similar than the assign but to write in a specific directory what it attempts to write and make believe the program the Disk.1 is writable? Or create a clean Disk.3 for this purpose and how is changed to write and make believe the Disk.3 is where needs to write? Or simply can I make believe the Disk.1 is writable and that in fact writes there?Or what is the accustomed here? I’m checking the both paths to see what is the best to do here if the bootdos or the disksonboot. |
|
![]() |
![]() |
#8 |
Registered User
Join Date: Feb 2019
Location: USA/Texas
Posts: 94
|
Working Now!
I made it working now regarding the crash. The crash I could fix with the next routine. No more crash:
HTML Code:
_disk1 dc.b "LOG",0 _disk2 dc.b "SIM",0 _dir1 dc.b "1_LOG",0 ;for Assign _dir2 dc.b "2_SIM",0 ;for Assign slv_CurrentDir dc.b "data",0 _program dc.b "MAIN",0 _args dc.b 10 _args_end dc.b 0 _dosbase dc.l 0 EVEN ;============================================================================ _bootdos move.l _resload(pc),a2 ;a2 = resload lea _dosname(pc),a1 ;Open doslib move.l (4),a6 jsr _LVOOldOpenLibrary(a6) lea (_dosbase,pc),a0 move.l d0,a6 ;A6 = dosbase ;enable cache move.l a0,-(A7) move.l #WCPUF_Base_NC|WCPUF_Exp_CB|WCPUF_Slave_CB|WCPUF_IC|WCPUF_DC|WCPUF_BC|WCPUF_SS|WCPUF_SB,d0 move.l #WCPUF_All,d1 jsr (resload_SetCPU,a2) lea _disk1(pc),a0 ;Assigns lea _dir1(pc),a1 ;;sub.l a1,a1 bsr _dos_assign lea _disk2(pc),a0 ;Assigns lea _dir2(pc),a1 ;;sub.l a1,a1 bsr _dos_assign lea _program(pc),a0 lea _args(pc),a1 moveq #_args_end-_args,d0 movem.l d0-a6,-(a7) move.l d0,d2 move.l a0,a3 move.l a1,a4 move.l a0,d1 jsr (_LVOLoadSeg,a6) move.l d0,d7 ;D7 = segment beq .end ;file not found ;call move.l d7,a1 add.l a1,a1 add.l a1,a1 IFD CHIP_ONLY move.l (a1),a0 add.l a0,a0 add.l a0,a0 move.l a0,$100.W ; segment #1 (not 0) ENDC move.l a4,a0 move.l ($44,a7),d0 ;stacksize sub.l #5*4,d0 ;required for MANX stack check movem.l d0/d7/a2/a6,-(a7) move.l d2,d0 ; argument string length jsr (4,a1) movem.l (a7)+,d1/d7/a2/a6 ;remove exe move.l d7,d1 jsr (_LVOUnLoadSeg,a6) movem.l (a7)+,d0-a6 rts Originally I have: HTML Code:
_disk2 dc.b "SIM",0 _dir1 dc.b "1_LOG",0 ;for Assign _dir2 dc.b "2_SIM",0 ;for Assign The test I made is to see if at least the assignment _disk2 it works. I change to: HTML Code:
_disk2 dc.b "!!!!!!SIM",0 _dir1 dc.b "1_LOG",0 ;for Assign _dir2 dc.b "2_SIM",0 ;for Assign HTML Code:
‘ _disk2 dc.b "SIM",0“ Is supposed it needs to go to the directory ‘2_SIM’ I have there the whole floppy but I have correct my assignment of that dir in the code or what could be happening? Now the crash is not happening but I have this issue. |
![]() |
![]() |
#9 |
Registered User
Join Date: Feb 2019
Location: USA/Texas
Posts: 94
|
Also if I make this test asks the floppy:
HTML Code:
_disk2 dc.b "SIM",0 _dir1 dc.b "1_LOG",0 ;for Assign _dir2 dc.b "!!!!!2_SIM",0 ;for Assign |
![]() |
![]() |
#10 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,492
|
Without seeing what "do_assign" does, it is hard to judge. The dos.library function "AssignAdd()" does what you want, or better still, the "assign" command.
You do not need to enable caches, that is what SetPatch does for you. Finally, I suggest not starting programs just with a jsr as this will not provide command line arguments to them properly. ReadArgs() will not be able to pick them up with this method - might be ok if it is your own program. I suggest "RunCommand()". Anyhow, if the attempt is just to load and execute a binary, "System()" does the job, or a custom startup-sequence. |
![]() |
![]() |
#11 | |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,311
|
Quote:
@OP: Only really general advice can be given. You will have to disasm/debug on your own. Generally I'd say don't mess with cache settings unless you're disabling them (which is usually a good start), and use the SNOOP option (with MMU) to check if any the programs are accessing hardware directly rather than going through DOS. |
|
![]() |
![]() |
#12 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,454
|
The "DISKSONBOOT" flag is probably a good option if game uses trackdisk. Ex: archon trackdisk
Code:
NUMDRIVES = 1 WPDRIVES = %1111 DISKSONBOOT BOOTBLOCK I suggest you use IRA + cheapres or AiraForce to perform a proper disassembly of the exe, see what it does at crucial points. Without disassembly, you can get lucky, or get stuck... Also there's the issue of detecting the proper disk / swap disks at the proper location. Reversing the game and patching it to switch disks before game checks them is often required, because most trackloading OS compliant games with more than 1 disk only use DF0: |
![]() |
![]() |
#13 |
Registered User
Join Date: Feb 2019
Location: USA/Texas
Posts: 94
|
@jotd @paraj @Thomas. Thank you for the tips. Finally I could make it work. Yes it was a check in a place with an intro we had from time ago and also I made a sequential load of 3 files in the same whdload so all the sequence is preserved as in the past. Now I will try to explore to make an Installer. But I tested now and it works very good. Yes @paraj is needed to disassemble deep some times, is something really frustrating some times but as in this case there is no other solution.
|
![]() |
![]() |
#14 |
Registered User
Join Date: Feb 2019
Location: USA/Texas
Posts: 94
|
Just one more comment. Exactly what is waiting this when you change a floppy?
HTML Code:
BTST #5, ($BFE001) BNE.B 3864a Also I wanted to ask if to change the quit Key to ‘*” is the key HEX 5D or that is the same if used in command line QuitKey=93 right? Because I test and works, however the splash screen of whdload shows PRTSCR as the exit key but is not why? Last edited by field3d; 01 July 2024 at 07:09. |
![]() |
![]() |
#15 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,454
|
this is DSKRDY flag. Just remove that for whdload. Use SNOOP to detect such stuff.
Intermixing OS stuff and hardware stuff is the worst. PRTSCR is probably different on another keyboard. Try a letter like "R" or space (0x40 = 64) it should display the proper key name. |
![]() |
![]() |
#16 | |
Registered User
Join Date: Feb 2019
Location: USA/Texas
Posts: 94
|
Quote:
Oh I see is a flag to check drive. This guys liked to be funny in that times. I will check SNOOP for next releases. Now in debugger of winaue I used the s xxxxxx 0 ffffffff where xxxxxx bytes search and from there take note of the bytes and insert the patch in the space and runs fine until now. I removed some other trash. Now, I’m in the las process to make one simply install. I had an issue with the code but I fixed. Thank you for the help Last edited by field3d; 01 July 2024 at 21:13. |
|
![]() |
![]() |
#17 |
Registered User
Join Date: Feb 2019
Location: USA/Texas
Posts: 94
|
@jotd I’m checking to see the SNOOp you mention. But I don’t know if is the correct one. I enabled in the commando line ‘SNOOP’ and it says the error: ‘ snooping requires at least a 68030“ and the splash screen never comes up.
Or if is inside the salve for example, how you kill the BTST #5, ($BFE001) instances? Any code for that? |
![]() |
![]() |
#18 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,454
|
If in game, just nop the btst and the bne using PL_NOP in patchlist. If in whdload slave, then it's stupid !
|
![]() |
![]() |
#19 |
Registered User
Join Date: Feb 2019
Location: USA/Texas
Posts: 94
|
Ok got it @jotd
|
![]() |
![]() |
#20 |
Registered User
Join Date: Feb 2019
Location: USA/Texas
Posts: 94
|
Finally I could totally complete. It was a nightmare. As you said @jotd on the live game I patched the simply 4e 71 instances, however it was not so easy because the funny guys who developed this made checksums or something. They detected that changes and they created an error of an illegal operation if you try to write bytes in the routine after load data and before start the program. When you ran program crashed ios course if you modded something. What I needed to do is make first a patch to intercept the routine who is at charge to run the last routine of the game after run and before decompress the routine of protection and test send a jsr to any memory $300 for example and a rts there and check if they detected and crashed my mod. I needed to check many times until I found a place they don’t check. If you write to any memory as the $300 no problem no crashes is just if you mod their code. Then I needed to patch that initial routine after tun the game and before decrunch and that will not crash for their checking if I modded. Then one patch is when run the game to make jump to memory $300 in the point where you can mod their code and there are no crashes and in that memory $300 when jumped the first initial location because I used a jsr $300 also send in that routine the bytes to mod the location after the decompress and is the final protection. That address does not appears initially. It appears long time after loading that is why needed the first patch to check this address. But there in that final protection I sent a second jsr to rest of other code for example $320 to make the final de-protection, in the $320 also I have 2 moves they use and execute and I run there so it continues the game normally after the rts. I needed to make double patches here and a long time to fire this. But now works very good and solid as also in the routines I checked with the registers to make the change of bytes in the proper locations as also the funny of this thing they change o memory locations, there are not fixated memory positions, they change it was a third problem added to the 2 patches. But using the registers they use to load and decompress you can find where to patch.
Now I miss to make icons. I’m having hard time to check something to make a real compatible icon .info from a png file. For example, I tried icon edit and the icon infos run very well in amitkit or modern installed workbench. They run fie there, but if I boot in BATOCERA or any retroarch the .lha the icon causes a problem and not boot. I know is the icon .info because if I change for any regular icon it boots perfectly in BATOCERA or others. I have my design and all in png that s why I need to do myself not use a previous icon. Then how can I make an icon .info real that is detected anywhere? |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Multiple ASSIGN's to merge directories under one drive | Stardust | support.AmigaOS | 7 | 28 July 2022 22:53 |
Changing directories | Biquet | support.FS-UAE | 3 | 02 May 2020 14:49 |
How to assign two separate game directories | amigappc | project.ClassicWB | 2 | 24 December 2015 14:49 |
EasyADF Sub Directories | chocolate_boy | support.Apps | 0 | 18 June 2014 16:21 |
Faster floppy file dialog for large directories? | rsn8887 | request.UAE Wishlist | 7 | 23 January 2012 06:31 |
|
|