Building Picodrive / Linux


pupnik

Member
Joined
Jul 17, 2007
Messages
107
Hewwo.

I was wondering if anyone has picodrive sources ported to non-gp2x specific platforms.

I'm crosscompiling via qemu in the scratchbox environment and i started pulling out gp2x specific functions, but i was hoping perhaps someone had a wrapper for a more generic environment, i.e. without the gp2x specific devkit...

more README
This port tries to emulate gp2x environment on a standard linux box for testing
(i.e. to be able to use things like valgrind and efence, gcc runtime
optimizations, etc.).

[sbox-SB_Arm2: ~/genesis/picodrive/tmp/PicoDrive/platform/linux] > make
../gp2x/main.c
../gp2x/menu.c
../gp2x/menu.c: In function `file2color':
../gp2x/menu.c:552: warning: implicit declaration of function `strcasecmp'
../gp2x/menu.c: In function `draw_dirlist':
../gp2x/menu.c:579: error: `DT_DIR' undeclared (first use in this function)
../gp2x/menu.c:579: error: (Each undeclared identifier is reported only once
../gp2x/menu.c:579: error: for each function it appears in.)
../gp2x/menu.c: In function `scandir_cmp':
../gp2x/menu.c:594: warning: implicit declaration of function `alphasort'
../gp2x/menu.c:595: error: `DT_DIR' undeclared (first use in this function)
../gp2x/menu.c: In function `romsel_loop':
../gp2x/menu.c:641: warning: implicit declaration of function `scandir'
../gp2x/menu.c:676: error: `DT_REG' undeclared (first use in this function)
../gp2x/menu.c:682: error: `DT_DIR' undeclared (first use in this function)
make: *** [../gp2x/menu.o] Error 1
 
Well like readme says it is only a quick hack for PC testing. And may I get to know where are you trying to port it to?
 
I have a port of notaz's version of PicoDrive for ps3 linux (ppc). It was based on the platform/linux project files and it compiled without too much changes (getting it running a game was a different matter).
(I've tried dgen, sdlhaze, and genesisplus and none of them have
the compatibility that PicoDrive has).

The port is not finished yet, but here's what I've done so far:
- All the endian issues have been fixed (as far as I am aware :p ), so the emulator looks and runs the same as everything PicoDrive for gp32x can run.
- sound works in most games, but for some games the sound seems to slow down sometimes (eg in Aladdin), maybe some cycle timing is incorrect when using the c version of the ym code...
- have you seen this before notaz? or is there anything you can think of that might cause this?
- There's no segacd support yet (want to do this after the sound slowdown issues are fixed)
- it uses the spu for screen scaling so you can play at 1080p without any slowdowns.
- I haven't worked on it for months, but hope to get back to it soon.

From your error messages, it looks like your compiler environment is slightly different.
- strcasecmp might be slightly different on your system
- try stricmp or wait and see if there are actual linker errors
- the DT_xxx are from dirent.h so maybe check your documentation for the equivalents for your system.
- dirent.d_type is non-standard (it's an extension), so your system might not support it. (you can check the define _DIRENT_HAVE_D_TYPE)
- if your system doesn't have it, you can do a stat on each file entry instead.

Hope that helps
 
squall_dc said:
- All the endian issues have been fixed (as far as I am aware :p ), so the emulator looks and runs the same as everything PicoDrive for gp32x can run.
Cool. Your changes would be welcome.

squall_dc said:
- sound works in most games, but for some games the sound seems to slow down sometimes (eg in Aladdin), maybe some cycle timing is incorrect when using the c version of the ym code...
- have you seen this before notaz? or is there anything you can think of that might cause this?
There is nothing wrong with C version of ym2612, actually it is used in 940 sound part (the asm version (really only a part of ym2612) performs better then C on the ARM920, but worse on ARM940 for some reason).
The problem is most likely with z80 core, more specifically with it's cycle timing (it's certainly the case if you use C version of mz80).
 
Last edited by a moderator:
Thanks for the info notaz, that'll save me heaps of time when I look into the problem again.

I've zipped up the files with the big endian changes here:

picobigendianchanges.zip - 0.04MB

There's also a diff file in there with the changes (base from 0964src) if you don't want to do a manual diff on each file.
You probably don't want to apply all the changes as parts of it probably might have a small performance impact on the gp2x (mainly the get_word and get_dword functions)

Also, I've only really looked at the 16-bit accurate renderer (as there isn't much use for the faster renderers on a ps3)
 
Back
Top