Lameguy64 / PSn00bSDK

The most powerful open source SDK for the PS1 (as far as open source PS1 SDKs go). Not recommended for beginner use.
Other
820 stars 66 forks source link

None of the demos work with Mednafen #21

Closed sk-io closed 3 years ago

sk-io commented 4 years ago

Using verified SCPH-5500 bios, tried with both opengl and software rendering For example, here's the log with psx.dbg_level 2 for fpscam (which works in ePSXe, though it's one of the only ones that do): ` Starting Mednafen 1.24.3 Build information: Compiled with gcc 4.9.4 Running with MinGW-W64 Runtime 5.0 (alpha - rev. 0) 0000-00-00 Compiled against zlib 1.2.8, running with zlib 1.2.8(flags=0x00000065) Compiled against libiconv 15.1, running with libiconv 15.1 Compiled against SDL 2.0.8(hg-11835:f622a4457a25), running with SDL 2.0.8(hg-11835:f622a4457a25) Running with libsndfile-1.0.28 Base directory: C:\dev\PSn00bSDK\mednafen Emulation modules: apple2 nes snes gb gba pce lynx md pcfx ngp psx ss ssfplay vb wswan sms gg snes_faust pce_fast demo cdplay Opening lockfile... Loading settings from "C:\dev\PSn00bSDK\mednafen\mednafen.cfg"... Loaded 7544 valid settings and 0 unknown settings. Initializing joysticks... ID: 0x000000000000000000010004f3ff0000 - XInput Unknown Controller Loading fpscam.exe... Applying IPS file ".\fpscam.exe.ips"... Failed: Error opening file ".\fpscam.exe.ips": No such file or directory Using module: psx(Sony PlayStation) Loading override settings from "C:\dev\PSn00bSDK\mednafen\psx.cfg"... Failed: Error opening file "C:\dev\PSn00bSDK\mednafen\psx.cfg": No such file or directory Loading override settings from "C:\dev\PSn00bSDK\mednafen\pgconfig\fpscam.psx.cfg"... Failed: Error opening file "C:\dev\PSn00bSDK\mednafen\pgconfig\fpscam.psx.cfg": No such file or directory

Region: Japan

Multitap on PSX Port 1: Disabled Multitap on PSX Port 2: Disabled PC=0x80012b20 SP=0x00000000 TextStart=0x80010000 TextSize=0x00008000

Loading cheats from C:\dev\PSn00bSDK\mednafen\cheats\psx.cht... Error opening file "C:\dev\PSn00bSDK\mednafen\cheats\psx.cht": No such file or directory

Initializing sound... Using "WASAPI(Shared mode)" audio driver with SexyAL's default device selection. Format: 16 bits(signed, 2 bytes, little-endian) Rate: 44100 Channels: 2 Buffer size: 1411 sample frames(31.995465 ms) Latency: 1411 sample frames(31.995465 ms) Initializing video... Driver: OpenGL Display Mode: 1920 x 1080 x 24 bpp @ 144Hz (Window: 960 x 720) Shader: none Fullscreen: No Special Scaler: None Scanlines: Off Destination Rectangle: X=0, Y=0, W=960, H=720 OpenGL Implementation: NVIDIA Corporation GeForce GTX 1060 6GB/PCIe/SSE2 4.6.0 NVIDIA 442.74 Checking extensions: GL_ARB_texture_non_power_of_two found. GL_ARB_sync found. Using non-power-of-2 sized textures. Checking maximum texture size... Apparently it is at least: 32768 x 32768 Using GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV for texture source data. [MEM] Unknown write32 to 1f801060 at time 40, =00000b88(2952) [MEM] Unknown write32 to 1f801060 at time 91902, =00000b88(2952) [MEM] Unknown write8 to 1f802041 at time 92017, =0000000f(15) [MEM] Unknown write8 to 1f802041 at time 92290, =0000000e(14) [MEM] Unknown write8 to 1f802041 at time 94143, =00000001(1) [MEM] Unknown write8 to 1f802041 at time 94340, =00000002(2) [MEM] Unknown write8 to 1f802041 at time 405693, =00000003(3) [MEM] Unknown write8 to 1f802041 at time 419632, =00000004(4) [MEM] Unknown write8 to 1f802041 at time 422787, =00000001(1) [MEM] Unknown write8 to 1f802041 at time 422867, =00000003(3) [MEM] Unknown write8 to 1f802041 at time 423301, =00000004(4) [MEM] Unknown write8 to 1f802041 at time 433711, =00000005(5) [MEM] Unknown write8 to 1f802041 at time 436482, =00000006(6) [MEM] Unknown write8 to 1f802041 at time 436544, =00000002(2) [MEM] Unknown write8 to 1f802041 at time 457375, =00000005(5)

PS-X Realtime Kernel Ver.2.5 Copyright 1993,1994 (C) Sony Computer Entertainment Inc. [MEM] Unknown write8 to 1f802041 at time 514809, =00000006(6) KERNEL SETUP!

Configuration : EvCB 0x10 TCB 0x04 [MEM] Unknown write8 to 1f802041 at time 566203, =00000007(7) [MEM] Unknown write32 to fffffffc at time 864080, =bfc06998(-1077909096) [MEM] Unknown write32 to fffffff8 at time 864081, =00000000(0) [MEM] Unknown write32 to fffffff4 at time 864082, =00000000(0) [MEM] Unknown write32 to fffffff0 at time 864090, =00000000(0) [MEM] Unknown write32 to ffffffdc at time 973276, =80012b84(-2147406972) [MEM] Unknown write32 to ffffffd8 at time 973277, =801fff00(-2145386752) [MEM] Unknown write32 to ffffffd4 at time 973278, =00000000(0) [MEM] Unknown write32 to ffffffd0 at time 973286, =00000000(0) [MEM] Unknown write32 to ffffffcc at time 973287, =00000000(0) [MEM] Unknown write32 to ffffffc8 at time 973288, =00000000(0) [MEM] Unknown write32 to ffffffc4 at time 973289, =00000000(0) [MEM] Unknown write32 to ffffffc0 at time 973297, =80010000(-2147418112) [MEM] Unknown write32 to ffffffbc at time 973298, =00000000(0) [MEM] Unknown write32 to ffffffb8 at time 973300, =00000000(0) [MEM] Unknown write32 to fffff5ec at time 973309, =00000000(0) [MEM] Unknown write32 to fffff5e8 at time 973317, =00000000(0) [MEM] Unknown write32 to fffff5fc at time 973320, =80010030(-2147418064) [MEM] Unknown write32 to fffff5f8 at time 973328, =00000000(0) [MEM] Unknown write32 to fffff5f4 at time 973329, =00000000(0) [MEM] Unknown write32 to fffff5f0 at time 973330, =80010000(-2147418112) [MEM] Unknown write32 to fffff5c8 at time 973348, =80011184(-2147413628) [MEM] Unknown write32 to fffff5cc at time 973349, =00000000(0) [MEM] Unknown write32 to fffff5c4 at time 973769, =8001208c(-2147409780) [MEM] Unknown write32 to fffff5ac at time 975113, =bfc07320(-1077906656) [MEM] Unknown read32 from fffff5ac at time 975346 `

