Jump to content
IGNORED

How to position text in Graphics mode 1+16 in Atari BASIC?


Recommended Posts

Hi everyone!

 

I am trying to use Atari BASIC to print some text in graphics mode 1+16 but the position command seems not to do what you would expect.

 

The code below will show "hello" at the center of the top line and not at position 0,0.

10 graphics 1+16

20 position 0,0

30 print #6,"hello"

40 goto 40

 

 

How can I have the hello print at the top left corner in this graphic mode?

Link to comment
Share on other sites

  • 2 years later...

Although this isn't about using the +16 full screen mode, I thought it relevant to this topic and figured it would be best to drop this query here.

 

So I'm running a Graphics 2 screen with the text window still present.

 

I understand how to position text where you want it to appear in either the Graphic 1 or 2 screens within Basic, but I'll be darned if I can figure out how to position text within the 4-line small text window. Because the POSITION X,Y statement only seems to apply to the large text window. Any hints?

 

Link to comment
Share on other sites

1 hour ago, mytek said:

I understand how to position text where you want it to appear in either the Graphic 1 or 2 screens within Basic, but I'll be darned if I can figure out how to position text within the 4-line small text window. Because the POSITION X,Y statement only seems to apply to the large text window. Any hints?

Yes. The cursor position in the text window is in separate memory locations, namely in $290 for the row (Y position) and $291,$292 for the column (X position). The editor handler exchanges these with the regular row/column coordinates whenever an editor window is present below a graphics mode.

  • Like 2
Link to comment
Share on other sites

6 hours ago, thorfdbg said:

Yes. The cursor position in the text window is in separate memory locations, namely in $290 for the row (Y position) and $291,$292 for the column (X position). The editor handler exchanges these with the regular row/column coordinates whenever an editor window is present below a graphics mode.

Based on what you stated, this worked...

10 TXTROW=656:TXTCOL=657:GRAPHICS 2
20 POKE TXTROW,2:POKE TXTCOL,10:PRINT "HELLO";
30 GOTO 30

 

Your memory location  references helped me find it quickly on page 57 of "Mapping The Atari".

 

TXTROW-TXTCOL.png.935d13d9e58d0a36487cb225ca243dc8.png

 

Since there are only 4 lines in the standard text window in this graphics mode, TXTROW will be between 0-3.

 

I assumed that the MSB of TXTCOL (658) would default to zero after invoking GRAPHICS 2, so I didn't bother to set it.

 

Thank you :)

 

EDIT: I added a semicolon after the PRINT "HELLO";  - otherwise the cursor will jump to the bottom of the screen.

Edited by mytek
added semicolon
  • Like 2
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   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.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...