English Amiga Board


Go Back   English Amiga Board > Support > support.FS-UAE

 
 
Thread Tools
Old 28 December 2021, 14:42   #1
girv
Mostly Harmless

girv's Avatar
 
Join Date: Aug 2004
Location: Northern Ireland
Posts: 1,030
Debug output from Amiga code?

I'd like to get debug text output on the FSUAE console/log from Amiga side code, with minimal cost on the Amiga side. Ideally it would be something like Amiga code setting up RawDoFmt-style arguments and triggering something on the host side to format and output them.

The Amiga code would be a game, running without the OS, so using the usual library functions or squirting stuff down the serial port isn't possible and/or fast enough to not disturb the Amiga side.

I believe patched versions of WinUAE exist with this kind of feature but I've not found anything for FSUAE.

I've seen mention of lua scripting that might help, but I can't find any guides or examples, only a few years-old snippets.

Open to suggestions...

Last edited by girv; 28 December 2021 at 14:42. Reason: formatting
girv is offline  
Old 28 December 2021, 17:05   #2
jbl007
Registered User
 
Join Date: Mar 2013
Location: Leipzig/Germany
Posts: 442
I'm not sure what the primary goals of the lua shell were but it was later used to control the emulator, not to debug the running software.
http://eab.abime.net/showthread.php?t=76800
https://lallafa.de/blog/2015/04/a-lua-shell-for-fs-uae/

Perhaps this is more helpful for you:
https://lallafa.de/blog/2016/09/libt...er-for-fs-uae/

or that:
https://github.com/cnvogelg/ucon
https://github.com/cnvogelg/fs-uae/tree/ucon
jbl007 is offline  
Old 28 December 2021, 17:34   #3
deimos
It's coming back!

deimos's Avatar
 
Join Date: Jul 2018
Location: comp.sys.amiga
Posts: 762
Quote:
Originally Posted by girv View Post
I believe patched versions of WinUAE exist with this kind of feature but I've not found anything for FSUAE.
You mean something like the way Bartman's VSCode / WinUAE works, but for FS-UAE?

Code:
__attribute__((noinline)) __attribute__((optimize("O1")))
void KPrintF(const char* fmt, ...) {
	va_list vl;
	va_start(vl, fmt);
	long(*UaeDbgLog)(long mode, const char* string) = (long(*)(long, const char*))0xf0ff60;
	if(*((UWORD *)UaeDbgLog) == 0x4eb9 || *((UWORD *)UaeDbgLog) == 0xa00e) {
		char temp[128];
		RawDoFmt((CONST_STRPTR)fmt, vl, PutChar, temp);
		UaeDbgLog(86, temp);
	} else {
		RawDoFmt((CONST_STRPTR)fmt, vl, KPutCharX, 0);
	}
}
deimos is offline  
Old 28 December 2021, 20:30   #4
girv
Mostly Harmless

girv's Avatar
 
Join Date: Aug 2004
Location: Northern Ireland
Posts: 1,030
Quote:
Originally Posted by deimos View Post
You mean something like the way Bartman's VSCode / WinUAE works, but for FS-UAE?

Kind of, yes, but with the format part happening on the host side as well.


I was thinking lua because it looks like it can trap or at least examine the Amiga memory. Something like the Amiga code loads known addresses with a "command" value and some parameters in just a couple of 68k instructions, then the lua side detects that and performs the "command" (eg: logging a printf string).
girv is offline  
Old 28 December 2021, 20:31   #5
girv
Mostly Harmless

girv's Avatar
 
Join Date: Aug 2004
Location: Northern Ireland
Posts: 1,030
Quote:
Originally Posted by jbl007 View Post
I'm not sure what the primary goals of the lua shell were but it was later used to control the emulator, not to debug the running software

I meant the base lua scripting built in to FSUAE. How does it work? What can it do?
girv is offline  
Old 06 February 2022, 12:35   #6
girv
Mostly Harmless

girv's Avatar
 
Join Date: Aug 2004
Location: Northern Ireland
Posts: 1,030
FWIW, I ported the 0xbfff00 debug output and on-the-fly warpmode switching (any config setting really) from WinUAE to my local build of FS-UAE quite easiy.
girv 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
Assembler files and C in GCC / bartman's amiga-debug zero Coders. C/C++ 11 12 March 2021 16:17
Amiga 600 vs Amiga 1200 Composite Output Quality Marle support.Hardware 2 22 March 2020 23:20
Sending debug output to the serial port OS3.x NovaCoder Coders. C/C++ 0 18 February 2013 06:56
Help me debug my shitty code? h0ffman Coders. General 13 22 March 2011 15:17
Avoid debug output? Flinx support.WinUAE 0 23 July 2002 09:35

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 08:54.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Page generated in 0.07308 seconds with 13 queries