Jump to content
  • 0
mobluse

20x30, 40x15, 20x15 text mode

Question

There are these text modes (below) now, but I would also like 20x30, 40x15, 20x15 text. They would be useful for making apps for visually impaired or that could be seen from a long distance. If I must choose only one of these text modes to be added, I would prefer 20x15. I know these characters could be drawn using bitmap graphics, but I would prefer e.g. a 20x15 text mode that works using PRINT in BASIC. Clarified feature request: Line wrap and screen editing should work as normal with e.g. 20x15 text mode.

$00 40x30 text  
$01 80x30 text (currently unsupported)
$02 80x60 text  
$80 320x200@256c
40x25 text
Edited by mobluse

Share this post


Link to post
Share on other sites

13 answers to this question

Recommended Posts

  • 0
Quote

10 SCREEN 0:REM 40X30
20 POKE $9F2A,32
20 POKE $9F2B,32

Gives you 20x15

You can omit line 10 and still get the same result, but then your cursor disappears.

Have a look at the VERA documenation and search for HSCALE or VSCALE

Edited by JimmyDansbo

Share this post


Link to post
Share on other sites
  • 0

Thanks! but there are problems with it. I wrote:

Quote

10 SCREEN 0:REM 40X30
20 POKE $9F2A,32
30 POKE $9F2B,32
40 PRINT "X16   ";
50 GOTO 40

and RUN it and press Esc, but then "BREAK IN 40" and "READY." is not seen until I press Enter a number of times, and then it appears, but then there is no cursor and you cannot list the program. This 20x15 mode would need to be a bit improved so that line wrap works and the cursor is the same as before.

Share this post


Link to post
Share on other sites
  • 0

yeah, the interactive basic prompt will not "recognise" the resolution to be lower than 40x30 characters.

Your program however can deal with this just fine, If you're not printing text lines that wrap over the screen edges.  Just contrain everything within 20 columns and 15 rows and you should be ok

Share this post


Link to post
Share on other sites
  • 0
Quote

10 SCREEN 0
20 POKE $9F2A,32
30 POKE $9F2B,32
40 POKE $386,20
50 POKE $387,15

This should solve it, although the addresses $386 and $387 might change with new releases of the KERNAL

Share this post


Link to post
Share on other sites
  • 0

I tested this:

Quote

10 SCREEN 0
20 POKE $9F2A,32
30 POKE $9F2B,32
40 POKE $386,20
50 POKE $387,15
60 N=0
70 PRINT N;
80 N=N+1
90 GOTO 70

but it skips some numbers each third line when printing 4-digit numbers. I think line wrap and the screen editor should work as normal in 20x15 text mode.

Share this post


Link to post
Share on other sites
  • 0

Although this won't fix the skipped numbers, I recommend that you add these lines:

Quote

52 POKE $388,16
54 POKE $389,14

The kernal uses these variables, and sets them when switching to other screen modes. Therefore, setting them will likely make 20x15 mode act a bit more normal.

Share this post


Link to post
Share on other sites
  • 0
43 minutes ago, mobluse said:

I tested this:

but it skips some numbers each third line when printing 4-digit numbers. I think line wrap and the screen editor should work as normal in 20x15 text mode.

It skips on the two-digit numbers as well. They just go by so fast that you don't see them unless you add a delay in the loop.

Share this post


Link to post
Share on other sites
  • 0

In the Commander X16 ROM, switching between the officially supported screen sizes is handled by the kernal function screen_set_mode, located in kernal/drivers/x16/screen.s. Prior to returning, this routine performs a JSR to a routine called scnsiz, which is located in kernal/cbm/editor.s. It sets $386 and $387 (labelled as llen and nlines, respectively), then proceeds to set $388 and $389. Specifically, $388 contains the number of lines plus one, and $389 contains the number of lines minus one. Although I am not sure exactly what they do, they are referenced multiple times in the file, so they are likely used for something important.

  • Thanks 1

Share this post


Link to post
Share on other sites
  • 0

I think if I were going to use a 20×15 screen, I'd rather just handle it in software for now, as in your recommendations to add lines 52 and 54 rather than make changes to a ROM image that currently doesn't even match what's in Proto2, much less Proto3...

Except that for some reason, the software solution doesn't work.

Edited by kelli217

Share this post


Link to post
Share on other sites
  • 0

The reason why it doesn't work with the official ROM is because the routines screen_set_char and screen_get_char in kernal/drivers/x16/screen.s are not equipped to handle more than one continuation line. Continuation lines are created when text (whether typed or printed by a program) goes off the right side of the screen, and wraps around to the left. These lines are handled differently by the kernal in order to allow line wrapping of BASIC code in 40x30 mode. As long as you make sure this does not happen, 20x15 mode should work fine.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Please review our Terms of Use