Jump to content



Photo
- - - - -

Scrolling The Screen


  • Please log in to reply
3 replies to this topic

#1 Hugh

Hugh

    Newbie

  • Members
  • Pip
  • 9 posts
  • Location:London, uk

  • Calculators:
    fx-9860g slim

Posted 09 February 2009 - 02:20 PM

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.

#2 Andreas B

Andreas B

    Casio Freak

  • Members
  • PipPipPipPip
  • 160 posts
  • Gender:Male
  • Location:Norway

  • Calculators:
    fx-9860G SD

Posted 09 February 2009 - 09:14 PM

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.

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).

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 Hugh

Hugh

    Newbie

  • Members
  • Pip
  • 9 posts
  • Location:London, uk

  • Calculators:
    fx-9860g slim

Posted 09 February 2009 - 10:03 PM

That answers my other question, thanks! i was going to ask is there a way to get the address of the screen, then i can do it myself.

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 Hugh

Hugh

    Newbie

  • Members
  • Pip
  • 9 posts
  • Location:London, uk

  • Calculators:
    fx-9860g slim

Posted 09 February 2009 - 10:23 PM

Awesome. worked first time. Cheers,



// 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