New modes, legacy mode support, double-buffering support#68
New modes, legacy mode support, double-buffering support#68breakintoprogram merged 1 commit intobreakintoprogram:mainfrom julianregel:vdpdev
Conversation
|
I've added a couple of simple test programs to my repo that demonstrate the screen modes and double buffering: https://github.com/julianregel/agonprograms |
|
I've pulled down VDP 1.04 RC1 and tried @julianregel test programs. Using Finding still that MODE0 and MODE2 are not able to sync properly / well to my VGA monitor. |
Hi. The new modes are not incorporated into the 1.04RC1 build yet (as far as I can see), so the test program won't show any difference on your monitor yet. |
|
Thank you for all your hard work sorting this out - I'll test this next week and merge into the main branch for the next release. |
|
Thanks for merging my PR. If testing goes well and the code is adopted into the VDP, please could I get a name check in the list of contributors? Thanks :-) |
This PR comprises the following features:
In order to faciliate the last two, additional VDU parameters have been created as extensions to the VDU 23,0 command. The rationale for this approach is that VDU 23,0 is used for manipulating the registers on the CRTC (on the BBC) and similar functions on the Agon Light VDP. Both of the extensions created could be seen from the perspective of setting registers in the VDP to provide the required functionality.
New screen modes
These screen modes have been chosen as the resolutions and refresh rates that should be compatible with the majority (all?) VGA/SVGA monitors. This could be considered the "standard" set of screen modes. Some of the more non-standard, esoteric modes suggested by the community are not included in this PR as they require additional testing.
The following screen modes are defined in the PR:
VGA standard resolutions and refresh rates
SVGA resolutions and refresh rates
Additionally, beyond VGA, the following SVGA modes are included:
Double Buffered Modes
The following modes implement double buffering. They are numbered as the non-buffered mode numbers + 128. This is similar to how "Shadow" modes were implemented on the BBC B+/Master. There is insufficient memory to support Modes 128 (640x480 in 16 colours) and 131 (640x240 in 64 colours) and these are therefore described as invalid modes in the table below.
Legacy screen mode support
The new screen modes are grouped together logically by resolution and then by decreasing number of colours. The current (VDP 1.03) modes are not structured in this way. In order to provide backwards compatibility for existing screen modes, following command has been added: VDU 23,0,193
This VDU command will set the VDP to support the modes listed above, or the original four modes defined in VDP 1.03. The options are:
Note: in the current implementation, running the MODE command after running the VDU command will only take effect if you are changing to a different numbered screen mode. For example, if you are in mode 0, make the VDU change and then try and set mode 0 again, it will not recognise the new mode. You must change to a different mode first.
Support for double buffered screen modes
Selecting a double buffered screen mode will cause all writes to go to the back buffer and will therefore not be visible to the user. In order to display these writes, the screen buffers need to be swapped. In order to enable this, a new VDU command has been implemented: VDU 23,0,195
This allows the programmer to issue a set of drawing commands to the back buffer and then swap the buffers at the time of their choosing.
[Side note: Why not VDU 23,0,194? This is currently being used in my VDP dev environment for other functionality that is not yet complete!]