Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How about using WinUAE 4.4.0's logger? #18

Open
tehKaiN opened this issue Jul 3, 2020 · 3 comments
Open

How about using WinUAE 4.4.0's logger? #18

tehKaiN opened this issue Jul 3, 2020 · 3 comments

Comments

@tehKaiN
Copy link
Contributor

tehKaiN commented Jul 3, 2020

I hope you don't have enough of me and my issues. ;)

The WinUAE 4.4.0 was released recently. It comes with printf-like logging, which works almost the same as your vscode-bound logger. Quoting the WinUAE release topic from EAB:

New easy to use and transparent printf()-like debug logging method for developers: simply write parameters to address $bfff00 (byte, word and long accepted) one by one, then format string to $bfff04 (must be long) and formatted log message will appear in log window. Address may change, currently only active if 128k UAE boot rom mode is enabled and accepts only %d, %u, %x, %p, %s and %b (BSTR). Quickly made for quick and easy UAESND AHI driver debug logging..

I think it'd be cool to be consistent and use same interface to pass the debug messages to vscode. This way, I can use same code to send messages to vscode and later give the exact same build to betatesters with uae logger enabled. It can be done with an ifdef and two code variants, which I already do, but having unified interface is better, I think. ;)

@BartmanAbyss
Copy link
Owner

Will have a look.

@BartmanAbyss
Copy link
Owner

I have now updated to WinUAE 4.4.0 so you can try to use it. Let me know if it works okay.

@tehKaiN
Copy link
Contributor Author

tehKaiN commented Aug 19, 2020

Yeah, it kinda works, with a bit of help. The text in debugger log is always red. UAE also uses this log for printing its internal stuff - perhaps there's a collision with some kind of your error printing?

Also, default.uae needs adding: debug_mem=true.

You can check the result using this fn:

static inline void uaeWrite(const char *szMsg) {
	volatile ULONG * const s_pUaeFmt = (ULONG *)0xBFFF04;
	*s_pUaeFmt = (ULONG)((UBYTE*)szMsg);
}

What do you think about it? Is merging with this serial interface worthwhile or does it collide with too many things?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants