memory location of screen width in screen 1?

By Pineapple

Supporter (12)

Pineapple's picture

31-05-2020, 04:46

I'm hoping someone can help.
I'm trying out x-basic, which seems great, but the lack of a WIDTH function is causing some issues with my program.
the msx2 technical handbook suggests that it's at either memory location F3AFH or F3B0H, but peeking, poking, vpeeking or vpoking these locations seems to do nothing and I can't seem to find the memory location in any of the other books I've tried.

Does anyone know the proper memory location for the text width in screen 1, or possibly an x-basic workaround for setting the width to 32?

Thanks.

Login or register to post comments

By epolesi

Supporter (2)

epolesi's picture

31-05-2020, 08:13

F3AFH is the width for the NEXT screen 1 mode change.
F3B0H is the width of the CURRENT text screen.
Changing none of them will change the current screen width, but.. try this:

POKE &HF3AF,32 : SCREEN 1

It should set screen 1 with width 32.

By theNestruo

Master (138)

theNestruo's picture

31-05-2020, 10:00

Actually, POKEing $F3B0 (LINLEN) and $F3B1 (CRTCNT) does affect current screen width for BASIC instructions (CLS, PRINT, ...)
Given that BASIC's PRINT "handles" the scrolling of the name table if you print beyond the last line... this POKEs can be used to print a border/HUD, then POKE those vlaues, then handle the game area using PRINT to get "automatic" scroll Smile

Dummy example: https://msxpen.com/codes/-M8diFXhzmmoKsHOYIYA

Reference: http://map.grauw.nl/resources/msxsystemvars.php

By thegeps

Champion (442)

thegeps's picture

31-05-2020, 11:56

cool trick theNestruo

By Pineapple

Supporter (12)

Pineapple's picture

31-05-2020, 16:52

Thanks! looks like I had the memory location, but didn't know what to do with it.