A simple effect I remember seeing in many intros & demos was what I always called a “Widescreen” effect. This is where the top and bottom borders extended all the way to the edge of the screen. It gives the impression of parts of the side border being removed. There are methods for actually removing both the top and bottom borders, but that’s more complicated and something I will look at in the future. For now, I will look at using the raster bar to toggle the screen and border colours at specific scan lines to give the impression of a wide screen display.
The effect is generated by setting the border colour to the screen colour on a certain scan line and then resetting it at a second scan line. First up, we need to do some initialsation. I use the kernal routine as $e544 to clear the screen and then set the screen background colour (located at $d021) to black. Next up it’s time to enable raster interrupts. To create the wide screen effect, I want to trigger the first interrupt at scan line 50 – which is the first line of the screen display (after the border).
There are two routines here that will be called. The first – widetop – sets the border colour to black (note the code also sets the background colour, but this can be removed here). It then adjusts the interrupt vector to point at the next routine – widebot and sets it to be called at scan line 250 – which is the first scan line of the bottom border. The widebot routine resets the border colour back to dark blue to complete the widescreen effect. It also adjusts the interrupt vector to point back at widetop and resets it to be triggered at scan line 50.
After the building and running the code, I got this result:
Almost – but those two rasters are not “latched” correctly to the right side of the screen. We need to add some delay into the code to ensure they latch correctly before changing the border colour. To achieve this, I experimented with the timing and found it required 22 cycles to have it latch correctly. I decided to add a latch routine to the bottom of the code. The jsr and rts instructions both take 6 cycles each. With a small loop added, this totaled up to the 22 cycles needed and was inserted as the first thing to execute in each interrupt.
Building and running this version gave us a nice looking wide screen effect and stable rasters:
The code is available on github here.