Add a 640x480 two-colour graphics mode; start in white

The graphics memory doubles as 640x480 at a bit a pixel (port 38), four
pixels to an entry, plotted by read-modify-write, in two colours from
port 39 (0 transparent). BASIC gets SCREEN 0 / SCREEN 1 [,set[,clear]];
a plain fill (as every game does) returns to 320x240 and BASIC follows.
The text now starts in white (SW5:4 = 00; 10 is green). The README is
rewritten to stand on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
brad ArantandClaude Opus 5.5 committed 2026-12-01 06:06:30 -08:00
1 parent 71fd403294
commit bda9bb67b6
13 files changed
+2985 -2680

No files matched your search

+7
View File
@@ -66,6 +66,7 @@ class RV32:
self.why = 0
self.bp = [0, 0]
self.bp_on = 0
self.g_hires = 0 # port 38: 640x480 graphics mode
@property
def sp(self):
@@ -137,6 +138,8 @@ class RV32:
return self.why
if port == 0x34:
return 0 # graphics fill: done at once
if port == 0x38:
return self.g_hires
return 0xFF
def io_out(self, port, v):
@@ -152,6 +155,10 @@ class RV32:
self.nmi_pending, self.why_r = True, 2
elif port == 0x67:
self.bp_on = v & 3
elif port == 0x38:
self.g_hires = v & 1
elif port == 0x34 and not v & 0x80:
self.g_hires = 0
self.io_out(port, v)
def millis(self):