Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Critikill (CK) ! (Registered 2024-09-19) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > $D016 bit 5
2023-08-05 18:22
Krill

Registered: Apr 2002
Posts: 2940
$D016 bit 5

There is this mysterious bit early on in the KERNAL reset routine:
FCEF: 8E 16 D0  STX $D016     ; VIC: Control Register 2
with X being anything in [0..5].

Now, some people [who?] claim that without this store to $d016, some [which?] cartridges won't start [citation needed].

However, $D016 apparently used to have a mysterious "reset bit" in supposedly early VIC-II revisions (those with only 5 not 9 luma steps, and then the early ones of those).
   | Bit  5   |    Reset-Bit: 1 = Stop VIC (no Video Out, no RAM  |
   |          |                   refresh, no bus access)         |
Could this be the reason why some things on some machines (?) won't start without that store to $D016?
Do any machines still exist where setting $D016 to, say, $f8 would crash them (when running code from RAM)?
Or did this "reset bit" never exist? =)
 
... 66 posts hidden. Click here to view all posts....
 
2023-08-08 10:32
Martin Piper

Registered: Nov 2007
Posts: 699
I suppose from the German: https://riff.2ix.at/c64/vic-txt.html

Das RES-Bit (Bit 5) von Register $d016 ist bei den bisher untersuchten VIC 6567/6569 ohne Funktion. Beim 6566 dient dieses Bit dazu, den VIC zu stoppen.
2023-08-08 11:32
tlr

Registered: Sep 2003
Posts: 1762
Quoting Krill
Could this be the reason why some things on some machines (?) won't start without that store to $D016?
Do any machines still exist where setting $D016 to, say, $f8 would crash them (when running code from RAM)?
Or did this "reset bit" never exist? =)

Is there an example of a particular cartridge lacking that store, not starting on a certain machine?

I think that store was usually omitted when replicating the startup code. I for one never included it.
2023-08-08 12:16
chatGPZ

Registered: Dec 2001
Posts: 11290
That said, it'd also be interesting where AAY64 copied the info from - i only remember that bit being described as "stop" or "test" bit (whatever that means).

And who owns a Max Machine and can run test programs? :)
2023-08-08 12:22
tlr

Registered: Sep 2003
Posts: 1762
Quoting chatGPZ
That said, it'd also be interesting where AAY64 copied the info from - i only remember that bit being described as "stop" or "test" bit (whatever that means).

It's called RES here: http://archive.6502.org/datasheets/mos_6567_vic_ii_preliminary...

Mapping the C64 states:
Bit 5:  Bit 5 controls the VIC-II chip Reset line.  Setting this bit
to 1 will completely stop the video chip from operating.  On older
64s, the screen will go black.  It should always be set to 0 to insure
normal operation of the chip.

Quoting chatGPZ
And who owns a Max Machine and can run test programs? :)

Looks like Macbeth might have one judging from recent videos.
2023-08-08 12:27
tlr

Registered: Sep 2003
Posts: 1762
Also in the C64 Programmer's Reference (second printing 1983), p447, this is stated:
"The reset bit (RES) in register 22 ($16) is not used for normal operation. Therefore it should be set to "0" when initializing the video chip. When set to a "1," the entire operation of the video chip is suspended, including video outputs and sync, memory refresh, and system bus access."

pdf: http://cini.classiccmp.org/pdf/Commodore/C64%20Programmer%27s%2..
2023-08-08 12:59
chatGPZ

Registered: Dec 2001
Posts: 11290
Posted a request here

Interestingly, the german "64 Intern" (which is basically a ripoff/translation of the PRG) does not describe bit 5 at all. To me that hints at it perhaps being removed from later editions of the PRG too. Maybe :)
2023-08-08 14:09
ws

Registered: Apr 2012
Posts: 248
Hej, just something i remembered is, that exactly this (screen going black, machine halting) happened to me a long time ago on my C128 in C64 mode while fiddling around with D016.
I remember this, because that is how i initially learned that one shouldn't just write untreated values into any register ("Oh, that is what this AND + OR is for!").
Sadly i don't own that machine anymore. Did anyone try this on a C128 (the reduced C64-like case version, not D)?
Please excuse if i am too far off topic.
2023-08-08 14:20
tlr

Registered: Sep 2003
Posts: 1762
Quote: Hej, just something i remembered is, that exactly this (screen going black, machine halting) happened to me a long time ago on my C128 in C64 mode while fiddling around with D016.
I remember this, because that is how i initially learned that one shouldn't just write untreated values into any register ("Oh, that is what this AND + OR is for!").
Sadly i don't own that machine anymore. Did anyone try this on a C128 (the reduced C64-like case version, not D)?
Please excuse if i am too far off topic.


The C128 PRG does state for $d016: "5 ALWAYS SET THIS BIT TO 0"

here (p547): https://www.pagetable.com/docs/Commodore%20128%20Programmer%27s..

Never noted that before but I've never really dug into the C128. Does that bit do anything?
2023-08-08 15:20
Jetboy

Registered: Jul 2006
Posts: 265
It does.
I remember fixing some demos to write nicely to $d016 to be able to run them on my c128. There were not many that needed that. I don't remember which ones were those. It was 25++ years ago :)
2023-08-08 15:31
chatGPZ

Registered: Dec 2001
Posts: 11290
And you don't mix it up with $d030?
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 - 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
MWR/Visdom
Guests online: 83
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 Uncensored  (9.6)
7 Comaland 100%  (9.6)
8 Wonderland XIV  (9.6)
9 No Bounds  (9.6)
10 Unboxed  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Rainbow Connection  (9.5)
6 It's More Fun to Com..  (9.5)
7 Morph  (9.5)
8 Dawnfall V1.1  (9.5)
9 Onscreen 5k  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Nostalgia  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.2)
Top Coders
1 Axis  (9.9)
2 Graham  (9.8)
3 Crossbow  (9.8)
4 Lft  (9.8)
5 HCL  (9.8)

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