Re: [AD] Porting Allegro to the PS2 |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Fri, Jun 07, 2002 at 10:01:05PM -0500, Joshua Walker wrote:
> what would be *really* nice would be making the makefile that went
> something like:
>
> if UNIX-LIKE
> unixflag=1
> if LINUX
> linuxflag=1
> if X86
> switch==x86stuff
> end
> if PPC
> switch==ppcstuff
> end
> if PS2MIPS
> switch==ps2stuff
> end
> if OSX
> switch==osxstuff
> end
> if X
> switch==xstuff
> end
> end
It kind of does work like that. :) ALLEGRO_UNIX is defined on
all Unix systems, ALLEGRO_LINUX if the Linux console driver is
enabled, ALLEGRO_WITH_XWINDOWS if it was compiled with X
support.
> > I didn't mean to suggest that the Linux driver should never
> > support anything other than x86, I just doubt that it's useful
> > on PS2. I don't know anything about PS2 Linux but I suspect
> > it's just a Linux kernel with some hacked together libraries to
> > access the hardware -- judging by the libraries Sony supply for
> > real PS2 development, I'd be very surprised if they bothered to
> > make a working fbdev or anything useful like that! :)
> >
>
> the ps2 kit didn't come with a framebuffer driver for a very good
> reason. You have no direct access to to video memory. Period.
All the more reason to provide a framebuffer device which wraps
that for you. :) But the focus with PS2 isn't 2D rendering
anyway, so that could be why they didn't bother.
> Everything
> must be prossesesed by Graphics Synthisiser using primitive packets. The
> packets are deleverd via the Graphics InterFace (GIF), every
> microcontroller, like the CPU and the the Vecter Units(VU) has a Video
> Interface (VIF) that sends packets to the GS. You can almost do a
> direct read, but not by address, you ask for coordinates from the GS.
>
> So a typical chain is CPU -> VU1 -> VU2 -> VIF -> GIF -> GS
Hmm, I didn't actually do graphics programming on the PS2, but I
thought VU2 did not have access to the GS and VU1 not have
access to VU2.
Still, none of that will be very useful for Allegro. I'd
investigate the possibility of providing Allegro with a
framebuffer in system RAM and uploading that as a texture every
frame -- IIRC the PS2 has very good DMA speeds... on our PS2
project we were swapping all of our textures (10-15Mb I think)
in and out at 30fps. This also allows easy reading from the
screen, since it's just a virtual framebuffer in system memory.
> Trufully, I never really bothered to check. First of all I don't even
> use the X server (XGS) as it takes up waaay to much overhead and then
> software will be the only option for rendering as I don't have anything
> cool like direct video memeory access. The console will be the best bet.
It's good to hear that X did work in the end. :)
> What the best course of action then is to make the ./configre script
> flag that my linux is not a linux, but should be treated as a generic
> unix. 'uname -s -m -p' returns "Linux mips unknown" But the cool linux
> stuff like keyboard and mouse would be useful.
Allegro's generic unix support is really the X system driver.
It (and the Linux console driver) use various other drivers from
the 'unix' directory, which is where the generic code is. You'd
want to make your own system driver, and then you can use
whatever you want from the generic unix code too.
If you're not comfortable modifying the configure scripts, you
can find a way to detect whatever you want to detect, tell the
conductors list, and then someone else will add the tests for
you. configure scripts are good at detecting whether files
exist, whether commands run successfully, what their output is,
whether libraries exist, whether header files exist, whether a
header defines a certain symbol, and whether a library contains
a symbol. So for a start, if you can make a PS2 detection
command then the configure script can be modified to do the test
for you.
> also My "joystick" is a little more strange than your normal PC
> joystick. (analage butotns, two analage joysticks and a d-pad) so there
> might me a bit of an altercation to the joystick code.
Find out whether the PS2 Linux kernel provides access to the
gamepad through the standard Linux joystick interface -- if it
doesn't, you'll have to write your own driver. Same goes for
the keyboard and mouse.
> Also, the PS2 has built-in support for hardware MPG2. New movie player,
> or jpg support can go there.
Allegro doesn't have these.
> There are also two primitives that Allegro doen't have that can be
> added. Triangle Fan and Triangle Strip. Also Sprites can't be rotated,
> (But textured polygons can be).
Allegro's strength is 2D, there's not much point in adding new
3D primitives.
George