Homebrew RELEASE Development Thread - RetroArch libnx

  • Thread starter Thread starter m4xw
  • Start date Start date
  • Views Views 764,793
  • Replies Replies 4,272
  • Likes Likes 69
Status
Not open for further replies.
Its not 3d, it could just run out of the box and if not, it should be fixable. Not like mupen. Thats just not gonna happen (anytime soon)
Still, it's only available on Android, Windows, Mac, Linux and iOS. Would be difficult trying to get it Switch-portable...
 
Still, it's only available on Android, Windows, Mac, Linux and iOS. Would be difficult trying to get it Switch-portable...

devkitA64 is a GNU GCC/G++ Toolchain, which is basically THE toolchain on linux, so if it does run on Linux, is 2D and does actually follow the Retroarch coding style, it will probably just work.
 
Last edited by m4xw,
  • Like
Reactions: wicksand420
Alright, after what seemed like forever...
aarch64-none-elf-gcc -c -o libretro.o libretro.c -DSWITCH=1 -U__linux__ -U__linu
x -DRARCH_INTERNAL -g -O2 -fPIE -I/opt/devkitpro/libnx/include/ -ffunction-secti
ons -fdata-sections -ftls-model=local-exec -Wl,--allow-multiple-definition -spec
s=/opt/devkitpro/libnx/switch.specs -D__SWITCH__ -std=gnu11 -D__LINUX__ -DNO_
MERCURY -DPX68K_VERSION=\"0.15+\" -DGIT_VERSION=\"" "\" -O3 -ffast-math -fomit-f
rame-pointer -I. -I./libretro -I./x68k -I./fmgen -I./win32api -DC68K_NO_JUMP_TA
BLE -D__LIBRETRO__ -std=gnu99
aarch64-none-elf-g++ -o px68k_libretro_switch.a fmgen/file.o fmgen/fmg_wrap.o fm
gen/fmgen.o fmgen/fmtimer.o fmgen/opm.o fmgen/opna.o fmgen/psg.o libretro/winx68
k.o x68k/d68k.o m68000/m68000.o m68000/c68k/c68k.o m68000/c68k/c68kexec.o x68k/a
dpcm.o x68k/bg.o x68k/crtc.o x68k/dmac.o x68k/fdc.o x68k/fdd.o x68k/disk_d88.o x
68k/disk_dim.o x68k/disk_xdf.o x68k/gvram.o x68k/ioc.o x68k/irqh.o x68k/mem_wrap
.o x68k/mercury.o x68k/mfp.o x68k/palette.o x68k/midi.o x68k/pia.o x68k/rtc.o x6
8k/sasi.o x68k/scc.o x68k/scsi.o x68k/sram.o x68k/sysport.o x68k/tvram.o libretr
o/joystick.o libretro/juliet.o libretro/keyboard.o libretro/mouse.o libretro/pro
p.o libretro/status.o libretro/timer.o libretro/dswin.o libretro/windraw.o libre
tro/winui.o libretro/about.o libretro/common.o win32api/dosio.o win32api/fake.o
win32api/peace.o libretro.o
c:/devkitpro/devkita64/bin/../lib/gcc/aarch64-none-elf/8.1.0/../../../../aarch64
-none-elf/lib/crt0.o: In function `_start':
(.text+0x44): undefined reference to `main'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile.libretro:170: px68k_libretro_switch.a] Error 1
Here's the Makefile LibNX code:
Code:
# Nintendo Switch (libnx)
else ifeq ($(platform), switch)
include $(DEVKITPRO)/libnx/switch_rules
    EXT=a
    TARGET := $(TARGET_NAME)_libretro_$(platform).$(EXT)
    FLAGS += -D__LINUX__
    DEFINES := -DSWITCH=1 -U__linux__ -U__linux -DRARCH_INTERNAL
    CFLAGS    :=     $(DEFINES) -g \
                -O2 \
                -fPIE -I$(LIBNX)/include/ -ffunction-sections -fdata-sections -ftls-model=local-exec -Wl,--allow-multiple-definition -specs=$(LIBNX)/switch.specs
    CFLAGS += $(INCDIRS)
    CFLAGS    +=    $(INCLUDE)  -D__SWITCH__
    CXXFLAGS := $(ASFLAGS) $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
    CFLAGS += -std=gnu11
 
Can you point out the error please? It might be the "FLAGS +- -D__LINUX__" line...
It seems like it includes windows files rather.

See we set it to -std gnu11 and there is explicit stated std97 in the log, so I guess variable names are wrong
Had something like that with the mame branch but thats a rather simple fix

