Closed Apteryks closed 6 months ago
Hi!
I tried running GUIX in QEMU in order to build ZSNES.
However, I get an error when building parsegen.cpp
(using make
), that it can not find linux/errno.h
, even after linux-libre-headers
has been installed.
Then I remembered that Debian has a similar issue, since parsegen is 64-bit (or arm64 or whatever the host system is) while zsnes is 32-bit for x86, and it's not straightforward to set up the toolchain for both 32-bit x86 and the host system at the same time for the same run of make
.
Ideally I would want to get rid of parsegen.cpp
alltogether. Perhaps a replacement could be written in a different language that would make it easier to deal with at build time.
I think the errors you are seeing about missing input.h
are related to parsegen
being built for the wrong platform.
One solution could be to first set up gcc and the tooling to build parsegen
for the right platform, then run make
, then set up the tooling for 32-bit x86 and then run make
again.
Is is a bit hacky, I know, but renovating ZSNES is a (long) work in progress.
Hello :-)
Thanks for trying it out in a VM. For the record, this is my current package definition:
(define-public zsnes
(package
(name "zsnes")
(version "2.0.12")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/xyproto/zsnes")
(commit version)))
(file-name (git-file-name name version))
(sha256
(base32
"0g9l1ij3p1adkp97wkp0dz44i2xpmsvfpkxvlfkpr7190dibsgsz"))))
(build-system gnu-build-system)
(arguments
(list #:system "i686-linux"
#:tests? #f ;no test suite
#:make-flags
#~(list (string-append "CC=" #$(cc-for-target))
(string-append "CXX=" #$(cxx-for-target))
(string-append "CFLAGS=-I"
#$(this-package-input "sdl12-compat")
"/include/SDL"))
#:phases #~(modify-phases %standard-phases
(delete 'configure)))) ;no configure script
(native-inputs (list nasm))
(inputs (list glib libpng mesa ncurses sdl12-compat zlib))
(home-page "https://www.zsnes.com")
(synopsis "Super Nintendo Entertainment System emulator")
(description "ZSNES is a Super Nintendo Entertainment System (SNES)
emulator that supports advanced features such as a multiplayer mode using a
TC/IP network and special graphic filters. It can run most of the SNES games
at full speed with sound. Some of its features include:
@itemize
@item Support for smoothing and dynamic image scaling
@item Support for rewinding and fast-forwarding in-game
@item JMA compression format
@item The ability to play multiplayer games with another person over a network
@item Change the appearance of the GUI
@item Take screenshots of currently running games
@item Saving the game at any point by recording the console’s state
@item Record movies of gameplay which can be played back.
@end itemize")
(license license:gpl2+)
(supported-systems (list "x86_64-linux"))))
I applied a patch from Sou Bunnbu to get sdl12-compat available in Guix, but the result was the same when using the plain old sdl
package already available.
The #:system
build argument is causing the package to be built for i686-linux (32 bit) even a x86_64-linux machine is used. Building the parsegen
binary appears to work correctly even as 32 bit:
===> CXX parsegen
g++ -o parsegen parsegen.cpp -lz
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/newgfx16.o video/newgfx16.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/newg162.o video/newg162.asm
===> PSR cfg.h
./parsegen -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -gcc gcc -compile -flags '-I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL' -cheader cfg.h -fname cfg cfg.o cfg.psr
===> PSR input.h
./parsegen -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -gcc gcc -compile -flags '-I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL' -cheader input.h -fname input input.o input.psr
===> PSR md.h
./parsegen -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -gcc gcc -compile -flags '-I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL' -cheader md.h -fname md md.o md.psr
parsegen: gcc -I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL -o md.o -c md.c
parsegen: gcc -I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL -o input.o -c input.c
parsegen: gcc -I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL -o cfg.o -c cfg.c
===> CC c_init.c
===> CC c_vcache.c
gcc -I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL -c -MMD -o c_vcache.o c_vcache.c
===> CC chips/7110emu.c
gcc -I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL -c -MMD -o c_init.o c_init.c
gcc -I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL -c -MMD -o chips/7110emu.o chips/7110emu.c
c_init.c: In function ‘ReadInputDevice’:
c_init.c:296:26: error: ‘pl1upk’ undeclared (first use in this function); did you mean ‘pl5upk’?
296 | PlayerDeviceHelp(pl1upk, &JoyAOrig, 0x08000000);
| ^~~~~~
| pl5upk
c_init.c:296:26: note: each undeclared identifier is reported only once for each function it appears in
c_init.c:297:26: error: ‘pl1downk’ undeclared (first use in this function); did you mean ‘pl5downk’?
297 | PlayerDeviceHelp(pl1downk, &JoyAOrig, 0x04000000);
| ^~~~~~~~
| pl5downk
c_init.c:298:26: error: ‘pl1leftk’ undeclared (first use in this function); did you mean ‘pl5leftk’?
298 | PlayerDeviceHelp(pl1leftk, &JoyAOrig, 0x02000000);
| ^~~~~~~~
| pl5leftk
c_init.c:299:26: error: ‘pl1rightk’ undeclared (first use in this function); did you mean ‘pl5rightk’?
299 | PlayerDeviceHelp(pl1rightk, &JoyAOrig, 0x01000000);
| ^~~~~~~~~
| pl5rightk
make: *** [Makefile:365: c_init.o] Error 1
make: *** Waiting for unfinished jobs....
c_vcache.c: In function ‘ConvertToAFormat’:
c_vcache.c:556:9: error: impossible constraint in ‘asm’
556 | asm volatile(
| ^~~
make: *** [Makefile:365: c_vcache.o] Error 1
~Perhaps I shouldn't use parallel make (drop the -j4
argument in my case).~ I just tried without -j
, and it fails in the same way as above.
Here's the complete build output in case it helps to diagnose what's wrong:
starting phase `build'
===> ASM chips/7110proc.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o chips/7110proc.o chips/7110proc.asm > chips/7110proc.d || rm -f chips/7110proc.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o chips/7110proc.o chips/7110proc.asm
===> ASM chips/c4proc.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o chips/c4proc.o chips/c4proc.asm > chips/c4proc.d || rm -f chips/c4proc.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o chips/c4proc.o chips/c4proc.asm
===> ASM chips/dsp1proc.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o chips/dsp1proc.o chips/dsp1proc.asm > chips/dsp1proc.d || rm -f chips/dsp1proc.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o chips/dsp1proc.o chips/dsp1proc.asm
===> ASM chips/dsp2proc.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o chips/dsp2proc.o chips/dsp2proc.asm > chips/dsp2proc.d || rm -f chips/dsp2proc.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o chips/dsp2proc.o chips/dsp2proc.asm
===> ASM chips/dsp3proc.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o chips/dsp3proc.o chips/dsp3proc.asm > chips/dsp3proc.d || rm -f chips/dsp3proc.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o chips/dsp3proc.o chips/dsp3proc.asm
===> ASM chips/dsp4proc.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o chips/dsp4proc.o chips/dsp4proc.asm > chips/dsp4proc.d || rm -f chips/dsp4proc.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o chips/dsp4proc.o chips/dsp4proc.asm
===> ASM chips/fxemu2.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o chips/fxemu2.o chips/fxemu2.asm > chips/fxemu2.d || rm -f chips/fxemu2.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o chips/fxemu2.o chips/fxemu2.asm
===> ASM chips/fxemu2b.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o chips/fxemu2b.o chips/fxemu2b.asm > chips/fxemu2b.d || rm -f chips/fxemu2b.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o chips/fxemu2b.o chips/fxemu2b.asm
===> ASM chips/fxemu2c.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o chips/fxemu2c.o chips/fxemu2c.asm > chips/fxemu2c.d || rm -f chips/fxemu2c.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o chips/fxemu2c.o chips/fxemu2c.asm
===> ASM chips/fxtable.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o chips/fxtable.o chips/fxtable.asm > chips/fxtable.d || rm -f chips/fxtable.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o chips/fxtable.o chips/fxtable.asm
===> ASM chips/obc1proc.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o chips/obc1proc.o chips/obc1proc.asm > chips/obc1proc.d || rm -f chips/obc1proc.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o chips/obc1proc.o chips/obc1proc.asm
===> ASM chips/sa1proc.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o chips/sa1proc.o chips/sa1proc.asm > chips/sa1proc.d || rm -f chips/sa1proc.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o chips/sa1proc.o chips/sa1proc.asm
===> ASM chips/sa1regs.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o chips/sa1regs.o chips/sa1regs.asm > chips/sa1regs.d || rm -f chips/sa1regs.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o chips/sa1regs.o chips/sa1regs.asm
===> ASM chips/sfxproc.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o chips/sfxproc.o chips/sfxproc.asm > chips/sfxproc.d || rm -f chips/sfxproc.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o chips/sfxproc.o chips/sfxproc.asm
===> ASM chips/st10proc.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o chips/st10proc.o chips/st10proc.asm > chips/st10proc.d || rm -f chips/st10proc.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o chips/st10proc.o chips/st10proc.asm
===> ASM chips/st11proc.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o chips/st11proc.o chips/st11proc.asm > chips/st11proc.d || rm -f chips/st11proc.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o chips/st11proc.o chips/st11proc.asm
===> ASM cpu/dma.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o cpu/dma.o cpu/dma.asm > cpu/dma.d || rm -f cpu/dma.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o cpu/dma.o cpu/dma.asm
===> ASM cpu/dsp.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o cpu/dsp.o cpu/dsp.asm > cpu/dsp.d || rm -f cpu/dsp.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o cpu/dsp.o cpu/dsp.asm
===> ASM cpu/dspproc.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o cpu/dspproc.o cpu/dspproc.asm > cpu/dspproc.d || rm -f cpu/dspproc.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o cpu/dspproc.o cpu/dspproc.asm
===> ASM cpu/execute.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o cpu/execute.o cpu/execute.asm > cpu/execute.d || rm -f cpu/execute.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o cpu/execute.o cpu/execute.asm
===> ASM cpu/irq.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o cpu/irq.o cpu/irq.asm > cpu/irq.d || rm -f cpu/irq.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o cpu/irq.o cpu/irq.asm
===> ASM cpu/memory.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o cpu/memory.o cpu/memory.asm > cpu/memory.d || rm -f cpu/memory.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o cpu/memory.o cpu/memory.asm
===> ASM cpu/spc700.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o cpu/spc700.o cpu/spc700.asm > cpu/spc700.d || rm -f cpu/spc700.d
cpu/spc700.asm:54: warning: dropping trailing empty parameter in call to multi-line macro `newsym' [-w+macro-params-legacy]
cpu/spc700.asm:56: warning: dropping trailing empty parameter in call to multi-line macro `newsym' [-w+macro-params-legacy]
cpu/spc700.asm:61: warning: dropping trailing empty parameter in call to multi-line macro `newsym' [-w+macro-params-legacy]
cpu/spc700.asm:66: warning: dropping trailing empty parameter in call to multi-line macro `newsym' [-w+macro-params-legacy]
cpu/spc700.asm:71: warning: dropping trailing empty parameter in call to multi-line macro `newsym' [-w+macro-params-legacy]
cpu/spc700.asm:76: warning: dropping trailing empty parameter in call to multi-line macro `newsym' [-w+macro-params-legacy]
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o cpu/spc700.o cpu/spc700.asm
cpu/spc700.asm:54: warning: dropping trailing empty parameter in call to multi-line macro `newsym' [-w+macro-params-legacy]
cpu/spc700.asm:56: warning: dropping trailing empty parameter in call to multi-line macro `newsym' [-w+macro-params-legacy]
cpu/spc700.asm:61: warning: dropping trailing empty parameter in call to multi-line macro `newsym' [-w+macro-params-legacy]
cpu/spc700.asm:66: warning: dropping trailing empty parameter in call to multi-line macro `newsym' [-w+macro-params-legacy]
cpu/spc700.asm:71: warning: dropping trailing empty parameter in call to multi-line macro `newsym' [-w+macro-params-legacy]
cpu/spc700.asm:76: warning: dropping trailing empty parameter in call to multi-line macro `newsym' [-w+macro-params-legacy]
===> ASM cpu/stable.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o cpu/stable.o cpu/stable.asm > cpu/stable.d || rm -f cpu/stable.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o cpu/stable.o cpu/stable.asm
===> ASM cpu/table.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o cpu/table.o cpu/table.asm > cpu/table.d || rm -f cpu/table.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o cpu/table.o cpu/table.asm
===> ASM cpu/tablec.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o cpu/tablec.o cpu/tablec.asm > cpu/tablec.d || rm -f cpu/tablec.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o cpu/tablec.o cpu/tablec.asm
===> ASM endmem.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o endmem.o endmem.asm > endmem.d || rm -f endmem.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o endmem.o endmem.asm
===> ASM gui/gui.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o gui/gui.o gui/gui.asm > gui/gui.d || rm -f gui/gui.d
gui/gui.asm:113: warning: dropping trailing empty parameter in call to multi-line macro `newsym' [-w+macro-params-legacy]
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o gui/gui.o gui/gui.asm
gui/gui.asm:113: warning: dropping trailing empty parameter in call to multi-line macro `newsym' [-w+macro-params-legacy]
===> ASM init.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o init.o init.asm > init.d || rm -f init.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o init.o init.asm
===> ASM vcache.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o vcache.o vcache.asm > vcache.d || rm -f vcache.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o vcache.o vcache.asm
===> ASM video/2xsaiw.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/2xsaiw.o video/2xsaiw.asm > video/2xsaiw.d || rm -f video/2xsaiw.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/2xsaiw.o video/2xsaiw.asm
===> ASM video/copyvid.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/copyvid.o video/copyvid.asm > video/copyvid.d || rm -f video/copyvid.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/copyvid.o video/copyvid.asm
===> ASM video/hq2x16.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/hq2x16.o video/hq2x16.asm > video/hq2x16.d || rm -f video/hq2x16.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/hq2x16.o video/hq2x16.asm
===> ASM video/hq2x32.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/hq2x32.o video/hq2x32.asm > video/hq2x32.d || rm -f video/hq2x32.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/hq2x32.o video/hq2x32.asm
===> ASM video/hq3x16.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/hq3x16.o video/hq3x16.asm > video/hq3x16.d || rm -f video/hq3x16.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/hq3x16.o video/hq3x16.asm
===> ASM video/hq3x32.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/hq3x32.o video/hq3x32.asm > video/hq3x32.d || rm -f video/hq3x32.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/hq3x32.o video/hq3x32.asm
===> ASM video/hq4x16.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/hq4x16.o video/hq4x16.asm > video/hq4x16.d || rm -f video/hq4x16.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/hq4x16.o video/hq4x16.asm
===> ASM video/hq4x32.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/hq4x32.o video/hq4x32.asm > video/hq4x32.d || rm -f video/hq4x32.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/hq4x32.o video/hq4x32.asm
===> ASM video/m716text.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/m716text.o video/m716text.asm > video/m716text.d || rm -f video/m716text.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/m716text.o video/m716text.asm
===> ASM video/makev16b.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/makev16b.o video/makev16b.asm > video/makev16b.d || rm -f video/makev16b.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/makev16b.o video/makev16b.asm
===> ASM video/makev16t.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/makev16t.o video/makev16t.asm > video/makev16t.d || rm -f video/makev16t.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/makev16t.o video/makev16t.asm
===> ASM video/makevid.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/makevid.o video/makevid.asm > video/makevid.d || rm -f video/makevid.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/makevid.o video/makevid.asm
===> ASM video/mode716.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/mode716.o video/mode716.asm > video/mode716.d || rm -f video/mode716.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/mode716.o video/mode716.asm
===> ASM video/mode716b.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/mode716b.o video/mode716b.asm > video/mode716b.d || rm -f video/mode716b.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/mode716b.o video/mode716b.asm
===> ASM video/mode716d.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/mode716d.o video/mode716d.asm > video/mode716d.d || rm -f video/mode716d.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/mode716d.o video/mode716d.asm
===> ASM video/mode716e.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/mode716e.o video/mode716e.asm > video/mode716e.d || rm -f video/mode716e.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/mode716e.o video/mode716e.asm
===> ASM video/mode716t.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/mode716t.o video/mode716t.asm > video/mode716t.d || rm -f video/mode716t.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/mode716t.o video/mode716t.asm
===> ASM video/mv16tms.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/mv16tms.o video/mv16tms.asm > video/mv16tms.d || rm -f video/mv16tms.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/mv16tms.o video/mv16tms.asm
===> ASM video/newg162.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/newg162.o video/newg162.asm > video/newg162.d || rm -f video/newg162.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/newg162.o video/newg162.asm
===> ASM video/newgfx.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/newgfx.o video/newgfx.asm > video/newgfx.d || rm -f video/newgfx.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/newgfx.o video/newgfx.asm
===> ASM video/newgfx16.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o video/newgfx16.o video/newgfx16.asm > video/newgfx16.d || rm -f video/newgfx16.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o video/newgfx16.o video/newgfx16.asm
===> ASM linux/sdlintrf.asm
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -M -o linux/sdlintrf.o linux/sdlintrf.asm > linux/sdlintrf.d || rm -f linux/sdlintrf.d
nasm -O1 -w-orphan-labels -felf32 -DELF -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -o linux/sdlintrf.o linux/sdlintrf.asm
===> CXX parsegen
g++ -o parsegen parsegen.cpp -lz
===> PSR cfg.h
./parsegen -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -gcc gcc -compile -flags '-I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL' -cheader cfg.h -fname cfg cfg.o cfg.psr
parsegen: gcc -I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL -o cfg.o -c cfg.c
===> PSR input.h
./parsegen -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -gcc gcc -compile -flags '-I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL' -cheader input.h -fname input input.o input.psr
parsegen: gcc -I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL -o input.o -c input.c
===> PSR md.h
./parsegen -DNO_AO -DNO_DEBUGGER -D__OPENGL__ -D__UNIXSDL__ -gcc gcc -compile -flags '-I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL' -cheader md.h -fname md md.o md.psr
parsegen: gcc -I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL -o md.o -c md.c
===> CC c_init.c
gcc -I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL -c -MMD -o c_init.o c_init.c
c_init.c: In function ‘ReadInputDevice’:
c_init.c:296:26: error: ‘pl1upk’ undeclared (first use in this function); did you mean ‘pl5upk’?
296 | PlayerDeviceHelp(pl1upk, &JoyAOrig, 0x08000000);
| ^~~~~~
| pl5upk
c_init.c:296:26: note: each undeclared identifier is reported only once for each function it appears in
c_init.c:297:26: error: ‘pl1downk’ undeclared (first use in this function); did you mean ‘pl5downk’?
297 | PlayerDeviceHelp(pl1downk, &JoyAOrig, 0x04000000);
| ^~~~~~~~
| pl5downk
c_init.c:298:26: error: ‘pl1leftk’ undeclared (first use in this function); did you mean ‘pl5leftk’?
298 | PlayerDeviceHelp(pl1leftk, &JoyAOrig, 0x02000000);
| ^~~~~~~~
| pl5leftk
c_init.c:299:26: error: ‘pl1rightk’ undeclared (first use in this function); did you mean ‘pl5rightk’?
299 | PlayerDeviceHelp(pl1rightk, &JoyAOrig, 0x01000000);
| ^~~~~~~~~
| pl5rightk
make: *** [Makefile:357: c_init.o] Error 1
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("CC=gcc" "CXX=g++" "CFLAGS=-I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL") exit-status: 2 term-signal: #f stop-signal: #f>
phase `build' failed after 16.6 seconds
command "make" "CC=gcc" "CXX=g++" "CFLAGS=-I/gnu/store/8gq4c2s5y3sdbmx661ddnhx2d75q99wi-sdl12-compat-1.2.68/include/SDL" failed with status 2
Oh, I think it had to do with me setting CFLAGS
. This was not needed after adding pkg-config
to the native-inputs, and I got to the installation phase failing now, which I should be able to handle by myself. Thanks a lot :-).
For the record, this is the working package definition, which will appear in Guix shortly:
(define-public zsnes
(package
(name "zsnes")
(version "2.0.12")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/xyproto/zsnes")
(commit version)))
(file-name (git-file-name name version))
(sha256
(base32
"0g9l1ij3p1adkp97wkp0dz44i2xpmsvfpkxvlfkpr7190dibsgsz"))))
(build-system gnu-build-system)
(arguments
(list #:system "i686-linux" ;requires 32 bit libraries to build
#:tests? #f ;no test suite
#:make-flags
#~(list (string-append "CC=" #$(cc-for-target))
(string-append "CXX=" #$(cxx-for-target))
(string-append "PREFIX=" #$output))
#:phases #~(modify-phases %standard-phases
(delete 'configure)))) ;no configure script
(native-inputs (list nasm pkg-config))
(inputs (list glib libpng mesa ncurses sdl12-compat zlib))
(home-page "https://www.zsnes.com")
(synopsis "Super Nintendo Entertainment System emulator")
(description "ZSNES is a @acronym{Super Nintendo Entertainment System,
SNES} emulator that supports advanced features such as a multiplayer mode
using a TC/IP network and special graphic filters. It can run most of the
SNES games at full speed with sound. Some of its features include:
@itemize
@item Support for smooth and dynamic image scaling
@item Support for rewinding and fast-forwarding in-game
@item JMA compression format
@item The ability to play multiplayer games with another person over a network
@item Change the appearance of the GUI
@item Take screenshots of currently running games
@item Saving the game at any point by recording the console’s state
@item Record movies of gameplay which can be played back.
@end itemize")
(license license:gpl2+)
(supported-systems (list "x86_64-linux"))))
Cool!
Note that the netplay feature was removed by the ZSNES devs before the last legacy ZSNES release, and that this fork is based on that release, so the tcp/ip bulletpoint may not be correct. It is a feature that would be fun to re-introduce, though.
Thanks, I've removed mention of the multiplayer mode in the description, but I note that the GUI still has a menu entry for it.
For the record; zsnes is now included in the ever-growing Guix collection; it can be installed simply with guix install zsnes
on any GNU/Linux system.
Nice! Thanks for packaging and testing. 👍
Thanks for maintaining it!
Hello,
I'm trying to package this for GNU Guix, but I'm hitting the following compilation error:
It seems the symbols
pl1upk
and friends are never defined. Looking at the source code, I see they are referred as external globals ininput.h
, but can't see their actual definition anywhere. Where are these supposed to be defined?Thank you!