diff --git a/scriptmodules/libretrocores/lr-hatari.sh b/scriptmodules/libretrocores/lr-hatari.sh index c0e06ff58a..e0dc9b0148 100644 --- a/scriptmodules/libretrocores/lr-hatari.sh +++ b/scriptmodules/libretrocores/lr-hatari.sh @@ -13,7 +13,7 @@ rp_module_id="lr-hatari" rp_module_desc="Atari emulator - Hatari port for libretro" rp_module_help="ROM Extensions: .st .stx .img .rom .raw .ipf .ctr .zip\n\nCopy your Atari ST games to $romdir/atarist" rp_module_licence="GPL2 https://raw.githubusercontent.com/libretro/hatari/master/gpl.txt" -rp_module_repo="git https://github.com/libretro/hatari.git master" +rp_module_repo="git https://github.com/libretro/hatari.git hitari2014-mercurial" rp_module_section="exp" function depends_lr-hatari() { @@ -22,7 +22,8 @@ function depends_lr-hatari() { function sources_lr-hatari() { gitPullOrClone - applyPatch "$md_data/01_libcapsimage.diff" + # TARGET_NAME should be overriden by user input + sed -i "s/TARGET_NAME :=/TARGET_NAME ?=/" "$md_build/Makefile.libretro" _sources_libcapsimage_hatari } @@ -30,7 +31,8 @@ function build_lr-hatari() { _build_libcapsimage_hatari cd "$md_build" - CFLAGS+=" -D__cdecl='' -I\"$md_build/src/includes/caps\" -DHAVE_CAPSIMAGE=1 -DCAPSIMAGE_VERSION=5" CAPSIMG_LDFLAGS="-L./lib -l:libcapsimage.so.5.1" make -f Makefile.libretro + make -f Makefile.libretro clean + make -f Makefile.libretro capsimg=1 capssrc="$md_build/capsimg_source_linux_macosx" capslib="$md_build/lib" capslibname=":libcapsimage.so.5.1" TARGET_NAME="hatari" LDFLAGS="-Wl,-rpath='$md_inst'" md_ret_require="$md_build/hatari_libretro.so" } @@ -52,11 +54,4 @@ function configure_lr-hatari() { addEmulator 1 "$md_id" "atarist" "$md_inst/hatari_libretro.so" addSystem "atarist" - - [[ "$md_mode" == "remove" ]] && return - - # add LD_LIBRARY_PATH='$md_inst' to start of launch command - iniConfig " = " '"' "$configdir/atarist/emulators.cfg" - iniGet "$md_id" - iniSet "$md_id" "LD_LIBRARY_PATH='$md_inst' $ini_value" } diff --git a/scriptmodules/libretrocores/lr-hatari/01_libcapsimage.diff b/scriptmodules/libretrocores/lr-hatari/01_libcapsimage.diff deleted file mode 100644 index 6da5dc2c50..0000000000 --- a/scriptmodules/libretrocores/lr-hatari/01_libcapsimage.diff +++ /dev/null @@ -1,94 +0,0 @@ -diff --git a/Makefile.libretro b/Makefile.libretro -index 58e33e4..eb654c6 100755 ---- a/Makefile.libretro -+++ b/Makefile.libretro -@@ -225,7 +225,7 @@ $(TARGET): $(OBJECTS) - ifeq ($(STATIC_LINKING_LINK),1) - $(AR) rcs $@ $(OBJECTS) - else -- $(CC) $(CFLAGS) $(INCFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ -lm $(ZLIB) $(SHARED) -+ $(CC) $(CFLAGS) $(INCFLAGS) $(LDFLAGS) $(OBJECTS) -o $@ -lm $(ZLIB) $(SHARED) $(CAPSIMG_LDFLAGS) - endif - - %.o: %.c -diff --git a/src/floppy_ipf.c b/src/floppy_ipf.c -index c615b75..3626c19 100644 ---- a/src/floppy_ipf.c -+++ b/src/floppy_ipf.c -@@ -24,6 +24,7 @@ const char floppy_ipf_fileid[] = "Hatari floppy_ipf.c : " __DATE__ " " __TIME__; - #include "screen.h" - #include "video.h" - #include "cycles.h" -+#include "inttypes.h" - - #ifdef HAVE_CAPSIMAGE - #if CAPSIMAGE_VERSION == 5 -@@ -46,7 +47,7 @@ typedef struct - - struct CapsFdc Fdc; /* Fdc state */ - struct CapsDrive Drive[ MAX_FLOPPYDRIVES ]; /* Physical drives */ -- CapsLong CapsImage[ MAX_FLOPPYDRIVES ]; /* For the IPF disk images */ -+ Sint32 CapsImage[ MAX_FLOPPYDRIVES ]; /* For the IPF disk images */ - - int Rev_Track[ MAX_FLOPPYDRIVES ]; /* Needed to handle CAPSSetRevolution for type II/III commands */ - int Rev_Side[ MAX_FLOPPYDRIVES ]; -@@ -63,9 +64,9 @@ static IPF_STRUCT IPF_State; /* All variables related to the IPF support */ - - - #ifdef HAVE_CAPSIMAGE --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 ); - #endif - -@@ -317,8 +318,8 @@ bool IPF_Insert ( int Drive , Uint8 *pImageBuffer , long ImageSize ) - return false; - - #else -- CapsLong ImageId; -- CapsLong ImageType; -+ Sint32 ImageId; -+ Sint32 ImageType; - - ImageId = CAPSAddImage(); - if ( ImageId < 0 ) -@@ -351,7 +352,7 @@ bool IPF_Insert ( int Drive , Uint8 *pImageBuffer , long ImageSize ) - } - #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; -@@ -467,7 +468,7 @@ void IPF_Reset ( void ) - * 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 */ -@@ -496,7 +497,7 @@ static void IPF_CallBack_Trk ( struct CapsFdc *pc , CapsULong State ) - * 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 ); - -@@ -515,7 +516,7 @@ static void IPF_CallBack_Irq ( struct CapsFdc *pc , CapsULong State ) - * -> 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; -