Page 1 of 1

How to use CEN64

Posted: Sun Oct 27, 2013 5:25 pm
by Devin
To use Cen64 first you need to acquire a copy of the program.

You will need the N64 pif file as well but due to legal issues you need to dump your own.

Pif file hashes of a good dump.
MD5: 4921d5f2165dee6e2496f4388c4c81da
SHA1: 9174eadc0f0ea2654c95fd941406ab46b9dc9bdd

Windows

Premade Windows builds can be found here. http://www.emucr.com/search/label/Cen64?&max-results=12

Once extracted you can make a batch file or use a front end.

Breadwinka's frontend: http://cen64.com/viewtopic.php?f=5&t=8
Presence's frontend: http://cen64.com/viewtopic.php?f=8&t=15
Thedax's frontend: http://cen64.com/viewtopic.php?f=5&t=17

Batch method: Open notepad and copy the following text while editing where necessary.

Batch code based on ShadowFX's.

Code: Select all

@echo off
:reset
cls
echo CEN64 (Git) - created by MarathonMan
echo.
set /p rom="Rom Path\Name: "
cen64.exe -eeprom "%rom%.eeprom" -sram "%rom%.sram" -controller keyboard pifdata.bin "%rom%"
timeout /t 1 /nobreak >Nul
if not errorlevel 1 goto reset
ROM name: Type in your ROM name.
Alternate controllers: mayflash64, retrolink, wiiu, and x360.

Save your file as Start.bat

You should now be good to go.

Linux

Moving compiling to its own thread.

I have not noticed any other premade builds for Linux so I have made my own.

I will try to keep the download up to date. Enjoy ;)

Cen64 Stable v0.1: http://ubuntuone.com/3sxprXmz0XhbNLSMgyIRk9
Cen64 Unstable v0.2: http://ubuntuone.com/3kvyYmfuQulxqC4AuKTWUC

Presence's frontend: http://cen64.com/viewtopic.php?f=8&t=15

Shell Script Method: Open the text editor of choice such as gedit or mousepad and copy the following editing as needed.
Shell Script based on ShadowFX's batch code.

Code: Select all

clear
echo "CEN64 (Git) - created by MarathonMan"
read -e -p "Input Rom Path\Name: " rom
./cen64 -eeprom "$rom.eeprom" -sram "$rom.sram" -controller keyboard pifdata.bin "$rom"
Alternate controllers: mayflash64, retrolink, wiiu, and x360.

Save your file as Start.sh and after you may need to tick a box in perms to allow execution.

Input

Code: Select all

Keyboard:
Start=Enter
Joystick=ArrowKeys
CStick=Home,End,Del,PageDown
Dpad=Not implemented?
A=X
B=C
Z=Z
R=S
L=A

Xbox360 Controller:
Start=Start
JoyStick=LeftStick
CStick=RightStick
Dpad=Not implemented?
A=A
B=B
Z=LT
R=RT
L=LB

Mayflash64: Uses real N64 Controllers.

Retrolink: Cant test this sorry.

WiiU: Cant test this sorry.

Re: How to use CEN64

Posted: Sun Oct 27, 2013 7:10 pm
by ShadowFX
Devin wrote:You will need N64 pif files as well...
I recommend you remove the URL. This ROM is most likely copyrighted code and needs to be dumped by the user.
As of right now, you need ROM dumps from the retail console to run the simulator. The PIF ("BIOS") image performs checksums and security checks on the ROM image and initializes the environment. Please do not consult me on regards to obtaining ROM images; this is illegal is most countries.

Re: How to use CEN64

Posted: Sun Oct 27, 2013 7:18 pm
by beannaich
PIF ROM image is definitely proprietary. Let's not give Nintendo any reasons to put the kibosh on this, yeah?

Re: How to use CEN64

Posted: Sun Oct 27, 2013 7:20 pm
by Devin
Link removed as requested.

