Closed tehKaiN closed 4 years ago
I did some quick research and it seems that it's quite possible to add harddrive config via commandline param:
http://eab.abime.net/showthread.php?t=63719
Pretty please? It's probably the last thing I'll need ;)
The problem is, that "runme.exe" is hard-coded into WinUAE to detect the launch of the program for the debugger. I'm not sure how to do this any other way. Re. Mounting other harddrives: You are free to change the configuration in WinUAE, just make sure to save it as "default", and it will be used every time the debugger is started. Does this work for you?
Yeah, but I have like 3 games which I'm actively working on and having to rename executable / rebind folder each time in uae config is a bit tedious.
I'm not a node.js guy but I've managed to do a bit of changes in amigaDebug.js locally. I've added:
const objdumpPath = path.join(binPath, "opt/bin/m68k-amiga-elf-objdump.exe");
const dh0Path = path.join(binPath, "dh0/"); // <-- this is new
const ssPath = path.join(dh0Path, "s/startup-sequence"); //<-- this is new
At the end of UAE config prep:
// filesystem for launched exe
let runmePathSplit = (args.program + ".exe").split('/');
let runmeDir = runmePathSplit.slice(0, -1).join('\\');
config['filesystem2'] = 'rw,dh1:dh1:' + runmeDir + ',-128';
Instead of copying to runme.exe:
try {
let baseName = runmePathSplit.slice(-1)[0];
fs.writeFileSync(ssPath, 'cd dh1:\n:' + baseName);
}
catch (err) {
this.sendErrorResponse(response, 103, `Failed to rewrite startup sequence at ${ssPath}. ${err.toString()}`);
return;
}
EDIT: I've revised code above with additional progress. There are still 2 problems:
cd
cmd from original wb or a replacementI've implemented basic cd
functionality here: https://github.com/AmigaPorts/amiga-cd - it does the job for that startup sequence.
So the only piece of puzzle remaining is to pass executable name to winuae which triggers debugging. I'm not familiar with uae codebase. Do you have any idea on where to start digging to have it passed as param or via config option?
unfortunately the WinUAE param parsing code is very complex. It took me ages... I have only implemented a new option for config['debugging_features'] = 'gdbserver';
Maybe search for these terms?
merged. at least doesn't seem to break anything. next time, please test beforehand.
I can confirm that this works like a charm. I'll clean up my local changes and start a pull request!
Now since my library and games are building correctly, I still need one thing to be completely happy - ability to load files. Right now I see that there is a dh0 directory in extension's directory, which I assume is used to run the executable.
Would it be possible for extension to dynamically bind executable's original directory as UAE's main DH, so that when launching executable via debug task it'd be able to find files via relative paths?