GLBasic forum

Main forum => GLBasic - en => Topic started by: erico on 2011-Nov-02

Title: CAANOO experimenting test programs
Post by: erico on 2011-Nov-02
Hi everyone,

I have been messing with compiling for the caanoo and ran into a few problems.
As I run the code on it, the image is somehow buggie and I can´t actually read the buttons, things go quite slow too.

If anyone has a hint, I might be doing something awkward... :(
I´m running latest firmware too.

Here is the code:
Code (glbasic) Select
// --------------------------------- //
// Project: CAANOOTEST
// Start: Tuesday, November 01, 2011
// IDE Version: 10.118


// LOADINGS
SETCURRENTDIR("Media")

LOADFONT "smalfont.png",1
LOADSPRITE "SCR_TEST.png",0

SETFONT 1
SETSCREEN 320,240,1

// VARIABLES
GLOBAL x,y,r,z
z=1

GLOBAL x1,y1,z1,x2,y2,z2
GLOBAL rx1,ry1,rz1,rx2,ry2,rz2

GLOBAL b1,b2,b1$,b2$
b1$="off"
b2$="off"
GLOBAL t,tf1,tf2

CLEARSCREEN RGB(255,255,255)


// MAINLOOP
WHILE TRUE

// GET JOYS
x1=GETJOYX(0)
y1=GETJOYY(0)
z1=GETJOYZ(0)

rx1=GETJOYRX(0)
ry1=GETJOYRY(0)
rz1=GETJOYRZ(0)

FOR t=0 TO 15
b1=GETJOYBUTTON(0,t)
IF b1=128
tf1=t
b1$="ON"
BREAK
ELSE
b1$="off"
ENDIF
NEXT

x2=GETJOYX(1)
y2=GETJOYY(1)
z2=GETJOYZ(1)

rx2=GETJOYRX(1)
ry2=GETJOYRY(1)
rz2=GETJOYRZ(1)

FOR t=0 TO 15
b2=GETJOYBUTTON(1,t)
IF b2=128
tf2=t
b2$="ON"
BREAK
ELSE
b2$="off"
ENDIF
NEXT


// DRAW SPRITE
SMOOTHSHADING FALSE
// ALPHAMODE -1
ROTOZOOMSPRITE 0,x,y,r,z


// CONTROL SPRITE
x=x+x1*6
y=y+y1*6
IF z1>0.2 OR z1<-0.2
z=z+z1/10
ENDIF
IF rz1>0.05 OR rz1<-0.05
r=r+rz1*5
ENDIF

// GRAVITY
IF x>0 THEN x=x-1
IF x<0 THEN x=x+1
IF y>0 THEN y=y-1
IF y<0 THEN y=y+1
IF z>1.10 THEN z=z-0.02
IF z<0.90 THEN z=z+0.02
IF r>1.1 THEN r=r-0.5
IF r<0.9 THEN r=r+0.5

// TRANSFORM LIMITS
IF x>160 THEN x=160
IF x<-160 THEN x=-160
IF y>120 THEN y=120
IF y<-120 THEN y=-120
IF z>3 THEN z=3
IF z<-3 THEN z=-3
IF r>360 THEN r=360
IF r<-360 THEN r=-360


// PRINT INFO
PRINT "TEST-CAANOO CONTROLS",0,5

PRINT "JOY 1",0,20
PRINT "BUTTON "+tf1+" "+b1$,160,20
PRINT " X "+FORMAT$(3,2,x1),0,30
PRINT " Y "+FORMAT$(3,2,y1),0,40
PRINT " Z "+FORMAT$(3,2,z1),0,50
PRINT "rX "+FORMAT$(3,2,rx1),0,60
PRINT "rY "+FORMAT$(3,2,ry1),0,70
PRINT "rZ "+FORMAT$(3,2,rz1),0,80

PRINT "JOY 2",0,150
PRINT "BUTTON "+tf2+" "+b2$,160,210
PRINT " X "+FORMAT$(3,2,x2),0,160
PRINT " Y "+FORMAT$(3,2,y2),0,170
PRINT " Z "+FORMAT$(3,2,z2),0,180
PRINT "rX "+FORMAT$(3,2,rx2),0,190
PRINT "rY "+FORMAT$(3,2,ry2),0,200
PRINT "rZ "+FORMAT$(3,2,rz2),0,210


SHOWSCREEN
WEND


I´m also adding zip files with the pc and caanoo compiled versions.
It works perfectly on PC, I´m using a logitech dual shock.

The program is suppose to show joy 0 and 1 and buttons pressed.
With joy 0 you can move the image around with the left analog control, with the right one you get zoom and rotation.

After running it I also get this error log on caanoo:
Code (glbasic) Select
Start new log...
debug works at all
preplic
lic done
timer
rbow
rbow init
SDL_init video
SDL_GetVideoInfo = 320x240 @ 24 bpp
Setting video mode: 320x240x16 fl=40000000
SDL_SetVideoMode seems to be 1
mempool
setdrawbuf
close screen done
get screen ptr
get accurate timer - 1st call
flip - 1st call
init fbo
can't use framebuffer object
2D VP
OGRB init [OK]
Cptn
Network
Input
Window mode
Create DXin
caanoo sensor init
caanoo sensor initalized
reptr
getexe
cd
set cdir to: /mnt/sd/apps/CAANOOTEST.app
exepath=curdir= /mnt/sd/apps/CAANOOTEST.app
Init Finalized
set cdir to: Media
Shut down GLB
glb is shut down
setdrawbuf
free cbuffer
free zbuffer
close screen done


I hope it is just me and my amateur code... :'(

[attachment deleted by admin]
Title: Re: CAANOO experimenting test programs
Post by: erico on 2011-Nov-02
Ops, better add pictures too so you get a better idea...

[attachment deleted by admin]
Title: Re: CAANOO problems with simple test program
Post by: Kitty Hello on 2011-Nov-02
It seems the clearscreen is broken. Use a DRAWRECT 0,0,320,480,RGB(255,255,255) instead.
Title: Re: CAANOO problems with simple test program
Post by: erico on 2011-Nov-02
Thanks,
that fixes the strange image effects.

I also noticed that on pc, my joy responds 128 for buttons pressed, while on caanoo the result is different (changed the code to check anything different from 0).

I get the following buttons:
ID 0,1,2,3 as A,X,B,Y
ID 4 is the analog control button (ie, press the analog control)
ID 5 help I
ID 6 help II
ID 9 left shoulder butt.
ID 10 right shoulder butt.

nothing gets back ID 7 or 8, could be the home button and the on/off button, but don´t know.

The G sensor works fine, x,y from joy(1).

On the speed side, it seems quite slow compared to the pc output.
And I´m just using a 320x240 png and rotozoomsprite command with smoothshade off.
Is this normal?

Would polyvectors do a faster job?

I will try different approaches, maybe different image type? or size.

EDIT: ID´s are different now, not the ones I stated above...

[attachment deleted by admin]
Title: Re: CAANOO problems with simple test program
Post by: erico on 2011-Nov-03
Different image types does nothing.
A smaller size sprite(80x60) yells higher FPS, the current 320x240 sprite sluggs around.

with a 320x240 test sprite:
With rotozoomsprite, gets ~10 FPS
with polyvectors, I get ~20 FPS

I also noticed that on PC I can change from polyvectors to rotozoomsprite on the fly back an forth,
while on caanoo, I can´t get back to the polyvector mode, but from poly to sprite no problem.
smoothshade true or false also does nothing, seems always off.

I wish I could get to at least 30 FPS constant.
The solution may be to use smaller polyvector sprites... I need no zoom or rotation on current project.
I paralax scrooling screen will kill the game if speed is no good.

Here is the updated code:
Code (glbasic) Select
// --------------------------------- //
// Project: CAANOOTEST
// Start: Tuesday, November 01, 2011
// IDE Version: 10.118


// LOADINGS and SETUPS
SETCURRENTDIR("Media")

LOADFONT "smalfont.png",1
LOADSPRITE "SCR_TEST.png",0

SETFONT 1
SETSCREEN 320,240,1


// VARIABLES
GLOBAL x,y,r,z
z=1

GLOBAL x1,y1,z1,x2,y2,z2
GLOBAL rx1,ry1,rz1,rx2,ry2,rz2

GLOBAL b1,b2,b1$,b2$
b1$="off"
b2$="off"
GLOBAL t,tf1,tf2
GLOBAL m
GLOBAL FramesPerSecond
GLOBAL poly
poly=1


// MAINLOOP-------------------------------------------------------
WHILE TRUE

DRAWRECT 0,0,320,240,RGB(255,255,255)

// GET JOYS
x1=GETJOYX(0)
y1=GETJOYY(0)
z1=GETJOYZ(0)

rx1=GETJOYRX(0)
ry1=GETJOYRY(0)
rz1=GETJOYRZ(0)

FOR t=1 TO 15
b1=GETJOYBUTTON(0,t)
IF b1>0
tf1=t
b1$="ON"
BREAK
ELSE
b1$="off"
ENDIF
NEXT

x2=GETJOYX(1)
y2=GETJOYY(1)
z2=GETJOYZ(1)

rx2=GETJOYRX(1)
ry2=GETJOYRY(1)
rz2=GETJOYRZ(1)

FOR t=0 TO 15
b2=GETJOYBUTTON(1,t)
IF b2>0
tf2=t
b2$="ON"
BREAK
ELSE
b2$="off"
ENDIF
NEXT

// POLY or SPRITE
m=GETJOYBUTTON(0,1)
IF m<>0 AND poly=0
poly=1
SLEEP 500
ENDIF

m=GETJOYBUTTON(0,1)
IF m<>0 AND poly=1
poly=0
SLEEP 500
ENDIF

IF poly=TRUE
STARTPOLY 0
POLYVECTOR   0+x,   0+y,   0,   0, RGB(255,255,255)
POLYVECTOR   0+x, 240+y,   0, 240, RGB(255,255,255)
POLYVECTOR 320+x, 240+y, 320, 240, RGB(255,255,255)
POLYVECTOR 320+x,   0+y, 320,   0, RGB(255,255,255)
ENDPOLY
ENDIF

IF poly=FALSE
ROTOZOOMSPRITE 0,x,y,r,z
ENDIF



// CONTROL SPRITE
x=x+x1*6
y=y+y1*6

// CAANOO G SENSOR
IF y2>0.5 OR y2<0.2
z=z+y2/10
ENDIF
IF x2>0.05 OR x2<-0.05
r=r+x2*5
ENDIF

// ANALOG LOGITECH JOYR
IF rz1>0.2 OR rz1<-0.2
z=z+rz1/10
ENDIF
IF z1>0.05 OR z1<-0.05
r=r+z1*5*-1
ENDIF


// GRAVITY
IF x>0 THEN x=x-1
IF x<0 THEN x=x+1
IF y>0 THEN y=y-1
IF y<0 THEN y=y+1
IF z>1.10 THEN z=z-0.02
IF z<0.90 THEN z=z+0.02
IF r>1.1 THEN r=r-0.5
IF r<0.9 THEN r=r+0.5

// TRANSFORM LIMITS
IF x>160 THEN x=160
IF x<-160 THEN x=-160
IF y>120 THEN y=120
IF y<-120 THEN y=-120
IF z>3 THEN z=3
IF z<-3 THEN z=-3
IF r>360 THEN r=360
IF r<-360 THEN r=-360


// PRINT INFO
PRINT "TEST-CAANOO CONTROLS",0,5

PRINT "JOY 1",0,20
PRINT "BUTTON "+tf1+" "+b1$,160,20
PRINT " X "+FORMAT$(3,2,x1),0,30
PRINT " Y "+FORMAT$(3,2,y1),0,40
PRINT " Z "+FORMAT$(3,2,z1),0,50
PRINT "rX "+FORMAT$(3,2,rx1),0,60
PRINT "rY "+FORMAT$(3,2,ry1),0,70
PRINT "rZ "+FORMAT$(3,2,rz1),0,80

PRINT "JOY 2",0,150
PRINT "BUTTON "+tf2+" "+b2$,160,210
PRINT " X "+FORMAT$(3,2,x2),0,160
PRINT " Y "+FORMAT$(3,2,y2),0,170
PRINT " Z "+FORMAT$(3,2,z2),0,180
PRINT "rX "+FORMAT$(3,2,rx2),0,190
PRINT "rY "+FORMAT$(3,2,ry2),0,200
PRINT "rZ "+FORMAT$(3,2,rz2),0,210

FramesPerSecond=FPS()
PRINT "FPS= "+FramesPerSecond,220,5
PRINT "POLYVECTORS= "+poly,160,220

SHOWSCREEN
WEND

// END MAIN LOOP-----------------------------------------------------


FUNCTION FPS:
// created by Hemlos
STATIC OldTimeReport$,FPSDat,TimeReport$,FPSd
OldTimeReport$=TimeReport$; FPSDat=FPSDat+1;
TimeReport$=PLATFORMINFO$("TIME")
IF OldTimeReport$<>TimeReport$; FPSd=FPSDat ; FPSDat=0; ENDIF
RETURN FPSd
ENDFUNCTION


No rotations or zoom on the polyvector mode yet, I´m quite scared of sin and cos stuff :blink:

I´m also attaching zips of current .exe for pc and caanoo.
I´m also using Hemlos fps function ;/

Any hints on it?
No glbasic caanoo users but me? Beating canon fodder with a single soldier is tough ;)

