Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:05 12 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PicoMite VGA Text Scrolling

Author Message
Mark
Regular Member

Joined: 26/11/2022
Location: United States
Posts: 85
Posted: 01:04pm 25 Dec 2024
Copy link to clipboard 
Print this post

This is with MMBasic 5.08.

Is it possible to scroll (left, right, up and down) colored text with a VGA MODE 1 display (640 by 480)?

The Sprite Read and Write commands can be used to scroll the text but the text color layer isn't changed, so the color stays with what was there before. Is there a way to manipulate the text color layer when scrolling text?

Mark
Edited 2024-12-25 23:05 by Mark
 
twofingers

Guru

Joined: 02/06/2014
Location: Germany
Posts: 1576
Posted: 01:18pm 25 Dec 2024
Copy link to clipboard 
Print this post

From manual (p68):
  Quote  ... This form of the BLIT command is particularly useful for creating graphs that can scroll horizontally or
vertically as new data is added.
In addition, the firmware provides BLIT MEMORY, BLIT COMPRESSED, BLIT FRAMEBUFFER, and
BLIT MERGE commands. ...

I would start with that.
Michael
causality ≠ correlation ≠ coincidence
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1220
Posted: 01:20pm 25 Dec 2024
Copy link to clipboard 
Print this post

you can use the Tile command to recolor areas of the Monocrome Screen.
  Quote  TILE x, y [,foreground]
[,background] [,nbr_tiles_wide]
[,nbr_tiles_high]
--------------------------------------
Sets the colour for one or more tiles on the screen.
When in monochrome mode by default the VGA screen is split up into
80x40 tiles each 8x12 pixels. This matches font 1 and allows full colour
coding in the editor in monochrome mode.
Each tile can have a different foreground and background named colour
assigned to it from the following: white, yellow, lilac, brown, fuchsia, rust,
magenta, red, cyan, green, cerulean, midgreen, cobalt, myrtle, blue and
black.
'x' and 'y' are the coordinates of the start block (0-79, 0-39)
'foreground ' and 'background' are the new colours selected.
'nbr_tiles_wide' and 'nbr_tiles_high' are the number of tiles to change.
The change is instant and does not affect the text or graphics currently
displayed in the tiles (just the colours).

Edited 2024-12-25 23:20 by Martin H.
'no comment
 
Mark
Regular Member

Joined: 26/11/2022
Location: United States
Posts: 85
Posted: 03:23pm 25 Dec 2024
Copy link to clipboard 
Print this post

Thanks for the suggestion on BLIT. From what I can tell in MMBasic 5.08, BLIT and SPRITEs are the same. That's changed in 6.0 and BLIT's would be more appropriate with that version.

Thanks for the tip on TILE. I hadn't found that command. Now the question is can the existing TILE data be read and manipulated directly?

Mark
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5058
Posted: 06:01pm 25 Dec 2024
Copy link to clipboard 
Print this post

The game Flappy Bird side scrolls the screen. Similar texr can be scrolled.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Mark
Regular Member

Joined: 26/11/2022
Location: United States
Posts: 85
Posted: 10:13pm 25 Dec 2024
Copy link to clipboard 
Print this post

Thanks for the Flappy Birds pointer. I've looked at the code.

I haven't shared all my requirements. While sprites can be used to scroll the entire screen, I really want to scroll text within a rectangle. For example, I'd like to have fixed non-scrolling title row(s) at the top and status row(s) at the bottom. It would be nice to have non-scrolling column(s) at the left and right. The SPRITE SCROLL command used in flappy birds.

Even with full screen scrolling, the SPRITE method isn't as smooth as the scrolling with LIST ALL. I used the SPRITE method and LIST ALL with a 721 line program file. LIST all did it in about 12 seconds and the SPRITE method was 14. The LIST ALL text appears smoother.

Is there a way to use the scrolling used by LIST ALL? If so, can it be used to scroll less than full screen.

Please don't take my question as a negative comment or even a feature request. I'm just trying to figure what can be done with the existing MMBASIC.

Mark
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5058
Posted: 11:49am 26 Dec 2024
Copy link to clipboard 
Print this post

Mark,

You can print your text on layer N (normal visual layer), and the columns on layer L. Layer L should have a "window" to layer N using the transparent color for layer L.

If you now scroll layer N, only the text visible through the window will scroll.
Maybe you need a extra task to refresh the text before it is visible. Flappy bird uses a similar system, only it scrolls the foreground (posts) left, and the background (buildings) right (slower).

List all is a single command. Sprite Scroll needs to be controlled from MMBasic (in a loop). The interpreter makes it slower. But if you scroll 720 lines in 14 seconds, that is too fast. The text will not be readable for humans.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Mark
Regular Member

Joined: 26/11/2022
Location: United States
Posts: 85
Posted: 08:51pm 26 Dec 2024
Copy link to clipboard 
Print this post

I think I figured it out.

MM.INFO(WRITEBUFF) gives the address of the screen.

This can be used with MEMORY COPY to move text around on the screen.

Of course it keeps the colors set by the previous TILEs.

Mark
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025