""
All times are GMT +2. The time now is 05:06 AM.  

Go Back   PSX/PS2/PS3 Scene Newz > PlayStation2 Forums > PS2 Homebrew/Dev & Emu Scene

PS2 Homebrew/Dev & Emu Scene Topics relating to homebrew PS2 development and emulation.

Reply
 
Thread Tools Display Modes
  #1  
Old 01-09-2007, 10:11 AM
ragnarok2040 ragnarok2040 is offline
Registered User
 
Join Date: Dec 2002
Posts: 110
Smile

FCEUltra for PS2


I ported FCEUltra to PS2 to play a couple NES games on a TV in a different room for the holiday season. I have an autistic brother who loves Megaman, heh.
The built-in game genie rom support works if you put the game genie rom as gg.rom. I haven't used any codes, so I'm not sure if they actually work on the PS2.

Some notes about the source code:
The original project source code that I ported is at sourceforge.net/projects/fceumm. It's a mapper modded version, which supports the most mappers of any FCEUltra version, I think. I tried to make as little change as possible, so using a diff utility won't be too much trouble to see the changes I made. From what I can remember:
I had to remove support from gzip compressed nes roms because of a reference to dup() which wasn't supported and it was over my head on how to implement a similar function.

Instructions for use:
Menu Input:
Select opens/closes Config Menu
Start is used to save the savepath or set the screen center.
Confirm
Cancel
Browse up one directory.

The emulator now uses a FCEUltra.cnf fie that stores the settings for the emulator
Both the digital pad and analog stick can be used for movement.
By default:
is A.
is B.
opens the ingame menu.
Select is Select.
Start is Start.
L3 is used for swapping FDS disks.
R3 is used for swapping FDS sides.
L2 loads savestate
R2 saves savestate

You can use the in-game menu to select your savestate number.

2 controllers should work, I haven't tested it myself, still.

The FCEUltra.cnf file should be in mc0:/FCEUMM/ so "mc0:/FCEUMM/FCEUltra.cnf".
Code:
# FCEULTRA.CNF == Configuration file for the emulator FCEUltra
# CNF Handling Code (c)2006 Ronald Andersson aka dlanor
# ------------------------------------------------------------
OffsetX      = 0
OffsetY      = 0
ButtonSwitch = 0
Display      = 0
Emulation    = 0
Interlace    = 0
Volume       = 50
LowPass      = 0
Turbo        = 0
Savepath     = mc0:/FCEUMM/
Elfpath      = mc0:/BOOT/BOOT.ELF
# ------------------------------------------------------------
# End-Of-File for FCEUltra.CNF
input1.cnf/input2.cnf
Code:
;Default configuration
JOY_Menu          = TRIANGLE
JOY_SaveState     = R2
JOY_LoadState     = L2
JOY_FDS_DiskSwap  = R3
JOY_FDS_SideSwap  = L3
JOY_A             = CROSS
JOY_B             = SQUARE
JOY_Select        = SELECT
JOY_Start         = START
JOY_Up            = UP
JOY_Down          = DOWN
JOY_Left          = LEFT
JOY_Right         = RIGHT
You can also use hex numbers that correspond to different buttons on the controller (taken from libpad.h):
Code:
LEFT      0x0080
DOWN      0x0040
RIGHT     0x0020
UP        0x0010
START     0x0008
R3        0x0004
L3        0x0002
SELECT    0x0001
SQUARE    0x8000
CROSS     0x4000
CIRCLE    0x2000
TRIANGLE  0x1000
R1        0x0800
L1        0x0400
R2        0x0200
L2        0x0100
If you want button combinations you can add them together in hex mode: e.g. select + square would be 0x8000 + 0x0001 = 0x8001. R1 + L1 would be 0x0800 + 0x0400 = 0x0C00.

For skins or color schemes:
Code:
# SKIN.CNF == Skin configuration file for the emulator FCEUltra
# CNF Handling Code (c)2006 Ronald Andersson aka dlanor        
# -------------------------------------------------------------
FrameColor  = 0x80FFFFFF
TextColor   = 0x80FFFFFF
Highlight   = 0x80408080
BGColor1    = 0x80000080
BGColor2    = 0x80000000
BGColor3    = 0x80000000
BGColor4    = 0x80000080
BGTexture   = mc0:/FCEUMM/back.png
BGMenu      = mc0:/FCEUMM/menu.png
# -------------------------------------------------------------
# End-Of-File for SKIN.CNF
You can define colors in... I think it's RRGGBBAA format. PNG/JPG textures are supported as well. The BGColors are applied to each corner in this order: top-left, top-right, bottom-left, bottom-right.

Thanks:
cah4e3 for making a version of FCEUltra with extra mapper support.
DCGrendel for providing a space to host my homebrew and helping me with various logic errors I had.
The entire ps2dev/ps2-scene community for PS2SDK, gsKit, and various other projects I utilized when porting FCEUltra, especially dlanor for his help and providing uLaunchelf's code as an example from which to work.

Latest release here.

Last edited by ragnarok2040; 05-28-2008 at 08:28 PM. Reason: New Beta
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 01-09-2007, 05:22 PM
latifundio's Avatar
latifundio latifundio is offline
Registered User
 
Join Date: Oct 2006
Posts: 10
Hey i tried zelda with this and play and looks nice, great job man!

Edit: also plays Castlevania 3 full speed... now this is sweet!

Last edited by latifundio; 01-09-2007 at 05:37 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 01-09-2007, 05:44 PM
gamecubesuxs's Avatar
gamecubesuxs gamecubesuxs is offline
I luv V0-11 PS2/Wii Newz MOD
 
Join Date: Jan 2006
Location: cali
Posts: 1,033
Wow good job all we need is sound and more rom support and it will be perfect
to bad u cannot work on it more thanks for the bins and source im sure some one will pick it up
__________________
V4 MI w/500gb HD & custom HD fan
V9 CC 2.0 w/300gb HD
V4 DMS4 Pro w/250gb HD
V3 CC 2.0
V12 Modbo 745 /clear case
V0 SCPH-10000 JAP w/ DMS3
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 01-09-2007, 07:18 PM
bootsector's Avatar
bootsector bootsector is offline
Registered User
 
Join Date: Feb 2006
Location: Campinas - SP - Brazil
Posts: 197
OMG! It looks like that the scene is not really dead!

Maybe the great coders (dlanor, EP, Polo35 and many others) of the scene could help to improve it!

Great job, Ragnarok! Thank you!

Best regards,

bootsector
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 01-09-2007, 08:20 PM
gamecubesuxs's Avatar
gamecubesuxs gamecubesuxs is offline
I luv V0-11 PS2/Wii Newz MOD
 
Join Date: Jan 2006
Location: cali
Posts: 1,033
This emu has way better video quality than than InfoNES and even savestates!

Like I said earlier just needs better rom loading options and sound
__________________
V4 MI w/500gb HD & custom HD fan
V9 CC 2.0 w/300gb HD
V4 DMS4 Pro w/250gb HD
V3 CC 2.0
V12 Modbo 745 /clear case
V0 SCPH-10000 JAP w/ DMS3
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 01-09-2007, 08:44 PM
gamecubesuxs's Avatar
gamecubesuxs gamecubesuxs is offline
I luv V0-11 PS2/Wii Newz MOD
 
Join Date: Jan 2006
Location: cali
Posts: 1,033
Does anyone know why the program freezes when triangle is pushed?
__________________
V4 MI w/500gb HD & custom HD fan
V9 CC 2.0 w/300gb HD
V4 DMS4 Pro w/250gb HD
V3 CC 2.0
V12 Modbo 745 /clear case
V0 SCPH-10000 JAP w/ DMS3
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 01-09-2007, 08:58 PM
Bootlegninja's Avatar
Bootlegninja Bootlegninja is offline
Disorganized User
 
Join Date: Apr 2005
Location: Ky, USA
Posts: 1,089
Can't wait to try it out as soon as my ps2 get straightened back out.
__________________
If you need help, post a question in the
forums, not my PM inbox. Thank you.


nunquam ut exsisto instituo
My list of consoles
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8  
Old 01-09-2007, 09:01 PM
gamecubesuxs's Avatar
gamecubesuxs gamecubesuxs is offline
I luv V0-11 PS2/Wii Newz MOD
 
Join Date: Jan 2006
Location: cali
Posts: 1,033
Game genie WORKS!
__________________
V4 MI w/500gb HD & custom HD fan
V9 CC 2.0 w/300gb HD
V4 DMS4 Pro w/250gb HD
V3 CC 2.0
V12 Modbo 745 /clear case
V0 SCPH-10000 JAP w/ DMS3
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9  
Old 01-09-2007, 09:50 PM
ragnarok2040 ragnarok2040 is offline
Registered User
 
Join Date: Dec 2002
Posts: 110
Thanks for all the great feedback, heh. As for the triangle button, pressing it does a call to exit(); which closes the program. It's needed for code profiling to dump the information to host: via xlink, but I forgot to remove it when I compiled the binaries. It doesn't do anything but freeze the ps2 without the -pg flag enabled.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10  
Old 01-09-2007, 10:46 PM
gamecubesuxs's Avatar
gamecubesuxs gamecubesuxs is offline
I luv V0-11 PS2/Wii Newz MOD
 
Join Date: Jan 2006
Location: cali
Posts: 1,033
Quote:
Originally Posted by ragnarok2040 View Post
Thanks for all the great feedback, heh. As for the triangle button, pressing it does a call to exit(); which closes the program. It's needed for code profiling to dump the information to host: via xlink, but I forgot to remove it when I compiled the binaries. It doesn't do anything but freeze the ps2 without the -pg flag enabled.
ok thanks im changing the source and compiling it to see it with sound. Do I have to boot .nes files from MC or is there something I could edit to boot more than 2 roms from a different source? BTW im no C or C++ programmer most Ive done is BASIC
__________________
V4 MI w/500gb HD & custom HD fan
V9 CC 2.0 w/300gb HD
V4 DMS4 Pro w/250gb HD
V3 CC 2.0
V12 Modbo 745 /clear case
V0 SCPH-10000 JAP w/ DMS3
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11  
Old 01-09-2007, 11:08 PM
ragnarok2040 ragnarok2040 is offline
Registered User
 
Join Date: Dec 2002
Posts: 110
The paths that are in FCEUI_LoadGame(); is in drivers/ps2/main.c, it pretty much just has hardcoded paths: "mc0:FCEUMM/nesrom1.nes" and near the bottom "mc0:FCEUMM/nesrom2.nes". Any type of rom browser function that returns a string could be used. The point where I added the nesrom2.nes code was where I had planned to add an in-game menu for opening other roms.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12  
Old 01-10-2007, 01:57 AM
gamecubesuxs's Avatar
gamecubesuxs gamecubesuxs is offline
I luv V0-11 PS2/Wii Newz MOD
 
Join Date: Jan 2006
Location: cali
Posts: 1,033
may i ask what you used to compile it, I cannot seem to do it with any compiler so far
__________________
V4 MI w/500gb HD & custom HD fan
V9 CC 2.0 w/300gb HD
V4 DMS4 Pro w/250gb HD
V3 CC 2.0
V12 Modbo 745 /clear case
V0 SCPH-10000 JAP w/ DMS3
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13  
Old 01-10-2007, 02:28 AM
ubergeek42 ubergeek42 is offline
Registered User
 
Join Date: Jul 2005
Posts: 194
The ps2sdk + toolchain from ps2dev.org?
Although it fails to compile with my cygwin toolchain, gcc segfaults on X6502_Run() in x6502.c:687.
__________________
Gaming Console: v7 PS2 Independence Exploit + 200gb Segate HDD
Development Console: v7 PS2 DMS4 Pro + EE_SIO Cable + 6gb HDD
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #14  
Old 01-10-2007, 02:33 AM
gamecubesuxs's Avatar
gamecubesuxs gamecubesuxs is offline
I luv V0-11 PS2/Wii Newz MOD
 
Join Date: Jan 2006
Location: cali
Posts: 1,033
im using cygwin it fails
__________________
V4 MI w/500gb HD & custom HD fan
V9 CC 2.0 w/300gb HD
V4 DMS4 Pro w/250gb HD
V3 CC 2.0
V12 Modbo 745 /clear case
V0 SCPH-10000 JAP w/ DMS3
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #15  
Old 01-10-2007, 02:49 AM
Bootlegninja's Avatar
Bootlegninja Bootlegninja is offline
Disorganized User
 
Join Date: Apr 2005
Location: Ky, USA
Posts: 1,089
Anybody try the win32 package?
__________________
If you need help, post a question in the
forums, not my PM inbox. Thank you.


nunquam ut exsisto instituo
My list of consoles
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #16  
Old 01-10-2007, 03:29 AM
ubergeek42 ubergeek42 is offline
Registered User
 
Join Date: Jul 2005
Posts: 194
@gamecubesuxs
"it fails" isn't too descriptive, detailed error messages would allow us to try help you.

@bootlegninja
Thats just a much more reduced cygwin environment from what I've heard.(That or MinGW)

@ragnorok2040
What operating system did you compile this on?
__________________
Gaming Console: v7 PS2 Independence Exploit + 200gb Segate HDD
Development Console: v7 PS2 DMS4 Pro + EE_SIO Cable + 6gb HDD
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #17  
Old 01-10-2007, 06:59 AM
gamecubesuxs's Avatar
gamecubesuxs gamecubesuxs is offline
I luv V0-11 PS2/Wii Newz MOD
 
Join Date: Jan 2006
Location: cali
Posts: 1,033


@ubergeek
heres what i get when i compile it
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #18  
Old 01-10-2007, 01:40 PM
ragnarok2040 ragnarok2040 is offline
Registered User
 
Join Date: Dec 2002
Posts: 110
Yeah, it's dependent on zlib. I used the one in ps2sdk-ports. Forgot to mention that it required that, lol. The system I used was a cross-compiled toolchain with MingW on XP.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #19  
Old 01-10-2007, 06:07 PM
gamecubesuxs's Avatar
gamecubesuxs gamecubesuxs is offline
I luv V0-11 PS2/Wii Newz MOD
 
Join Date: Jan 2006
Location: cali
Posts: 1,033
Quote:
Originally Posted by ragnarok2040 View Post
Yeah, it's dependent on zlib. I used the one in ps2sdk-ports. Forgot to mention that it required that, lol. The system I used was a cross-compiled toolchain with MingW on XP.
Im not sure I understand, partly because Im slowy learning programming by myself
You used MingW to compile it but how did you get zlib on there?
__________________
V4 MI w/500gb HD & custom HD fan
V9 CC 2.0 w/300gb HD
V4 DMS4 Pro w/250gb HD
V3 CC 2.0
V12 Modbo 745 /clear case
V0 SCPH-10000 JAP w/ DMS3
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #20  
Old 01-10-2007, 06:17 PM