I tried to make Caanoo version of APong and run into a problem. Game works perfectly, but reacts only to keys "I" and "II".
After a few days of unlucky digging I wrote this test code:
[code language="bennu"]import "mod_text"
import "mod_key"
import "mod_video"
import "mod_mouse"
import "mod_map"
import "mod_joy"
import "mod_screen"
global
string s1 = "SYSINFO";
end
///////////////////////////////////////////////////////////////////////////////
function draw_joystate( )
local
int i, j, dx, dy, t, yy;
string zz;
end
begin
yy = 30;
for( i = 0; i<5 ; i++ )
zz = i+") ";
for( j = 0; j<16 ; j++ )
zz += joy_getbutton ( i, j );
end
zz += " | ";
zz += joy_getaxis ( i, 0 ) + " ";
zz += joy_getaxis ( i, 1 ) + " ";
zz += joy_getaxis ( i, 2 ) + " ";
zz += joy_getaxis ( i, 3 ) + " ";
zz += " | ";
t = joy_getball ( i , &dx , &dy);
zz += t+" ("+dx+","+dy+") ";
zz += joy_gethat( i )+" ";
write( 0, 0, yy+=10, 0, zz );
end
zz = "KEY: ";
for( i=0; i<255; i++ )
if( key(i) ) zz += i+" "; end
end
write( 0, 0, yy+=10, 0, zz );
end
///////////////////////////////////////////////////////////////////////////////
process main()
local
int m;
end
begin
set_mode ( 320, 240, 16 );
s1 = "OS:" + os_id + " C:" +COMPILER_VERSION+" V:"+__VERSION__;
loop
delete_text( ALL_TEXT );
draw_joystate( );
write( 0, 160, 15 , 4, s1 );
frame;
if( mouse.left ) break; end;
end;
m = screen_get();
png_save( 0, m ,"report.png");
end
[/code]
I had no reaction at all.
Attached screen shot is taken when L+R+A+B+X+Y are pressed and stick moved right.
Firmware version 1.0.6, BGD revision 165
Anyone who owe Caanoo, please test this code. As far as I see the code has no errors, so I had a feeling that this is problem of my exact console.
use last version
I asked people from the local community test this code on their Caanoos.
Four people tested it on firmware versions 1.0.1, 1.0.6, 1.5.0, bgd rev. 165 and 181. Results are the same: Key "I" or "II" mapped as joy0 buttons, other buttons does not work. In other hand these people reported that FireWhip works.
This is really strange. Probably I do something wrong, but I have no clue what :/
This is exact test we used: http://uwolke.ru/_project/test/cjt4.tgz
You use the SDL dll's of firmware or Bennu calling the game ?
I use the SDL version included in Bennu and i have no problems.
I whant to know if the joy's now work fine with the last firmware SDL dll's.
Quote from: FreeYourMind on October 30, 2010, 01:47:27 PM
You use the SDL dll's of firmware or Bennu calling the game ?
I use the SDL version included in Bennu and i have no problems.
I whant to know if the joy's now work fine with the last firmware SDL dll's.
I used bgd-runtime as they downloaded from http://www.bennugd.org/node/2 and from http://betatester.bennugd.org/snapshot/
LD_LIBRARY_PATH
eugene@eugene-note ~/Programming/Bennu/cjt/caanoojoytest $ ls
bgd-runtime-165(caanoo) bgd-runtime-181(wiz) cleanup.sh run-caanoo-165.gpe run.sh run-wiz-181.gpe
bgd-runtime-165(wiz) bgd-runtime-old(caanoo) prg run-caanoo-181.gpe run-wiz run-wiz-old.gpe
bgd-runtime-181(caanoo) bgd-runtime-old(wiz) run-caanoo run-caanoo-old.gpe run-wiz-165.gpe
eugene@eugene-note ~/Programming/Bennu/cjt/caanoojoytest $ cat run-caanoo
[code language="bash"]
#!/bin/sh
echo 2 > /proc/cpu/alignment
cd prg
rm main.dcb
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:../bgd-runtime-$1(caanoo)/" ../bgd-runtime-$1\(caanoo\)/bgdc main.prg
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:../bgd-runtime-$1(caanoo)/" ../bgd-runtime-$1\(caanoo\)/bgdi main.dcb
cd ..
[/code]
eugene@eugene-note ~/Programming/Bennu/cjt/caanoojoytest $ cat run-caanoo*.gpe
[code language="bash"]
#!/bin/sh
./run-caanoo 165
sync
cd /usr/gp2x
exec ./gp2xmenu
[/code]
[code language="bash"]
#!/bin/sh
./run-caanoo 181
sync
cd /usr/gp2x
exec ./gp2xmenu
[/code]
[code language="bash"]
#!/bin/sh
./run-caanoo old
sync
cd /usr/gp2x
exec ./gp2xmenu[/code]
eugene@eugene-note ~/Programming/Bennu/cjt/caanoojoytest $ ls bgd-runtime-165\(caanoo\)/
[code language="bash"]
bgdc libgrbase.so libsdlhandler.so mod_crypt.so mod_grproc.so mod_mem.so mod_screen.so mod_timers.so
bgdi libjoy.so libSDL_mixer-1.2.so.0 mod_debug.so mod_joy.so mod_mouse.so mod_scroll.so mod_time.so
libbgdrtm.so libkey.so libtext.so mod_dir.so mod_key.so mod_path.so mod_sort.so mod_video.so
libblit.so libmouse.so libvideo.so mod_draw.so mod_m7.so mod_proc.so mod_sound.so mod_wm.so
libcrypto.so.0.9.8 librender.so libwm.so mod_effects.so mod_map.so mod_rand.so mod_string.so
libdraw.so libscroll.so mod_blendop.so mod_file.so mod_mathi.so mod_regex.so mod_sys.so
libfont.so libSDL-1.2.so.0 mod_cd.so mod_flic.so mod_math.so mod_say.so mod_text.so
[/code]
eugene@eugene-note ~/Programming/Bennu/cjt/caanoojoytest $ ls bgd-runtime-181\(caanoo\)/
[code language="bash"]
bgdc libgrbase.so libsdlhandler.so mod_crypt.so mod_flic.so mod_mathi.so mod_rand.so mod_sound.so mod_video.so
bgdi libjoy.so libtext.so mod_debug.so mod_grproc.so mod_math.so mod_regex.so mod_string.so mod_wm.so
libbgdrtm.so libkey.so libvideo.so mod_dir.so mod_joy.so mod_mem.so mod_say.so mod_sys.so
libblit.so libmouse.so libwm.so mod_draw.so mod_key.so mod_mouse.so mod_screen.so mod_text.so
libdraw.so librender.so mod_blendop.so mod_effects.so mod_m7.so mod_path.so mod_scroll.so mod_timers.so
libfont.so libscroll.so mod_cd.so mod_file.so mod_map.so mod_proc.so mod_sort.so mod_time.so
[/code]
Should it be other way?
LD_LIBRARY_PATH="../bgd-runtime-$1(caanoo)/:$LD_LIBRARY_PATH" ../bgd-runtime-$1\(caanoo\)/bgdc main.prg
LD_LIBRARY_PATH="../bgd-runtime-$1(caanoo)/:$LD_LIBRARY_PATH" ../bgd-runtime-$1\(caanoo\)/bgdi main.dcb
AHHHHH! Thanks! :-[
I'm still waiting for a fix of sound and joy in firmware SDL (i dont' know if the last version fix that).
The method to call Bennu SDL it's to slow loading the game. Some games (i'm developing) take more than 2 minutes to loading....
Quote from: FreeYourMind on October 30, 2010, 05:33:35 PM
I'm still waiting for a fix of sound and joy in firmware SDL (i dont' know if the last version fix that).
The method to call Bennu SDL it's to slow loading the game. Some games (i'm developing) take more than 2 minutes to loading....
what you mean? Call Bennu SDL do slow loading game??? what you think? you think that load SDL in bennu runtime mean extra CPU? you think that SDL in firmware is more faster? you are wrong... maybe it's load a bit more faster because is in NAND,maybe 1sec or anything, but 2 minutes??? no way...
It's true.
My pinball action remake and another game i'm working, take 2 minutes to loading if i use the sdl of bennu in the .gpe script...
Strangely my other game 'Skull' it's the only where the loading time it's basically the same, in less than 1,2 seconds the game load!
Could it be because BGDC compilation? I had this problem with "the king os fighters: flames of courage" on my F100, so i did a GPE for compilation, and a GPE just for play.
I never compile in the caanoo or wiz, i always execute a dcb compiled in windows with option -a (files included in dcb)
your problem is the NAND and SD access, maybe your SD isn't very faster... in my console the games load faster.
I don't believe that. I don't have problems in anything else, loading stuff's from my SD.
By the way.
joy_number ( ) returns 0 on Caanoo.
with SDL firmware, yes... return 0