English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 07 January 2022, 20:43   #1
Oriens
Registered User

 
Join Date: Aug 2019
Location: Narbonne / France
Posts: 17
Real Time memory display

Just want to share a small change I've done to help me debugging my current game.
As an equivalent of good old "printf" I was looking for a real time display of some memory space, to help real time debug (see the value without stopping execution). I found nothing so I changed source code to display some memory on WinUAE hud.

At the bottom of screen I display 8 bytes, representing memory $100 to $107 (unused memory I think).
In my code, I can copy anything into that space and see them while running the game.
This helped me a lot debugging my game.

Last edited by Oriens; 08 January 2022 at 21:12.
Oriens is offline  
Old 08 January 2022, 11:41   #2
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,727
That's an interesting idea, neat way to output data for debugging.
StingRay is offline  
Old 08 January 2022, 12:11   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 47
Posts: 25,381
Looks useful in some situations. But $100 isn't unused enough for all purposes and adding special cases to Chip RAM accesses isn't optimal.

There is also following logging method which can be extended to also show values written to similar addresses (unused CIA space). I'll think about it.

From changelog:

Quote:
- 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).
Quote:
- $bfff00 debug logging word/long behavior changed. Format string without %l (except pointers: %p, %s and %b) is now consided word even if long was written to $bfff00.
Quote:
- Added b1 debug logging format string flags and width specifier support (except floating point values). Alternate use mode implemented: write pointer to argument array to $BFFF08, then format string to $BFFF04. In this mode %d/%u/%x is assumed to be word wide, %ld/%lu/%lx long word wide (like exec/RawDoFmt). %c was missing.
Toni Wilen is online now  
Old 08 January 2022, 12:47   #4
Tomislav
Registered User

 
Join Date: Aug 2014
Location: Zagreb / Croatia
Posts: 302
Never assume that some part of memory is unused. Use AllocMem to allocate memory or reserve space in program. Eventually you can use AllocAbs which returns NULL if memory is already occupied or not enough memory.
Tomislav is offline  
Old 08 January 2022, 12:53   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 47
Posts: 25,381
Quote:
Originally Posted by Tomislav View Post
Never assume that some part of memory is unused. Use AllocMem to allocate memory or reserve space in program. Eventually you can use AllocAbs which returns NULL if memory is already occupied or not enough memory.
Everyone knows that but I think you missed the point. It is a debugging feature that should work even if you don't allocate anything. It should use address space that is never used.

You can't even allocate memory from $100 anyway. Or from CIA space
Toni Wilen is online now  
Old 08 January 2022, 21:10   #6
Oriens
Registered User

 
Join Date: Aug 2019
Location: Narbonne / France
Posts: 17
Thanks for the feedback. I need to add that I mainly work for OCS machine and my game (or demo) are not using the system (boot and trackload).
This small hack is surely not suitable for all needs (but for me, it is realy convenient).
Oriens is offline  
Old 08 January 2022, 21:12   #7
Oriens
Registered User

 
Join Date: Aug 2019
Location: Narbonne / France
Posts: 17
Quote:
Originally Posted by Toni Wilen View Post
Looks useful in some situations. But $100 isn't unused enough for all purposes and adding special cases to Chip RAM accesses isn't optimal.

There is also following logging method which can be extended to also show values written to similar addresses (unused CIA space). I'll think about it.

From changelog:
Thanks. I was not aware of these. I'll check.
Oriens 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
WANTED - A1000 Real time clock "A-time" loggio MarketPlace 0 21 August 2020 04:40
Display memory usage during a game Brick Nash support.WinUAE 1 18 September 2017 18:30
Display date and time in menu bar edd_jedi project.ClassicWB 7 16 March 2014 08:54
display issue (real amiga) DaveMB support.WinUAE 5 29 August 2011 02:09
What display do you use for real Amiga? kixs New to Emulation or Amiga scene 47 18 November 2007 23:48

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 17:04.


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