ps: the g-sensor is lovely working!

[attachment deleted by admin]
Title: Re: CAANOO problems with simple test program
Post by: erico on 2011-Nov-03
better add the errorlog.txt too

Code (glbasic) Select
Start new log...
debug works at all
preplic
lic done
timer
rbow
rbow init
SDL_init video
SDL_GetVideoInfo = 320x240 @ 24 bpp
Setting video mode: 320x240x16 fl=40000000
SDL_SetVideoMode seems to be 1
mempool
setdrawbuf
close screen done
get screen ptr
get accurate timer - 1st call
flip - 1st call
init fbo
can't use framebuffer object
2D VP
OGRB init [OK]
Cptn
Network
Input
Window mode
Create DXin
caanoo sensor init
caanoo sensor initalized
reptr
getexe
cd
set cdir to: /mnt/sd/apps/CAANOOTEST.app
exepath=curdir= /mnt/sd/apps/CAANOOTEST.app
Init Finalized
set cdir to: Media
Shut down GLB
glb is shut down
setdrawbuf
free cbuffer
free zbuffer
close screen done


How do I turn this off? because it gets generated does it mean something is wrong?
I wonder about this lines:

SDL_GetVideoInfo = 320x240 @ 24 bpp
Setting video mode: 320x240x16 fl=40000000
...
can't use framebuffer object

