forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Allegro for PSP

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
diedel



Joined: 22 Sep 2008
Posts: 16

PostPosted: Wed Sep 24, 2008 11:44 pm    Post subject: Allegro for PSP Reply with quote

Hi all,
I would like to share my Allegro PSP WIP :)
A simple graphic driver and the a mini keyboard driver using the PSP controller are implemented by now. It compiles and links with success some Allegro examples and the excellent Humphrey remake (the main reason for converting the library :P )

Two Allegro examples:
http://album.miarroba.com/diedel/0/6/
http://album.miarroba.com/diedel/0/7/


The Humphrey remake:
http://retrospec.sgn.net/users/ignacio/humpi.htm

In PSP:
http://album.miarroba.com/diedel/0/8/
http://album.miarroba.com/diedel/0/9/

Greetings!
Back to top
View user's profile Send private message
Wraggster



Joined: 26 Aug 2005
Posts: 121

PostPosted: Thu Sep 25, 2008 6:14 am    Post subject: Reply with quote

ooh awesome, awesome indeed, opens up a lot of releases and even a possible virtual boy emu and FreeCNC :)
_________________
Webmaster of http://www.dcemu.co.uk

DCEMU The Worlds Only Homebrew & Gaming Network of Sites.
Back to top
View user's profile Send private message Visit poster's website
[wl]



Joined: 05 May 2006
Posts: 16

PostPosted: Sat Sep 27, 2008 9:22 am    Post subject: Reply with quote

looks like now "KQ - the console-style roleplaying game" can be ported to psp?
Back to top
View user's profile Send private message
diedel



Joined: 22 Sep 2008
Posts: 16

PostPosted: Sun Oct 19, 2008 6:09 am    Post subject: Reply with quote

Hi,
a beta version of the library is ready to use. It is possible to add it to the ps2dev svn?

Thanks.
Back to top
View user's profile Send private message
diedel



Joined: 22 Sep 2008
Posts: 16

PostPosted: Mon Oct 20, 2008 1:32 am    Post subject: Allegro 4.2.2 PSP alpha version Reply with quote

Hi,

more info in:
http://diedel.blogcindario.com/2008/10/00003-allegro-psp-alpha-version.html

Regards.
Back to top
View user's profile Send private message
TehSausage



Joined: 29 Sep 2008
Posts: 3
Location: Australia

PostPosted: Wed Oct 22, 2008 4:23 pm    Post subject: Reply with quote

Great job, I know how much work it is. (Well, I had no prior PSP programming experience)
You don't seem to have an IR keyboard driver, you can use mine if you want ( Shouldn't be too hard to fix up. Requires kernel mode :( ) - http://tehsausage.com/allegro-psp/download

I think I've pretty much given up on mine now, too lazy to implement scaling etc.

Edit: You could use the timer (and possibly analog mouse) driver from there too, they're not perfect (thread synchronization mainly) but better than nothing.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
diedel



Joined: 22 Sep 2008
Posts: 16

PostPosted: Thu Oct 23, 2008 6:54 am    Post subject: Reply with quote

This is my first PSP programming experience too.
As you say it gets much time but actually I have enough of it to spend :) I like this project.

Quote:

I think I've pretty much given up on mine now, too lazy to implement scaling etc.

You know the projects are never finished :) so you can continue anytime.

Quote:
You don't seem to have an IR keyboard driver, you can use mine if you want ( Shouldn't be too hard to fix up. Requires kernel mode :( ) - http://tehsausage.com/allegro-psp/download
Quote:
Edit: You could use the timer (and possibly analog mouse) driver from there too, they're not perfect (thread synchronization mainly) but better than nothing.

Thanks man, I appreciate your friendly help. Technically, joining our codes the port is near complete :)

Greetings!
Back to top
View user's profile Send private message
diedel



Joined: 22 Sep 2008
Posts: 16

PostPosted: Wed Jan 21, 2009 1:56 am    Post subject: Allegro 4.3.10plus PSP port Reply with quote

Finally the PSP port of the Allegro library (4.3.10plus version) is ready:

http://diedel.blogcindario.com/2009/01/00010-allegro-psp-final-user-version.html

Feedback is welcome.
Back to top
View user's profile Send private message
NoEffex



Joined: 27 Nov 2008
Posts: 108

PostPosted: Wed Jan 21, 2009 3:43 pm    Post subject: Reply with quote

Very, very good deal.
_________________
Programming with:
Geany + Latest PSPSDK from svn
Back to top
View user's profile Send private message
blu_eye4



Joined: 26 Oct 2008
Posts: 37