Re: How to use CEN64

Posted: Sun Oct 27, 2013 7:40 pm
by Snowstorm64
Devin wrote:To use Cen64 first you need to acquire a copy of the program.

Linux

I don't know of any premade Linux builds so looks like we will have to make our own.

Cen64 built on Xubuntu 13.10

Start by downloading the following.

https://github.com/tj90241/cen64/archive/master.zip
https://github.com/tj90241/cen64-audio/ ... master.zip
https://github.com/tj90241/cen64-bus/archive/master.zip
https://github.com/tj90241/cen64-pif/archive/master.zip
https://github.com/tj90241/cen64-rdp/archive/master.zip
https://github.com/tj90241/cen64-rdram/ ... master.zip
https://github.com/tj90241/cen64-rom/archive/master.zip
https://github.com/tj90241/cen64-rsp/archive/master.zip
https://github.com/tj90241/cen64-video/ ... master.zip
https://github.com/tj90241/cen64-vr4300 ... master.zip
http://sourceforge.net/projects/glfw/fi ... p/download

First extract cen64-master.zip then once you open the extracted folder there will be a bunch of empty subfolders. You will need to extract the other zips into their aproriate subfolders.

GLFW requires some extra steps.

Copy glfw's GL folder into the cen64-master include folder. GL can be found under deps.
This manual method is ugly and uncomfortable, it's better to use git for automatically download and update the source code.

Code: Select all

# This command will create a directory named "cen64" in your home and inside it will download the source code
$ git clone https://github.com/tj90241/cen64.git cen64
# Then, you MUST initialize the submodules (you need to do it only one time)
$ git submodule init

# If you want to update the git repository, you may want to launch these commandes
$ git pull
$ git submodule update

# To compile
$ make

# After an update, you need to remove old binary and compilation files, then recompile
$ make clean && make
Other options: I will try to figure out what these do later.
-eeprom <file>
-sram <file>
These options are for load savegame.

Re: How to use CEN64

Posted: Mon Oct 28, 2013 8:38 am
by ShadowFX
Devin wrote:Batch method: Open notepad and copy the following text while editing where necessary.

Code: Select all

cen64.exe -controller keyboard -eeprom eeprom.sav -sram sram.sav pifdata.bin "Path to rom"
pause
Alternate controllers: mayflash64, retrolink, and x360.

Save your file as Start.bat and you should be good to go.
I'll contribute my very simple batch file to this guide:

Code: Select all

@echo off
:reset
cls
echo CEN64 (Git) - created by MarathonMan
echo.
echo Type in N64 ROM name:
echo ---------------------
set /p rom="romname"
cen64.exe -eeprom %rom%.eeprom -sram %rom%.sram -controller "controller" pifdata.bin %rom%
timeout /t 1 /nobreak >Nul
if not errorlevel 1 goto reset
ROM name: type in your ROM name here (without the quotes)
Controller options: keyboard, mayflash64, retrolink, and x360 (without the quotes)

Re: How to use CEN64

Posted: Sun Nov 03, 2013 4:36 am
by Net_Bastard
For some reason all of the EmuCR Windows builds are giving me error messages when I try to unzip them.

Re: How to use CEN64

Posted: Sun Nov 03, 2013 2:04 pm
by MarathonMan
Net_Bastard wrote:For some reason all of the EmuCR Windows builds are giving me error messages when I try to unzip them.
Just tried extracting the most recent version. Works fine for me...

Re: How to use CEN64

Posted: Sun Nov 03, 2013 2:42 pm
by Net_Bastard
Oh wow. It turns out my version of 7-zip was extremely outdated. Sorry about that.

Re: How to use CEN64

Posted: Mon Nov 18, 2013 12:04 am
by Net_Bastard
Oh god I feel like such a newb when asking for help on beginner's stuff like this... :oops: but I can't get games to work despite me converting them to z64, and checking compatibility lists to ensure that they're supposed to work. Doing it via command line gives me a "Failed to create device" and when I use a frontend, I get an error message. What am I doing wrong?