EDIT : changed subject title ;/
Title: Re: CAANOO problems with simple test program
Post by: Kitty Hello on 2011-Nov-03
ignore these.
Title: Re: CAANOO problems with simple test program
Post by: MrTAToad on 2011-Nov-03
Caanoo's seem to be very hard to get hold of - I could like a nice cheap one :)
Title: Re: CAANOO experimenting test programs
Post by: erico on 2011-Nov-04
yep, it´s lovely, I guess the cheapest you can get is from playasia, at around 150$+shipping I guess. Ebay may do cheaper...
I will be posting more info maybe a video down the announcements caanoo suport thread as I figure the basics out on running glbasic on it.

So here is the final test code:
Code (glbasic) Select
// --------------------------------- //
// Project: CAANOOTEST
// Start: Tuesday, November 01, 2011
// IDE Version: 10.118


// LOADINGS and SETUPS
SETCURRENTDIR("Media")

LOADFONT "smalfont.png",1
LOADSPRITE "SCR_TEST.png",0
LOADSPRITE "ST1.png",1
LOADSPRITE "ST2.png",2
LOADSPRITE "ST3.png",3
LOADSPRITE "ST4.png",4

SETFONT 1
SETSCREEN 320,240,1


// VARIABLES
GLOBAL x,y,r,z
z=1

