Luke Gorrie (lukego) wrote,
Luke Gorrie
lukego

Forth: baby steps with Geode

I did my first little odd job on OLPC: making the firmware's console snappier by scrolling the screen using the Geode graphics processor instead of the CPU. This turns out to be really simple using the tiny library for accessing the graphics processor registers:
: ypos ( line# -- y ) char-height *  window-top + ;

: fbgeode-delete-lines ( delta-#lines -- )
   line# + ypos  window-left  swap ( src-x,y )
   window-left  line# ypos         ( src-x,y dst-x,y )
   screen-width screen-height      ( src-x,y dst-x,y w,h )
   gp-move
;

\ Patch geode acceleration into an installed (fb16) framebuffer
: fbgeode-accelerate  ( -- )
   gp-setup
   ['] fbgeode-delete-lines is delete-lines
;   
This improves the speed of inserting a new line of text into the framebuffer from 58ms to 4.5ms.
Tags: forth, olpc
Subscribe
  • Post a new comment

    Error

    default userpic
    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 0 comments