Authors
Publication
Pub Details
Date
Pages
Amongst the differences between the Spectrum and the 2068, there are the 2068’s video modes. These modes are not directly reached by BASIC. To use them, we must write some routines in machine language. This machine code toolkit is for the mode called “extended color”. If we type in normal mode:
CIRCLE 125,87,50:PLOT 0,87:DRAW 1,0,255
we will see the flash attribute on eight bytes. In the extended color mode, each display file byte has its own attribute byte. The color resolution is multiplied by eight.
There is no use of POKES with the toolkit. When we need to pass some information to the machine code routine, we use the form:
INPUT USR add,x,y
where add is the routine entry point, and x & y are the information needed by the routine.
First type in the HEXLOADER program and SAVE it to tape. RUN the program and wait. If an error is detected, the line number will be printed. If there are no errors in the DATA statements,an error report “OUT OF DATA” will occur. Then RUN 550 to. save the toolkit code.
RANDOMIZE USR 62000 Switches the extended color mode on and a welcome message should be printed at the top of the screen. If not, type PRINT USR 0 and LOAD the HEXLOADER to check the DATA lines for any errors. Remember, its very important to CLEAR 61999 before switching into extended mode.
Here is a summary of the toolkit’s routines:
- RANDOMIZE USR 62000
- enables D FILE2
- RANDOMIZE USR 62048
- clears D FILE1 and D FILE2. CLS will only clear D FILE1. If we have something on the screen and we want to change the ink color without erasing the screen, INK x:RAND USR 62051 will do it. This entry point erases only D FILE2, i.e. the attribute file.
- INPUT USR 62069,X,Y
- attributes on PLOT. X=(8*PAPER)+INK. If we want a plot with yellow ink on blue paper, then X=(8*1)+6=14 Y=FLASH/BRIGHT
if Y=1 then BRIGHT 1
Y=2 then FLASH 1
Y=3 then BRIGHT 1 and FLASH 1
Y=0 then BRIGHT 1 and FLASH 1
These two arguments are not optional. - INPUT USR 62105,X,Y
- fills a zone with the attribute X and Y. X=(8*PAPER)+INK Y=FLASH/BRIGHT For example, enter CIRCLE 125,87,80 and PLOT INVERSE 1,125,87 to determine the filling starting point. If the screen PAPER is black and INK is yellow (if not, use PAPER 0:INK 6:RAND USR 62051), type INPUT USR 62105, 14,0 to fill the circle with green INK because X=(8*0)+6=14
- PRINT AT X,Y;INK/ PAPER/ FLASH/ BRIGHT;CHR$
USR 62220 - prints the variable s$ with the different attributes than the current screen attributes. For example:
10 LET sS=”This is a Test…”
20 PAPER 1:INK 0:RAND USR 62048: REM CLS
30 PRINT AT 10,5; FLASH 1; PAPER 0, INK 6; CHRS USR 62220. If
you don’t let s$ equal something, an error report is given. - RANDOMIZE USR 62292
- scrolls D FILE1 & 2 one character up. RAND USR 62295 will scroll up D FILE2 only.
- RANDOMIZE USR 62346
- scrolls D FILE1 & 2 one character down. RAND USR 62360 will scroll down D FILE2 only.
- RANDOMIZE USR 62446
- scrolls D FILE1 & 2 one character left. RAND USR 62461 for D FILE2 only.
- RANDOMIZE USR 62500
- scrolls D FILE1 & 2 one character right. RAND USR 62515 for D FILE2 only.
TECHNICAL NOTES
Don’t forget to always CLEAR 61999. When D FILE2 is in use and the toolkit is in memory,there are 28268 bytes free to BASIC.
The UDG area now begins at 63256. The BASIC program begins at 31510. For a line 0, POKE 31511,0. To put machine code in REM statements, poke at 31514 upward. To SAVE a screen to tape, use:
SAVE "D_FILE1" CODE 16384,6143
SAVE "D_FILE2" CODE 24576,6143
At anytime, you can return to normal mode using OUT 255,0 and return to extended mode with OUT 255,2. When using the fill routine (INPUT USR 62105,x,y), if we reach the top or the bottom of the screen, an error report “Integer out of range” will occur. To overcome this Situation, use ON ERR GOTO and ON ERROR RESET in your BASIC programs.
The DRAW command works but we don’t have any control over the attribute. Same thing for CIRCLE. In extended color mode, attribute file2 is opened but not used. If you want you can use it to put machine code there. ATT FILE2 is between 30720 and 31487 (767 bytes long). (Ed. note, only use RAND USR 62000 once.)
Products
Media
Image Gallery
Source Code
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.