Jump to content
IGNORED

How to make a static status bar in Atari BASIC. :)


Recommended Posts

This probably won't work every time. Especially if more variables are added. There's no guarantee that DLIST$ and STAT$ are properly aligned (1kB and 4kB alignment).

 

A possible solution would be to overwrite the first three $70/112/'p' of the OS generated display list with a jump to page 6. Do your status bar there, including its screen memory, and jump back to the original display list.

 

  • Like 2
Link to comment
Share on other sites

1 minute ago, ivop said:

This probably won't work every time. Especially if more variables are added. There's no guarantee that DLIST$ and STAT$ are properly aligned (1kB and 4kB alignment).

 

A possible solution would be to overwrite the first three $70/112/'p' of the OS generated display list with a jump to page 6. Do your status bar there, including its screen memory, and jump back to the original display list.

 

This is true.

-Thom

 

Link to comment
Share on other sites

My point is, if someone absolutely wants to use E:ditor then they can use one that gives you the ability to build a text user interface. Currently available E: do not have this, so I suggest adding margins from the top and bottom as a standard first.

 

 

 

  • Like 2
Link to comment
Share on other sites

BTW I added line 10 so I didn't need to do that manually every time I checked if it was already working. If you leave it out, and only run line 20-80 once, you get the statusbar without a full reset of E:.

 

It's a pity there are no width and height E: variables ? Otherwise, it would be ease to subtract 1 of the height, and only temporarily adding 1 while printing to the lowest line. That would be a low cost bottom bar. But alas.

 

BTW2 note that the previous post does not overwrite anything of the original DL, even though the jump is wrong at the end. The first VBI will overwrite the ANTIC registers anyway with the contents of its shadow register. Looking into extending this to a top and bottom bar, but that would need to overwrite the $41 instruction at the end of the DL, and point back to somewhere on page 6, for the extra DL line and 40 bytes of screen memory.

 

Link to comment
Share on other sites

Here's both a top and bottom statusbar.

 

atari001.png.447100b568008fc52d80a2ac021ee33a.png atari002.png.cc12086cbc424e05e7e9b75059ca6e78.png

 

That's 94 bytes at the bottom of page six.

 

We could turn this into an AUTORUN.SYS, and save a bunch of BASIC token space :)

 

Edit: the ; at the end of status strings is important, or it'll try to print a cursor on the next line, which is non-existent.

 

Edit2: have a working AUTORUN.SYS now. Will release source etc... shortly. Working on a demo program. Must have been years since I've done so much BASIC programming ;)

 

test.atr

Edited by ivop
  • Like 3
Link to comment
Share on other sites

Here's a version that can be (re)initialized over and over again from BASIC

 

atari000.png.89bd91d0f0466a09f20a6cd9d2f76e03.png

 

Downside: it uses 153 ($99) bytes instead of 94 bytes on the bottom of page six.

 

Upside: if your BASIC program is RESET proof, you can reinstate the statusbars by running Q=USR(1536+94). Or if your program switches to other graphics modes for a while, once you get back to graphics 0, you can call the same USR() to get your statusbars back.

statusbar2.atr statusbar2.s

Link to comment
Share on other sites

On 2/3/2021 at 9:18 PM, ivop said:

...l no guarantee that DLIST$ and STAT$ are properly aligned (1kB and 4kB alignment).

1k aligned? AFAIK dIsplay list has to be within a 1kb segment

 

Screen memory 4k?

 

I‘m quite some time out of Atari coding, so maybe I‘m wrong. ?

 

 

  • Like 1
Link to comment
Share on other sites

57 minutes ago, Copper said:

1k aligned? AFAIK dIsplay list has to be within a 1kb segment

True, my wording was incorrect. But still, you cannot guarantee it won't cross a 1kB boundary.

57 minutes ago, Copper said:

Screen memory 4k?

Similar here. Screen memory cannot cross 4kB boundaries.

57 minutes ago, Copper said:

I‘m quite some time out of Atari coding, so maybe I‘m wrong. ?

No, you are right :)

  • Like 1
Link to comment
Share on other sites

I'm so glad my example was vastly improved upon. [emoji4]


Absolutely [emoji41]
My first ‚project‘ with CC65 and Atari in general since 1986 will be a status bar lib in C [emoji2957]


Gesendet von iPhone mit Tapatalk
  • 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...