From b284a3168fa91a038925d2ecf5e4791011ea5e7d Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 18 Nov 2019 10:15:03 +0000 Subject: gentoo resync : 18.11.2019 --- .../hatari/files/hatari-2.1.0_caps5_files.patch | 147 --------------------- .../hatari/files/hatari-2.2.1-default-rom.patch | 16 +++ .../hatari/files/hatari-2.2.1-joystick.patch | 59 +++++++++ 3 files changed, 75 insertions(+), 147 deletions(-) delete mode 100644 games-emulation/hatari/files/hatari-2.1.0_caps5_files.patch create mode 100644 games-emulation/hatari/files/hatari-2.2.1-default-rom.patch create mode 100644 games-emulation/hatari/files/hatari-2.2.1-joystick.patch (limited to 'games-emulation/hatari/files') diff --git a/games-emulation/hatari/files/hatari-2.1.0_caps5_files.patch b/games-emulation/hatari/files/hatari-2.1.0_caps5_files.patch deleted file mode 100644 index cac630f66f44..000000000000 --- a/games-emulation/hatari/files/hatari-2.1.0_caps5_files.patch +++ /dev/null @@ -1,147 +0,0 @@ -diff -Nuar hatari-2.1.0-orig/cmake/FindCapsImage.cmake hatari-2.1.0/cmake/FindCapsImage.cmake ---- hatari-2.1.0-orig/cmake/FindCapsImage.cmake 2018-07-28 20:32:59.164780571 +0300 -+++ hatari-2.1.0/cmake/FindCapsImage.cmake 2018-07-28 20:33:16.130781607 +0300 -@@ -1,22 +1,18 @@ -- - IF (CAPSIMAGE_INCLUDE_DIR) -- # Already in cache, be silent -- SET(CAPSIMAGE_FIND_QUIETLY TRUE) -+ # Already in cache, be silent -+ SET(CAPSIMAGE_FIND_QUIETLY TRUE) - ENDIF (CAPSIMAGE_INCLUDE_DIR) - -- --# Choose the library version to use : 4 or 5 --SET(CAPSIMAGE_VERSION 5) -- -- --if(CAPSIMAGE_VERSION STREQUAL 4) -- SET(CAPSIMAGE_DIR caps) -- FIND_PATH(CAPSIMAGE_INCLUDE_DIR ${CAPSIMAGE_DIR}/capsimage.h) -+if(ENABLE_CAPSIMAGE5) -+ SET(CAPSIMAGE_VERSION 5) -+ FIND_PATH(CAPSIMAGE_INCLUDE_DIR NAMES CapsAPI.h PATH_SUFFIXES caps5) - else() -- SET(CAPSIMAGE_DIR caps5) -- FIND_PATH(CAPSIMAGE_INCLUDE_DIR ${CAPSIMAGE_DIR}/CapsAPI.h) -+ SET(CAPSIMAGE_VERSION 4) -+ FIND_PATH(CAPSIMAGE_INCLUDE_DIR NAMES capsimage.h PATH_SUFFIXES caps) - endif() - -+message(${CAPSIMAGE_INCLUDE_DIR}) -+ - if(WIN32) - FIND_LIBRARY(CAPSIMAGE_LIBRARY NAMES capsimg PATH_SUFFIXES ${CAPSIMAGE_DIR} ) - else() -diff -Nuar hatari-2.1.0-orig/src/CMakeLists.txt hatari-2.1.0/src/CMakeLists.txt ---- hatari-2.1.0-orig/src/CMakeLists.txt 2018-07-28 20:32:59.152780571 +0300 -+++ hatari-2.1.0/src/CMakeLists.txt 2018-07-28 20:33:16.131781607 +0300 -@@ -55,6 +55,10 @@ - include_directories(${PNG_INCLUDE_DIR}) - endif(PNG_FOUND) - -+if(CAPSIMAGE_FOUND) -+ include_directories(${CAPSIMAGE_INCLUDE_DIR}) -+endif(CAPSIMAGE_FOUND) -+ - if(X11_FOUND) - include_directories(${X11_INCLUDE_DIR}) - endif(X11_FOUND) -diff -Nuar hatari-2.1.0-orig/src/floppy_ipf.c hatari-2.1.0/src/floppy_ipf.c ---- hatari-2.1.0-orig/src/floppy_ipf.c 2018-07-28 20:32:59.152780571 +0300 -+++ hatari-2.1.0/src/floppy_ipf.c 2018-07-28 20:34:32.782786288 +0300 -@@ -30,9 +30,9 @@ - - #ifdef HAVE_CAPSIMAGE - #if CAPSIMAGE_VERSION == 5 --#include -+#include - #else --#include -+#include - #define CAPS_LIB_RELEASE 4 - #define CAPS_LIB_REVISION 2 - #endif -@@ -61,8 +61,8 @@ - - struct CapsFdc Fdc; /* Fdc state */ - struct CapsDrive Drive[ MAX_FLOPPYDRIVES ]; /* Physical drives */ -- CapsLong CapsImage[ MAX_FLOPPYDRIVES ]; /* Image Id or -1 if drive empty */ -- CapsLong CapsImageType[ MAX_FLOPPYDRIVES ]; /* ImageType or -1 if not known */ -+ Sint32 CapsImage[ MAX_FLOPPYDRIVES ]; /* Image Id or -1 if drive empty */ -+ Sint32 CapsImageType[ MAX_FLOPPYDRIVES ]; /* ImageType or -1 if not known */ - - int Rev_Track[ MAX_FLOPPYDRIVES ]; /* Needed to handle CAPSSetRevolution for type II/III commands */ - int Rev_Side[ MAX_FLOPPYDRIVES ]; -@@ -83,9 +83,9 @@ - static char *IPF_FilenameFindTrackSide (char *FileName); - static bool IPF_Insert_RawStreamImage ( int Drive ); - --static void IPF_CallBack_Trk ( struct CapsFdc *pc , CapsULong State ); --static void IPF_CallBack_Irq ( struct CapsFdc *pc , CapsULong State ); --static void IPF_CallBack_Drq ( struct CapsFdc *pc , CapsULong State ); -+static void IPF_CallBack_Trk ( struct CapsFdc *pc , Uint32 State ); -+static void IPF_CallBack_Irq ( struct CapsFdc *pc , Uint32 State ); -+static void IPF_CallBack_Drq ( struct CapsFdc *pc , Uint32 State ); - static void IPF_Drive_Update_Enable_Side ( void ); - static void IPF_FDC_LogCommand ( Uint8 Command ); - #endif -@@ -419,8 +419,8 @@ - return false; - - #else -- CapsLong ImageId; -- CapsLong ImageType; -+ Sint32 ImageId; -+ Sint32 ImageType; - - ImageId = CAPSAddImage(); - if ( ImageId < 0 ) -@@ -470,7 +470,7 @@ - ImageType = -1; - #endif - -- if ( CAPSLockImageMemory ( ImageId , pImageBuffer , (CapsULong)ImageSize , DI_LOCK_MEMREF ) == imgeOk ) -+ if ( CAPSLockImageMemory ( ImageId , pImageBuffer , (Uint32)ImageSize , DI_LOCK_MEMREF ) == imgeOk ) - { - struct CapsImageInfo cii; - int i; -@@ -703,7 +703,7 @@ - * We need to update the track data by calling CAPSLockTrack - */ - #ifdef HAVE_CAPSIMAGE --static void IPF_CallBack_Trk ( struct CapsFdc *pc , CapsULong State ) -+static void IPF_CallBack_Trk ( struct CapsFdc *pc , Uint32 State ) - { - int Drive = State; /* State is the drive number in that case */ - struct CapsDrive *pd = pc->drive+Drive; /* Current drive where the track change occurred */ -@@ -732,7 +732,7 @@ - * Callback function used when the FDC change the IRQ signal - */ - #ifdef HAVE_CAPSIMAGE --static void IPF_CallBack_Irq ( struct CapsFdc *pc , CapsULong State ) -+static void IPF_CallBack_Irq ( struct CapsFdc *pc , Uint32 State ) - { - LOG_TRACE(TRACE_FDC, "fdc ipf callback irq state=0x%x VBL=%d HBL=%d\n" , (int)State , nVBLs , nHBL ); - -@@ -751,7 +751,7 @@ - * -> copy the byte to/from the DMA's FIFO if it's a read or a write to the disk - */ - #ifdef HAVE_CAPSIMAGE --static void IPF_CallBack_Drq ( struct CapsFdc *pc , CapsULong State ) -+static void IPF_CallBack_Drq ( struct CapsFdc *pc , Uint32 State ) - { - Uint8 Byte; - -diff -Nuar hatari-2.1.0-orig/src/uae-cpu/newcpu.c hatari-2.1.0/src/uae-cpu/newcpu.c ---- hatari-2.1.0-orig/src/uae-cpu/newcpu.c 2018-07-28 20:32:59.158780571 +0300 -+++ hatari-2.1.0/src/uae-cpu/newcpu.c 2018-07-28 20:33:16.132781607 +0300 -@@ -167,7 +167,7 @@ - - #ifdef HAVE_CAPSIMAGE - #if CAPSIMAGE_VERSION == 5 --#include -+#include - #endif - #endif - diff --git a/games-emulation/hatari/files/hatari-2.2.1-default-rom.patch b/games-emulation/hatari/files/hatari-2.2.1-default-rom.patch new file mode 100644 index 000000000000..c42f67f733c1 --- /dev/null +++ b/games-emulation/hatari/files/hatari-2.2.1-default-rom.patch @@ -0,0 +1,16 @@ +Use etos512k.img from the emutos package rather than tos.img. + +diff -Naur a/src/configuration.c b/src/configuration.c +--- a/src/configuration.c 2019-02-08 08:30:11.000000000 +0000 ++++ b/src/configuration.c 2019-11-10 21:19:31.712605716 +0000 +@@ -841,8 +841,8 @@ + ConfigureParams.Sound.YmVolumeMixing = YM_TABLE_MIXING; + + /* Set defaults for Rom */ +- sprintf(ConfigureParams.Rom.szTosImageFileName, "%s%ctos.img", +- Paths_GetDataDir(), PATHSEP); ++ sprintf(ConfigureParams.Rom.szTosImageFileName, "%s%c..%cemutos%cetos512k.img", ++ Paths_GetDataDir(), PATHSEP, PATHSEP, PATHSEP); + ConfigureParams.Rom.bPatchTos = true; + strcpy(ConfigureParams.Rom.szCartridgeImageFileName, ""); + diff --git a/games-emulation/hatari/files/hatari-2.2.1-joystick.patch b/games-emulation/hatari/files/hatari-2.2.1-joystick.patch new file mode 100644 index 000000000000..193bb7206c31 --- /dev/null +++ b/games-emulation/hatari/files/hatari-2.2.1-joystick.patch @@ -0,0 +1,59 @@ +https://bugs.gentoo.org/689538 + +diff -ruN hatari-2.1.0.old/src/gui-sdl/sdlgui.c hatari-2.1.0/src/gui-sdl/sdlgui.c +--- hatari-2.1.0.old/src/gui-sdl/sdlgui.c 2018-02-07 18:33:56.000000000 +0000 ++++ hatari-2.1.0/src/gui-sdl/sdlgui.c 2019-07-08 23:55:50.481270799 +0100 +@@ -1329,12 +1329,28 @@ + } + break; + ++ case SDL_JOYHATMOTION: ++ if (sdlEvent.jhat.value & SDL_HAT_LEFT) ++ retbutton = SDLGui_HandleShortcut(dlg, SG_SHORTCUT_LEFT); ++ else if (sdlEvent.jhat.value & SDL_HAT_RIGHT) ++ retbutton = SDLGui_HandleShortcut(dlg, SG_SHORTCUT_RIGHT); ++ if (sdlEvent.jhat.value & SDL_HAT_UP) ++ { ++ SDLGui_RemoveFocus(dlg, focused); ++ focused = SDLGui_FocusNext(dlg, focused, -1); ++ } ++ else if (sdlEvent.jhat.value & SDL_HAT_DOWN) ++ { ++ SDLGui_RemoveFocus(dlg, focused); ++ focused = SDLGui_FocusNext(dlg, focused, +1); ++ } ++ break; ++ + case SDL_JOYBUTTONDOWN: + retbutton = SDLGui_HandleSelection(dlg, focused, focused); + break; + + case SDL_JOYBALLMOTION: +- case SDL_JOYHATMOTION: + case SDL_MOUSEMOTION: + break; + +diff -ruN hatari-2.1.0.old/src/joy.c hatari-2.1.0/src/joy.c +--- hatari-2.1.0.old/src/joy.c 2018-02-07 18:33:56.000000000 +0000 ++++ hatari-2.1.0/src/joy.c 2019-07-09 14:46:36.502410790 +0100 +@@ -199,9 +199,20 @@ + */ + static bool Joy_ReadJoystick(int nSdlJoyID, JOYREADING *pJoyReading) + { ++ unsigned hat = SDL_JoystickGetHat(sdlJoystick[nSdlJoyID], 0); ++ + /* Joystick is OK, read position from the configured joystick axis */ + pJoyReading->XPos = SDL_JoystickGetAxis(sdlJoystick[nSdlJoyID], pJoyReading->XAxisID); + pJoyReading->YPos = SDL_JoystickGetAxis(sdlJoystick[nSdlJoyID], pJoyReading->YAxisID); ++ /* Similarly to other emulators that support hats, override axis readings with hats */ ++ if (hat & SDL_HAT_LEFT) ++ pJoyReading->XPos = -32768; ++ if (hat & SDL_HAT_RIGHT) ++ pJoyReading->XPos = 32767; ++ if (hat & SDL_HAT_UP) ++ pJoyReading->YPos = -32768; ++ if (hat & SDL_HAT_DOWN) ++ pJoyReading->YPos = 32767; + /* Sets bit #0 if button #1 is pressed: */ + pJoyReading->Buttons = SDL_JoystickGetButton(sdlJoystick[nSdlJoyID], 0); + /* Sets bit #1 if button #2 is pressed: */ -- cgit v1.2.3