Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow use of characters 0-31 #155

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions video/agon.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
#define VDP_RTC 0x87 // RTC
#define VDP_KEYSTATE 0x88 // Keyboard repeat rate and LED status
#define VDP_MOUSE 0x89 // Mouse data
#define VDP_UDG 0x90 // User defined characters
#define VDP_UDG_RESET 0x91 // Reset UDGs
#define VDP_BUFFERED 0xA0 // Buffered commands
#define VDP_UPDATER 0xA1 // Update VDP
#define VDP_LOGICALCOORDS 0xC0 // Switch BBC Micro style logical coords on and off
Expand Down
33 changes: 33 additions & 0 deletions video/agon_fonts.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,39 @@ namespace fabgl {
uint8_t FONT_AGON_DATA[256*8];

static const uint8_t FONT_AGON_BITMAP[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //

0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, //
0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x00, // !
0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, // "
Expand Down
2 changes: 1 addition & 1 deletion video/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ uint8_t palette[64]; // Storage for the palette
// Copy the AGON font data from Flash to RAM
//
void copy_font() {
memcpy(fabgl::FONT_AGON_DATA + 256, fabgl::FONT_AGON_BITMAP, sizeof(fabgl::FONT_AGON_BITMAP));
memcpy(fabgl::FONT_AGON_DATA, fabgl::FONT_AGON_BITMAP, sizeof(fabgl::FONT_AGON_BITMAP));
}

// Redefine a character in the font
Expand Down
9 changes: 6 additions & 3 deletions video/vdu.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@
// Handle VDU commands
//
void VDUStreamProcessor::vdu(uint8_t c) {

// We want to send raw chars back to the debugger
// this allows binary (faster) data transfer in ZDI mode
// to inspect memory and register values
//
if(consoleMode) {
DBGSerial.write (c);
if (consoleMode) {
DBGSerial.write(c);
}

switch(c) {
Expand Down Expand Up @@ -86,6 +85,10 @@ void VDUStreamProcessor::vdu(uint8_t c) {
case 0x1A: // Reset text and graphics viewports
vdu_resetViewports();
break;
case 0x1B: { // VDU 27
auto b = readByte_t(); if (b == -1) return;
plotCharacter(b);
} break;
case 0x1C: // Define a text viewport
vdu_textViewport();
break;
Expand Down
9 changes: 9 additions & 0 deletions video/vdu_sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@ void VDUStreamProcessor::vdu_sys_video() {
case VDP_MOUSE: { // VDU 23, 0, &89, command, <args>
vdu_sys_mouse();
} break;
case VDP_UDG: { // VDU 23, 0, &90, c, <args>
auto c = readByte_t(); // Redefine a display character
if (c >= 0) {
vdu_sys_udg(c);
}
} break;
case VDP_UDG_RESET: { // VDU 23, 0, &91
copy_font(); // Reset UDGs
} break;
case VDP_BUFFERED: { // VDU 23, 0, &A0, bufferId; command, <args>
vdu_sys_buffered();
} break;
Expand Down