Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > what is your RAM init pattern?
2016-04-27 19:49
chatGPZ

Registered: Dec 2001
Posts: 11386
what is your RAM init pattern?

since i stumbled about yet another case of some ancient demo that relies on uninitialized RAM - and which would only work if you change the default VICE uses currently - i think its about time to collect some hard data about this phenomenon and perhaps at the end add proper configuration for it to VICE (or even choose a better default).

background: when you power on your C64, the RAM will not be zero, instead (about) half of the RAM cells will be 1, and the other half will be 0. this results in some kind of pattern (mostly) consisting of $00 and $ff. for example if you start VICE, then enter the monitor and look at a page of RAM it shows this:

(C:$e5d4) m c000 c0ff
>C:c000  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
>C:c010  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
>C:c020  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
>C:c030  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
>C:c040  ff ff ff ff  ff ff ff ff  ff ff ff ff  ff ff ff ff   ................
>C:c050  ff ff ff ff  ff ff ff ff  ff ff ff ff  ff ff ff ff   ................
>C:c060  ff ff ff ff  ff ff ff ff  ff ff ff ff  ff ff ff ff   ................
>C:c070  ff ff ff ff  ff ff ff ff  ff ff ff ff  ff ff ff ff   ................
>C:c080  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
>C:c090  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
>C:c0a0  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
>C:c0b0  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
>C:c0c0  ff ff ff ff  ff ff ff ff  ff ff ff ff  ff ff ff ff   ................
>C:c0d0  ff ff ff ff  ff ff ff ff  ff ff ff ff  ff ff ff ff   ................
>C:c0e0  ff ff ff ff  ff ff ff ff  ff ff ff ff  ff ff ff ff   ................
>C:c0f0  ff ff ff ff  ff ff ff ff  ff ff ff ff  ff ff ff ff   ................


this is the default pattern, which could be shortened to "64 times $00, 64 times $ff, repeat"

now i'd like to know how it looks like on your (real) C64... if you have some cartridge with ML monitor, all you need to do is power on your c64, check some memory page, and post the pattern here (you can ignore that some values wont actually be 0 or $ff - what matters is the general trend). additionally it would be extra cool if you could look into your C64 and post the type of RAM chips that it uses as well (since the pattern most likely depends on them) - they are labelled 4164 or 4464 or 41464 (please post everything written on it, the exact type and manufacturer is interesting here). Also please post the ASSY NO of the board, as the way RAM is wired up matters as well.

thanks for your help!

PS: if you are curious, Typical is the demo in question... if you can name other examples ("works in CCS64 but not in VICE is often an indicator for it), please post them too!
 
... 47 posts hidden. Click here to view all posts....
 
2016-04-28 08:00
tlr

Registered: Sep 2003
Posts: 1790
Quote: Isn't convenient to analyze the 00-3ff area? I think is the primary cause of programs malfunctions...

Everything except the stack is initialized on reset...

I don't think it's especially common to rely on the initial contents of the $0100-$01ff area.
2016-04-28 09:24
lft

Registered: Jul 2007
Posts: 369
Is this true for all the common carts too?
2016-04-28 09:47
tlr

Registered: Sep 2003
Posts: 1790
Yes, most probably. In carts there are obviously some modifications to vectors and things like this though.
2016-04-28 10:36
Flavioweb

Registered: Nov 2011
Posts: 463
What make ram cells have the values they have after a cold start?
Is a "internal ram chip" question or some external factor can influence them?
Maybe bus 'activity' or other chips init?
Reading this Gpz sentence:
Quote:
repeating ff,ff,00,00,00,00,ff,ff pattern, every $4000 bytes the pattern seems to be inverted (for another $4000 bytes). occasional random bytes

i started thinking if Vic init-activity can influence ram values...
FF/00 are values usually "leaved" on bus by vic during normal operations...
2016-04-28 11:04
chatGPZ

Registered: Dec 2001
Posts: 11386
IAN: what an epic thread that is - we've come a long way since then :)

others: if you post dumps, try to post a page at least, that makes it much easier to see patterns. if you dont want to type it all out, you could also just save c000-d000 in monitor and send the resulting file to me via email. (in this case please put assy no and ram type in the filename AND add the same info in the mail itself)
2016-04-28 11:09
chatGPZ

Registered: Dec 2001
Posts: 11386
Quote:
What make ram cells have the values they have after a cold start?
Is a "internal ram chip" question or some external factor can influence them?
Maybe bus 'activity' or other chips init?

its simple law of physics - at poweron the internal flipflops will flip to either 0 or 1 randomly, roughly with a 50:50 chance. now the actual pattern you see results from the internal organisation of the RAM chips, for example neighboured cells may more likely flip into the same state. additionally *some* RAMs apparently contain reset circuitry that actually makes them start up in a defined way (i dont think this is a case for those old RAMs as found in C64s though).
other chips having an impact on the behaviour is unlikely IMHO - because for that to happen the write line of the RAM would have to be pulled low actively from somewhere, which shouldnt happen at poweron.
2016-04-28 11:16
tlr

Registered: Sep 2003
Posts: 1790
It's DRAM we are talking about so the memory cells do not consist of flip-flops. They are basically caps.

I agree that the pattern probably arises from the organisation of the cells. Perhaps half of the cells are referenced to VDD?
2016-04-28 11:22
chatGPZ

Registered: Dec 2001
Posts: 11386
ok perhaps i should have written "RAM cells" :)
2016-04-28 13:32
tlr

Registered: Sep 2003
Posts: 1790
An important point about the cells being caps is that they aren't going to have 50:50 to land in any state. The most likely state is uncharged, which will mean 1 or 0 depending on if it is referenced to VDD or GND. Upon a power cycle all cells will (surprisingly slowly) fade towards the uncharged state. A quick power cycle will likely keep most contents.

The source of the spurious bits in the initial state could be due to how the refresh logic is implemented perhaps? E.g an initial glitch that injects some random bits. Remember that there are no resets to the ram chips so some strange startup behaviour is likely.
2016-04-28 14:14
chatGPZ

Registered: Dec 2001
Posts: 11386
sounds convincing :)

infact, now that i checked all my C64s (updates in the repo coming soon) i can say that even the one that first showed a seemingly random pattern (like TMR posted) dropped to mostly $00 and $ff after powering it off for several minutes.
Previous - 1 | 2 | 3 | 4 | 5 | 6 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Brittle/Dentifrice^(?)
Guests online: 80
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Fullscreen Graphicians
1 Joe  (9.7)
2 Sulevi  (9.6)
3 The Sarge  (9.6)
4 Veto  (9.6)
5 Facet  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.058 sec.