Author Topic: Sparrow Compo4All Manager  (Read 10034 times)

Ziz (OP)

  • Posts: 284
    • http://ziz.gp2x.de
Sparrow Compo4All Manager
« on: September 08, 2013, 03:57:49 pm »
Greetings folk!

I don't own a gcw yet (I wait for the delivery of EvilDragon), but however compiled my newest project for the gcw. In fact I wrote it because of the gcw, but lets start earlier.

Does any of you know "Compo4All"? C4A is a system skeezix invented some months ago. First it was just meant to read MAME-scores out of the memory and commit these scores afterwards to an online highscore. I will not port MAME or the MAME-functionality of C4A. But C4A evolved. Now it is possible to use it in non-MAME applications, too. But it had disadvantages:
  • You need an extra program to commit scores.
  • The program to commit was Pandora only.
  • The program to create accounts (essential to commit scores!) was Pandora only
  • Even if you port the program, it needs gtk, python and a keyboard
  • Furthermore skeezix has a LOT to do these days because of his new twins. ;) So a port for other system was had low priority

So I spoke to him and got the okay to reimplement the client side of his great work.
Now you don't need an extra application to commit anymore. The only thing you need is my library "sparrowNet", which is more practical. The program I want to introduce here, uses this library.

So, what can you do with "Sparrow Compo4All Manager"?
  • You can create an account on the C4A server and you get a global profile file for all supported gcw applications
  • You can edit your account
  • You can delete your account
  • Furthermore you can have a look at highscores of all possible C4A-games. Unfortunately most of them are MAME only at the moment, but I am quite sure, that more and more applications of the pandora will be avaible on the gcw sooner or later. :)

These are screenshots of the application:


I would be glad, if someone could test this program. Jxv already tested an older version and even committed scores as you see in the screenshots, so the opk file should work.

Of course you need an internet connection to create an account. Jxv reported, that there was some trouble about getting an connection, if an USB device is connected (or similar, he can explain best I think), so keep an eye on that.

http://ziz.gp2x.de/downloads/Sparrow-C4A-Manager/Sparrow-C4A-Manager-gcw-1.0.3.2.opk

If you got an account, feel free to test the newest Puzzletube Version I released, too:
http://boards.dingoonity.org/gcw-development/puzzletube

greetings,
Ziz
« Last Edit: December 15, 2013, 09:19:27 pm by Ziz »
I am a leaf on the wind - watch how I soar. Wash

Drem

  • Posts: 853
    • Russian Android/Dingo/GCW/gaming gadgets blog
Re: Sparrow Compo4All Manager
« Reply #1 on: September 08, 2013, 05:03:47 pm »
Looks promising, I would be glad if there will be a standartised ladders for games on GCW Zero. Thank you for you work!

BAFelton

  • Posts: 276
    • Open Consoles
Re: Sparrow Compo4All Manager
« Reply #2 on: September 08, 2013, 07:55:58 pm »
We need to use the same roms that the Pandora version ?

Hope i can try it, i can't make the wifi on the zer0 work  >:(

BAFelton

  • Posts: 276
    • Open Consoles
Re: Sparrow Compo4All Manager
« Reply #3 on: September 08, 2013, 08:16:48 pm »
Ok it works now.

On the account creating, letters don't register when pressing A or any keys.

Can we use the same account than the Pandora ?

Where do we put the roms ?
« Last Edit: September 08, 2013, 08:25:26 pm by BAFelton »

Ziz (OP)

  • Posts: 284
    • http://ziz.gp2x.de
Re: Sparrow Compo4All Manager
« Reply #4 on: September 08, 2013, 11:18:12 pm »
Sorry to disappoint you, but my program is ONLY about creating and managing accounts of C4A! I didn't port anything about MAME! Afaik atm Puzzletube is the only game supported on the gcw. But hopefully more games (and even MAME with C4A support if skeezix got his gcw and more time) are added sooner or later, I am quite sure. :D

How did you test it without A? Touchscreen? And why doesn't it work? :\
However, you can copy your c4a-prof file from your Pandora (dunno, where it lays) to your gcw to ~/.config/compo4all/c4a-prof. In that case you have the same account on two devices.
I am a leaf on the wind - watch how I soar. Wash

pcercuei

  • Posts: 1673
    • My devblog
Re: Sparrow Compo4All Manager
« Reply #5 on: September 08, 2013, 11:49:39 pm »
Ehrm, since last time I launched it, I reflashed my Zero. Now I have already created an account but there's no way to log in without registering first, could you fix this?

Ziz (OP)

  • Posts: 284
    • http://ziz.gp2x.de
Re: Sparrow Compo4All Manager
« Reply #6 on: September 09, 2013, 12:13:46 am »
No, unfortunately I can't. That is "broken by design". You define a username and password, but however in fact especially the password is never used - even internal. The most important thing about your account is your unique ID "prid", which looks like this: "d863a2c1-2075-1257-9e3b-e2ff05739366". This is used for every action like submitting scores or even delete your account.

The only method to get your prid from your flashed gcw is to ask skeezix for your c4a-prof, if you can trustworthy prove, that your are the person, who lost his c4a-prof file. :)

However: I think, that could be in fact a problem. I should save the profile file TWICE: In the flash and in the folder (on the sd card) of Sparrow C4A Manager. In that case at next start after flashing the c4a file could be restored. :)

greetings,
Ziz
I am a leaf on the wind - watch how I soar. Wash

elwing

  • Posts: 186
Re: Sparrow Compo4All Manager
« Reply #7 on: September 12, 2013, 01:49:36 pm »
Hum, I just noticed there's an OpenTyrian c4all pandora version...  If I undestood correctly, I can't directly use that as this version just push highscore to another software using "Spaghetti client(sc)" and software support on the GCW0 pass through your "sparrowNet" library instead of IPC and another software, right?
did you published your library and is there a documentation? I'd like to add c4all support to my ongoing OpenTyrian port...

Ziz (OP)

  • Posts: 284
    • http://ziz.gp2x.de
Re: Sparrow Compo4All Manager
« Reply #8 on: September 12, 2013, 02:31:19 pm »
Hum, I just noticed there's an OpenTyrian c4all pandora version...  If I undestood correctly, I can't directly use that as this version just push highscore to another software using "Spaghetti client(sc)" and software support on the GCW0 pass through your "sparrowNet" library instead of IPC and another software, right?
Yes, However you could of course make an easy and full compatible "clone" of the spaghetti client. Most parameters of the spaghetti client are in fact unnecessary. I did not test this code, but if I would rewrite the spaghetti client with sparrowNet, it would look like this:
Code: [Select]
#include <sparrowNet.h>

int main( int argc, char **argv )
{
if (argc < 6)
{
printf("Too few parameters. Usage:\n");
printf("./sc so push GAMENAME PLATFORM SCORE\n");
return 1;
}
spInitNet();
spNetC4AProfilePointer profile = spNetC4AGetProfile();
if (profile)
{
spNetC4ACommitScore(profile,argv[3],atoi(argv[5]),NULL,15000); //Timeout 15 Seconds
while (spNetC4AGetStatus() == SP_C4A_PROGRESS) //Wait for the thread
spSleep(200); //Wait at least 200 Ás
}
else
printf("No C4A profile found.\n");
spQuitNet();
return 0;
}
Of course most of the parameters are for compatibility reasons. Even the "PLATFORM" attribute isn't necessary anymore as sparrowNet set it automaticly depending on the target built for. :)
Quote
did you published your library and is there a documentation? I'd like to add c4all support to my ongoing OpenTyrian port...
Yes. I published it under the GPLv2+ here: https://github.com/theZiz/sparrow3d
You need just sparrowNet, which is part of sparrow3d, but doesn't have dependencies to libsparrow3d.so (anymore).
Documentation is available here: http://ziz.gp2x.de/documentation/files/sparrowNet-h.html#Compo4all_stuff

If you run into any problem, please tell me! :D

greetings,
Ziz
« Last Edit: September 12, 2013, 02:38:55 pm by Ziz »
I am a leaf on the wind - watch how I soar. Wash

TrashyMG

  • Posts: 4
Re: Sparrow Compo4All Manager
« Reply #9 on: September 12, 2013, 07:12:25 pm »
For the Pandora's OpenTyrian C4ALL version I do something like this to handle successful submission or not.

Code: [Select]
sprintf(c4all_command, "./sc so push opentyrian_ep_%d pandora %lu >/dev/null 2>&1",episodeNum,player[0].cash); //format the command line call to the spaghetti

c4_all_ret = WEXITSTATUS(system(c4all_command)); //execute the command, get the return code
           
if (c4_all_ret != 0) {
      JE_outTextGlow(VGAScreenSeg, 30, 90, "Comp4All Submit Failed"); //draws to the game menu it failed
} else {
      JE_outTextGlow(VGAScreenSeg, 30, 90, "Comp4All Score Submitted"); //draws to the game menu it submitted properly.
}
« Last Edit: September 12, 2013, 07:15:04 pm by TrashyMG »

elwing

  • Posts: 186
Re: Sparrow Compo4All Manager
« Reply #10 on: September 12, 2013, 07:24:02 pm »
thanks much, that will help me.


Ziz, to test all that I copied sparrow c4a manager and the updated puzzletube on my gcw0, however I also have the issue about the "A" button not registering...
everything else seems correct in the "Account management" screen, everything seems correct, the cursor is blinking, I can move the red box to any letter, switch field using L/R but no character are selected when pressing "a"... even start work, trough it just tell me that I need to fill the fields first...

but pressing "A" does nothing at all.

also if I try to check the online score I get a segfault after ~second.

I tried with USB and wifi connected. I disconnected the USB, rebooted the console after having read about USB issue, reconnected WIFI and it behave exactly the same.

Puzzletube on its side just tell me that c4- manager or mini-c4a is not installed...

edit: tried using "Sparrow-C4A-Manager-gcw-1.0.1.0.opk"
« Last Edit: September 12, 2013, 07:26:16 pm by elwing »

Ziz (OP)

  • Posts: 284
    • http://ziz.gp2x.de
Re: Sparrow Compo4All Manager
« Reply #11 on: September 14, 2013, 11:37:00 pm »
Thanks for the input!

The "A-doesn't working"-error I could reproduce. Should be fixed in the Version 1.0.2 now.
But I have no idea, why it crashes, if you just load the highscore... When exactly does it crash? I compiled the new version with debugging informations. Could you maybe give me a line of code using gdb? Does gdb even exist for the gcw? :\ LD_LIBRARY_PATH has to be . in that case (that does my start script ;) )

However, you are right, I should change the Puzzletube text. It meant, that no profile was found and you should create one e.g. with Sparrow C4A Manager. It doesn't check for the existing of the application. ^^

The new version is here:
http://ziz.gp2x.de/downloads/Sparrow-C4A-Manager/Sparrow-C4A-Manager-gcw-1.0.2.0.opk
I am a leaf on the wind - watch how I soar. Wash

zear

  • * Moderator
  • Posts: 2381
Re: Sparrow Compo4All Manager
« Reply #12 on: September 15, 2013, 01:54:08 am »
Does gdb even exist for the gcw?
Yes, and it's included with the firmware. So all you need to do is telnet/ssh inside and run the program via gdb.

elwing

  • Posts: 186
Re: Sparrow Compo4All Manager
« Reply #13 on: September 15, 2013, 09:16:26 am »
Ok, I was now able to create an account, but getting high score still segfault...

in puzzletube, it now try to load scores, and it try to submit score, however i think it0's not really successful, are online score meant to be displayed in the high score page?

here is the output I got, it looks like it can't get highscore at all...
Code: [Select]
Found 1 Joysticks
  Opened Joystick 0 (analog joystick)
Created Projection frustum with:
  Left:   -0.622
  Right:  0.622
  Top:    0.466
  Bottom: -0.466
  Z-near: 1.000
  Z-far:  100.000
  Matrix:
    |  1.608 |  0.000 |  0.000 |  0.000 |
    |  0.000 |  2.145 |  0.000 |  0.000 |
    |  0.000 |  0.000 | -1.000 | -1.000 |
    |  0.000 |  0.000 | -1.000 |  0.000 |
Reading "./images/splash.obj" with
  0 Triangles without uv
  0 Triangles with uv
  0 Quads without uv
  20 Quads with uv
  0 Edges
  61 uv Edges
Reading "./images/splash.obj" with
  0 Triangles without uv
  0 Triangles with uv
  0 Quads without uv
  20 Quads with uv
  0 Edges
  61 uv Edges
