Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRITICAL: C:\Users\autch\src\piemu\piemu.c:10:SetEmuParameters: DIE: Cannot open piece.pfi #4

Closed
Dunard opened this issue Jan 4, 2024 · 10 comments

Comments

@Dunard
Copy link

Dunard commented Jan 4, 2024

C:\Users\KingH>D:\piemu\piemu.exe
INFO: Created renderer: direct3d
CRITICAL: C:\Users\autch\src\piemu\piemu.c:10:SetEmuParameters: DIE: Cannot open piece.pfi

What is this file?

Download the build from here. #3

I don't know what tools that you use to build this. I have Windows 11 and Nobara 39 OS Linux.

@autch
Copy link
Owner

autch commented Jan 5, 2024

The instructions on what a piece.pfi file is and how to obtain it are written in comment #1
The instructions for writing an app to a pfi file are in #2

@Dunard
Copy link
Author

Dunard commented Jan 5, 2024

ok I got the usr files and the piemu_old source. What all tools I need to compile all?

I didn't find the mkpfi anywhere.

@autch
Copy link
Owner

autch commented Jan 5, 2024

To generate piece.pfi from official BIOS update image, use mkpfi tool.
To add/remove apps into/from PFI image, use pffs or pfar tool.

piemu_old branch uses Visual C++ toolchain and NMAKE, use Visual Studio Developer Command Prompt / PowerShell to build them.
Other branches (eg. modernize) are using CMake, any toolchain can be used.

@Dunard
Copy link
Author

Dunard commented Jan 6, 2024

Thank you. I posted a screenshot here. https://www.mameworld.info/ubbthreads/showthreaded.php?Cat=&Number=397661&page=0&view=expanded&sb=5&o=&fpart=1&vc=1 There is no sounds on this game. So I don't have a hardware to test this game out on. I got the game here at. https://web.archive.org/web/20040220122225/http://nepiaworld.com/menu/works/wr/index.html

@Dunard
Copy link
Author

Dunard commented Jan 6, 2024

On the Windows 11. I get this error.

[MINGW64] D:\piemu_old>make OVERRIDE_CC=clang OVERRIDE_CXX=clang++
cl /c /Iinclude /W3 /WX /DWINDOWS /MD /Ox /G6 /GL /nologo bcu.c
process_begin: CreateProcess(NULL, cl /c /Iinclude /W3 /WX /DWINDOWS /MD /Ox /G6 /GL /nologo bcu.c, ...) failed.
make (e=2): The system cannot find the file specified.
makefile.rule:10: recipe for target 'bcu.obj' failed
make: *** [bcu.obj] Error 2

Installing the Visual Studio 2022. I going to see I can compile with it instead of the msys64-2022-01-12.exe from here https://www.mamedev.org/tools/ (I don't like the Visual Studio 2022 at all. Meh.)

@autch
Copy link
Owner

autch commented Jan 7, 2024

If you are building with MSYS2/MinGW64, it is recommended to use the modernize or revert-to-single-thread branches rather than piemu_old:

$ pacman -S mingw64/mingw-w64-x86_64-SDL2 msys/cmake mingw64/mingw-w64-x86_64-gcc git
$ git clone -b modernize https://github.com/autch/piemu.git
$ cd piemu
$ mkdir BUILD
$ cd BUILD
$ CC=x86_64-w64-mingw32-gcc cmake ../
$ make -j4

@Dunard
Copy link
Author

Dunard commented Jan 8, 2024

ninja instead of make. I got it to work now. But one error.

[30/30] Linking C executable piemu.exe
FAILED: piemu.exe
cmd.exe /C "cd . && D:\msys64\mingw64\bin\x86_64-w64-mingw32-gcc.exe CMakeFiles/piemu.dir/bcu.c.obj CMakeFiles/piemu.dir/emu.c.obj CMakeFiles/piemu.dir/fram.c.obj CMakeFiles/piemu.dir/lcdc.c.obj CMakeFiles/piemu.dir/piemu.c.obj CMakeFiles/piemu.dir/usbc.c.obj CMakeFiles/piemu.dir/core.c.obj CMakeFiles/piemu.dir/flash.c.obj CMakeFiles/piemu.dir/iomem.c.obj CMakeFiles/piemu.dir/main.c.obj CMakeFiles/piemu.dir/sram.c.obj -o piemu.exe -Wl,--out-implib,libpiemu.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -Wl,-Bstatic -lSDL2main -Wl,-Bdynamic -lSDL2 libc33core.a -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): in function main': C:/M/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to WinMain'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

The tools is made though.

I will try out the one from the revert-to-single-thread to see that will make it.

Update: Same error.

@autch
Copy link
Owner

autch commented Jan 8, 2024

try to uncomment SDLmain line in piemu/CMakeLists.txt, or change its order among them

piemu/CMakeLists.txt

Lines 88 to 92 in 19d95d5

target_link_libraries(piemu
${SDL2_LIBRARIES}
c33core
# SDLmain
)

@Dunard
Copy link
Author

Dunard commented Jan 11, 2024

[26/30] Building C object tools/CMakeFiles/mkpfi.dir/pfi.c.obj
C:/msys64/home/KingH/piemu/tools/pfi.c: In function 'PFIOpen':
C:/msys64/home/KingH/piemu/tools/pfi.c:37:49: warning: multi-character character constant [-Wmultichar]
37 | if((pfi->header.signature & 0xffffff00) == ('PFI0' & 0xffffff00))
| ^~~~~~
[30/30] Linking C executable piemu.exe

I finally got it now.
Screenshot 2024-01-11 053501

SDLmain isn't needed.

I'm using this now to build it. https://docs.mamedev.org/initialsetup/compilingmame.html#using-a-standard-msys2-installation

Much better than the msys64-2022-01-12.exe. Not using this anymore.

@Dunard
Copy link
Author

Dunard commented Jan 13, 2024

I got the SDLmain to work now. I didn't know which of the sdl is missing parts. I got both. https://packages.msys2.org/base/mingw-w64-SDL installed first and then installed this after. https://packages.msys2.org/base/mingw-w64-SDL2 (Note: I skipped the aarch64 on both. Not needed.)

@Dunard Dunard closed this as completed Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants