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

Changing the 8-pixel font by POKE works differently from GW-BASIC #198

Open
robhagemans opened this issue Jul 13, 2022 · 1 comment
Open
Assignees

Comments

@robhagemans
Copy link
Owner

PC-BASIC can change the 8-bit font in CGA mode, but the way this works is different from GW-BASIC.

Consider the code from PC-Magazine's PEEKs and POKES articles (12 Nov 1985 and 26 Nov 1985):

30 SCREEN 1,0:COLOR 1,1:KEY OFF:CLS
70 CLEAR,49152!
90 DEFINT I:I=0
100 DEF SEG=0
110 POKE 124,0
120 POKE 125,192
130 POKE 126,PEEK(1296)
140 POKE 127,PEEK(1297)
150 DEF SEG
160 POKE 49152!,132
170 POKE 49153!,136
180 POKE 49154!,158
190 POKE 49155!,162
200 POKE 49156!,70
210 POKE 49157!,130
220 POKE 49158!,14
230 POKE 49159!,0
240 LOCATE 12,20:PRINT CHR$(128)

This is expected to show a redefined glyph that resembles the vulgar fraction 1/3.
However, PC-BASIC does not allow changing low-memory addresses 124--126, and instead needs the user to overwrite the original addresses where the font is stored:

30 SCREEN 1,0:COLOR 1,1:KEY OFF:CLS
100 DEF SEG=0
150 ADDR=PEEK(125)*256+PEEK(124)
155 DEF SEG=PEEK(127)*256+PEEK(126)
160 POKE ADDR  ,132
170 POKE ADDR+1,136
180 POKE ADDR+2,158
190 POKE ADDR+3,162
200 POKE ADDR+4,70
210 POKE ADDR+5,130
220 POKE ADDR+6,14
230 POKE ADDR+7,0
240 LOCATE 12,20:PRINT CHR$(128)

This in turn does not work on GW-BASIC on DOSBox. Note however that the original code does not work on DOSBox either and shows a glyph made up of random dots. It may well be that DOSBox's emulation does not allow setting these memory ranges.

Further investigation needed to see if the original font address can be overwritten in GW-BASIC (not on DOSBox) or if this is a ROM area instead.

@robhagemans
Copy link
Owner Author

Update: VirtualBox's CGA mode emulation seems broken entirely, but both bits of code work on a PC AT simulated on pcjs.org.

@robhagemans robhagemans self-assigned this Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant