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 > C128, VIC, 2Mhz, Border
2013-08-17 20:09
Monte Carlos

Registered: Jun 2004
Posts: 351
C128, VIC, 2Mhz, Border

There is this trick to switch C128 to 2Mhz in the border and back to 1Mz in the non border area. When you open upper/lower border you see also display bugs in the former border area where C64 would display the ghostbyte and $d021. Risen from Oblivion displays many effects (on VIC) also in the open border areas, which seems contradictous. This led me to the question if there is a way to avoid these display bugs in the opened upper/lower borders, for example by setting an invalid VIC mode (eg extcolor+graphic)? Can these be covered with sprites?
2013-08-17 20:31
Oswald

Registered: Apr 2002
Posts: 5017
its pointless. if you hide the display bug by invalid mode, then you are almost at the same point as not opening it. in 2mhz mode VIC will always read what the CPU left on the bus, so you will get a "random ghostbyte" noise with opened borders (unless you use the feat to display gfx, like the very first part of RFO) to hide that you have to set d021 to black. invalid modes I have no idea what they do with the ghostbyte probably keep it all black.

sprites will also have the effect that VIC will read what the cpu left on the bus (every 2nd cycle), so it will be a mess.

the boris pic on the border is done by using 1mhz, except messing up the VICII so much by the testbit in d030, that it will draw gfx instead of border. Exactly how this works I've no idea.
2013-08-18 12:45
Krill

Registered: Apr 2002
Posts: 2844
I guess a bit of semi-correct theory is in order.

In 1 MHz mode, VIC and CPU access the bus alternatingly. On the rising edge of a clock cycle, the CPU issues a read or write on the bus, and on the falling edge, the VIC will access the bus to read a value from memory. (During VIC DMA, like badlines or sprite fetches, the VIC hogs both edges, thus the CPU must be stalled.)

Now, in 2 MHz mode, the VIC does not issue any commands on the bus, its bus pins will be tri-stated, reading whatever is put on the bus in every other CPU cycle.
Furthermore, no VIC DMA is performed, so there are no CPU stalls for badlines or sprite fetches.

Thus, the CPU can control directly what the VIC reads, and effects like the full-screen hires display in Risen From Oblivion can be achieved by executing a chain of 2-cycle ops, with a literal operand being read as the pattern to be displayed, i.e., lda #pattern1 : lda #pattern2 : lda #pattern3, etc.
(This code must be aligned correctly, otherwise the VIC will display the op-codes instead of the operands.)
Using this in a meaningful way for manipulating character and sprite fetches is a lot trickier, as both op-codes and operands will be read as video data. It should be possible to toggle between 1 and 2 MHz modes in the right places, but that does not seem easier, either.

$D030 has 2 used bits. Bit 0 is used to set 1 or 2 MHz mode, and bit 1 will increase VIC's internal line counter by 1 for every clock cycle it is set. This can be used to skip over border lines, so bitmap or character graphics can be displayed where VIC would normally display border, as it was done in the aforementioned part displaying a Boris Vallejo picture (trivia: it's from a book cover - http://www.paperbackfantasies.jjelmquist.com/images/boris/Brack..).
It can also be used to achieve a screen refresh rate higher than 50 Hz on PAL, by simply skipping over a fixed amount of lines per frame, or display real PAL/NTSC interlace, or mess with the colour phase, switching red and green components of the video signal, as done in the final VIC part of RFO, re: frogs.

Coming back to the original question:
Using an illegal display mode while the border is open would simply display black in the border area. Putting sprites there in 2 MHz mode is possible, but as outlined above, it will be difficult to make them display meaningful patterns.

What exactly do you want to do? :)
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
csabanw
Krill/Plush
LDX#40
Sentinel/Excess/TREX
Guests online: 154
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 S!R  (9.9)
3 Antitrack  (9.8)
4 Mr Zero Page  (9.8)
5 OTD  (9.8)

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