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 > $D016 bit 5
2023-08-05 18:22
Krill

Registered: Apr 2002
Posts: 2980
$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-07 18:18
Monte Carlos

Registered: Jun 2004
Posts: 361
It's good to have different sights on the same thing, although if it gets a one man show, the constructive discussion suffers a lot.
2023-08-07 19:15
Krill

Registered: Apr 2002
Posts: 2980
What iAN CooG and Monte Carlos said.

Quoting Groepaz
AFAIK this bit is only needed/used in the VICII of the MAX Machine. If at all :)
Quoting tlr
The reset bit does not do anything on the 6569R1. I'm guessing early 6567's, maybe only prototypes even?

How likely is it that some (NTSC) C-64 have one of those early VIC-II revisions?
And if unlikely, why could a cartridge fail to start without that store to $d016?
2023-08-07 19:36
chatGPZ

Registered: Dec 2001
Posts: 11386
Quote:
How likely is it that some (NTSC) C-64 have one of those early VIC-II revisions?

"uncommon but not rare" :) The first batch(es) had the early VICIIs (obviously) - whats probably unlikely is that someone is still using these (64 cycles and everything)
Quote:
And if unlikely, why could a cartridge fail to start without that store to $d016?

Could be as simple as "some broken code relies on the value in the register", who knows - i'd like to know who made those claims about which cartridges though (that would give us a chance to answer that question, perhaps).
2023-08-07 20:38
Krill

Registered: Apr 2002
Posts: 2980
Quoting Groepaz
i'd like to know who made those claims about which cartridges though (that would give us a chance to answer that question, perhaps).
Will ask them to chime in. One of the best current coders on this machine, though, with many games under the belt. =)
Was stumped as well by a bug report of one of the testers and the fix.

Some sort of (yet unemulated) VIC-II startup state (unrelated to the reset bit) that only gets unlocked by a store to $D016 is ruled out?
2023-08-07 21:28
chatGPZ

Registered: Dec 2001
Posts: 11386
I'd never rule out weird things like that.... That strange behaviour with one of the sprites that some VICII show was also quite unexpected :)

But as said, without knowing more details its all (a bit pointless) speculation. Once we know these, we can knock up tests and ask people to run them - and we can find out what exactly is happening.
2023-08-08 10:30
Martin Piper

Registered: Nov 2007
Posts: 723
http://janklingel.de/wordpress/wp-content/uploads/2020/08/MOS-6..

"The RES bit (bit 5) of register $d016 has no function on the VIC 6567/6569 examined as yet. On the 6566, this bit is used to stop the VIC."

6566...

Wikipedia: "MOS Technology 6566 – designed for SRAM/non-muxed address lines (used in the MAX Machine)"

So... SRAM, no need for refresh, by normal reading or by scheduling forced row address _RAS strobes.
2023-08-08 10:32
Martin Piper

Registered: Nov 2007
Posts: 723
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: 1790
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: 11386
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: 1790
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.
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
Chesser/Blazon
Guests online: 249
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 X-Mas Demo 2024  (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 Booze Design  (9.3)
2 Oxyron  (9.3)
3 Performers  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 Tim  (9.7)

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