--------------------- MERGED ---------------------------

In mame it was like CXX_FLAGS instead of CXXFLAGS (and so on..), but you gotta look at the file, can't just try them blind.
 
  • Like
Reactions: Melon__Bread
It seems like it includes windows files rather.

See we set it to -std gnu11 and there is explicit stated std97 in the log, so I guess variable names are wrong
Had something like that with the mame branch but thats a rather simple fix

--------------------- MERGED ---------------------------

In mame it was like CXX_FLAGS instead of CXXFLAGS (and so on..), but you gotta look at the file, can't just try them blind.
Sorry, I'm a noob at doing stuff like this
I just ended up putting underscores everywhere like this:
Code:
# Nintendo Switch (libnx)
else ifeq ($(platform), switch)
include $(DEVKITPRO)/libnx/switch_rules
    EXT=a
    TARGET := $(TARGET_NAME)_libretro_$(platform).$(EXT)
    FLAGS += -D__LINUX__
    DEFINES := -DSWITCH=1 -U__linux__ -U__linux -DRARCH_INTERNAL
    C_FLAGS    :=     $(DEFINES) -g \
                -O2 \
                -fPIE -I$(LIBNX)/include/ -ffunction-sections -fdata-sections -ftls-model=local-exec -Wl,--allow-multiple-definition -specs=$(LIBNX)/switch.specs
    C_FLAGS += $(INC_DIRS)
    C_FLAGS    +=    $(INCLUDE)  -D__SWITCH__
    CXX_FLAGS := $(AS_FLAGS) $(C_FLAGS) -fno-rtti -fno-exceptions -std=gnu++11
    C_FLAGS += -std=gnu11
And I still get the same error:
make: git: Command not found
aarch64-none-elf-g++ -o px68k_libretro_switch.a fmgen/file.o fmgen/fmg_wrap.o fm
gen/fmgen.o fmgen/fmtimer.o fmgen/opm.o fmgen/opna.o fmgen/psg.o libretro/winx68
k.o x68k/d68k.o m68000/m68000.o m68000/c68k/c68k.o m68000/c68k/c68kexec.o x68k/a
dpcm.o x68k/bg.o x68k/crtc.o x68k/dmac.o x68k/fdc.o x68k/fdd.o x68k/disk_d88.o x
68k/disk_dim.o x68k/disk_xdf.o x68k/gvram.o x68k/ioc.o x68k/irqh.o x68k/mem_wrap
.o x68k/mercury.o x68k/mfp.o x68k/palette.o x68k/midi.o x68k/pia.o x68k/rtc.o x6
8k/sasi.o x68k/scc.o x68k/scsi.o x68k/sram.o x68k/sysport.o x68k/tvram.o libretr
o/joystick.o libretro/juliet.o libretro/keyboard.o libretro/mouse.o libretro/pro
p.o libretro/status.o libretro/timer.o libretro/dswin.o libretro/windraw.o libre
tro/winui.o libretro/about.o libretro/common.o win32api/dosio.o win32api/fake.o
win32api/peace.o libretro.o
c:/devkitpro/devkita64/bin/../lib/gcc/aarch64-none-elf/8.1.0/../../../../aarch64
-none-elf/lib/crt0.o: In function `_start':
(.text+0x44): undefined reference to `main'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile.libretro:170: px68k_libretro_switch.a] Error 1
Please don't tell me I have to re-extract the library and copy the Makefile and compile all over again...I already did that with parallel-n64 like a gazillion times already
 
Sorry, I'm a noob at doing stuff like this
I just ended up putting underscores everywhere like this:
It seems like it includes windows files rather.
In mame it was like CXX_FLAGS instead of CXXFLAGS (and so on..), but you gotta look at the file, can't just try them blind.

Sometimes I really get the feeling you're not even trying to think lol.
Being noob doesn't stop you from using your head.
I knew you would do that and I literally wrote you can't do that, in case you do.

I am sure someone else can help, I rather go to bed.
 
  • Like
Reactions: Azel and CatmanFan
Sometimes I really get the feeling you're not even trying to think lol.
Being noob doesn't stop you from using your head.
I knew you would do that and I literally wrote you can't do that, in case you do.

I am sure someone else can help, I rather go to bed.
I'm sorry.
I would rather try porting something else easier for now, like mGBA or something...
 
I'm sorry.

I feel like a dick too for saying that, but being a dev literally means using your head.

Theres no way around that. I remember how overwhelming it can be at the start and I know you're (somewhat) trying to help, but I think thats rather discouraging other people from trying themselves.
 
  • Like
