Start the screen at 132x64
The terminal comes up (and resets with ESC c) in DECCOLM's 132x64 mode; term_ctrl's WIDE_BOOT parameter selects 80x32 instead. Port 0 bit 2 tells software which width is showing: BASIC's line editor wraps at it, and the games, which play at 80 columns, put 132 back when they end. scripts/sim.sh wide checks the start-up; the other checks still start at 80x32. Manual, README and terminfo updated. send-hex.py is executable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5930b958b4
commit
19278d1d74
23 files changed
+4183
-4102
No files matched your search
Binary file not shown.
+11
-8
@@ -33,7 +33,7 @@ typedef uint32_t u32;
|
||||
/* ------------------------------------------------------------- platform */
|
||||
#ifdef __riscv
|
||||
#include "basys3.h"
|
||||
#define con_stat IO8(0x00) /* bit 0: key waiting, bit 1: can send */
|
||||
#define con_stat IO8(0x00) /* bit 0: key waiting, bit 1: can send, bit 2: 132 columns */
|
||||
#define con_data IO8(0x01)
|
||||
|
||||
static void out_c(u8 c) { while (!(con_stat & 2)); con_data = c; }
|
||||
@@ -46,6 +46,7 @@ static void poke(u32 a, u8 v) { *(volatile u8 *)a = v; }
|
||||
static u8 io_in(u8 p) { return IO8(p); }
|
||||
static void io_out(u8 p, u8 v) { IO8(p) = v; }
|
||||
static void bye(void) { }
|
||||
static u8 scr_width(void) { return con_stat & 4 ? 132 : 80; }
|
||||
|
||||
#define gx_lo IO8(0x30)
|
||||
#define gx_hi IO8(0x31)
|
||||
@@ -116,6 +117,7 @@ static u8 io_in(u8 p) { (void)p; return 0xFF; }
|
||||
static void io_out(u8 p, u8 v) { (void)p; (void)v; }
|
||||
static void close_all(void);
|
||||
static void bye(void) { close_all(); exit(0); }
|
||||
static u8 scr_width(void) { return 80; }
|
||||
static u8 gmem[240][320];
|
||||
static u16 hgx;
|
||||
static u8 hgy;
|
||||
@@ -1037,10 +1039,10 @@ static void check_break(void)
|
||||
At the end of a line that is only a line number, Right copies that program
|
||||
line one character at a time and End copies the rest of it; Delete there
|
||||
skips a character of it. The screen is kept up to date with cursor moves
|
||||
only, so a line may wrap: ed_sc is the column it starts in, ED_W the
|
||||
screen width, ed_row the screen row (from the line's first) the
|
||||
only, so a line may wrap: ed_sc is the column it starts in, ed_w the
|
||||
screen width (80 or 132, read when the line starts), ed_row the screen row (from the line's first) the
|
||||
terminal's cursor is on and ed_at the place it is at. */
|
||||
#define ED_W 80
|
||||
static u8 ed_w = 80;
|
||||
static void esc_num(u8 n);
|
||||
static u8 ed_sc, ed_row, ed_at, ed_pend, ed_n, ed_cur;
|
||||
static u8 *ed_src; /* the program line being copied, or 0 */
|
||||
@@ -1055,7 +1057,7 @@ static void ed_csi(u8 n, char f)
|
||||
static void ed_go(u8 i)
|
||||
{
|
||||
u16 p = ed_sc + i;
|
||||
u8 r = p / ED_W, c = p % ED_W;
|
||||
u8 r = p / ed_w, c = p % ed_w;
|
||||
if (i == ed_at && !ed_pend) return;
|
||||
out_c('\r');
|
||||
if (r < ed_row) ed_csi(ed_row - r, 'A');
|
||||
@@ -1073,9 +1075,9 @@ static void ed_show(u8 i, u8 gone)
|
||||
for (; k < ed_n; k++) out_c(linebuf[k]);
|
||||
for (; gone; gone--, k++) out_c(' ');
|
||||
if (k > i) {
|
||||
ed_row = (ed_sc + k - 1) / ED_W;
|
||||
ed_row = (ed_sc + k - 1) / ed_w;
|
||||
ed_at = k;
|
||||
ed_pend = (ed_sc + k) % ED_W == 0;
|
||||
ed_pend = (ed_sc + k) % ed_w == 0;
|
||||
}
|
||||
ed_go(ed_cur);
|
||||
}
|
||||
@@ -1133,7 +1135,8 @@ static void ed_del(void)
|
||||
static u8 read_line(void)
|
||||
{
|
||||
u8 c, k;
|
||||
ed_sc = col % ED_W;
|
||||
ed_w = scr_width();
|
||||
ed_sc = col % ed_w;
|
||||
ed_row = ed_at = ed_pend = ed_n = ed_cur = 0;
|
||||
ed_src = 0;
|
||||
for (;;) {
|
||||
|
||||
+780
-780
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user