Scroll portion of screen with clib ansi

Discussion about other targets
Post Reply
DJ Sures
Member
Posts: 67
Joined: Sun Dec 11, 2022 12:41 pm

Scroll portion of screen with clib ansi

Post by DJ Sures »

Hello - I'm looking to port some of my text-based applications to the clib=ansi using conio.h for gotoxy() and vtrendition() on TMS9918a VDP. The thing is, I need to scroll a portion of the screen between rows. For example, scroll text UP between rows 3 and 12.

I created a small function to read the name table from vdp and move everything up 32 columns, which does scroll the top 1/3 of the screen. That is when I realized the pattern and color generators are using the 3/3 memory setting in the vdp - which makes sense since the fonts are dynamically drawn to the pattern generator.

So, before I start creating a function to copy the pattern and color generator with the nametable data, is there already a function for scrolling a window (between top and bottom rows)?
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: Scroll portion of screen with clib ansi

Post by dom »

I've got a memory of something like this coming in the past and I thought it was great idea and started work on it.

However, I can't find any trace of it unfortunately.
DJ Sures
Member
Posts: 67
Joined: Sun Dec 11, 2022 12:41 pm

Re: Scroll portion of screen with clib ansi

Post by DJ Sures »

Thanks for the response, dom - I was hoping there was a simple scrollUp(topRow, bottomRow) command that would use the same text scrolling code from clib ansi.

Shifting the data in the pattern and color generator isn't that much more effort, so it's something that I can do. I was struggling to find the source files for ansi console - I did find the videotms9918a.txt - which helped me get the register settings for the address configuration. I'll also have to poke a bit more to get the pattern and color generator addresses.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: Scroll portion of screen with clib ansi

Post by dom »

The addresses are documented here: https://github.com/z88dk/z88dk/wiki/Classic-TMS9918 - they basically match the default MSX configuration.

The VDP code is located here: https://github.com/z88dk/z88dk/tree/mas ... eo/tms9918

There's (assembler) variables named: __tms9918_pattern_name and __tms9918_pattern_generator which are setup by changing screen mode.
Post Reply