GLOBAL x1,y1,z1,x2,y2,z2
GLOBAL rx1,ry1,rz1,rx2,ry2,rz2

GLOBAL b1,b2,b1$,b2$
b1$="off"
b2$="off"
GLOBAL t,tf1,tf2
GLOBAL m
GLOBAL FramesPerSecond
GLOBAL poly,poly$
poly=3


// MAINLOOP-------------------------------------------------------
WHILE TRUE

DRAWRECT 0,0,320,240,RGB(255,255,255)


// DISPLAY MANAGER
m=GETJOYBUTTON(0,1)
IF m<>0 AND poly=0
poly=1
SLEEP 500
ENDIF

m=GETJOYBUTTON(0,1)
IF m<>0 AND poly=1
poly=3
SLEEP 500
ENDIF

m=GETJOYBUTTON(0,1)
IF m<>0 AND poly=2
poly=0
SLEEP 500
ENDIF

m=GETJOYBUTTON(0,1)
IF m<>0 AND poly=3
poly=2
SLEEP 500
ENDIF

// DISPLAY POLY
IF poly=1
STARTPOLY 0
POLYVECTOR   0+x,   0+y,   0,   0, RGB(255,255,255)
POLYVECTOR   0+x, 240+y,   0, 240, RGB(255,255,255)
POLYVECTOR 320+x, 240+y, 320, 240, RGB(255,255,255)
POLYVECTOR 320+x,   0+y, 320,   0, RGB(255,255,255)
ENDPOLY
ENDIF

