AZO234 / NP2kai

Neko Project II kai
http://domisan.sakura.ne.jp/article/np2kai/np2kai.html
MIT License
246 stars 61 forks source link

Rev. 22 - Segmentation fault when starting on RG350 #99

Closed goldmojo closed 4 years ago

goldmojo commented 4 years ago

I compiled and tested r22 on OpenDingux R350.

I installed bios + empty np2kai.cfg + default.ttf (renamed from TakaoGothic.ttf) in ~/.config/np2kai.

When starting a game with command "np2kai .hdi", the application display "Loading np2kai.cfg from /usr/local/home/.config/np2kai/np2kai.cfg" and "Segmentation fault".

Any help would be really appreciated.

AZO234 commented 4 years ago

First, I don't have R350 machine and I can't test. I'm sorry.

How about work when without default.ttf?

goldmojo commented 4 years ago

No pb, I am happy to test on this platform.

If I remove the default.ttf file, I have this log (last line appears 2 times) :

Loading np2kai.cfg from /usr/local/home/.config/np2kai/np2kai.cfg Couldn't load 12 points font from ./default.ttf: Couldn't open ./default.ttf Couldn't load 12 points font from ./default.ttf: Couldn't open ./default.ttf Segmentation fault

goldmojo commented 4 years ago

I just found what was wrong, RG350 screen resolution is 320x240 and the emulator requires 640x400.

I modified sdl2/scrnmng.c line 93 and 94 to set resolution to 320x240. Games now start but the display is cut to the upper left side. What else should I adapt in the source in order to get a 320x240 scaling ?

goldmojo commented 4 years ago

I achieved to get this : np2kai_rg350_test1 when activating NP2_SIZE_QVGA in compiler.h I need your help to get the full picture :-)

AZO234 commented 4 years ago

NP2kai's QVGA code(NP2_SIZE_QVGA) is very old.

On OpenDigux, draw with VGA and just reduction to QVGA. Then we should use NP2_SIZE_VGA directive. I'm checking too! 👀

goldmojo commented 4 years ago

I found what was wrong ... I switched SDL version to SDL 2 and everything is fine now :-) I propose to add an option in Makefile.opendingux in order to propose a dedicated rg350 option activating SDL 2 instead of default gcw0 option. I will send you a pull request if ok for you. Thank you for your support, I will share the binary with my rg350 friends.

AZO234 commented 4 years ago

NP2kai's Makefile.opendingux was deleted now. Please use to make instead of CMakeLists.txt. This method default use SDL2 on RG350.

RG350's tool-chain is collision to GCW0's tool-chain. I make toolchan from RG350-buildroot, https://github.com/tonyjih/RG350_buildroot and my patch file. https://raw.githubusercontent.com/AZO234/RAcross_linux/master/RG350_buildroot.patch A bit difficult.

goldmojo commented 4 years ago

Ok, I will do that when rev. 23 will be out.

Thank you for helping me to build rev. 22.