You are viewing lukego

Luke's Weblog - boing boing boing [entries|archive|friends|userinfo]
Luke Gorrie

[ website | My Website ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

boing boing boing [Aug. 14th, 2007|10:33 am]
Previous Entry Share Next Entry
[Tags|, ]
[Current Location |austrian hospice, jerusalem]

Today's XO firmware graphics hack makes the screen bounce up and down! To run it you first install a recent firmware (one having graphics processor words) and then type:
25 bouncing
after you've loaded this code of bounce.fth:
screen-ih iselect     \ open display device

: wait-vblank ( -- )  \ wait until the next screen refresh
   gp-wait-ready  0 0 wh!  h# 6000.00cc ropmode!   \ setup NOP
   b# 10000000000 blt!                             \ execute on next vblank
;
: origin-xy ( -- x y ) 0 0 ;
: screen-wh ( -- w h ) screen-width screen-height ;
: bounce-setup ( -- )
   gp-setup
   origin-xy  0 screen-height      screen-wh  gp-move
   ffff       0 screen-height 2 *  screen-wh  gp-fill
;
: bounce-step ( speed pos -- speed' pos' )
   over +         ( speed  pos' )
   swap 1- swap   ( speed' pos' )
;
: bounce-draw ( pos -- )
   screen-height +  0 swap  ( src-x,y )
   origin-xy screen-wh      ( src-x,y dst-x,y w,h )
   gp-move
;
: bounce ( init-speed -- )
   bounce-setup
   0 begin
      wait-vblank  bounce-step  dup bounce-draw    ( speed pos )
   dup 0= until  2drop
;      
: bouncing ( init-speed -- )
   recursive  dup 0> if  dup bounce  2 / bouncing  then
;
LinkReply

Comments:
From: (Anonymous)
2008-10-07 08:43 pm (UTC)

What firmware release.

(Link)

What firmware release for the XO has the graphics processor words?
From: syneklisnoy
2013-02-16 09:57 pm (UTC)

(Link)

Log in and let the naughty fun begin! Go Here welcomemyhomecat.blogspot.com