Characters on HIRES screen

Everything related to BASIC version 1.x (Oric 1 and Atmos) or HYPERBASIC (Telestrat).
Don't hesitate to give your small program samples, technical insights, or questions...
User avatar
Vyper68
Flying Officer
Posts: 244
Joined: Mon Sep 22, 2014 4:18 pm
Location: Hurworth, UK
Contact:

Characters on HIRES screen

Post by Vyper68 »

Is there a way to print double height characters on a HIRES screen. I use CHAR for single height but wondered if it was possible to do this in BASIC.
Oric Extended Basic V1.1
(C) 1983 Tangerine
37631 Bytes Free
User avatar
6502Nerd
Flying Officer
Posts: 158
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

Re: Characters on HIRES screen

Post by 6502Nerd »

Unfortunately not from BASIC, CHAR only gives the option of FB mode and which charset (standard or alt). To create a new way in BASIC will be slow, but is possible.
User avatar
Vyper68
Flying Officer
Posts: 244
Joined: Mon Sep 22, 2014 4:18 pm
Location: Hurworth, UK
Contact:

Re: Characters on HIRES screen

Post by Vyper68 »

6502Nerd wrote: Sun Oct 12, 2025 8:21 pm Unfortunately not from BASIC, CHAR only gives the option of FB mode and which charset (standard or alt). To create a new way in BASIC will be slow, but is possible.
Thanks, I thought it was the case as I couldn't think of a way to do it and was wondering if I was missing something.
Oric Extended Basic V1.1
(C) 1983 Tangerine
37631 Bytes Free
User avatar
Dbug
Site Admin
Posts: 5263
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Characters on HIRES screen

Post by Dbug »

CHAR is a very slow function, because it allows you to print a character at any location at a pixel resolution.

But if you can deal with being restricted to a character column (multiple of 6) positioning, I guess you could do your own CHAR even in BASIC using PEEK and POKE, something like that (not tested):

Code: Select all

' C=Character code, H=Horizontal, V=Vertical position
A=#A000+H+V*40   ' Screen position
F=#9800+C*8         ' Font position
FOR Y=0 TO 7
   POKE A,PEEK(F+Y)+64  ' Read the character font and forces 64 to make it displayable
   A=A+40                       ' Next scanline
NEXT Y
Which obviously can easily be modified to handle double height:

Code: Select all

   V=PEEK(F+Y)+64     ' Read the character font and forces 64 to make it displayable
   POKE A,V               
   POKE A+40,V
   A=A+80                       ' Next scanline
User avatar
rax
Flying Officer
Posts: 254
Joined: Tue Jul 24, 2018 3:16 pm

Re: Characters on HIRES screen

Post by rax »

Here’s a slow but reliable way to print a character at any position on the screen in double height.
To do this, we use a helper character that we modify and print on the screen.
The program works in two passes:
1. It modifies the helper character with code 127 to contain the upper half of the letter we want to display, then prints it on the screen.
2. It then modifies the same character with the lower half of the letter and prints it again.

There’s also a small demo program that shows how to print text.

The subroutine for displaying a character starts from line 1000 and uses a few variables:
- X, Y – the position where we want to print the character
- C – the ASCII code of the character to display

The subroutine also uses the variables A1, A2, and Z.

Code: Select all

10 HIRES: A$="Lorem ipsum dolor sit amet"
20 FOR N=1 TO6:
30 ::X=20+N: Y=20+N*20
30 ::FOR I=1 TO LEN(A$)
40 ::::C=ASC(MID$(A$,I,1))
50 ::::GOSUB 1000
60 ::::X=X+6
70 ::NEXT
80 NEXT
90 END

1000 'PRINT CHAR
1001 ' X,Y - POS : C - ASCII CHAR NUM
1010 A1 = #9800+C*8 ' CHAR ADDRESS
1020 A2 = #9800+127*8 ' TEMP CHAR ADDRESS
1020 FOR Z=0TO7 : POKE A2+Z,PEEK(A1+Z/2) : NEXT
1030 CURSET X,Y,0 : CHAR 127,0,1
1040 A1=A1+4
1040 FOR Z=0TO7 : POKE A2+Z,PEEK(A1+Z/2) : NEXT
1050 CURSET X,Y+8,0 : CHAR 127,0,1
1060 RETURN
User avatar
6502Nerd
Flying Officer
Posts: 158
Joined: Thu Oct 08, 2020 9:48 pm
Location: Leicestershire, UK
Contact:

Re: Characters on HIRES screen

Post by 6502Nerd »

Nice way to do pixel level plotting! 👍🏽👍🏽
Post Reply