Skip to content

Commit

Permalink
Drop support for old Caps library v4.2, we only support v5.1 now
Browse files Browse the repository at this point in the history
As such, caps library's files should be located in /usr/local/include/caps and /usr/local/lib/caps,
there's no more need for a 'caps5' directory
  • Loading branch information
npomarede committed Jul 1, 2020
1 parent 1c7e17e commit 367a87b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 40 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,9 @@ else()
endif(PortMidi_FOUND)

if(CapsImage_FOUND)
message( " - capsimage :\tv${CAPSIMAGE_VERSION} found, allow to use .IPF, .RAW and .CTR disk images" )
message( " - capsimage :\tv5 found, allow to use .IPF, .RAW and .CTR disk images" )
else()
message( " - capsimage :\tv${CAPSIMAGE_VERSION} not found, install it to use .IPF, .RAW and .CTR disk images" )
message( " - capsimage :\tv5 not found, install it to use .IPF, .RAW and .CTR disk images" )
endif(CapsImage_FOUND)

if(Udev_FOUND)
Expand Down
14 changes: 2 additions & 12 deletions cmake/FindCapsImage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,8 @@ IF (CAPSIMAGE_INCLUDE_DIR)
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)
else()
SET(CAPSIMAGE_DIR caps5)
FIND_PATH(CAPSIMAGE_INCLUDE_DIR ${CAPSIMAGE_DIR}/CapsAPI.h)
endif()
SET(CAPSIMAGE_DIR caps)
FIND_PATH(CAPSIMAGE_INCLUDE_DIR ${CAPSIMAGE_DIR}/CapsAPI.h)

if(WIN32)
FIND_LIBRARY(CAPSIMAGE_LIBRARY NAMES capsimg PATH_SUFFIXES ${CAPSIMAGE_DIR} )
Expand Down
1 change: 0 additions & 1 deletion cmake/config-cmake.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

/* Define if you have the capsimage library */
#cmakedefine HAVE_CAPSIMAGE 1
#cmakedefine CAPSIMAGE_VERSION @CAPSIMAGE_VERSION@

/* Define if you have a X11 environment */
#cmakedefine HAVE_X11 1
Expand Down
20 changes: 1 addition & 19 deletions src/floppy_ipf.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,12 @@ const char floppy_ipf_fileid[] = "Hatari floppy_ipf.c : " __DATE__ " " __TIME__;
#include <string.h>

#ifdef HAVE_CAPSIMAGE
#if CAPSIMAGE_VERSION == 5
#ifndef __cdecl
#define __cdecl /* CAPS headers need this, but do not define it on their own */
#endif
#include <caps5/CapsLibAll.h>
#include <caps/CapsLibAll.h>
#define CapsLong SDWORD
#define CapsULong UDWORD
#else
#include <caps/fdc.h>
#define CAPS_LIB_RELEASE 4
#define CAPS_LIB_REVISION 2
#endif
/* Macro to check release and revision */
#define CAPS_LIB_REL_REV ( CAPS_LIB_RELEASE * 100 + CAPS_LIB_REVISION )
#endif
Expand Down Expand Up @@ -232,12 +226,10 @@ bool IPF_FileNameIsIPF(const char *pszFileName, bool bAllowGZ)
{
return ( File_DoesFileExtensionMatch(pszFileName,".ipf" )
|| ( bAllowGZ && File_DoesFileExtensionMatch(pszFileName,".ipf.gz") )
#if CAPS_LIB_REL_REV >= 501
|| File_DoesFileExtensionMatch(pszFileName,".raw" )
|| ( bAllowGZ && File_DoesFileExtensionMatch(pszFileName,".raw.gz") )
|| File_DoesFileExtensionMatch(pszFileName,".ctr" )
|| ( bAllowGZ && File_DoesFileExtensionMatch(pszFileName,".ctr.gz") )
#endif
);
}

Expand Down Expand Up @@ -437,7 +429,6 @@ bool IPF_Insert ( int Drive , Uint8 *pImageBuffer , long ImageSize )
return false;
}

#if CAPS_LIB_REL_REV >= 501
ImageType = CAPSGetImageTypeMemory ( pImageBuffer , ImageSize );
if ( ImageType == citError )
{
Expand Down Expand Up @@ -481,9 +472,6 @@ bool IPF_Insert ( int Drive , Uint8 *pImageBuffer , long ImageSize )
}
}

#else
ImageType = -1;
#endif

if ( CAPSLockImageMemory ( ImageId , pImageBuffer , (CapsULong)ImageSize , DI_LOCK_MEMREF ) == imgeOk )
{
Expand Down Expand Up @@ -837,24 +825,20 @@ void IPF_Drive_Set_DoubleSided ( int Drive , bool value )
#ifdef HAVE_CAPSIMAGE
static void IPF_Drive_Update_Enable_Side ( void )
{
#if CAPS_LIB_REL_REV >= 501
int i;
#endif

if ( IPF_State.DriveEnabled[ 1 ] )
IPF_State.Fdc.drivemax = MAX_FLOPPYDRIVES; /* Should be 2 */
else
IPF_State.Fdc.drivemax = MAX_FLOPPYDRIVES - 1; /* Should be 1 */

#if CAPS_LIB_REL_REV >= 501
for ( i=0 ; i < MAX_FLOPPYDRIVES ; i++ )
{
if ( IPF_State.DoubleSided[ i ] )
IPF_State.Drive[ i ].diskattr &= ~CAPSDRIVE_DA_SS; /* Double sided */
else
IPF_State.Drive[ i ].diskattr |= CAPSDRIVE_DA_SS; /* Single sided */
}
#endif
}
#endif

Expand Down Expand Up @@ -915,7 +899,6 @@ void IPF_FDC_WriteReg ( Uint8 Reg , Uint8 Byte )
else
LOG_TRACE(TRACE_FDC, "fdc ipf write reg=%d data=0x%x VBL=%d HBL=%d\n" , Reg , Byte , nVBLs , nHBL );

#if CAPS_LIB_REL_REV >= 501
/* In the case of CTR images, we must reset the revolution counter */
/* when a command access data on disk and track/side changed since last access */
if ( Reg == 0 )
Expand All @@ -936,7 +919,6 @@ void IPF_FDC_WriteReg ( Uint8 Reg , Uint8 Byte )
}
}
}
#endif

IPF_Emulate(); /* Update emulation's state up to this point */

Expand Down
6 changes: 0 additions & 6 deletions src/uae-cpu/newcpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,6 @@ const char NewCpu_fileid[] = "Hatari newcpu.c : " __DATE__ " " __TIME__;
#include "68kDisass.h"
#include "stMemory.h"

#ifdef HAVE_CAPSIMAGE
#if CAPSIMAGE_VERSION == 5
#include <caps5/CapsLibAll.h>
#endif
#endif

//#define DEBUG_PREFETCH

struct flag_struct regflags;
Expand Down

0 comments on commit 367a87b

Please sign in to comment.