Page 1 of 1

PS2VIC not loading from ps2 hdd using my loader and fakehost

Posted: Sat May 01, 2004 8:51 pm
by t0mb0la
Can anybody shed any light on what is happening here? The same files load fine through ps2link off PC host:

The following is the extended debug output. Sorry there is a lot of it.

Loading fakehost.irx 3801 bytes
pfs0:/PS2TESTS/ps2vic/
loadbuffer: addrres 10a500 args 22 arg pfs0:/PS2TESTS/ps2vic/
fakehost: Copyright (c) 2004 adresd
redirecting 'host:' to 'pfs0:/PS2TESTS/ps2vic/'
HOST final step, bye
fakehost: initializing 'host' file driver.
fakehost: initializing 'host' file driver.
loadbuffer: id 43, ret 0
Loading host:ps2vic.elf
loadelf: fname host:ps2vic.elf secname all
loadelf version 3.30
fakehost: open 0 ps2vic.elf pfs0:/PS2TESTS/ps2vic/
fakehost: read 2 1fdb5c 65536
Input ELF format filename = host:ps2vic.elf
0 00100000 0005a51c ..fakehost: read 2 1fda0c 65536
.fakehost: read 2 1fda0c 65536
.fakehost: read 2 1fda0c 65536
.fakehost: read 2 1fda0c 65536
.fakehost: read 2 1fda0c 65536

Loaded, host:ps2vic.elf
start address 0x100008
gp address 00000000
fakehost: close 2
EE: LoadElf returned 0
EE: Creating user thread (ent: 100008, gp: 0, st: 0)
EE: Created user thread: 12
pkoLoadElf returned 12
loadmodule: fname rom0:SIO2MAN args 0 arg
loadmodule: id 44, ret 1
loadmodule: fname rom0:PADMAN args 0 arg
loadmodule: id 45, ret 1
Enabling dual shock functions
setMainMode dualshock (locked): 1
infoPressMode: 1
enterPressMode: 1
# of actuators: 2
padSetActAlign: 1
loadmodule: fname rom0:SIO2MAN args 0 arg
loadmodule: id 46, ret 1
loadmodule: fname rom0:CDVDMAN args 0 arg
loadmodule: id 47, ret 1
loadmodule: fname rom0:LIBSD args 0 arg
loadmodule: id 48, ret 0
loadmodule: fname host:sjpcm.irx args 0 arg
fakehost: open 0 sjpcm.irx pfs0:/PS2TESTS/ps2vic/
fakehost: lseek 3 0 2
fakehost: lseek 3 0 0
fakehost: read 3 1fed34 8645
fakehost: close 3
SjPCM v2.0 - by Sjeep
SjPCM: RPC Initialize
loadmodule: id 49, ret 0
SjPCM: Memory Allocated. 734464 bytes left.
SjPCM: Sound buffers cleared
SjPCM: libsd initialised!
SjPCM: Setting up playing thread
SjPCM: Entering playing thread.
loadmodule: fname host:npm-usbd.irx args 0 arg
fakehost: open 0 npm-usbd.irx pfs0:/PS2TESTS/ps2vic/
ps2fs: Warning: NULL buffer returned
loadmodule: id -203, ret 0
loadmodule: fname host:NPM-USBD.IRX args 0 arg
fakehost: open 0 NPM-USBD.IRX pfs0:/PS2TESTS/ps2vic/
ps2fs: Warning: NULL buffer returned
loadmodule: id -203, ret 0
loadmodule: fname host:NPM-USBD.IRX;1 args 0 arg
fakehost: open 0 NPM-USBD.IRX;1 pfs0:/PS2TESTS/ps2vic/
ps2fs: Warning: NULL buffer returned
loadmodule: id -203, ret 0
loadmodule: fname host:usbd.irx args 0 arg
fakehost: open 0 usbd.irx pfs0:/PS2TESTS/ps2vic/
fakehost: lseek 4 0 2
fakehost: lseek 4 0 0
fakehost: read 4 1fed34 30317
fakehost: close 4
loadmodule: id 50, ret 1
loadmodule: fname host:ps2kbd.irx args 0 arg
fakehost: open 0 ps2kbd.irx pfs0:/PS2TESTS/ps2vic/
fakehost: lseek 5 0 2
fakehost: lseek 5 0 0
fakehost: read 5 1fed34 38498
fakehost: close 5
UsbRegisterDriver 0
PS2KBD - USB Keyboard Library
loadmodule: id 51, ret 0
open name basic.rom flag 0 data 44978
open fd = -19
open name BASIC.ROM flag 0 data 44978
open fd = -19
open name BASIC.ROM;1 flag 0 data 44978
open fd = -19
open name host:basic.rom flag 0 data 44978
fakehost: open 0 basic.rom pfs0:/PS2TESTS/ps2vic/
open fd = 3
fakehost: read 6 1fc49c 1024
fakehost: close 6
open name roms.rb flag 0 data 44978
open fd = -19
open name ROMS.RB flag 0 data 44978
open fd = -19
open name ROMS.RB;1 flag 0 data 44978
open fd = -19
open name host:roms.rb flag 0 data 44978
fakehost: open 0 roms.rb pfs0:/PS2TESTS/ps2vic/
ps2fs: Warning: NULL buffer returned
open fd = -2
open name host:ROMS.RB flag 0 data 44978
fakehost: open 0 ROMS.RB pfs0:/PS2TESTS/ps2vic/
ps2fs: Warning: NULL buffer returned
open fd = -2
open name host:ROMS.RB;1 flag 0 data 44978
fakehost: open 0 ROMS.RB;1 pfs0:/PS2TESTS/ps2vic/
ps2fs: Warning: NULL buffer returned
open fd = -2
open name kernal.rom flag 0 data 44978
open fd = -19
open name KERNAL.ROM flag 0 data 44978
open fd = -19
open name KERNAL.ROM;1 flag 0 data 44978
open fd = -19
open name host:kernal.rom flag 0 data 44978
fakehost: open 0 kernal.rom pfs0:/PS2TESTS/ps2vic/
open fd = 3
fakehost: read 7 1fc49c 1024
fakehost: close 7
open name roms.rb flag 0 data 44978
open fd = -19
open name ROMS.RB flag 0 data 44978
open fd = -19
open name ROMS.RB;1 flag 0 data 44978
open fd = -19
open name host:roms.rb flag 0 data 44978
fakehost: open 0 roms.rb pfs0:/PS2TESTS/ps2vic/
ps2fs: Warning: NULL buffer returned
open fd = -2
open name host:ROMS.RB flag 0 data 44978
fakehost: open 0 ROMS.RB pfs0:/PS2TESTS/ps2vic/
ps2fs: Warning: NULL buffer returned
open fd = -2
open name host:ROMS.RB;1 flag 0 data 44978
fakehost: open 0 ROMS.RB;1 pfs0:/PS2TESTS/ps2vic/
ps2fs: Warning: NULL buffer returned
open fd = -2
open name chargen.rom flag 0 data 44978
open fd = -19
open name CHARGEN.ROM flag 0 data 44978
open fd = -19
open name CHARGEN.ROM;1 flag 0 data 44978
open fd = -19
open name host:chargen.rom flag 0 data 44978
fakehost: open 0 chargen.rom pfs0:/PS2TESTS/ps2vic/
open fd = 3
fakehost: read 8 1fc49c 1024
fakehost: close 8
open name roms.rb flag 0 data 44978
open fd = -19
open name ROMS.RB flag 0 data 44978
open fd = -19
open name ROMS.RB;1 flag 0 data 44978
open fd = -19
open name host:roms.rb flag 0 data 44978
fakehost: open 0 roms.rb pfs0:/PS2TESTS/ps2vic/
ps2fs: Warning: NULL buffer returned
open fd = -2
open name host:ROMS.RB flag 0 data 44978
fakehost: open 0 ROMS.RB pfs0:/PS2TESTS/ps2vic/
ps2fs: Warning: NULL buffer returned
open fd = -2
open name host:ROMS.RB;1 flag 0 data 44978
fakehost: open 0 ROMS.RB;1 pfs0:/PS2TESTS/ps2vic/
ps2fs: Warning: NULL buffer returned
open fd = -2
open name usbkbd:dev flag 0 data 44978
open fd = 3
emulation started

It seems to fail to recognise the rom files, although they do appear to open and part of them is read. I don't think this is file corruption on the hdd, I copied the files back to PC host:, loaded them with ps2link and the emulator runs properly. The IRX modules load with fakehost without any problem, as does the program elf, so I am at a loss as to why the rom files are not. I should point out that the roms are of sizes 4k and 8k, but I'm assuming that the emulator just reads the first 1k to determine their validity.

Any ideas or suggestions?
Regards, Tommy.

Posted: Mon May 03, 2004 12:24 am
by mrbrown
Checking ps2drv/common/include/errno.h, code -2 means the file wasn't found. Within the pfs0:/PS2TESTS/ps2vic/ directory, are you sure the rom files are named exactly the way open() expects them? If they are then you probably want to check fakehost to make sure it doesn't do anything funky to the passed-in filename. Look at the "real" filename passed to the pfs driver, the one returned from fd_name() to the open() call (in fd_open()). If everything looks good there, then your next place to look is in ps2fs itself. I just looked in pfs_fio.c and noticed pfsOpen() returns ENOENT right off the bat if the passed in filename is NULL. openFile() (called later by pfsOpen()) is another place where ENOENT is returned.

Use the source, that's what it's there for.

Posted: Mon May 03, 2004 1:17 pm
by t0mb0la
This issue has been resolved now. Hopefully we can expect to see the updated version of PS2VIC available soon, if it isn't already. Raipsu was good enough to equip me with a fixed version, and it loads very effectively through fakehost now. Very nice it is too :P
The problem was due to the method of file access used in PS2VIC, I understand the same effect was apparent when the ps2vic.elf and rom files were installed on memory card. Changing to fioOpen/fioRead etc. has fixed this. Thank you for your swiftness in doing this Raipsu.
You are right about the -2 error MrBrown, roms.rb was not included; although this file is not essential to load the emulator. Repeated attempts were made to open roms.rb though, when the files basic.rom, kernal.rom and chargen.rom had failed; this was probably a distraction from the real problem, and I should've perhaps deleted this extraneous debug output, but I felt it was relevant.