GithubPrankster commented 3 years ago

I have a similar problem too!

Executing mednafen with command line: "/usr/games/mednafen -psx.dbg_level 0 -video.fs 0 -cheats 1 /home/prankster/repos/PSn00bSDK/examples/cdrom/cdbrowse/cdbrowse.cue "

Starting Mednafen 1.24.3 Build information: Compiled with gcc 9.3.0 Compiled against zlib 1.2.11, running with zlib 1.2.11(flags=0x000000a9) Compiled against SDL 2.0.10(hg-12952:bc90ce38f1e2), running with SDL 2.0.12(hg-13609:34cc7d3b69d3) Running with libsndfile-1.0.28 Base directory: /home/prankster/.mednafen Emulation modules: apple2 nes snes gb gba pce lynx md pcfx ngp psx ss ssfplay vb wswan sms gg snes_faust pce_fast demo cdplay Opening lockfile... Loading settings from "/home/prankster/.mednafen/mednafen.cfg"... Loaded 7544 valid settings and 0 unknown settings. Initializing joysticks... ID: 0x00030079000601100006000c00000000 - Microntek USB Joystick
Loading /home/prankster/repos/PSn00bSDK/examples/cdrom/cdbrowse/cdbrowse.cue... Loading SBI file "/home/prankster/repos/PSn00bSDK/examples/cdrom/cdbrowse/cdbrowse.sbi"... Error: Error opening file "/home/prankster/repos/PSn00bSDK/examples/cdrom/cdbrowse/cdbrowse.sbi": No such file or directory

CD 1 TOC: Disc Type: 0x20 (CD-XA) First Track: 1 Last Track: 1 Track 1, MSF: 00:02:00, LBA: 0 DATA Leadout: 1068 DATA

Could not find a system that supports this CD.

sk-io commented 3 years ago

The issue seems to be from 82a441e, where line 270 of elf2x.c is commented out.

With the reason being:

  • elf2x: s_addr no longer set on PS-EXE header, console BIOS already sets it by STACK value in SYSTEM.CNF and allows child executables to return to parent if left zero.

@Lameguy64 Is this important behaviour? What about setting it to 0x801FFFF0 by default and adding an optional argument to change it? I think the first thing alot of newcomers will do is build the examples and try to run the EXEs in an emulator.

Lameguy64 commented 3 years ago

It's normal for s_addr to be zero in a PS-EXE as the PS1's boot loader does exactly what is described in that changelog entry. I've yet to get around setting up Mednafen to test PS-EXEs built with PSn00bSDK myself, but I haven't heard anyone else having the same problem with Mednafen as you.

Though I did hear of GithubPrankster's issue with Mednafen not accepting ISO images created with MKPSXISO elsewhere even when the generated ISO is fully licensed. It must be doing some very obscure check of the ISO image I haven't got to the bottom of yet.