Re: How to use CEN64

Posted: Mon Nov 18, 2013 12:23 am
by mustangemu
Don't feel bad I have the same problem. Just didn't ask cause I don't want to be considered a newb. :oops:

Re: How to use CEN64

Posted: Mon Nov 18, 2013 11:19 pm
by Devin
Net_Bastard wrote:Oh god I feel like such a newb when asking for help on beginner's stuff like this... :oops: but I can't get games to work despite me converting them to z64, and checking compatibility lists to ensure that they're supposed to work. Doing it via command line gives me a "Failed to create device" and when I use a frontend, I get an error message. What am I doing wrong?
mustangemu wrote:Don't feel bad I have the same problem. Just didn't ask cause I don't want to be considered a newb. :oops:
Do you have the pif file in your cen64 directory?

Re: How to use CEN64

Posted: Wed Nov 20, 2013 2:49 pm
by Net_Bastard
Devin wrote:
Net_Bastard wrote:Oh god I feel like such a newb when asking for help on beginner's stuff like this... :oops: but I can't get games to work despite me converting them to z64, and checking compatibility lists to ensure that they're supposed to work. Doing it via command line gives me a "Failed to create device" and when I use a frontend, I get an error message. What am I doing wrong?
mustangemu wrote:Don't feel bad I have the same problem. Just didn't ask cause I don't want to be considered a newb. :oops:
Do you have the pif file in your cen64 directory?

Yes, I have the pif.

Re: How to use CEN64

Posted: Wed Nov 20, 2013 4:42 pm
by Devin
Net_Bastard wrote:
Devin wrote:
Net_Bastard wrote:Oh god I feel like such a newb when asking for help on beginner's stuff like this... :oops: but I can't get games to work despite me converting them to z64, and checking compatibility lists to ensure that they're supposed to work. Doing it via command line gives me a "Failed to create device" and when I use a frontend, I get an error message. What am I doing wrong?
mustangemu wrote:Don't feel bad I have the same problem. Just didn't ask cause I don't want to be considered a newb. :oops:
Do you have the pif file in your cen64 directory?

Yes, I have the pif.
You mentioned an error with the front end what was it and what front end did you use? Also what version are you using Windows/Linux/Mac?

Re: How to use CEN64

Posted: Thu Nov 21, 2013 4:07 am
by Net_Bastard
I'm using the latest (since I checked) Windows build from EmuCR. The frontend I tried to use was thedax's frontend: http://cen64.com/viewtopic.php?f=17&t=17

I also tried to use the Cen64-Qt frontend by Presence and the same thing happens.

Re: How to use CEN64

Posted: Thu Nov 21, 2013 9:52 am
by Presence
The relevent error in the code is on line 201 here:
https://github.com/tj90241/cen64/blob/master/CEN64.c

The if statement it's inside of makes a call to CreateDevice here:
https://github.com/tj90241/cen64/blob/master/Device.c

The most likely reason that returned NULL is that your PIF file is invalid. I'd suggest running an md5 check on your file and see if it matches the hash listed near the top here: http://cen64.com/viewtopic.php?f=12&t=10

Re: How to use CEN64

Posted: Fri Nov 22, 2013 6:58 am
by Net_Bastard
I ran an MD5 check and it matched. To be sure, I checked the SHA1 and it also matched.

EDIt: I looked up the CRC hash and checked that as well. That also matches.

Re: How to use CEN64

Posted: Fri Nov 22, 2013 7:59 am
by Nacho
Net_Bastard wrote:I ran an MD5 check and it matched. To be sure, I checked the SHA1 and it also matched.

EDIt: I looked up the CRC hash and checked that as well. That also matches.
How do you start CEN64 on the command line?

The correct way is

Usage: ./cen64 [options] <pifrom> <cart>