// DISPLAY SPRITE
IF poly=0
ROTOZOOMSPRITE 0,x,y,r,z
//DRAWSPRITE 0,x,y
//ZOOMSPRITE 0,x,y,z,z
//ROTOSPRITE 0,x,y,r
ENDIF

// DISPLAY MULTISPRITES
IF poly=2
//ROTOZOOMSPRITE 1,x,y,r,z
//ROTOZOOMSPRITE 2,x+160,y,r,z
//ROTOZOOMSPRITE 3,x,y+120,r,z
//ROTOZOOMSPRITE 4,x+160,y+120,r,z

//DRAWSPRITE 1,x,y
//DRAWSPRITE 2,x+160,y
//DRAWSPRITE 3,x,y+120
//DRAWSPRITE 4,x+160,y+120

//ZOOMSPRITE 1,x,y,z,z
//ZOOMSPRITE 2,x+160,y,z,z
//ZOOMSPRITE 3,x,y+120,z,z
//ZOOMSPRITE 4,x+160,y+120,z,z

ROTOSPRITE 1,x,y,r
ROTOSPRITE 2,x+160,y,r
ROTOSPRITE 3,x,y+120,r
ROTOSPRITE 4,x+160,y+120,r

ENDIF

// DISPLAY MULTI POLY
IF poly=3
// STARTPOLY 1
// POLYVECTOR   0+x,   0+y,   0,   0, RGB(255,255,255)
// POLYVECTOR   0+x, 120+y,   0, 120, RGB(255,255,255)
// POLYVECTOR 160+x, 120+y, 160, 120, RGB(255,255,255)
// POLYVECTOR 160+x,   0+y, 160,   0, RGB(255,255,255)
// ENDPOLY
//
// STARTPOLY 2
// POLYVECTOR 160+x,   0+y,   0,   0, RGB(255,255,255)
// POLYVECTOR 160+x, 120+y,   0, 120, RGB(255,255,255)
// POLYVECTOR 320+x, 120+y, 160, 120, RGB(255,255,255)
// POLYVECTOR 320+x,   0+y, 160,   0, RGB(255,255,255)
// ENDPOLY
//
// STARTPOLY 3
// POLYVECTOR   0+x, 120+y,   0,   0, RGB(255,255,255)
// POLYVECTOR   0+x, 240+y,   0, 120, RGB(255,255,255)
// POLYVECTOR 160+x, 240+y, 160, 120, RGB(255,255,255)
// POLYVECTOR 160+x, 120+y, 160,   0, RGB(255,255,255)
// ENDPOLY

STARTPOLY 4
POLYVECTOR 160+x, 120+y,   0,   0, RGB(255,255,255)
POLYVECTOR 160+x, 240+y,   0, 120, RGB(255,255,255)
POLYVECTOR 320+x, 240+y, 160, 120, RGB(255,255,255)
POLYVECTOR 320+x, 120+y, 160,   0, RGB(255,255,255)
ENDPOLY
ENDIF



// CONTROL SPRITE

// GET JOYS
x1=GETJOYX(0)
y1=GETJOYY(0)
z1=GETJOYZ(0)

rx1=GETJOYRX(0)
ry1=GETJOYRY(0)
rz1=GETJOYRZ(0)

x2=GETJOYX(1)
y2=GETJOYY(1)
z2=GETJOYZ(1)

rx2=GETJOYRX(1)
ry2=GETJOYRY(1)
rz2=GETJOYRZ(1)

// GET BUTTONS
FOR t=1 TO 15
b1=GETJOYBUTTON(0,t)
IF b1>0
tf1=t
b1$="ON"
BREAK
ELSE
b1$="off"
ENDIF
NEXT

FOR t=0 TO 15
b2=GETJOYBUTTON(1,t)
IF b2>0
tf2=t
b2$="ON"
BREAK
ELSE
b2$="off"
ENDIF
NEXT

// MOVE OBJECT
x=x+x1*6
y=y+y1*6

// READ G SENSOR
IF y2>-0.2 OR y2<0.8
z=z+y2/10
ENDIF
IF x2>0.2 OR x2<0.6
r=r+x2*5
ENDIF

// READ ANALOG LOGITECH DUALSHOCK (right joy)
IF rz1>0.2 OR rz1<-0.2
z=z+rz1/10
ENDIF
IF z1>0.05 OR z1<-0.05
r=r+z1*5*-1
ENDIF


// GRAVITY
IF x>0 THEN x=x-1
IF x<0 THEN x=x+1
IF y>0 THEN y=y-1
IF y<0 THEN y=y+1
IF z>1.10 THEN z=z-0.02
IF z<0.90 THEN z=z+0.02
IF r>1.1 THEN r=r-0.5
IF r<0.9 THEN r=r+0.5

// TRANSFORM LIMITS
IF x>160 THEN x=160
IF x<-160 THEN x=-160
IF y>120 THEN y=120
IF y<-120 THEN y=-120
IF z>3 THEN z=3
IF z<-3 THEN z=-3
IF r>360 THEN r=360
IF r<-360 THEN r=-360


// PRINT INFO
PRINT "TEST-CAANOO CONTROLS",0,5

PRINT "JOY 1",0,20
PRINT "BUTTON "+tf1+" "+b1$,160,20
PRINT " X "+FORMAT$(3,2,x1),0,30
PRINT " Y "+FORMAT$(3,2,y1),0,40
PRINT " Z "+FORMAT$(3,2,z1),0,50
PRINT "rX "+FORMAT$(3,2,rx1),0,60
PRINT "rY "+FORMAT$(3,2,ry1),0,70
PRINT "rZ "+FORMAT$(3,2,rz1),0,80

