Skip to navigation


Drawing the screen: B%

[Acorn Electron version, Loader]

Name: B% [Show more] Type: Variable Category: Drawing the screen Summary: VDU commands for changing to a standard mode 4 screen
Context: See this variable in context in the source code Variations: See code variations for this variable in the different versions References: This variable is used as follows: * Elite loader (Part 2 of 5) uses B%

This block contains the bytes that get written by OSWRCH to set up the screen mode (this is equivalent to using the VDU statement in BASIC). The Electron version of Elite is unique in that it uses a standard mode 4 screen, rather than the custom square mode used in the BBC versions. This is because the Electron lacks the 6845 CRTC chip, which the BBC versions use to customise the mode. To make the Electron screen appear square like the BBC versions, there is a blank 32-byte (&20-byte) margin on each end of each character row, so each character row consists of 32 blank bytes on the left, then a page (256 bytes) of screen memory containing the game display, then another 32 blank bytes on the right. Screen memory is from &5800 to &7FFF, and the bottom row from &7EC0 to &7FFF is left blank, again to be consistent with look of the BBC version. This means the screen takes up more memory on the Electron version than on the BBC versions, despite showing the same amount of content. On top of this, the Electron also lacks the Video ULA of the BBC Micro, so the famous split-screen mode of the BBC versions can't be implemented in the Electron version, as the BBC versions reprogram the ULA to create the coloured dashboard. As a result, not only does the Electron suffer from the bigger memory footprint of the screen, it also has to stick to the same palette for the whole screen, so while the space view is the same monochrome mode 4 view as in the BBC versions, the dashboard has to be in the same screen mode, so it's also monochrome (though it has twice the number of horizontal pixels as the four-colour mode 5 dashboard of the BBC versions, so it is noticeably sharper, at least). The following are also set up: * The text window is 9 rows high and 15 columns wide, and is at (8, 10) * The cursor is disabled
.B% EQUB 22, 4 \ Switch to screen mode 4 IF DISC EQUB 28 \ Define a text window as follows: EQUB 8, 19, 23, 10 \ \ * Left = 8 \ * Right = 23 \ * Top = 10 \ * Bottom = 19 \ \ i.e. 9 rows high, 15 columns wide at (8, 10) ELSE EQUB 28 \ Define a text window as follows: EQUB 8, 23, 23, 14 \ \ * Left = 8 \ * Right = 23 \ * Top = 14 \ * Bottom = 23 \ \ i.e. 9 rows high, 15 columns wide at (8, 14) \ \ This is slightly lower than the default window, as \ otherwise the cassette's loading message overwrites \ the main code file as it loads into screen memory ENDIF EQUB 23, 1, 0, 0 \ Disable the cursor EQUB 0, 0, 0 EQUB 0, 0, 0