Options:
-controller [keyboard,mayflash64,retrolink,wiiu,x360]
-eeprom <file>
-port 0, <1..65535>
-sram <file>

Then: cen64 pifdata.bin zelda.z64

Re: How to use CEN64

Posted: Fri Nov 22, 2013 8:03 pm
by Net_Bastard
That didn't work either. I still got "Failed to create a device."

Re: How to use CEN64

Posted: Fri Nov 22, 2013 8:13 pm
by Nacho
That's.... well... that's weird.

Tell us more data... what are you exactly doing? Which rom?

If you get a "Failed to create a device" error, the possibilties are wrong pifdata.bin (which is not, since you checked the md5 sum), or failure at allocating memory.

Are you doing weird things? Something as running CEN64 on a 64MB Pentium II computer, or running it whit "wine", or running it through a virtual machine...?

Re: How to use CEN64

Posted: Sat Nov 23, 2013 1:48 am
by beannaich
Nacho wrote:Then: cen64 pifdata.bin zelda.z64
I don't think cen64 likes relative file paths. Try specifying absolute file paths, in quotes, for everything.

Code: Select all

cen64 "D:/Emulators/pifdata.bin" "D:/ROMs/Nintendo 64/zelda.z64"
If that doesn't work, try physically taking the files and drag/dropping them onto the executable.

Re: How to use CEN64

Posted: Sat Nov 23, 2013 9:02 pm
by Snowstorm64
Do you have a 32 bit or 64 bit OS? 64-bit is required by CEN64 to work properly.

Re: How to use CEN64

Posted: Sun Nov 24, 2013 8:20 pm
by Net_Bastard
I'm running it on regular 64-bit Windows, no virtual machines nor Wine, with an AMD Phenom II X4 955. I've tried both a Kirby 64 ROM and a San Francisco Rush 2049 ROM, both of which I read were compatible with CEN64.
beannaich wrote:
Nacho wrote:Then: cen64 pifdata.bin zelda.z64
I don't think cen64 likes relative file paths. Try specifying absolute file paths, in quotes, for everything.

Code: Select all

cen64 "D:/Emulators/pifdata.bin" "D:/ROMs/Nintendo 64/zelda.z64"
If that doesn't work, try physically taking the files and drag/dropping them onto the executable.

I just tried that with Kirby 64. Now it doesn't say "Failed to create device" anymore. Now it just gives me the window and crashes immediately, just like with the frontends.

Re: How to use CEN64

Posted: Sun Nov 24, 2013 10:00 pm
by Nacho
The best you could do is to compile it yourself. Give it a try.

Re: How to use CEN64

Posted: Mon Nov 25, 2013 1:09 am
by The Extremist
Net_Bastard wrote:with an AMD Phenom II X4 955.
There's your problem. That is a pre-SSSE3 CPU.

Re: How to use CEN64

Posted: Mon Nov 25, 2013 9:14 pm
by Net_Bastard
The Extremist wrote:
Net_Bastard wrote:with an AMD Phenom II X4 955.
There's your problem. That is a pre-SSSE3 CPU.
I had a suspicion that it was the problem. Sadly I was really inexperienced when I built this computer so I can't exactly upgrade the CPU without replacing the entire motherboard. But thanks anyway.

Re: How to use CEN64

Posted: Tue Nov 26, 2013 6:39 am
by The Extremist
Net_Bastard wrote:I had a suspicion that it was the problem. Sadly I was really inexperienced when I built this computer so I can't exactly upgrade without scrapping 90% of it. But thanks anyway.
Are you sure? What's your motherboard model number?

Re: How to use CEN64

Posted: Sun Dec 01, 2013 2:52 pm
by Net_Bastard
The Extremist wrote:
Net_Bastard wrote:I had a suspicion that it was the problem. Sadly I was really inexperienced when I built this computer so I can't exactly upgrade without scrapping 90% of it. But thanks anyway.
Are you sure? What's your motherboard model number?
Okay, 90% is a bit of an exaggeration. I could do without upgrading the GPU, RAM, case, and hard drive for a short while. But I would have to replace the motherboard if I wanted to upgrade the CPU.
It's this motherboard: http://www.newegg.com/Product/Product.a ... 6813128439

It came out in 2010, it doesn't support anything newer than the phenom II, it certainly wouldn't be able to run a newer graphics card at full speed, and it's micro ATX.

Re: How to use CEN64

Posted: Sun Dec 01, 2013 4:07 pm
by Nacho
If you really want to test CEN64, you can compile it without SSSE3 support. Just remove the corresponding flag inside the Makefile. More information about compiling in the "How to compile CEN64" thread.

Re: How to use CEN64

Posted: Sun Dec 01, 2013 7:57 pm
by The Extremist
Net_Bastard wrote:It came out in 2010, it doesn't support anything newer than the phenom II, it certainly wouldn't be able to run a newer graphics card at full speed, and it's micro ATX.
I asked because certain Socket AM3 boards can support Socket AM3+ CPUs. And you may be in luck.

According to this page, revision 1.4 of that board supports two Piledriver CPUs - the FX 4350 and the FX 6350. Check for a rev. number stamped on your mobo.

Re: How to use CEN64

Posted: Wed Dec 04, 2013 11:45 pm
by Net_Bastard
Nacho wrote:If you really want to test CEN64, you can compile it without SSSE3 support. Just remove the corresponding flag inside the Makefile. More information about compiling in the "How to compile CEN64" thread.
So I followed the instructions on the thread, but... how do you edit the makefile? I know where the makefile is, but how do you edit it?

Re: How to use CEN64

Posted: Thu Dec 05, 2013 3:57 am
by V1del
With a text editor? Like notepad or less crappy alternatives

Re: How to use CEN64

Posted: Sun Dec 21, 2014 11:31 pm
by slot9
I'm not sure if this has been asked before, but would this reverse engineered version of the pif work with Cen64?

http://forum.pj64-emu.com/showthread.php?t=2644

I also have a secondary question, does anyone have any specific recommendations as far as what equipment I should buy if I wanted to go ahead and dump the pif myself?

I love that this project exists!

Re: How to use CEN64

Posted: Mon Dec 22, 2014 12:49 am
by MarathonMan
That's essentially just the key/algorithm for one variant of the PIF (6105).

If you want to dump yourself, his method by Hacktarux worked for me:
  • Put a watch point using the appropriate watch register in VR4300 COP0 in an address read during PIF ROM execution.
  • Copy the PIF ROM in a part of RDRAM not used by boot code within the code called by the watch point.
  • Print on screen content of the part of the rdram where the pif has been copied.
That being said, you just need a way to run homebrew, essentially. For that, marshallh's 64drive (http://64drive.retroactive.be/) is the best-in-class in this regards.

Re: How to use CEN64

Posted: Thu Mar 05, 2015 12:45 am
by Nintendo Maniac 64
One thing to point out, in the Windows the batch file text it isn't immediately obvious where the user should input the rom name.

Alternatively, you could just make the batch file text use "game.z64" and just tell the user to rename their rom file to that.

Re: How to use CEN64

Posted: Wed May 27, 2015 1:09 pm
by sargos7
I have a few issues. I managed to get Ocarina of Time running, by putting everything in the same folder, and using this as a batch file:

cen64 pifdata.bin zelda.z64

However, whenever I try to have the game in another folder, use the batch file in this thread, use an x360 controller, or use any of the front ends, it just does nothing.
Also, it will even sometimes randomly do nothing when using the above batch file, but then when I try again, it works.

Also, while it was running, I noticed a few things:
-It sometimes only uses about 12% of my 4 core cpu (so only half of one core), yet it does not run the game any faster than when it's using 25% (a whole core).
-Anytime the game goes into top down view, the ground (and walls, if inside) become a single grey texture.

