27 February 2019, 16:34 | #1 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
WinUAE/Real Hardware Memory Differences
Hi all,
So I have a situation where I have an ADF of my game which works in a base 1200 config on WinUAE but does not on Real Hardware (base config). I was having a chat with @alpine9000 and he mentioned that WinUAE would always seem to clear/zero any declared bytes (ds.b/ds.w/ds.l) and a real Amiga would not necessarily do this so I'm wondering if this could be part of the problem? Even looking into my code I can see some instances of where I'm not initializing enough bytes in some of these arrays... but is the theory correct? Another quick question... is it work me nulling each block of allocated memory before I occupy it... I guess is could be in there too. On the stock winuae I even have enforcer running but it isn't popping up with anything (where normally it would in these situations). Any help is appreciated. Geezer |
27 February 2019, 16:47 | #2 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,322
|
Data declared as DS directives is guaranteed to be zero except in code-bss or data-bss sections (= code/data sections with bss at the end).
You don't need to clear allocated data by hand, AllocMem will do that for you if you pass in the relevant flag. Under winuae the situation isn't very different. Only thing, memory is normally zeroed upon startup. But don't count on it, as it's no longer zero as soon as some program has used it (even if a reboot occurs). Enforcer detects completely illegal accesses, not accesses to uninitialized memory. |
27 February 2019, 18:16 | #3 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
|
RAM chips at power up contain partially random bit patterns (depends on internal row/column details so it can depend on size and manufacturer etc..). I don't have enough information to emulate it properly. It is not simply random.
Assuming it is dos loaded executable, you can try this: http://eab.abime.net/showthread.php?t=91321 It detects many kinds of invalid accesses that enforcer and similar utilities can't. |
27 February 2019, 18:20 | #4 |
Registered User
Join Date: Jun 2016
Location: UK
Posts: 428
|
I'd have thought it's more likely to be something like a slightly different version of Kickstart than the random contents of memory causing your code to work.
|
27 February 2019, 20:17 | #5 |
Amigan
Join Date: Feb 2012
Location: London
Posts: 1,309
|
Run Mungwall on your real Amiga. It fills ram with data. Using it with enforcer is even better.
http://www.memphisamigagroup.net/dis...l/MungWall.doc |
27 February 2019, 22:15 | #6 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Do a little program, the first on s-s, that allocate all the RAM (using the clear flag).
Release the memory. Launch Rygar. If there is no more a crash then is the pseudo-random pattern on RAM of a real machine (a memory leak somewhere in your code that read a "bad" value for a variable). |
27 February 2019, 22:55 | #7 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
Thanks for responses all... @Toni I will certainly look at the UAEDBG tool...looks excellent.
I've managed to fix this, I recreated the ADF for starters and changed two things... the first was that I was using add21k instead of add44k for AGA, but I also added a tool called 'Memclear' which zero'd out all of the ram. Probably still have an issue in the code somewhere but at least it is mostly fixed. |
27 February 2019, 23:08 | #8 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
Reliable, can be used instead of all addxxk commands and also recovers the memory allocated for external drives. ['Memclear' is exactly what I mean ] |
|
28 February 2019, 08:11 | #9 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
I think you might have recommended that at some point but if i recall I couldn't compile it but as well, I didn't (and still don't) have an easy way of writing the boot block.
|
28 February 2019, 09:11 | #10 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
The bootblock can be expanded to cover MemClear function. [Removed: use official Rygar release ] Last edited by ross; 28 February 2019 at 21:22. |
|
28 February 2019, 11:44 | #11 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
If you don't want a trackloader (which is what I pefer for simplicity and efficiency) you might further automatize (is this a legal english word?) the process by including some open source ADF tools into your project, which can write files to OFS/FFS formatted images. I do not remember what the best tools were. Maybe something like http://lclevy.free.fr/adflib/ or http://lallafa.de/blog/amiga-projects/amitools/xdftool/ ? With an ADF image automatically built you could easily attach your custom boot block as well. |
|
28 February 2019, 11:55 | #12 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,406
|
There are a few bootblock tools on Aminet as well (though not all of them generate a correct checksum ). IIRC, http://aminet.net/package/disk/moni/BB20 works well, as does http://aminet.net/package/disk/misc/BootWriter
However, I'm not at my development PC right now and I recall trying several before I found one that worked so it is possible I'm misremembering which one I ended up using before I started using PHX's disk image writing tool and skipping on the OS altogether. |
01 March 2019, 04:37 | #13 |
Registered User
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,771
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
What are the differences between this and WinUAE? | Foebane | support.FS-UAE | 21 | 02 April 2018 21:06 |
WINUAE MIPS vs Real Hardware MIPS on SysMon | antiriad76 | support.WinUAE | 1 | 26 May 2017 20:12 |
WinUAE debugger differences | pmc | support.WinUAE | 2 | 05 October 2011 12:57 |
differences in ram consuming winuae vs real 1200 | _ThEcRoW | support.WinUAE | 9 | 02 May 2006 13:01 |
|
|