Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"mochaExplorer.files": "src/test/suite/*.test.ts",
"mochaExplorer.require": "ts-node/register",
"testExplorer.hideEmptyLog": false,
"testExplorer.useNativeTesting": true,
"testExplorer.useNativeTesting": true,
"[m68k]": {
"editor.rulers": []
},
}
Binary file added bin/win32/fs-uae/DiskLed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/DiskLed_On.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/FloppyLed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/FloppyLed_On.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/InfoBackgroundGradient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/KLockLed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/KLockLed_On.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/MLockLed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/MLockLed_On.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/NotificationCursor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/NotificationInfo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/NotificationKeyboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/NotificationPause.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/NotificationWarning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/NotificationWarp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/PowerLed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/PowerLed_On.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/SDL2.dll
Binary file not shown.
Binary file added bin/win32/fs-uae/SDL2_ttf.dll
Binary file not shown.
Binary file added bin/win32/fs-uae/SairaCondensed-Bold.ttf
Binary file not shown.
Binary file added bin/win32/fs-uae/SairaCondensed-Medium.ttf
Binary file not shown.
Binary file added bin/win32/fs-uae/SairaCondensed-Regular.ttf
Binary file not shown.
Binary file added bin/win32/fs-uae/SairaCondensed-SemiBold.ttf
Binary file not shown.
Binary file added bin/win32/fs-uae/ShortcutKeyAlt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/TitleBarCloseIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/TitleBarMaximizeIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/TitleBarMenuIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/TitleBarMinimizeIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/TitleBarWithShadow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/VSyncLed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/VSyncLed_Alt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bin/win32/fs-uae/VSyncLed_On.png
1 change: 1 addition & 0 deletions bin/win32/fs-uae/Version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Binary file added bin/win32/fs-uae/fs-uae-device-helper.exe
Binary file not shown.
Binary file added bin/win32/fs-uae/fs-uae.dat
Binary file not shown.
Binary file added bin/win32/fs-uae/fs-uae.exe
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please strip the exe (and maybe all the DLLs)? it's way too big

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bin folder is already big (446 MB) and fs-uae will add another 109 MB.

How would you prefer to distribute it? Perhaps the entire bin folder should be a separate repo and be included as a submodule?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just strip the debug symbols from the exe/dll and it should be fine.

Also please don‘t set fsuae as default. This would affect all users and can be unexpected.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay stripped debug symbols and fs-uae folder is down from 109 to 35 MB!

Changed default emulator to be WinUAE for Windows and FS-UAE for linux/darwin as in previous release.

Binary file not shown.
Binary file added bin/win32/fs-uae/libbrotlicommon.dll
Binary file not shown.
Binary file added bin/win32/fs-uae/libbrotlidec.dll
Binary file not shown.
Binary file added bin/win32/fs-uae/libbz2-1.dll
Binary file not shown.
Binary file added bin/win32/fs-uae/libfreetype-6.dll
Binary file not shown.
Binary file added bin/win32/fs-uae/libglib-2.0-0.dll
Binary file not shown.
Binary file added bin/win32/fs-uae/libgraphite2.dll
Binary file not shown.
Binary file added bin/win32/fs-uae/libharfbuzz-0.dll
Binary file not shown.
Binary file added bin/win32/fs-uae/libiconv-2.dll
Binary file not shown.
Binary file added bin/win32/fs-uae/libintl-8.dll
Binary file not shown.
Binary file added bin/win32/fs-uae/libmpeg2-0.dll
Binary file not shown.
Binary file added bin/win32/fs-uae/libmpeg2convert-0.dll
Binary file not shown.
Binary file added bin/win32/fs-uae/libpcre2-8-0.dll
Binary file not shown.
Binary file added bin/win32/fs-uae/libpng16-16.dll
Binary file not shown.
Binary file added bin/win32/fs-uae/libstdc++-6.dll
Binary file not shown.
Binary file added bin/win32/fs-uae/libwinpthread-1.dll
Binary file not shown.
Binary file added bin/win32/fs-uae/zlib1.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,30 @@
},
"description": "Addtional CLI arguments for emulator",
"default": []
},
"noExtension": {
"type": "boolean",
"description": "Build binary with no extension (omit .exe)",
"default": false
},
"emulatorType": {
"type": "string",
"description": "Emulator to use: fs-uae or winuae",
"default": "fs-uae",
"enum": [
"fs-uae",
"winuae"
]
},
"stopOnEntry": {
"type": "boolean",
"description": "Stop the debugger on entry",
"default": false
},
"noDebug": {
"type": "boolean",
"description": "Run the emulator without debugger support",
"default": false
}
}
}
Expand Down
88 changes: 56 additions & 32 deletions src/amigaDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ interface LaunchRequestArguments extends DebugProtocol.LaunchRequestArguments {
slowmem?: string; // '0', '512k', '1M', '1.8M'
ntsc?: boolean; // NTSC mode
emuargs?: string[]; // Additional CLI arguments for emulator
noExtension?: boolean; // default: false — build binary with no extension
emulatorType?: string; // 'fs-uae' | 'winuae', default: 'fs-uae'
stopOnEntry?: boolean; // default: false — stop debugger on entry
}

