English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 27 February 2019, 16:34   #1
mcgeezer
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
mcgeezer is offline  
Old 27 February 2019, 16:47   #2
meynaf
son of 68k
 
meynaf's Avatar
 
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.
meynaf is offline  
Old 27 February 2019, 18:16   #3
Toni Wilen
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.
Toni Wilen is online now  
Old 27 February 2019, 18:20   #4
zero
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.
zero is offline  
Old 27 February 2019, 20:17   #5
nogginthenog
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
nogginthenog is offline  
Old 27 February 2019, 22:15   #6
ross
Defendit numerus
 
ross's Avatar
 
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).

ross is offline  
Old 27 February 2019, 22:55   #7
mcgeezer
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.
mcgeezer is offline  
Old 27 February 2019, 23:08   #8
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by mcgeezer View Post
... the first was that I was using add21k instead of add44k for AGA
I really never advised you my "addchip" bootblock? I have to be really distracted

Reliable, can be used instead of all addxxk commands and also recovers the memory allocated for external drives.

['Memclear' is exactly what I mean ]
ross is offline  
Old 28 February 2019, 08:11   #9
mcgeezer
Registered User
 
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
Quote:
Originally Posted by ross View Post
I really never advised you my "addchip" bootblock? I have to be really distracted

Reliable, can be used instead of all addxxk commands and also recovers the memory allocated for external drives.

['Memclear' is exactly what I mean ]
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.
mcgeezer is offline  
Old 28 February 2019, 09:11   #10
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by mcgeezer View Post
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.
No more glitch over CLI screen on startup.

The bootblock can be expanded to cover MemClear function.

[Removed: use official Rygar release ]

Last edited by ross; 28 February 2019 at 21:22.
ross is offline  
Old 28 February 2019, 11:44   #11
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by mcgeezer View Post
I didn't (and still don't) have an easy way of writing the boot block.
Probably because you don't build the complete ADF image with a custom trackloader, but just an executable file which has to be loaded from an AmigaDOS file system?

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.
phx is offline  
Old 28 February 2019, 11:55   #12
roondar
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.
roondar is offline  
Old 01 March 2019, 04:37   #13
Hewitson
Registered User
 
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,771
Quote:
Originally Posted by phx View Post
automatize (is this a legal english word?)
Automate
Hewitson 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
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

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:34.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.18882 seconds with 15 queries