Changes

Programming:Overscan

2,301 bytes added, 12:08, 7 October 2015
Category
Overscan simply means increasing the screen size past the normal 640×200 resolution by extending the screen into the borders.
 
This can be achieved in a number of ways, the simplest of which is to simply change some values in the CRTC registers and take advantage of a 32K screen.
 
In order to set up the CRTC properly you need to change registers 1 (Horizontal displayed), a full width screen would be around 48 characters, but you may like to use 50 to make sure you cover the left/right edges of the screen. Register 2 (HSYNC position) is then used to align the screen left/right so the picture appears in the middle. Register 6 (Vertical displayed) is used to extend the screen vertically, and register 7 (VSYNC position) to adjust the vertical position of the display.
 
Try the following from BASIC:
 
<pre>
cls
out &bc00,1:out &bd00,50
out &bc00,2:out &bd00,51
out &bc00,6:out &bd00,34
out &bc00,7:out &bd00,35
</pre>
 
The final step is to set the screen base address to cover 32K. This is done by exploiting a feature of the address decoding from the 6845 to the Gate Array. Address lines MA10 and MA11 from the 6845 are not used for screen address decoding and if you set them both to 1, at the address wrap-around they will increment address line MA12, providing the next bank of RAM as the screen base. This means the screen base address offset will wrap from #07FF to #4000 for the first scan line, #0FFF to #4800 for the second scan line and so forth.
 
out &bc00,12:out &bd00,&2c will give a screen that starts in bank 2 (#8000..#bfff) and then wraps into bank 3 (#c000..#ffff). Similarly, you can wrap from banks 0..1 with out &bd00,&0c, banks 1 and 2 with out &bd00,&1c and bank 3 back to bank 0 with out &bd00,&3c.
 
Unfortunately, all of these options mean that the screen either overlaps the restart block of memory at #0000..#003f or the high kernal jumpblock at #b900..#bfff. In order to get around this problem, I usually like to use banks 0 and 1, and offset the screen by #40 bytes by setting register 13 to #20. This will ensure that the screen memory used is #40..#3fff and #4000..?
 
[[User:Executioner|Executioner]]
 
 
Source code from the '''The Unofficial Amstrad WWW Resource''' to achieve overscan in assembler
 
<pre>
;; This example shows a simple method for a overscan
ret
</pre>
 
[[Category:Programming]]
[[Category:Source code]]
901
edits