class ExtendedVariable {
Expand Down Expand Up @@ -193,8 +196,15 @@ export class AmigaDebugSession extends LoggingDebugSession {
let config = new Map<string, string>();

const exePath = path.dirname(args.program);
const exeName = path.basename(args.program) + ".exe";
const debugTrigger = args.endcli ? exeName : ':' + exeName;
const exeName = args.noExtension
? path.basename(args.program)
: path.basename(args.program) + ".exe";
const debugTrigger = args.noDebug
? exeName
: (args.endcli ? exeName : ':' + exeName);

const useWinUAE = (args.emulatorType === 'winuae');
const useFSUAE = !useWinUAE; // fs-uae is default
const machine = args.config?.toLowerCase();

if (args.kickstart && !fs.existsSync(args.kickstart)) {
Expand All @@ -206,7 +216,7 @@ export class AmigaDebugSession extends LoggingDebugSession {
return;
}

if (isWin) {
if (useWinUAE) {
// WinUAE:

try {
Expand Down Expand Up @@ -279,30 +289,32 @@ export class AmigaDebugSession extends LoggingDebugSession {
config.set('filesystem', 'rw,dh0:' + dh0Path);
config.set('filesystem2', 'rw,dh1:dh1:' + exePath + ',-128');
// debugging options
config.set('debugging_features', 'gdbserver');
config.set('debugging_trigger', debugTrigger);
if(!args.noDebug) {
config.set('debugging_features', 'gdbserver');
config.set('debugging_trigger', debugTrigger);
}
// video
config.set('ntsc', args.ntsc ? 'true' : 'false');

// safety
config.delete('statefile');

// Optional override memory config
// Optional override memory config (values in KB for WinUAE config)
switch(args.chipmem?.toLowerCase()) {
case '256k':
config.set('chipmem_size', '0');
config.set('chipmem_size', '256');
break;
case '512k':
config.set('chipmem_size', '1');
config.set('chipmem_size', '512');
break;
case '1m':
config.set('chipmem_size', '2');
config.set('chipmem_size', '1024');
break;
case '1.5m':
config.set('chipmem_size', '3');
config.set('chipmem_size', '1536');
break;
case '2m':
config.set('chipmem_size', '4');
config.set('chipmem_size', '2048');
break;
default:
config.delete('chipmem_size');
Expand All @@ -314,30 +326,30 @@ export class AmigaDebugSession extends LoggingDebugSession {
config.set('fastmem_size', '0');
break;
case '64k':
config.set('fastmem_size_k', '64');
config.set('fastmem_size', '64');
break;
case '128k':
config.set('fastmem_size_k', '128');
config.set('fastmem_size', '128');
break;
case '256k':
config.set('fastmem_size_k', '256');
config.set('fastmem_size', '256');
break;
case '512k':
case '0.5m':
case '.5m':
config.set('fastmem_size_k', '512');
config.set('fastmem_size', '512');
break;
case '1m':
config.set('fastmem_size', '1');
config.set('fastmem_size', '1024');
break;
case '2m':
config.set('fastmem_size', '2');
config.set('fastmem_size', '2048');
break;
case '4m':
config.set('fastmem_size', '4');
config.set('fastmem_size', '4096');
break;
case '8m':
config.set('fastmem_size', '8');
config.set('fastmem_size', '8192');
break;
default:
config.delete('fastmem_size');
Expand All @@ -349,13 +361,13 @@ export class AmigaDebugSession extends LoggingDebugSession {
config.set('bogomem_size', '0');
break;
case '512k':
config.set('bogomem_size', '2');
config.set('bogomem_size', '512');
break;
case '1m':
config.set('bogomem_size', '4');
config.set('bogomem_size', '1024');
break;
case '1.8m':
config.set('bogomem_size', '7');
config.set('bogomem_size', '1792');
break;
default:
config.delete('bogomem_size');
Expand Down Expand Up @@ -389,9 +401,11 @@ export class AmigaDebugSession extends LoggingDebugSession {
config.set('hard_drive_0', dh0Path);
config.set('hard_drive_1', exePath);
// debugging options
config.set('remote_debugger', "20");
config.set('remote_debugger_port', "2345");
config.set('remote_debugger_trigger', debugTrigger);
if(!args.noDebug) {
config.set('remote_debugger', "20");
config.set('remote_debugger_port', "2345");
config.set('remote_debugger_trigger', debugTrigger);
}
// video
config.set('ntsc_mode', args.ntsc ? '1' : '0');
// specify savestate dir so we don't overwrite user's default FS-UAE save slots
Expand All @@ -402,7 +416,7 @@ export class AmigaDebugSession extends LoggingDebugSession {
}
// args.cpuboard: no FS-UAE equivalent?

// Optional override memory config
// Optional override memory config (values in MB for FS-UAE)
switch(args.chipmem?.toLowerCase()) {
case '256k':
config.set('chip_memory', '256');
Expand Down Expand Up @@ -471,15 +485,15 @@ export class AmigaDebugSession extends LoggingDebugSession {
}
}

const emuPath = isWin
const emuPath = useWinUAE
? path.join(binPath, "winuae-gdb.exe")
: path.join(binPath, "fs-uae", "fs-uae");
: path.join(binPath, "fs-uae", isWin ? "fs-uae.exe" : "fs-uae");

if(args.emuargs === undefined)
args.emuargs = [];

const emuArgs = [
...(isWin
...(useWinUAE
// all WinUAE options now in config file
? [ '-portable' ]
// FS-UAE options as args
Expand All @@ -500,8 +514,9 @@ export class AmigaDebugSession extends LoggingDebugSession {
return;
}

if (!fs.existsSync(args.program + ".exe")) {
this.sendErrorResponse(response, 103, `Unable to find executable file at ${args.program}.exe.`);
const exeFile = args.noExtension ? args.program : args.program + ".exe";
if (!fs.existsSync(exeFile)) {
this.sendErrorResponse(response, 103, `Unable to find executable file at ${exeFile}.`);
return;
}

Expand Down Expand Up @@ -547,7 +562,7 @@ export class AmigaDebugSession extends LoggingDebugSession {
}

// launch Emulator
const cwd = isWin
const cwd = useWinUAE
? dirname(emuPath)
// CWD determines location for debug_save/debug_load on FS-UAE
: vscode.workspace.workspaceFolders[0].uri.fsPath;
Expand All @@ -568,6 +583,12 @@ export class AmigaDebugSession extends LoggingDebugSession {
this.sendErrorResponse(response, 103, `Emulator error. ${err.toString()}`);
});

if(args.noDebug) {
// No debugger — just launch emulator and return success
this.sendResponse(response);
return;
}

// init debugger
this.miDebugger = new MI2(gdbPath, gdbArgs);
this.miDebugger.procEnv = { XDG_CACHE_HOME: gdbPath, HOME: gdbPath }; // to shut up GDB about index cache directory
Expand All @@ -583,6 +604,9 @@ export class AmigaDebugSession extends LoggingDebugSession {
this.symbolTable.relocate(sections);
this.started = true;
this.sendResponse(response);
if(args.stopOnEntry) {
this.sendEvent(new StoppedEvent('entry', this.currentThreadId));
}
} else {
this.sendErrorResponse(response, 103, 'no sections found');
}
Expand Down