Many games, for example, Maniac Mansion, or Kissenschlacht, use two screenmodes. Oftentimes, a bitmap mode for the main screen, and a text mode for the lower part which displays scores or whatever. Considering how the raster moves across the screen, it's not so hard to implement. It's basically, set up a raster interrupt, and then change the mode in the interrupt routine. Same way you open up the lower and upper borders.

Now, with careful timing, the left and right borders may be opened up too. So I'm wondering if a similar technique can be used to change the screen mode partway across a line, so that the whole screen is divided into, say, a textmode left half and a bitmapped right half. Has this ever been done or could it be done?

  • 4
    Definitely not on all scanlines since the C64 famously has 'bad lines' — lines where it is necessary to fetch tile map contents for that row, in which the CPU isn't actually running. So there's nobody about to change screen mode. On all the other lines I'll bet the answer is 'yes', as it is on almost every other comparable machine, but I don't actually know. So don't take that as an answer. – Tommy Sep 12 '18 at 14:39
  • In demos apparently yes: csdb.dk/release/?id=10881 – Alan B Nov 21 '18 at 16:27

[TL;DR] vertical rastersplit with different graphic modes is possible with some quirks, in practice one would rather write characters onto a full hires image.

I did some experiments, and found out that it is possible for the VIC chip to switch mode within a rasterline. However a practical application is hindered by the following issues:

  • Every 8th rasterline, the VIC chip is stopping the CPU for about 40 cycles. This is the so-called bad line. The CPU is stunned while the middle part of the screen is drawn, which makes it impossible to switch modes in the middle of a badline. This page has a very good depiction of the phenomen.
  • After switching between modes it seems that the transition is done in parts. First the color mode is changed to hires while the actual hires graphics appear around two chars later. The following image shows an example where the left side of the screen is in char mode while the right side is in hires mode. The last two characters of "COMMODORE" are already colored with hires function while shown as characters:

                             Horizontal split

That being said, when one can live with every 8th line on the left side being hires (could be colored in background color so it would be not visible) and when the two character wide transition border is concealed, a vertical split would be feasible.

See my question How to exactly sync to the raster line for a vertical raster split? for a short code example.

On a second thought, if the overall mode is hires it is possible to represent any text or blockgraphic from textmode, only printing a char requires 8 bytes to be poked instead of one. However, this is still much less effort than the raster split every line.

| improve this answer | |
  • 2
    You can prevent badlines by constantly tweaking the y scroll register so that the Vic never finds itself to have reached the first line of a new character row. Unfortunately I think it will just revert to its in-visible-area idle state of fetching and outputting the value at 3FFF on a black background once it runs past where it should have had a bad line, so I don't immediately have a means to make that observation especially helpful. – Tommy Jan 14 '19 at 19:55
  • 1
    @Tommy: $3fff in VIC 14-bit addressing. The actual byte read may be at $3fff, $7fff, $bfff or $ffff (always RAM), depending on the VIC page selected by CIA2. – Janka Jan 15 '19 at 5:27
  • Unless I'm mistaken, the only system of that era I knew that had official support for this sort of thing was the Nutting chip that was used in some of the Midway arcade games.IIRC it had a register based on the color clock that switched to/from text mode. Gorf used this maybe? I'd love to know if there were other examples that deliberately included this feature. – Maury Markowitz Jan 15 '19 at 20:37
  • 1
    That is a really interesting find! I've coded quite a bit on the C64, but never knew the VIC had this hidden screen-mode which is a mix of text-mode and bitmap-mode. Granted it's hard to exploit, since it's only there for 2 cycles per $D011-write. And the screen-mode itself isn't too flexible, since the screen-bytes both decides the character to show as well as its foreground + background color (each char is locked to a specific fg and bg color). But still, it might be useful for something - it's like an extended "extended color mode" (256 chars instead of 64 and 16 bg colors instead of 4). – Bjarke Aug 16 at 22:05

I'm going to go out on a limb; after thorough reading of The MOS 6567/6569 video controller (VIC-II) and its application in the Commodore 64:

  • graphics modes are directly selected by the bits in d011 and d016 (so e.g. they're not just latches that are copied somewhere else upon horizontal or vertical retrace); and
  • most of the pipeline is common, and runs at a fixed clock — the selected mode affects address calculation for pushing to a shift register, which is always some translation of the same mode-independent global counters; and translation of whatever comes out of the register.

No mention is made anywhere in the documentation of anything that would cause mode changes to take effect anything other than instantly, and the idea of raster effects that cause vertical boundaries is well-enough established that you can find the occasional argument about it.

Several vertical raster split demos are available on Youtube but alas I was unable to identify one that I could definitively say was a mode change rather than a palette effect.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.