Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Artcore ! (Registered 2024-12-18) 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: 359
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: 5094
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: 2980
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
Quetzal/Chrome
Guests online: 88
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.6)
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 Layers  (9.6)
2 No Listen  (9.6)
3 Party Elk 2  (9.6)
4 Cubic Dream  (9.6)
5 Copper Booze  (9.6)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (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 Original Suppliers
1 Derbyshire Ram  (9.7)
2 Fungus  (9.3)
3 Black Beard  (9.2)
4 Baracuda  (9.2)
5 hedning  (9.1)

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