Scrolling The Screen
#1
Posted 09 February 2009 - 02:20 PM
i am using Print() and PrintC to write to the screen [fx-9860g SDk], also locate(y,x) to set positions. However, i would like to be able to scroll the text up once it reaches the bottom. I can't find any such function in the API and Print does not appear to do this automatically - or is there a special character i can print to make this happen?
The only other way i can think of is to bitblt the pixels up manually, but this seems a messy way.
thanks for any help,
-- hugh.
#2
Posted 09 February 2009 - 09:14 PM
No practical functions among the ones that are included in the SDK. My approach would be to shift the content of the VRAM (display buffer).this is a bit of a novice question.
i am using Print() and PrintC to write to the screen [fx-9860g SDk], also locate(y,x) to set positions. However, i would like to be able to scroll the text up once it reaches the bottom. I can't find any such function in the API and Print does not appear to do this automatically - or is there a special character i can print to make this happen?
The only other way i can think of is to bitblt the pixels up manually, but this seems a messy way.
thanks for any help,
-- hugh.
Put the following assembly code in a file ending with ".src" instead of ".c" and add it to your project:
.section P, code .export _GetVRAMPtr _GetVRAMPtr: mov.l #H'0135, r0 mov.l #H'80010070, r2 jmp @r2 nop .end
It is an interface to a system call that is not already available by name in the SDK.
The defined function, GetVRAMPtr(), returns a pointer to the VRAM data block, independent of the OS version. You can then create a loop that shifts the data in the VRAM memory 'upwards' (towards the start of the VRAM data black). That is the most efficient way to do it.
#3
Posted 09 February 2009 - 10:03 PM
im running on a 9860g slim. i understand the screen address might be different in this model and didnt want to use a hardcoded value.
thanks for the code, i'll give it a go.
-- hugh.
#4
Posted 09 February 2009 - 10:23 PM
// scroll 1 line
unsigned char* d = GetVRAMPtr();
unsigned char* p = d + 128; // 128 bytes per line
memmove(d, p, 128*7); // move 7 lines
memset(d + 128*7, 0, 128); // erase last line
-- hugh.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users