Wedge80
A downloadable tool
Wedge80 a C128 BASIC extension for VDC graphics
Copyright (c) 2026 Graham (Francesco Gramignani)
Version 1.11
Revision 15/1/2026
Introduzione
Wedge80 è un programma che permette di creare e visualizzare immagini grafiche in alta risoluzione, tramite l'interfaccia video VDC (Video Display Controller, MOS 8563) del Commodore C128.
Questo nasce dal desiderio di studiare il funzionamento di Pangea Basic (https://github.com/graham-it/PangeaBasic) un programma pubblicato nel n. 2 del 1988 di Commodore Gazette e che fino a poco tempo fa rischiava di essere perduto per sempre.
Tuttavia l'approccio basato sulla generazione di errori fittizi nei parametri è poco efficiente e la sintassi dei comandi non è coerente con quella del BASIC V7, motivo per cui con Wedge80 ho deciso di ricominciare da un foglio bianco.
Il nome Wedge80 si riferisce al fatto che questo programma sfrutta una tecnica chiamata 'wedging' (da 'cuneo' o 'zeppa' in italiano) che permette di aggiungere nuove istruzioni all'interprete BASIC o di modificarne il comportamento.
Il BASIC V7 del C128 dispone di un set di istruzioni dedicate alla grafica che utilizzano la modalità a 40 colonne, gestita dal chip VIC-II, ma che non permettono di sfruttare le capacità grafiche del chip VDC, che viene utilizzato solo in modalità testo a 80 colonne.
Wedge80 non aggiunge nuove istruzioni al BASIC V7 del C128, ma estende l'applicazione di quelle già esistenti alla modalità grafica bitmap del chip VDC, mantenendo la sintassi originale e garantendo la piena compatibilità con il software già esistente.
Tali istruzioni consistono in comandi e funzioni che possono essere introdotte dall'utente sia in modalità diretta che in modalità programma.
Installazione
Per installare Wedge80 basta eseguire il programma "BOOT", fornito nel file immagine .d64, che sull'emulatore VICE può essere eseguito semplicemente trascinando l'immagine del disco nella finestra del programma.
In alternativa, è possibile caricare ed eseguire direttamente il codice in linguaggio macchina con il comando:
BOOT "WEDGE80"
Nelle prime versioni del C128, a causa di un bug presente nel KERNAL che impedisce il corretto funzionamento del comando BOOT, è necessario utilizzare i seguenti comandi:
BLOAD "WEDGE80"
SYS 4864
oppure:
LOAD "WEDGE80",8,1
NEW (necessario!)
SYS 4864
Durante l'installazione, una parte delle routines grafiche native del BASIC V7 viene copiata in RAM e su queste vengono applicate alcune 'patch' per adattarle alla grafica bitmap del chip VDC.
La porzione di RAM che ospita le nuove routines comprende:
- Cassette buffer and Disk boot buffer [$0b00-$0bff]
- RS-232 input buffer [$0c00-$0cff]
- RS-232 output buffer [$0d00-$0dff]
Resta invece disponibile la RAM dedicata agli sprites:
- Sprite pattern storage area [$0e00-$0fff]
Queste 'patch' sono necessarie perché il VDC è dotato di una propria memoria RAM, separata dalla memoria centrale del C128, e per accedervi occorre utilizzare gli opportuni registri.
Inoltre, la memoria per la grafica bitmap è organizzata diversamente da quella del VIC-II (dove le celle sono di 8 x 8 pixel), nel VDC le celle sono disposte linearmente lungo tutto lo schermo e continuano nella riga successiva.
Utilizzo
Una volta installato, il programma stampa un messaggio di benvenuto, per comunicare all'utente che il sistema è pronto per l'utilizzo.
Il comando 'HELP' (richiamabile con il tasto rapido presente nella tastiera del C128, che sull'emulatore VICE corrisponde al tasto 'End' della tastiera del PC), pur mantenendo la sua funzione originale, consente di conoscere lo stato di Wedge80 e della funzione AUTOFAST (spiegata più avanti).
Wedge80 può essere disattivato con il comando 'QUIT' (che nel BASIC V7 standard restituisce il messaggio di errore 'UNIMPLEMENTED COMMAND') senza perdere il programma BASIC eventualmente presente in memoria.
Inoltre, esso può essere riattivato, in qualsiasi momento, con il comando 'SYS 4864', a meno che la memoria in cui risiedono le routines principali di Wedge80 (Application Program Area: $1300-$1bff) non venga cancellata o sovrascritta.
Con Wedge80 installato la grafica tradizionale su VIC-II e quella estesa su VDC possono essere utilizzate anche in contemporanea.
Infatti, i comandi e le funzioni riguardanti la grafica, vengono applicate all'ultima modalità grafica utilizzata, che viene selezionata con comando GRAPHIC (richiamabile rapidamente da tastiera con il tasto 'F1'):
- GRAPHIC 1 VIC-II bitmap (320 x 200, 2 colori per cella 8 x 8)
- GRAPHIC 3 VIC-II bitmap (160 x 200, 4 colori per cella 8 x 8)
- GRAPHIC 6 VDC bitmap (640 x 200, 2 colori per tutto lo schermo)
Le modalità 2 e 4 sono analoghe a quelle 1 e 2 con l'attivazione dello 'split screen' (non disponibile su VDC).
Per pulire lo schermo basta aggiungere l'opzione '1' preceduta da una virgola, ai comandi sopra descritti, oppure utilizzare il comando SCNCLR (corrispondente al tasto 'F4') ma in questo caso non verrà cambiata la modalità grafica corrente.
Per tracciare una linea sullo schermo si può utilizzare il comando DRAW, che (analogamente al BASIC V7) si basa sull'algoritmo di Bresenham:
DRAW[mode][,x0,y0][TO x1,y1][...]
Le opzioni tra parentesi quadre possono essere omesse, ma in assenza del primo parametro, la coppia di coordinate iniziali deve essere preceduta da una virgola.
L'opzione 'mode' (che sostituisce 'source', cioè la sorgente di colore per lo schermo VIC-II), sullo schermo VDC indica il modo in cui devono essere tracciati i pixel:
0 = per cancellare
1 = per disegnare (default)
2 = esegue uno XOR con i pixel già presenti sullo schermo
Le coordinate rappresentano il punto di partenza e quello finale della linea, che può essere prolungata con altre linee per formare una spezzata.
Se le coordinate iniziali vengono omesse, la linea partirà dall'ultimo punto tracciato dall'istruzione precedente. In assenza della parola chiave 'TO' verranno disegnati uno o più punti isolati.
Inoltre, le coordinate possono essere espresse in termini relativi alla posizione corrente nei seguenti modi:
- anteponendo i segni '+' e '-' alle coordinate stesse
- utilizzando la notazione polare, lunghezza e angolo (in gradi sessagesimali) separati da un punto e virgola ';'
La modalità VDC bitmap può essere disattivata nei seguenti modi:
- GRAPHIC 5 il cursore passa allo schermo a 80 colonne
- GRAPHIC OFF il cursore rimane nello schermo a 40 colonne
Ogni volta che si passa dalla modalità testo a 80 colonne alla modalità bitmap del VDC (e viceversa) le informazioni in esso contenute vengono sovrascritte.
Questa scelta è stata fatta perché Wedge80 è stato concepito per l'utilizzo su un C128 standard che presenta una RAM video dedicata al chip VDC di soli 16 KB, sufficienti a rappresentare una risoluzione grafica di 640 x 200 pixel a 2 colori.
Nulla vieta in futuro di espandere la memoria gestibile da Wedge80 a 64 KB, o di allocare una memoria di swap in modo da non perdere le informazioni dello schermo (testo o bitmap) ogni qualvolta si cambia modalità.
Per maggiori dettagli sui comandi affetti da Wedge80, consultare la sezione BASIC commands, più avanti.
Auto FAST mode
Quando Wedge80 viene avviato, per default viene abilitata la modalità AUTOFAST, che permette di eseguire i comandi estesi di Wedge80 in modalità FAST (2 MHz), per poi ritornare automaticamente alla modalità SLOW (1 MHz) al termine dell'operazione.
La modalità AUTOFAST, che può essere utilizzata sia in modalità diretta che in modalità programma è stata aggiunta per facilitare l'utilizzo dei comandi grafici da parte dell'utente, dato che in modalità FAST lo schermo a 40 colonne (VIC-II) viene disabilitato e quest'ultimo è l'unico schermo di testo attivo mentre l'uscita a 80 colonne (VDC) si trova in modalità grafica.
La modalità AUTOFAST può essere disattivata cambiando la velocità del processore con i normali comandi 'FAST' e 'SLOW', mentre per riattivarla occorre introdurre il comando 'AUTO FAST' (con o senza lo spazio tra le 2 parole chiave).
Le sequenze ESCAPE
Il C128 offre diverse funzioni per il controllo dell'editor dello schermo, accessibili direttamente da tastiera tramite il tasto ESC (che su VICE 3.9 corrisponde al tasto 'F9' del PC, oppure al tasto 'F1' nelle versioni precedenti), seguito da un tasto per formare una sequenza.
Tra queste, la sequenza 'ESC X' permette di passare rapidamente dalla modalità testo a 40 colonne a quella a 80 colonne (e viceversa).
Ciò ha reso necessario una ulteriore 'wedge' per controllare quando viene richiamata la sequenza 'ESC X' mentre il VDC si trova in modalità bitmap.
Il BASIC esteso
I comandi estesi in Wedge80 sono i seguenti:
| GRAPHIC | SSHAPE |
| SCNCLR | GSHAPE |
| COLOR | LOCATE |
| DRAW | AUTO |
| BOX | FAST |
| CIRCLE | SLOW |
| PAINT | HELP |
| CHAR | QUIT |
Inoltre, le funzioni estese sono:
| RCLR (n) | RDOT (n) |
| RGR (n) | POS (n) |
Per i comandi e le funzioni non menzionate in elenco, si rimanda all'Enciclopedia del BASIC V7 presente nel manuale di sistema del C128 o al libro "Commodore 128 Programmer's Reference Guide" (Bantam, 1986).
BASIC commands
Analogamente ai comandi del BASIC V7, le opzioni indicate tra parentesi quadre sono facoltative ma, in assenza di un parametro, i parametri successivi devono essere preceduti da una virgola, in numero pari alle opzioni omesse.
Tutti gli spazi tra le opzioni sono stati aggiunti per motivi di leggibilità e vengono ignorati dall'interprete.
Segue una guida sintetica dei comandi estesi disponibili con Wedge80:
GRAPHIC
Selects a graphics mode.
syntax: GRAPHIC mode [,clr] [,sl]
mode =
0 VIC-II text (40 column)
1 VIC-II bitmap (320 x 200)
2 VIC-II split screen bitmap
3 VIC-II multicolor bitmap (160 x 200)
4 VIC-II split screen multicolor bitmap
5 VDC text (80 column)
6 VDC bitmap (640 x 200) (*)
clr =
0 do not clear screen (default)
1 clear screen (implicit on VDC
switching from bitmap to text mode)
sl = 0..24 the starting line number of the VIC
split screen bitmap (default = 20)
(not available on VDC)
alternate syntax: GRAPHIC cmd
cmd =
CLR the VIC-II bitmap screen is cleared
and then deallocated
OFF the VDC display is switched to
text mode and then cleared (*)
(*) new options
SCNCLR
Clears the selected screen mode.
syntax: SCNCLR [mode]
mode =
0 VIC-II text (40 column)
1 VIC-II bitmap (320 x 200)
2 VIC-II split screen bitmap
3 VIC-II multicolor bitmap (160 x 200)
4 VIC-II split screen multicolor bitmap
5 VDC text (80 column)
6 VDC bitmap (640 x 200) (*)
(*) new option
Note: without an argument both the current text screen
and the current active graphics screen will be cleared.
COLOR
Sets a color for the selected source.
syntax: COLOR src, col
src =
0 VIC-II background color
1 VIC-II bitmap foreground color
2 VIC-II multicolor 1
3 VIC-II multicolor 2
4 VIC-II border color
5 VIC-II or VDC text char color
6 VDC text/bitmap background color
7 VDC bitmap foreground color (*)
col = 1..16 the value of the color to be used
(*) new option
C128 Color table
| Code | VIC-II | VDC |
|---|---|---|
| 1 | Black | Black |
| 2 | White | White |
| 3 | Red | Dark Red |
| 4 | Cyan | Light Cyan |
| 5 | Purple | Light Purple |
| 6 | Green | Dark Green |
| 7 | Blue | Dark Blue |
| 8 | Yellow | Light Yellow |
| 9 | Orange | Dark Purple |
| 10 | Brown | Dark Yellow |
| 11 | Light Red | Light Red |
| 12 | Dark Gray | Dark Cyan |
| 13 | Medium Gray | Medium Gray |
| 14 | Light Green | Light Green |
| 15 | Light Blue | Light Blue |
| 16 | Light Gray | Light Gray |
DRAW
Draws dots, lines, and shapes at the positions
specified by the coordinates.
syntax: DRAW [mode] [,x0, y0] [TO x1, y1] [...]
mode =
0 clear pixels
1 set pixels (default)
2 XOR with foreground (*)
x0, y0 = starting coordinates (default = current position)
x1, y1 = ending coordinates
(*) polygonal chains missing internal vertices due
to the use of Bresenham's line algorithm with XOR.
Note: without parameters draws a dot at current coords.
BOX
Draws a BOX on the screen as specified by the parameters
that follow the command.
syntax: BOX [mode] ,x0, y0 [,x1, y1] [,angle] [,fill]
mode =
0 clear pixels
1 set pixels (default)
2 XOR with foreground (*)
x0, y0 = the top left corner coordinates
x1, y1 = the opposite corner (default = current position)
angle = the rotation in clockwise degrees (default = 0)
paint =
0 do not fill the shape (default)
1 fill the shape (**)
(*) missing vertices due to the use
of Bresenham's line algorithm with XOR.
(**) the paint option does not work with XOR.
(use PAINT command after drawing box, instead)
CIRCLE
Draws circles, ellipses, or arcs depending on the parameters
specified after the command.
syntax: CIRCLE [mode] [,xc, yc] [,xr] [,yr] [,sa] [,ea] [,angle] [,incr]
mode =
0 clear pixels
1 set pixels (default)
2 XOR with foreground (*)
xc, yc = the center of the circle (default = current position)
xr = the horizontal radius (default = 0)
yr = the vertical radius (default = xr)
sa = the starting arc angle (default = 0)
ea = the ending arc angle (default = 360)
angle = the rotation angle in degrees (default = 0)
incr = the number of degrees between each segment (default = 2)
(*) very inaccurate due to the use
of Bresenham's line algorithm with XOR.
PAINT
Fills an area starting from a specified position.
syntax: PAINT [mode] [,x, y] [,opt]
mode =
0 clear all contiguous active pixels
1 fill an empty area (default)
x, y = the starting coordinates
(default = current coords)
opt =
0 paint an area that is defined by
the color source specified (*)
1 paint an area that is defined by any
non-background source (*)
(*) not available on VDC
Note: the RUN/STOP key breaks painting at any time.
CHAR
Displays a string of characters to the bitmap screen
at the position specified.
syntax: CHAR [mode], col, row[,string] [,rev]
mode =
0 clear using char shape (*)
1 draw solid char (default)
2 XOR with foreground (*)
3 OR with foreground (*)
col = 0..79 column to start printing at
row = 0..24 row to start printing at
string = string of characters to be printed
rev =
0 normal mode (default)
1 (or n > 1) reverse mode
(*) new options
SSHAPE
Saves an area of the the screen into a BASIC string variable.
syntax: SSHAPE string, x0, y0 [, x1, y1]
string = the string variable to which you
wish to save the area of screen
(max 251 bytes = 2008 pixels)
the remaining 4 bytes are used
for the shape size (x,y)
x0, y0 = the starting corner
coordinates for the save
x1, y1 = the opposite corner
(default = current coords)
GSHAPE
Draws a shape stored in a BASIC string variable.
syntax: GSHAPE string[,x, y] [,mode]
string = the string variable where the
shape to be drawn is stored
x, y = the top left corner coordinates
where the shape is to be drawn
(default = current coords)
mode =
0 place the shape as is
1 invert the shape
2 OR the shape with the area
3 AND the shape with the area
4 XOR the shape with the area
LOCATE
Places the pixel cursor to a specified position on the bitmap screen.
syntax: LOCATE x, y
x, y: the position to move the bitmap pixel cursor to
AUTO
Enables the AUTOFAST mode.
syntax: AUTO [FAST]
Note: without the FAST argument, it
operates as the standard AUTO command.
FAST
Disables the AUTOFAST mode
then sets the clock speed to 2 MHz.
syntax: FAST
SLOW
Disables the AUTOFAST mode
then sets the clock speed to 1 MHz.
syntax: SLOW
HELP
Displays program info, then operates
as the standard HELP command
syntax: HELP
QUIT
Disables BASIC wedge:
syntax: QUIT
To disable Wedge80, the following steps are performed:
- restore ESC handler indirect vector
- restore BASIC indirect vectors
- restore DO_DMA routine
- restore VDC text mode
- clear Wedge80 enabled flag (INIT_STATUS = $0a04, bit 5)
- print a message
BASIC functions
Segue una guida sintetica delle funzioni estese disponibili con Wedge80:
RCLR (n)
Returns the current color value (1..16)
of the color source specified.
syntax: result = RCLR (n)
n =
0 VIC-II background color
1 VIC-II bitmap foreground color
2 VIC-II multicolor 1
3 VIC-II multicolor 2
4 VIC-II border color
5 VIC-II or VDC text char color
6 VDC text/bitmap background color
7 VDC bitmap foreground color (*)
(*) new option
RDOT (n)
Returns the current pixel cursor coordinates
or the pixel status at current position
depending on the value specified.
syntax: result = RDOT (n)
n =
0 x-coord of the pixel cursor
1 y-coord of the pixel cursor
2 pixel status at current position (*)
(*) result applied to the current graphics screen:
VIC-II: color source of the pixel (0..3)
VDC: pixel status (0 = off, 1 = on)
RGR (n)
Returns the value of the current graphics mode.
syntax: result = RGR (n)
n =
0 current graphic mode
1 current graphics screen (0 = VIC-II, 1 = VDC) (*)
2 current width mode (1 = normal, 2 = double) (*)
3 (or n > 3) current scale mode (0 = not active, 1 = active) (*)
(*) new options
POS (n)
Returns a value that indicates where the cursor is within the current text screen window.
syntax: result = POS (n)
n =
0 get column
1 (or n > 0) get row (*)
(*) new option
Wedge80 Library
Una volta installato, Wedge80 offre una libreria di funzioni accessibili direttamente da linguaggio macchina tramite una Jump table, in modo da garantire la compatibilità dei programmi eventualmente sviluppati con essa, anche in caso di aggiornamento del programma principale.
Jump table:
| Routine name | Address | Function (arguments/results) |
|---|---|---|
| InstWedge | $1300 | Install Wedge80 |
| StartWedge | $1303 | Enable Wedge80 |
| QuitWedge | $1306 | Disable Wedge80 |
| SetMem80_IO | $1309 | Set VDC bitmap address (enabling I/O space) |
| SetMem80 | $130c | Set VDC bitmap address |
| GetMode80 | $130f | Get VDC mode (a = value of VDC register 25) |
| SwapMode80 | $1312 | Swap VDC mode (text/bitmap) |
| SetTxt80 | $1315 | Activate VDC text mode |
| SetBmp80 | $1318 | Activate VDC bitmap mode |
| ClrBmp80 | $131b | Clear VDC bitmap screen |
| GetBgCol80 | $131e | Get VDC background color (a = RGBI) |
| SetBgCol80 | $1321 | Set VDC background color (a = RGBI) |
| GetFgCol80 | $1324 | Get VDC foreground color (a = RGBI) |
| SetFgCol80 | $1327 | Set VDC foreground color (a = RGBI) |
| GPlot80 | $132a | Draw a pixel (plotmode, XPOS, YPOS) (considering WIDTH and FILFLG) |
| GPlot80a | $132d | Draw a pixel (plotmode, XPOS, YPOS) |
| ReadPt80 | $1330 | Test a pixel (plotmode, XPOS, YPOS) |
| DrawLn80 | $1333 | Draw a line (plotmode, XPOS, YPOS, XDEST, YDEST) |
| DrawBox80 | $1336 | Draw a box (plotmode, XCORDl, YCORDl, XCORD2, YCORD2, BOXANG) (x = fill flag) |
| Circle80 | $1339 | Draw a circle (plotmode, XCIRCL, YCIRCL, XRCOS, YRCOS, YRSIN, XRSIN, ANGBEG, ANGEND) (CIRSUB and DSTPOS to get 1st point on circle) (x = degrees per segment) |
| Paint80 | $133c | Fill a graphics area (plotmode, XPOS, YPOS) |
BASIC demos
Insieme a Wedge80, vengono forniti alcuni programmi demo in BASIC, utili a mostrare le potenzialità ed il funzionamento di questo strumento:
| TITLE | mostra una schermata di benvenuto |
| BALLOON | un semplice disegno |
| DARKNESS | utilizzo intenso di linee |
| DOUBLE GLOBE | uso simultaneo della grafica del VDC e del VIC-II |
| MARBLE | dimostrazione dell'utilizzo del comando CIRCLE |
| MONOSCOPE | un classico monoscopio per la TV |
| RND LINES | traccia linee casuali (mediante il comando DRAW) |
| RND SHAPES | disegna poiligoni casuali (mediante il comando CIRCLE) |
| SIN(X) | traccia il grafico di una funzione matematica |
| RACING CARS | dimostra l'utilizzo dei comandi SSHAPE/GSHAPE |
| SPACESHIPS | compone una figura unendo più moduli con SSHAPE/ GSHAPE |
Sketch80 demo
Sketch80 è un semplice programma dimostrativo che permette di disegnare con i tasti di direzione del cursore sullo schermo VDC in modalità grafica.
A differenza dei precedenti, questo programma è stato scritto in assembly e utilizza la libreria grafica fornita da Wedge80, che contribuisce a ridurre le dimensioni del file compilato.
Il programma risiede nell'area BASIC può essere caricato e avviato nei modi consueti. All'avvio del programma viene controllato se Wedge80 è già installato in memoria ed in caso contrario viene segnalato.
I comandi da tastiera sono i seguenti:
| HOME | home position (center of the screen) |
| CLR | clear screen (SHIFT+HOME) |
| LEFT | move left |
| RIGHT | move right |
| UP | move up |
| DOWN | move down |
| B | change background color (SHIFT = rapid) |
| F | change foreground color (SHIFT = rapid) |
| C | clear mode (set/clear) |
| X | XOR mode (on/off) |
| D | pixel width (single/double) |
| S | clock speed (FAST/SLOW) |
| ESC | exit |
| RUN/STOP | exit (with break error) |
I tasti di direzione sono quelli della tastiera estesa del C128 (i tasti in grigio presenti nella striscia in alto) che sull'emulatore VICE corrispondono ai normali quattro tasti del cursore.
Se vengono oltrepassati i bordi dello schermo, il cursore comparirà dalla parte opposta, in stile 'Pac-Man'.
Buon disegno!
Graham












Comments
Log in with itch.io to leave a comment.
Here is an ENGLISH TRANSLATION of V 1.11 by Google Gemini;
Wedge80
A C128 BASIC extension for VDC graphics Copyright (c) 2026 Graham (Francesco Gramignani)
Version 1.11 Revision 15/1/2026
Introduction
Wedge80 is a program that allows for the creation and display of high-resolution graphic images via the VDC (Video Display Controller, MOS 8563) video interface of the Commodore 128.
This project was born from a desire to study the inner workings of Pangea Basic (
The name "Wedge80" refers to the fact that this program uses a technique called "wedging," which allows for adding new instructions to the BASIC interpreter or modifying its behavior. While the C128's BASIC 7.0 includes a set of dedicated graphics instructions, they are designed for 40-column mode (managed by the VIC-II chip) and do not support the graphic capabilities of the VDC chip, which is normally used only for 80-column text mode.
Wedge80 does not add entirely new keywords to C128 BASIC 7.0; instead, it extends existing instructions to work with the VDC chip's bitmap mode. It maintains the original syntax and ensures full compatibility with existing software. These instructions consist of commands and functions that can be used by the user in both direct and program modes.
Installation
To install Wedge80, simply run the "BOOT" program provided in the .d64 image file. On the VICE emulator, this can be done by dragging the disk image into the program window.
Alternatively, you can load and run the machine language code directly with the command:
BOOT "WEDGE80"On early versions of the C128, a bug in the KERNAL prevents the
BOOTcommand from working correctly. In those cases, use the following commands:BLOAD "WEDGE80"SYS 4864Or:
LOAD "WEDGE80",8,1NEW(Necessary!)SYS 4864During installation, a portion of the native BASIC 7.0 graphics routines is copied into RAM and "patched" to adapt them to the VDC chip's bitmap graphics.
The RAM area hosting the new routines includes:
[$0b00-$0bff][$0c00-$0cff][$0d00-$0dff]The RAM dedicated to sprites remains available:
[$0e00-$0fff]These patches are necessary because the VDC has its own dedicated RAM, separate from the C128's main memory, and must be accessed via specific registers. Furthermore, VDC bitmap memory is organized differently than the VIC-II (where cells are 8x8 pixels); in the VDC, cells are arranged linearly across the screen and continue onto the next line.
Usage
Once installed, the program displays a welcome message to signal that the system is ready. The HELP command (accessible via the Help key on the C128 keyboard, or the "End" key in VICE) retains its original function but also displays the status of Wedge80 and the AUTOFAST function (explained below).
Wedge80 can be deactivated with the QUIT command (which normally returns an 'UNIMPLEMENTED COMMAND' error in standard BASIC 7.0) without losing any BASIC program currently in memory. It can be reactivated at any time with
SYS 4864, provided the memory where the main Wedge80 routines reside (Application Program Area:$1300-$1bff) has not been erased or overwritten.With Wedge80 installed, traditional VIC-II graphics and extended VDC graphics can be used simultaneously. Graphics commands and functions are applied to the last graphics mode selected via the GRAPHIC command (Shortcut: F1):
Modes 2 and 4 are similar to 1 and 2 but with "split screen" enabled (not available on VDC). To clear the screen, append
,1to the commands above, or use SCNCLR (Shortcut: F4), though the latter does not change the current graphic mode.To draw a line, use the DRAW command, which uses the Bresenham algorithm:
DRAW [mode] [,x0,y0] [TO x1,y1] [...]On the VDC screen, the
modeoption (which replaces the "source" parameter on the VIC-II) indicates how pixels are drawn:Coordinates can be expressed relatively by prefixing them with
+or-, or by using polar notation (length and angle in degrees separated by a semicolon;).VDC bitmap mode can be deactivated as follows:
Note: Switching between VDC text and bitmap mode overwrites the contained information. This is because Wedge80 is designed for a standard C128 with only 16 KB of VDC RAM—just enough for a 640 x 200 2-color resolution. Future versions may support 64 KB VDC RAM or swap memory to preserve screen data.
Auto FAST Mode
By default, Wedge80 enables AUTOFAST mode. This allows Wedge80's extended commands to execute in FAST (2 MHz) mode and then automatically return to SLOW (1 MHz) mode once the operation is finished. This was added because in 2 MHz mode, the 40-column (VIC-II) screen is disabled; AUTOFAST ensures the user can use graphics commands easily while still having a functional 40-column text display when the command finishes.
AUTOFAST can be disabled by manually using the
FASTorSLOWcommands. It can be re-enabled with the commandAUTO FAST.ESCAPE Sequences
The C128 features screen editor functions accessible via the ESC key followed by another key. Notably, ESC X toggles between 40 and 80-column modes. Wedge80 includes a specific wedge to monitor when ESC X is called while the VDC is in bitmap mode.
Extended BASIC
The following commands are extended in Wedge80:
GRAPHIC,SCNCLR,COLOR,DRAW,BOX,CIRCLE,PAINT,CHAR,SSHAPE,GSHAPE,LOCATE,AUTO,FAST,SLOW,HELP,QUIT.The following functions are extended:
RCLR(n),RDOT(n),RGR(n),POS(n).BASIC Commands (Summary)
(Note: Most of the technical syntax for GRAPHIC, SCNCLR, COLOR, DRAW, BOX, CIRCLE, PAINT, CHAR, SSHAPE, GSHAPE, LOCATE, etc., was already provided in English in your source text and remains unchanged.)
Key Additions/Changes for VDC:
Wedge80 Library (Machine Language)
Wedge80 provides a library of functions accessible via a Jump Table starting at
$1300. This ensures that programs developed using these routines remain compatible even if the main program is updated.(The Jump Table provided in your text is already in a technical format suitable for English documentation.)
Demos and Sketch80
Several BASIC demos are included:
Sketch80 is a special demo written in assembly that uses the Wedge80 library. It allows you to draw using the C128 cursor keys.
Controls:
Happy drawing! Graham
Thanks again! As you can see, the project is constantly evolving...
I am very impressed what you are doing so far, would be nice if you also could implement support for 64kb VDC and option for more (custum ?) resulutions. Keep it going on.
This is one of my goals, thanks for the appreciation!
Here is an ENGLISH TRANSLATION of the Instructions (done by Gemini AI):
Introduction
Wedge80 is a program that allows you to create and view high-resolution graphic images using the VDC (Video Display Controller, MOS 8563) video interface of the Commodore C128. The name refers to the fact that this program utilizes a technique called a 'wedge', which allows the user to interact with it through the BASIC command interpreter. These commands can be entered in both direct mode and program mode and use the same instruction set as the BASIC V7 language, ensuring compatibility with existing software.
Installation
Wedge80 consists of a single file, which can be installed into the C128's memory in the following ways:
Additionally, the provided .d64 image includes a 'BOOT' file, which allows you to start Wedge80 on the VICE emulator simply by dragging the disk image into the program window. During installation, some BASIC V7 graphic routines are copied into RAM and 'patched' so they can be applied to the bitmap graphics of the VDC chip, which has a different memory organization than the VIC-II.
Basic Usage
Once installed, the program prints a welcome message to inform the user that the system is ready for use. The 'HELP' command (accessible via the dedicated key on the C128 keyboard), while maintaining its original function, allows you to check if Wedge80 is active and view its version number. On the VICE 3.9 emulator, the 'HELP' key corresponds to the 'End' key, while in previous versions, it corresponds to the 'F5' key on the PC.
Wedge80 can be deactivated with the 'QUIT' command (which normally returns the 'unimplemented command' error message) without losing any BASIC program currently in memory. Furthermore, it can be reactivated at any time with the 'SYS 4864' command, provided that the user memory ($1300-$1bff) has not been cleared or overwritten.
With Wedge80 installed, traditional VIC-II graphics and extended VDC graphics can be used simultaneously. In fact, graphic commands are applied to the last graphic mode used, which is selected as follows:
The GRAPHIC command can be quickly called from the keyboard using the 'F1' key. To clear the screen, simply add the option '1' to the GRAPHIC command, or use the SCNCLR command (corresponding to the 'F4' key).
To draw a line on the screen, use the DRAW command, which in BASIC V7 is based on the Bresenham algorithm: DRAW mode, x0, y0 TO x1, y1
The 'mode' option, which replaces 'source' (the color source in the classic version), indicates how pixels should be drawn on the VDC screen:
The coordinates represent the starting and ending points of the line. Initial coordinates can be omitted to continue from the last point drawn. For more details on the commands affected by Wedge80, see the "BASIC commands" section below.
Auto FAST mode
When Wedge80 is started, the 'autofast' function is enabled. This allows Wedge80's extended commands to execute in FAST mode (2 MHz) and then automatically return to SLOW mode (1 MHz) once the operation is finished. This function was added for user convenience, as in FAST mode, the 40-column screen (VIC-II) is disabled, and the latter is the only active text screen while the 80-column output (VDC) is in graphic mode. The 'autofast' function works in both direct and program modes and can be deactivated by 'forcing' the processor speed with the standard 'FAST' and 'SLOW' commands. To reactivate the 'autofast' function, enter the command 'FAST AUTO' (with or without a space between the two keywords).
ESC sequences
The Commodore 128 offers various functions accessible directly from the keyboard via ESCAPE sequences (the ESC key on VICE 3.9 corresponds to the 'F9' key on the PC). Among these, the 'ESC X' sequence allows you to quickly switch between 40-column and 80-column text modes (and vice versa). This necessitated an additional 'wedge' to monitor when the 'ESC X' sequence is called while the VDC is in bitmap mode.
Note that every time you switch from 80-column text mode to VDC bitmap mode (and vice versa), the information contained within is overwritten. This choice was made because Wedge80 was designed for use on a standard C128 (not C128 DCR), which has only 16 KB of dedicated VDC video RAM—just enough to represent a 640 x 200 pixel resolution with 2 colors. Nothing prevents expanding the memory manageable by Wedge80 to 64 KB in the future, or allocating swap memory in the C128's main RAM to avoid losing information (text or bitmap) whenever the mode is changed.
Extended BASIC
The commands whose functionalities are extended by Wedge80 are:
The affected functions are:
Thanks for the translation, the description I posted was just a draft...
very nice idea, thank you.
Thank you for your interest!