Support for ogg: Yes
Support for mp3: No (Mixer not built with MP3 support)
Support for flac: No (Mixer not built with MP3 support)
Support for mod: Yes
Try to open Sound: Success
  8 channels are avaible as default
Points score 0 already at server
Points score 0 already at server
Points score 0 already at server
Survival score 0 already at server
Survival score 0 already at server
Survival score 0 already at server
Race score 10000 already at server
Race score 10000 already at server
Race score 10000 already at server

I'll try to GDB, never done that yet but I should manage...

Ziz (OP)

  • Posts: 284
    • http://ziz.gp2x.de
Re: Sparrow Compo4All Manager
« Reply #14 on: September 15, 2013, 09:26:00 am »
Does gdb even exist for the gcw?
Yes, and it's included with the firmware. So all you need to know is telnet/ssh inside and run the program via gdb.
Excellent.

Ok, I was now able to create an account, but getting high score still segfault...

in puzzletube, it now try to load scores, and it try to submit score, however i think it0's not really successful, are online score meant to be displayed in the high score page?

here is the output I got, it looks like it can't get highscore at all...
Code: [Select]
Found 1 Joysticks
  Opened Joystick 0 (analog joystick)
Created Projection frustum with:
  Left:   -0.622
  Right:  0.622
  Top:    0.466
  Bottom: -0.466
  Z-near: 1.000
  Z-far:  100.000
  Matrix:
    |  1.608 |  0.000 |  0.000 |  0.000 |
    |  0.000 |  2.145 |  0.000 |  0.000 |
    |  0.000 |  0.000 | -1.000 | -1.000 |
    |  0.000 |  0.000 | -1.000 |  0.000 |
Reading "./images/splash.obj" with
  0 Triangles without uv
  0 Triangles with uv
  0 Quads without uv
  20 Quads with uv
  0 Edges
  61 uv Edges
Reading "./images/splash.obj" with
  0 Triangles without uv
  0 Triangles with uv
  0 Quads without uv
  20 Quads with uv
  0 Edges
  61 uv Edges
Support for ogg: Yes
Support for mp3: No (Mixer not built with MP3 support)
Support for flac: No (Mixer not built with MP3 support)
Support for mod: Yes
Try to open Sound: Success
  8 channels are avaible as default
Points score 0 already at server
Points score 0 already at server
Points score 0 already at server
Survival score 0 already at server
Survival score 0 already at server
Survival score 0 already at server
Race score 10000 already at server
Race score 10000 already at server
Race score 10000 already at server

I'll try to GDB, never done that yet but I should manage...
The Puzzletube highscore is local. Sparrow3d loads the highscore, but only to determine, whether your score with your name is in the highscore already. So the highscore menu point in Puzzletube shows "only" your local highscores.

However no score of you is submitted, which is strange. You should start the manager via gdb with the following commando:
Code: [Select]
LD_LIBRARY_PATH=. gdb ./Sparrow-C4A-MananagerOtherwise it will not find the libraries libsparrowNet and libsparrow3d. ;)

And please redownload this file:
http://ziz.gp2x.de/downloads/Sparrow-C4A-Manager/Sparrow-C4A-Manager-gcw-1.0.2.0.opk

I recompiled even the libraries with debug symbols. ;)

greetings and thx,
Ziz
I am a leaf on the wind - watch how I soar. Wash

elwing

  • Posts: 186
Re: Sparrow Compo4All Manager
« Reply #15 on: September 15, 2013, 09:44:42 am »
hum, that gets a bit complicated... here is what I tried from telnet:

Code: [Select]
opendingux:/media/data/apps # mount Sparrow-C4A-Manager-gcw-1.0.2.0.opk /mnt/Sparrow-C4A-Manager-gcw-1.0.2.0/

opendingux:/media/data/apps # cd /mnt/Sparrow-C4A-Manager-gcw-1.0.2.0/

opendingux:/mnt/Sparrow-C4A-Manager-gcw-1.0.2.0 # ls
Sparrow-C4A-Manager      Sparrow-C4A-Manager.sh
Sparrow-C4A-Manager.png  default.gcw0.desktop