PostPosted: Sat Jan 24, 2009 9:26 pm    Post subject: Reply with quote

Great!!!


Now, I need to ask you a question... Can you work a porting of your library for Nanodesktop? I hope that you accept... You can contact me at cameracafffe@live.it for further informations...
Back to top
View user's profile Send private message
diedel



Joined: 22 Sep 2008
Posts: 16

PostPosted: Mon Jan 26, 2009 12:33 am    Post subject: Reply with quote

What's Nanodesktop?
Back to top
View user's profile Send private message
Gefa



Joined: 13 Aug 2008
Posts: 12
Location: Italy

PostPosted: Mon Jan 26, 2009 2:22 am    Post subject: Reply with quote

diedel wrote:
What's Nanodesktop?

Nanodesktop is an SDK for PSP. More info here: http://visilab.unime.it/~filippo/Nanodesktop/nanodesktop.htm
this if the official forum: http://www.psp-ita.com/forum/viewforum.php?f=23

you can see from http://visilab.unime.it/~filippo/Nanodesktop/PSP_PSPE/Screenshots/ndPSP_Screenshoots.htm some screenshots of some nd features: as you can see, nanodesktop is a very very good SDK, and his developer (Filippo Battaglia aka "pegasus2000") wants to port Allegro library on his library: can you help him?
_________________
For my PSP project, visit my web site: www.gefa.altervista.org

PaintMIXER v2.6.0 released: http://www.neoflash.com/forum/index.php/topic,5253.0.html
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
blu_eye4



Joined: 26 Oct 2008
Posts: 37

PostPosted: Mon Jan 26, 2009 3:27 am    Post subject: Reply with quote

Gefa wrote:
diedel wrote:
What's Nanodesktop?

Nanodesktop is an SDK for PSP. More info here: http://visilab.unime.it/~filippo/Nanodesktop/nanodesktop.htm
this if the official forum: http://www.psp-ita.com/forum/viewforum.php?f=23

you can see from http://visilab.unime.it/~filippo/Nanodesktop/PSP_PSPE/Screenshots/ndPSP_Screenshoots.htm some screenshots of some nd features: as you can see, nanodesktop is a very very good SDK, and his developer (Filippo Battaglia aka "pegasus2000") wants to port Allegro library on his library: can you help him?
Exact! Nanodesktop is the most important PSPSDK... your Allegro Library is very very important... if you accept, we can create all what we want... scientific application, games, emulators :)
Back to top
View user's profile Send private message
sauron_le_noir



Joined: 05 Jul 2008
Posts: 229

PostPosted: Thu Feb 19, 2009 8:08 am    Post subject: Reply with quote

Just done the mouse driver for the psp allegro port
available at: http://fileupload.filetac.com/file/82b034036d52a95279a984a374e88d8f12943be2
and here http://online-sharing.net/5w2ogfwx5f2f/allegro.tgz.html

file modified makefile.lst
src/psp/pdriver.c
new file src/psp/pmouse.c
Back to top
View user's profile Send private message Send e-mail MSN Messenger
diedel



Joined: 22 Sep 2008
Posts: 16

PostPosted: Fri Feb 20, 2009 7:07 am    Post subject: Reply with quote

Thanks sauron_le_noir.

I'll add it to the last version of the library.

I wrote you a PM.

Cya.
Back to top
View user's profile Send private message
sauron_le_noir



Joined: 05 Jul 2008
Posts: 229

PostPosted: Sat Feb 21, 2009 1:30 am    Post subject: Reply with quote

you are welcome. Allegro is a great library
Back to top
View user's profile Send private message Send e-mail MSN Messenger
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Wed Apr 08, 2009 9:32 am    Post subject: Re: Allegro 4.3.10plus PSP port Reply with quote

diedel wrote:
Finally the PSP port of the Allegro library (4.3.10plus version) is ready:

http://diedel.blogcindario.com/2009/01/00010-allegro-psp-final-user-version.html

Feedback is welcome.


Download link on the above page no longer works.
Back to top
View user's profile Send private message AIM Address
diedel



Joined: 22 Sep 2008
Posts: 16

PostPosted: Sun Apr 12, 2009 11:48 pm    Post subject: Reply with quote

The download links from the entire blog are working again.

Big thanks J.F.
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Mon Apr 13, 2009 6:49 am    Post subject: Reply with quote

The link is indeed working again. Thanks! :)
Back to top
View user's profile Send private message AIM Address
sauron_le_noir



Joined: 05 Jul 2008
Posts: 229

PostPosted: Wed Apr 15, 2009 5:19 am    Post subject: Reply with quote

Just a little correction in de mouse driver.
Code:
/*         ______   ___    ___
 *        /\  _  \ /\_ \  /\_ \
 *        \ \ \L\ \\//\ \ \//\ \      __     __   _ __   ___
 *         \ \  __ \ \ \ \  \ \ \   /'__`\ /'_ `\/\`'__\/ __`\
 *          \ \ \/\ \ \_\ \_ \_\ \_/\  __//\ \L\ \ \ \//\ \L\ \
 *           \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
 *            \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
 *                                           /\____/
 *                                           \_/__/
 *
 *      PSP mouse driver.
 *      TODO:.
 *
 *      By sauron_le_noir some part of psp_mouse_timer_poll based on
 *                        the sdl code of Nekuz0r
 *
 *      See readme.txt for copyright information.
 */

#include "allegro.h"
#include "allegro/internal/aintern.h"
#include "allegro/platform/aintpsp.h"

#include "math.h"
#include <pspctrl.h>

#ifndef ALLEGRO_PSP
#error something is wrong with the makefile
#endif

static int  psp_mouse_init(void);
static void psp_mouse_exit(void);
static void psp_mouse_position(int, int);
static void psp_mouse_set_range(int, int, int, int);
static void psp_mouse_get_mickeys(int *, int *);
static void psp_mouse_timer_poll(void);


MOUSE_DRIVER mouse_psp =
{
   MOUSE_PSP,
   empty_string,
   empty_string,
   "psp mouse",
   psp_mouse_init,
   psp_mouse_exit,
   NULL,       // AL_METHOD(void, poll, (void));
   psp_mouse_timer_poll,                 // AL_METHOD(void, timer_poll, (void));
   psp_mouse_position,
   psp_mouse_set_range,
   NULL,       // AL_METHOD(void, set_speed, (int xspeed, int yspeed));
   psp_mouse_get_mickeys,
   NULL,       // AL_METHOD(int,  analyse_data, (AL_CONST char *buffer, int size));
   NULL,       // AL_METHOD(void,  enable_hardware_cursor, (AL_CONST int mode));
   NULL        // AL_METHOD(int,  select_system_cursor, (AL_CONST int cursor));
};

static int mouse_minx = 0;
static int mouse_miny = 0;
static int mouse_maxx = 479;  /* 0 to 479 = 480 */
static int mouse_maxy = 271;  /* 0 to 272 = 272 */   /* 480x272 is the resolution of the psp display */

static int mymickey_x = 0;
static int mymickey_y = 0;

static SceCtrlData pad;
static int aStickX = 0;
static int aStickY = 0;
static float aStickR;
static float aStickA;
static int x,y;
static float Precision = 360.0f;

static int getSqrRadius(int X, int Y)
{
   return sqrt((X * X) + (Y * Y));
}
static int psp_mouse_init(void)
{
  sceCtrlSetSamplingCycle(0);
  sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
}

static void psp_mouse_timer_poll(void)
{
   sceCtrlPeekBufferPositive(&pad, 1);

   if (pad.Buttons != 0)
   {
     sceCtrlReadBufferPositive(&pad, 1);
     _mouse_b = 0;
     if (pad.Buttons & PSP_CTRL_LTRIGGER) _mouse_b = 1;
     if (pad.Buttons & PSP_CTRL_RTRIGGER) _mouse_b = 2;
     if ( (pad.Buttons & PSP_CTRL_LTRIGGER) && (pad.Buttons & PSP_CTRL_RTRIGGER)) _mouse_b = 4;
   }
   aStickX = pad.Ly - 128;
   aStickY = pad.Lx - 128;
   
   aStickR = getSqrRadius(aStickX, aStickY);
   if (aStickR > 100) {
      if (getSqrRadius(aStickX, aStickY) > 30) {
         aStickA = ((atan2f(aStickX, -aStickY) + M_PI) / (M_PI * 2)) * Precision;
      } else {
         aStickA = -1;     
      }
   
      //1° a 89°
      if (aStickA >= 1 && aStickA <= (89 * (Precision / 360.0f))) {
         x += (10 * (1 - (aStickA / (Precision / 360.0f) / 90)));
         y -= (10 * (0 + (aStickA / (Precision / 360.0f) / 90)));
      }
      else if (aStickA >= (91 * (Precision / 360.0f)) && aStickA <= (179 * (Precision / 360.0f))) {
         x -= (10 * (0 + (((aStickA / (Precision / 360.0f)) - 89) / 90)));
         y -= (10 * (1 - (((aStickA / (Precision / 360.0f)) - 89) / 90)));
      }
      else if (aStickA >= (181 * (Precision / 360.0f)) && aStickA <= (269 * (Precision / 360.0f))) {
         x -= (10 * (1 - (((aStickA / (Precision / 360.0f)) - 179) / 90)));
         y += (10 * (0 + (((aStickA / (Precision / 360.0f)) - 179) / 90)));
      }
      else if (aStickA >= (271 * (Precision / 360.0f)) && aStickA <= (359 * (Precision / 360.0f))) {
         x += (10 * (0 + (((aStickA / (Precision / 360.0f)) - 269) / 90)));
         y += (10 * (1 - (((aStickA / (Precision / 360.0f)) - 269) / 90)));
      }
      else if (aStickA == 0) {
         x += 10;
      }
      else if (aStickA == (90 * (Precision / 360.0f))) {
         y -= 10;
      }
      else if (aStickA == (180 * (Precision / 360.0f))) {
         x -= 10;
      }
      else if (aStickR == (270 * (Precision / 360.0f))) {
         y += 10;
      }
   }
   if (x < 0)
      x = 0;

   if (x > 479)
      x = 479;

   if (y < 0)
     y = 0;

   if (y > 271)
     y = 271;

   _mouse_x = x;
   _mouse_y = y;
}

static void psp_mouse_position(int x, int y)
{
  _mouse_x = x;
  if (_mouse_x <  mouse_minx) _mouse_x = 0;
  if (_mouse_x > mouse_maxx)  _mouse_x = mouse_maxx;
  _mouse_y = y;
  if (_mouse_y < mouse_miny) _mouse_y = 0;
  if (_mouse_y > mouse_maxy) _mouse_y = mouse_maxy;
}

static void psp_mouse_set_range(int x1, int y1, int x2, int y2)
{
}

static void psp_mouse_get_mickeys(int *mickeyx, int *mickeyy)
{
  *mickeyx = 0;
  *mickeyy = 0;
}

static void psp_mouse_exit(void)
{
}

it limit the mouse correctly to 0..479 and 0.271
Back to top
View user's profile Send private message Send e-mail MSN Messenger
DanielC



Joined: 11 Jul 2008
Posts: 40
Location: Australia

PostPosted: Thu Apr 16, 2009 1:02 pm    Post subject: Reply with quote

Sorry if this is off topic, but i'm just curious...

Is this in anyway related to the legendary Allegro graphics/gaming library from back in the MS-DOS days (which is still maintained today)? Or is the same name purely coincedental..?

EDIT: Sorry, you failed to mention that this is a port of THE Allegro library. WOW. Well done! Very awesome!
_________________
Regards,
Daniel C
Back to top
View user's profile Send private message MSN Messenger
pegasus2000



Joined: 12 Jul 2006
Posts: 160

PostPosted: Mon Apr 20, 2009 4:04 am    Post subject: Reply with quote

@diedel:

In any case, I'm writing a new version of Nanodesktop that shall
support sprites. I thought that this can be useful in an Allegro
porting. I've open a thread in this forum for the proof of concept.

Here a screenshot:

http://img82.imageshack.us/img82/6527/screenshotftk.png

I hope that you can create a version of ndAllegro in the future...
:)
Back to top
View user's profile Send private message
sauron_le_noir



Joined: 05 Jul 2008
Posts: 229

PostPosted: Tue Apr 21, 2009 5:38 am    Post subject: Reply with quote

DanielC it is indeed this library that have been ported to the psp
Back to top
View user's profile Send private message Send e-mail MSN Messenger
slasher2661996



Joined: 22 Feb 2009
Posts: 91
Location: Melbourne Australia ZOMG

PostPosted: Tue Apr 21, 2009 7:11 pm    Post subject: Reply with quote

Mind telling me what this is used for?
Back to top
View user's profile Send private message
whistler



Joined: 04 Mar 2008
Posts: 40

PostPosted: Tue Oct 06, 2009 1:05 am    Post subject: Reply with quote

thanks for porting allegro:) btw are you working on making the addons(allegroGL, jpgalleg, loadpng, logg) usable with the psp. From what i can see all the dependencies like libpng, jpeg, zlib, ogg and pspgl(which is basically a subset of opengl) are already in the svn repo
Back to top
View user's profile Send private message
Josh1billion



Joined: 12 Jul 2005
Posts: 32
Location: Wisconsin, USA

PostPosted: Fri Jan 01, 2010 5:34 pm    Post subject: Reply with quote

Is it possible to install this on Windows alongside MinPSPW?
_________________
Josh1billion - PHP, C++, PSP programmer.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group