mirror of
https://github.com/dschmenk/PLASMA.git
synced 2026-04-19 09:23:06 +00:00
Make sure 40 column text mode properly restored
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -8,29 +8,19 @@ include "dhgr.tk/inc/dhgrutils.plh"
|
||||
sysflags resxtxt1|reshgr1|resxhgr1
|
||||
|
||||
var arg
|
||||
var xPen = 60
|
||||
var yPen = 30
|
||||
var fontWidth, fontHeight
|
||||
char hello = "Hello, world"
|
||||
var msg = @hello
|
||||
var strWidth, strHeight
|
||||
var fontfile
|
||||
char darthstr = "DartH GRaphics"
|
||||
|
||||
arg = argNext(argFirst)
|
||||
dhgrMode(DHGR_COLOR_MODE)
|
||||
screenRead("scroll.dhgr")
|
||||
while arg and ^arg
|
||||
if ^(arg + 1) == '-'
|
||||
msg = arg + 1
|
||||
^msg = ^arg - 1
|
||||
else
|
||||
dcgrFont(fontRead(arg))
|
||||
fontWidth, fontHeight = fontGlyphDim('a')
|
||||
fontHeight++
|
||||
dcgrColor(CLR_BLACK)
|
||||
dcgrStr(xPen, yPen + (fontHeight * 7) / 8, msg)
|
||||
yPen = yPen + fontHeight
|
||||
fin
|
||||
arg = argNext(arg)
|
||||
loop
|
||||
screenRead("darth.dhgr")
|
||||
fontfile = (arg and ^arg) ?? arg :: "trade54.fon"
|
||||
dcgrFont(fontRead(fontfile))
|
||||
getc
|
||||
strWidth, strHeight = dcgrStrExtents(@darthstr)
|
||||
dcgrColor(CLR_BLACK)
|
||||
dcgrStr((140 - strWidth) / 2, (strHeight * 7) / 8, @darthstr)
|
||||
getc
|
||||
dhgrMode(DHGR_TEXT_MODE)
|
||||
done
|
||||
|
||||
@@ -2361,7 +2361,7 @@ export def dhgrMode(mode)#1
|
||||
// Make sure we are a 128K //e or //c
|
||||
//
|
||||
if MACHID & $F0 <> $B0
|
||||
puts("\n128K required for double color graphics.\n")
|
||||
puts("\n128K required for double hires graphics.\n")
|
||||
^$C010
|
||||
while ^$C000 < 128; loop
|
||||
return 0
|
||||
@@ -2381,11 +2381,14 @@ export def dhgrMode(mode)#1
|
||||
dcgrColor(0)
|
||||
dhgrClearBl7(0, 0, 20, 192)
|
||||
else
|
||||
^store80dis = 0
|
||||
^dhresdis
|
||||
^show40col = 0
|
||||
^showtext
|
||||
^page1m
|
||||
^showtext
|
||||
^IOUdis = 0
|
||||
^show40col = 0
|
||||
^dhresdis
|
||||
^store80dis = 0
|
||||
call($FB2F, 0, 0, 0, 0) // INIT
|
||||
call($FC58, 0, 0, 0, 0) // home()
|
||||
fin
|
||||
return mode
|
||||
end
|
||||
|
||||
@@ -115,17 +115,18 @@ export def dcgrStrExtents(strptr)#2
|
||||
var glyptrs, xext, yext
|
||||
byte first, last, width, i, ch
|
||||
|
||||
xext = 0
|
||||
first = fontPtr->fnt_first
|
||||
last = fontPtr->fnt_last
|
||||
if fontPtr & FONT_PROP
|
||||
glyptrs = fontPtr + fnt_glyptrs
|
||||
for i = 1 to ^strptr
|
||||
xext = -glyptrs=>[^(strptr + 1) - first]=>gly_left
|
||||
for i = 1 to ^strptr-1
|
||||
ch = ^(strptr + i)
|
||||
if ch >= first and ch <= last
|
||||
xext = xext + glyptrs=>[ch - first]->gly_adv
|
||||
fin
|
||||
next
|
||||
xext = xext + glyptrs=>[^(strptr + ^strptr) - first]->gly_width
|
||||
if fontPtr & FONT_AA
|
||||
xext = xext / 4
|
||||
fin
|
||||
|
||||
@@ -98,10 +98,6 @@ const txt80a = $40 // ALS SmartTerm 80 column card
|
||||
const txt80 = txt80e | txt80v | txt80a
|
||||
byte flags
|
||||
//
|
||||
// Apple 2 KSW snd CSW values
|
||||
//
|
||||
word kswsave, cswsave
|
||||
//
|
||||
// UltraTerm extended mode heights
|
||||
byte[] UltraTermHeight = 24, 24, 24, 24, 32, 48, 24, 32
|
||||
//
|
||||
@@ -734,9 +730,7 @@ def a2textmode(columns)
|
||||
fin
|
||||
if columns >= 80 and MACHID & MACHID_80COL
|
||||
if not (flags & txt80)
|
||||
cswsave = *CSW
|
||||
kswsave = *KSW
|
||||
*CSW = $C300
|
||||
*CSW = $C300
|
||||
if MACHID & $C0 == MACHID_IIE
|
||||
conio:clear = @a2clear80
|
||||
conio:gotoxy = @a2gotoxy80e
|
||||
@@ -775,11 +769,12 @@ def a2textmode(columns)
|
||||
elsif flags & txt80a // ALS SmartTerm disable
|
||||
a2cout(20); a2cout('A'); a2cout('1')
|
||||
fin
|
||||
*CSW = cswsave
|
||||
*KSW = kswsave
|
||||
flags = flags & ~txt80
|
||||
fin
|
||||
call($FB39, 0, 0, 0, 0) // textmode()
|
||||
call($FE89, 0, 0, 0, 0) // IN#0
|
||||
call($FE93, 0, 0, 0, 0) // PR#0
|
||||
call($FB2F, 0, 0, 0, 0) // INIT
|
||||
a2clear(cls)
|
||||
conio:putchars = flags & uppercase ?? @a2putuprchars :: @a2putchars
|
||||
conio:clear = @a2clear
|
||||
conio:gotoxy = @a2gotoxy
|
||||
|
||||
@@ -541,6 +541,7 @@ export def dgrMode(mode)#1
|
||||
^show40 = 0
|
||||
^mapmain = 0
|
||||
^an3off
|
||||
call($FB2F, 0, 0, 0, 0) // INIT
|
||||
call($FC58, 0, 0, 0, 0) // home()
|
||||
wend
|
||||
return mode
|
||||
|
||||
@@ -462,6 +462,7 @@ export def grMode(mode)#1
|
||||
^show40 = 0
|
||||
^mapmain = 0
|
||||
^an3off
|
||||
call($FB2F, 0, 0, 0, 0) // INIT
|
||||
call($FC58, 0, 0, 0, 0) // home()
|
||||
wend
|
||||
return mode
|
||||
|
||||
@@ -1187,6 +1187,8 @@ export def hgrMode(mode)#1
|
||||
//
|
||||
^showpage1
|
||||
^showtext
|
||||
call($FB2F, 0, 0, 0, 0) // INIT
|
||||
call($FC58, 0, 0, 0, 0) // home()
|
||||
wend
|
||||
return mode
|
||||
end
|
||||
|
||||
@@ -1419,6 +1419,7 @@ def cmdmode#0
|
||||
conio:clear(cleol)
|
||||
conio:textctrl(ctrlecho, ON)
|
||||
conio:textctrl(ctrlcursor, ON)
|
||||
perr = 0 // Reset perr
|
||||
while not (flags & exit)
|
||||
puts(@filename)
|
||||
cmdptr = gets($BA)
|
||||
|
||||
Reference in New Issue
Block a user