PRINT "JOY 2",0,150
PRINT "BUTTON "+tf2+" "+b2$,160,210
PRINT " X "+FORMAT$(3,2,x2),0,160
PRINT " Y "+FORMAT$(3,2,y2),0,170
PRINT " Z "+FORMAT$(3,2,z2),0,180
PRINT "rX "+FORMAT$(3,2,rx2),0,190
PRINT "rY "+FORMAT$(3,2,ry2),0,200
PRINT "rZ "+FORMAT$(3,2,rz2),0,210

FramesPerSecond=FPS()
PRINT "FPS= "+FramesPerSecond,220,5

IF poly=0 THEN poly$="SPRITE"
IF poly=1 THEN poly$="POLY V"
IF poly=2 THEN poly$="MULT S"
IF poly=3 THEN poly$="MULT P"
PRINT "MODE= "+poly$,160,220

SHOWSCREEN
WEND

// END MAIN LOOP-----------------------------------------------------


FUNCTION FPS:
// created by Hemlos
STATIC OldTimeReport$,FPSDat,TimeReport$,FPSd
OldTimeReport$=TimeReport$; FPSDat=FPSDat+1;
TimeReport$=PLATFORMINFO$("TIME")
IF OldTimeReport$<>TimeReport$; FPSd=FPSDat ; FPSDat=0; ENDIF
RETURN FPSd
ENDFUNCTION


Out of testing sprites and polyvectors, I get the following basic figures:

TYPE              #   RES      FPS      OBS

polyvector     1   320x240   24
polyvector     1   160x240   34
multi poly      4   160x240   -   shows only first polyvector(am I doing something wrong on the code here?)!

sprite            1   320x240   36   drawsprite
sprite           1   320x240   36   zoomsprite
sprite           1   320x240   12   rotosprite
sprite           1   320x240   11   rotozoomsprite

multi sprite   4   160x120   37   drawsprite
multi sprite   4   160x120   35   zoomsprite
multi sprite   4   160x120   19   rotosprite
multi sprite   4   160x120   18   rotozoomsprite

- So it seems the polyvector is faster when smaller but slower then sprite.
- Could not test multipoly vector, as it showed just #1, but may be my lousy code :P (first time polyvectors...)
- Drawsprite and zoomsprite commands seem to hold nice, above 30 fps and things can start up! :)
- Anything rotation is frame killer. :(

I guess this at least shows current limitations on drawing basic things I ran into(bear in mind it is just me).
I haven´t tried sprite to mem stuff neither drawing lines and boxes, as the former is yet a bit over my mind and the latter is not needed yet, although drawrect to paint the background white every loop seems to work fine.
All tests went ok on PC and showed what was supposed to on 60 fps.

I think with these controls and handling gfx I can advance to a full simple game to further test the other game things, like sound, collisions, mouse or touchscreen.
I will remake a COCO game I did long time ago(with get and put and 16kb memory, gasp :P). If it turns out any good I could even sell for a buck on cashable platforms :whistle:

But as a generalist (ye, do a little of all, nothing good enough), I better have something fully done on multiplatforms and also increase the caanoo information we have around the forum.

Final exe for pc and caanoo are attached.

EDIT: moderators, can the subject be changed to "CAANOO control and sprites test code" maybe? I find the word "problem" to be too heavy.
EDIT2: canon fodder with a squad of 3 has higher chances dosen´t it? Thanks Kitty and Mr Tatoad.




[attachment deleted by admin]
Title: Re: CAANOO experimenting test programs
Post by: Kitty Hello on 2011-Nov-04
Yes, the Caanoo, Wiz code is highly optimized for DRAWSPRITE, so use that whenever possible.

The zooming and rotating requires calling the software rasterizer, which is pretty fast but not overwhelming.
Title: Re: CAANOO experimenting test programs
Post by: erico on 2011-Nov-19
Just a last note,

I have been coding my 320x240 game with drawsprite and drawanim and so far I have rock solid 60fps on the caanoo.
Wondeful! :good:

...and I have been drawing a loooot of sprites, some really huge and it all holds perfectly!
Great! I´m happy!

and my code is not even close to be optimized for all that drawing!