opendingux:/boot/local/home/Sparrow-C4A-Manager-gcw-1.0.2.0/Sparrow-C4A-Manager # LD_LIBRARY_PATH=. gdb ./Sparrow-C4A-Manager
GNU gdb (GDB) 7.5
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "mipsel-gcw0-linux-uclibc".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /boot/local/home/Sparrow-C4A-Manager-gcw-1.0.2.0/Sparrow-C4A-Manager/Sparrow-C4A-Manager...done.
(gdb) run
Starting program: /boot/local/home/Sparrow-C4A-Manager-gcw-1.0.2.0/Sparrow-C4A-Manager/Sparrow-C4A-Manager
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Found 1 Joysticks
  Opened Joystick 0 (analog joystick)


edit: forget my previous version, here is what I got, I don't receive anything after the "Opened Joystick 0" message, nothing appear on the console screen either...


edit2: ok, progressed further ignore my previous rambling...
« Last Edit: September 15, 2013, 10:03:21 am by elwing »

elwing

  • Posts: 186
Re: Sparrow Compo4All Manager
« Reply #16 on: September 15, 2013, 10:06:17 am »
hum, nothing really interesting I guess, how can I get a more verboos information?

here is the log
Code: [Select]
(gdb) run
Starting program: /boot/local/home/Sparrow-C4A-Manager-gcw-1.0.2.0/Sparrow-C4A-Manager/Sparrow-C4A-Manager
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Found 1 Joysticks
  Opened Joystick 0 (analog joystick)

Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()

basically the application run fine, when I select the get online score the timeout start counting and after a little while (it's currently blocked displaying "Getting game list... Timeout in 14.0"

edit:
ignore once more my ignorance of GDB... here is a part of the rest:
Code: [Select]
(gdb) bt
#0  0x00000000 in ?? ()
#1  0x00407110 in spDeleteTextBlock () at sparrowFont.c:930
Backtrace stopped: frame did not save the PC
(gdb)
« Last Edit: September 15, 2013, 10:09:13 am by elwing »

elwing

  • Posts: 186
Re: Sparrow Compo4All Manager
« Reply #17 on: September 15, 2013, 11:10:08 am »
I can't seems to get much more interesting info from GDB...
Code: [Select]
(gdb) backtrace full
#0  0x00000000 in ?? ()
No symbol table info available.
#1  0x00407110 in spDeleteTextBlock () at sparrowFont.c:930
No symbol table info available.
Backtrace stopped: frame did not save the PC
(gdb)

and the mandatory registry contents:
Code: [Select]
(gdb) info registers
          zero       at       v0       v1       a0       a1       a2       a3
 R0   00000000 77279e2c 7fed13c8 00000000 7fed13c8 00442e08 00000001 005041f9
            t0       t1       t2       t3       t4       t5       t6       t7
 R8   00000000 00000000 00000002 7727e538 0000026c 00000000 ffffffff 0040521c
            s0       s1       s2       s3       s4       s5       s6       s7
 R16  00442e08 7fed13c8 005041e8 00000000 000000a0 000000a0 2aaaaaab 770b79e0
            t8       t9       k0       k1       gp       sp       s8       ra
 R24  00000077 00000000 00000001 00000000 00420800 7fed13a8 7fed13b8 00407110
        status       lo       hi badvaddr    cause       pc
      00000413 000000a0 00000050 00000000 00800308 00000000
          fcsr      fir  restart
      01001004 00330000 00000000
is that even useful when not programming in assembly??

Ziz (OP)

  • Posts: 284
    • http://ziz.gp2x.de
Re: Sparrow Compo4All Manager
« Reply #18 on: September 15, 2013, 06:18:18 pm »
That helps a lot. I will have a look in that function and line, if I have a bit more time. :)
I am a leaf on the wind - watch how I soar. Wash

elwing

  • Posts: 186
Re: Sparrow Compo4All Manager
« Reply #19 on: September 15, 2013, 06:33:00 pm »
Ignoring that problem, I'm now facing the question as to whether I'll link directly to your lib or I'll use a simple SC client. using a SC client would let me use the same source as the pandora version. but I'm not sure writing myself a SC client would be a good idea as, as I get it, all pandora software ported over would also need that. do you plan to provide such client with your lib?

If I have to write some code specific for my platform it would be some code to directly link with the lib rather than a SC client that I wouldn't really know how to distribute for all other developers...

 

Post a new topic