Reactions: Azel and CatmanFan
Man, I don't know where you're living but I'm practically burning alive over here. :P
"Location: Toronto, Ontario"

--------------------- MERGED ---------------------------

Also, is there a way we can get dynarec working? It's basically one of many things that are preventing parallel-n64 from being compiled...
mupen64plus-core/src/r4300/hacktarux_dynarec/assemble.h: In function 'mov_m16_re
g16':
mupen64plus-core/src/r4300/hacktarux_dynarec/assemble.h:520:10: warning: cast fr
om pointer to integer of different size [-Wpointer-to-int-cast]
put32((unsigned int)(m16));
^
mupen64plus-core/src/r4300/hacktarux_dynarec/assemble.h: In function 'cmp_reg32_
m32':
mupen64plus-core/src/r4300/hacktarux_dynarec/assemble.h:527:10: warning: cast fr
om pointer to integer of different size [-Wpointer-to-int-cast]
put32((unsigned int)(m32));
^
mupen64plus-core/src/r4300/hacktarux_dynarec/assemble.h: In function 'add_m32_re
g32':
mupen64plus-core/src/r4300/hacktarux_dynarec/assemble.h:534:10: warning: cast fr
om pointer to integer of different size [-Wpointer-to-int-cast]
put32((unsigned int)(m32));
^
mupen64plus-core/src/r4300/hacktarux_dynarec/assemble.h: In function 'sub_reg32_
m32':
mupen64plus-core/src/r4300/hacktarux_dynarec/assemble.h:541:10: warning: cast fr
om pointer to integer of different size [-Wpointer-to-int-cast]
put32((unsigned int)(m32));
^
mupen64plus-core/src/r4300/hacktarux_dynarec/assemble.h: In function 'mov_eax_me
moffs32':
mupen64plus-core/src/r4300/hacktarux_dynarec/assemble.h:547:10: warning: cast fr
om pointer to integer of different size [-Wpointer-to-int-cast]
put32((unsigned int)(memoffs32));
^
mupen64plus-core/src/r4300/hacktarux_dynarec/assemble.h: In function 'test_m32_i
mm32':
mupen64plus-core/src/r4300/hacktarux_dynarec/assemble.h:569:10: warning: cast fr
om pointer to integer of different size [-Wpointer-to-int-cast]
put32((unsigned int)m32);
^
mupen64plus-core/src/r4300/hacktarux_dynarec/assemble.h: In function 'mov_m32_re
g32':
mupen64plus-core/src/r4300/hacktarux_dynarec/assemble.h:590:10: warning: cast fr
om pointer to integer of different size [-Wpointer-to-int-cast]
put32((unsigned int)(m32));
^
mupen64plus-core/src/r4300/hacktarux_dynarec/assemble.h: In function 'mov_memoff
s32_eax':
mupen64plus-core/src/r4300/hacktarux_dynarec/assemble.h:691:10: warning: cast fr
om pointer to integer of different size [-Wpointer-to-int-cast]
put32((unsigned int)(memoffs32));
^
In file included from mupen64plus-core/src/r4300/mips_instructions.def:50,
from mupen64plus-core/src/r4300/cached_interp.c:165:
mupen64plus-core/src/r4300/fpu.h: At top level:
mupen64plus-core/src/r4300/fpu.h:56:12: fatal error: fenv.h: No such file or dir
ectory
#include <fenv.h>
^~~~~~~~
compilation terminated.
make: *** [Makefile:893: mupen64plus-core/src/r4300/cached_interp.o] Error 1
 
  • Like
Reactions: Leonidas87
"Location: Toronto, Ontario"[/SPOILER]
I'm well aware of the flag below his picture, dude. It's not like it's some hidden illuminati 666 spoopy sign that only you can see with your third eye.

It was more of a saying as opposed to be taken literal "I don't know where *you* live..." with emphasis on you.

Edit: grammar is hard
 
Last edited by ownedlol,
Also, is there a way we can get dynarec working? It's basically one of many things that are preventing parallel-n64 from being compiled...

How many times do we need to repeat ourselves that N64 emulators won't work without hardware acceleration?

They do not support software rendering. Period.
The plugins are not made for software rendering. Period.
3D acceleration isn't a thing and won't be for a while. Period.

I'm sorry but this constant mentioning has seriously irked me for the longest time.
 
Last edited by SeongGino,
Has the screen tearing issue been fixed yet?

On RSDuck's VBA-Next emulator there's no screen tearing, but last I checked these emulators they all had the same weird diagonal glitch screen tear
 
Last edited by Syynx,
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum