libretro / px68k-libretro

Portable SHARP X68000 Emulator for Libretro
http://hissorii.blog45.fc2.com
GNU General Public License v2.0
45 stars 40 forks source link

px68k:Crash when ChangeScreenSize #154

Closed TurtleBazooka closed 2 years ago

TurtleBazooka commented 2 years ago

Hello. when , I play px68k-libretro with RetroArch ,"Phalanx_op.HDM" demo , every time crash.

When change screen size, there is a bug, in libretro/windraw.c

490 if(VLINE==-1){ 491 p6logd("%d %d\n",VLINE,VLINE); 492 return; 493 }

and..... libretro/winx68k.cpp

67 DWORD VLINE = 0; 68 DWORD vline = 0; ....... 391 VLINE = (DWORD)-1;

VLINE is DWORD, eq unsigned long. it can't mean "-1". (0xfffffff neq -1)

I changed source code, (winx68k.cpp ). and some extern in header file. 67 long VLINE = 0; 68 long vline = 0; ........ 391 VLINE = (long)-1;

change and re-make, px68k_libretro.dylib(macOS), "Phalanx_op.HDM" demo is not crash.

(over.)

gingerbeardman commented 2 years ago

Please file a PR (Pull Request) with this bug fix.

inactive123 commented 2 years ago

I have merged your PR, but I will say that moving forward we need to avoid usage of non-stdint types to make the code easier, more maintainable and portable. So, in other words, no usage of long or Win32 typedefs. So if you could please move in that direction in the future.