Re: How to use CEN64

Posted: Wed May 27, 2015 1:16 pm
by MarathonMan
sargos7 wrote:However, whenever I try to have the game in another folder, use the batch file in this thread, use an x360 controller, or use any of the front ends, it just does nothing.
Also, it will even sometimes randomly do nothing when using the above batch file, but then when I try again, it works.
CEN64 currently lacks a lot of polish, especially on Windows. Sounds like it's having trouble finding OpenAL32.dll when it's not in the same directory, but can't say for certain until I play around with WinAPI a little more and get it to kick out error messages.

The joystick not working is expected; the new CEN64 core only uses the keyboard for input.

The CPU thing is just flat out weird. Are you sure you don't have a 4 core/8 thread CPU (in which case, 1 "thread" of execution is really 25% of your total horsepower)? What CPU is it? How are you limiting the execution to half of a core?

Re: How to use CEN64

Posted: Wed May 27, 2015 2:04 pm
by sargos7
I have an Intel Core i7-4790K. It's hyper-threaded. Is that what you mean? I was thinking maybe that was what was causing it, except it does go up to 25% sometimes...

http://www.newegg.com/Product/Product.a ... 6819117369

Re: How to use CEN64

Posted: Wed May 27, 2015 2:08 pm
by MarathonMan
sargos7 wrote:I have an Intel Core i7-4790K. It's hyper-threaded. Is that what you mean? I was thinking maybe that was what was causing it, except it does go up to 25% sometimes...

http://www.newegg.com/Product/Product.a ... 6819117369
Yes, that's why you're seeing 12.5%... you have what appears to the OS to be '8 things on which I can run stuff'.

So since CEN64 is largely single-threaded, you see 1/8th load most of the time. I say 'largely single-threaded', because CEN64 talks to OpenGL, WinAPI, etc. from a dedicated thread... not sure why it would be consuming so much in some circumstances, though.

Re: How to use CEN64

Posted: Wed May 27, 2015 2:11 pm
by Presence
The input menu in CEN64-Qt is non-functional (as well as the save files section under configure). It's a carry-over from the old core and I just commented out the section in the code where the -controller parameter was passed to CEN64. It could probably just be completely removed at this point unless the -controller parameter will be brought back.

If nothing is happening when trying to launch from the frontend, you can try Emulation->View Log... to see if any error messages are contained there.

Re: How to use CEN64

Posted: Wed May 27, 2015 2:19 pm
by sargos7
So I disabled hyper-threading, and now it seems to be running a bit faster. In fact, in some places, it runs more than 100% speed... I guess there isn't an option to limit the speed, then?

Re: How to use CEN64

Posted: Wed May 27, 2015 2:54 pm
by MarathonMan
sargos7 wrote:So I disabled hyper-threading, and now it seems to be running a bit faster. In fact, in some places, it runs more than 100% speed... I guess there isn't an option to limit the speed, then?
I use V-Sync (check your graphics) card.

No, another one of the areas of polish that isn't there. ;)

Re: How to use CEN64

Posted: Sat Jul 23, 2016 12:08 am
by slot9
MarathonMan wrote:That's essentially just the key/algorithm for one variant of the PIF (6105).

If you want to dump yourself, his method by Hacktarux worked for me:
  • Put a watch point using the appropriate watch register in VR4300 COP0 in an address read during PIF ROM execution.
  • Copy the PIF ROM in a part of RDRAM not used by boot code within the code called by the watch point.
  • Print on screen content of the part of the rdram where the pif has been copied.
That being said, you just need a way to run homebrew, essentially. For that, marshallh's 64drive (http://64drive.retroactive.be/) is the best-in-class in this regards.
I know this is from years ago. But do you know of any existing homebrew that would do the steps you list above 'for me' if I were to get it copied to a card like the 64drive?

Thank you!!!