Jump to content
IGNORED

IntyBASIC Horizontal Text Scrolling using GRAM?


First Spear

Recommended Posts

Please help me think through this idea.

 

A very long text string like this "Pack my box with five dozten liquor jugs. Please understand that this is fairly long!     "

 

Put black blocks in all GRAM locations.

 

Assign write GRAM 43 to Bitmap location 220, 44 to 221, 45 to 222, 46 to 223, 47 to 224...239.

 

I want to scroll that string from right to left on a single line, nothing taller than 8 px high.

 

Put that text into a long bitmap graphic, use IntyColor to convert it to a graphic.

 

Read the data that makes up the first 8x8 block, write it to GRAM 43, second 8x8 to GRAM 44, third 8x8 to GRAM 45, etc. up to GRAM 62 going to Backtab #239

 

Loop reads second block and writes it to GRAM 43, third block to 44, etc.

 

In a loop that should show a scrolling effect.

 

 

Am I way off here inmy thinking?

 

 

Thanks.

 

 

 

Link to comment
Share on other sites

include "constants.bas"

for i = 0 to 19
    #backtab(220+i) = text(i) * 8 + 7
next

i = 18
i2 = 7
start:
    scroll i2
    wait
    i2 = i2 - 1
    if i2 = 255 then 
        i2 = 7
        scroll ,,2
        i = i + 1
        if i >  84 then i = 0
        #backtab(239) = text(i) * 8 + 7
    end if
goto start

text:
data "Pack my box with five dozen liquor jugs. Please understand that this is fairly long! "

Edited by skywaffle
  • Like 1
Link to comment
Share on other sites

If you are looking for a title screen and not use any scrolling, your method would work the same, just not smooth:

 

include "constants.bas"

start:
    wait
    delay = delay + 1
    if delay > 10 then 
        delay = 0
        i2 = i2 + 1
        if i2 > 84 then i2 = 0
    end if

    for i = 0 to 19
        i3 = i + i2: if i3 > 84 then i3 = i3 - 85
        #backtab(220+i) = text(i3) * 8 + 7
    next

goto start

text:
data "Pack my box with five dozen liquor jugs. Please understand that this is fairly long! "

Edited by skywaffle
  • Like 1
Link to comment
Share on other sites

11 hours ago, skywaffle said:

That would work, however you could also use the scroll command to shift 8 pixels, and just update the rightmost block.   I am not sure which uses more resources, but with that, you could also incorporate smooth scrolling

Thanks Mr. Waffle. What I was thinking of was a hybrid between both of your awesome examples. I like the smooth scroll, but there is no way to only scroll the bottom row of tiles and leave the rest of the screen static, as far as I know. #learning

Link to comment
Share on other sites

If you want an actual smooth-scrolling bitmap, scrolling at something less than 8px granularity, and not scroll the rest of the screen, then you'll need to recompute bitmaps shifted over by however many pixels.  I've written assembly code to do that in the past.  

 

You probably can't get a full 20 tiles across, but you could probably manage 16.  

  • Like 1
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...