WIP - Fixes merge 3 (it now compiles fully)
This commit is contained in:
parent
5adf64a276
commit
7bc131d023
50 changed files with 947 additions and 3223 deletions
78
Makefile
78
Makefile
|
@ -3,13 +3,13 @@ ifeq ($(PLATFORM),)
|
|||
endif
|
||||
|
||||
ifeq ($(PLATFORM),rpi3)
|
||||
CPU_FLAGS += -std=gnu++14 -march=armv8-a -mfpu=neon-fp-armv8 -mfloat-abi=hard
|
||||
CPU_FLAGS += -march=armv8-a -mfpu=neon-fp-armv8 -mfloat-abi=hard
|
||||
MORE_CFLAGS += -DARMV6T2 -DUSE_ARMNEON
|
||||
else ifeq ($(PLATFORM),rpi2)
|
||||
CPU_FLAGS += -std=gnu++14 -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard
|
||||
CPU_FLAGS += -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard
|
||||
MORE_CFLAGS += -DARMV6T2 -DUSE_ARMNEON
|
||||
else ifeq ($(PLATFORM),rpi1)
|
||||
CPU_FLAGS += -std=gnu++14 -march=armv6zk -mfpu=vfp -mfloat-abi=hard
|
||||
CPU_FLAGS += -march=armv6zk -mfpu=vfp -mfloat-abi=hard
|
||||
endif
|
||||
|
||||
NAME = amiberry-sdl2
|
||||
|
@ -32,22 +32,26 @@ SDL_CFLAGS = `sdl2-config --cflags --libs`
|
|||
DEFS += `xml2-config --cflags`
|
||||
DEFS += -DARMV6_ASSEMBLY -DAMIBERRY -DCPU_arm
|
||||
DEFS += -DCAPSLOCK_DEBIAN_WORKAROUND
|
||||
DEFS += -DROM_PATH_PREFIX=\"./\" -DDATA_PREFIX=\"./data/\" -DSAVE_PREFIX=\"./saves/\"
|
||||
#DEFS += -DROM_PATH_PREFIX=\"./\" -DDATA_PREFIX=\"./data/\" -DSAVE_PREFIX=\"./saves/\"
|
||||
DEFS += -DUSE_SDL
|
||||
|
||||
MORE_CFLAGS += -Isrc -Isrc/osdep -Isrc/threaddep -Isrc/include -Isrc/guisan/include
|
||||
MORE_CFLAGS += -Wno-unused -Wno-format -DGCCCONSTFUNC="__attribute__((const))"
|
||||
MORE_CFLAGS += -fexceptions -fpermissive
|
||||
MORE_CFLAGS += -fdiagnostics-color=auto
|
||||
MORE_CFLAGS += -mstructure-size-boundary=32
|
||||
MORE_CFLAGS += -falign-functions=32
|
||||
MORE_CFLAGS += -std=gnu++14 -pipe
|
||||
|
||||
LDFLAGS += -lpthread -lm -lz -lpng -lrt -lxml2 -lFLAC -lmpg123 -ldl
|
||||
LDFLAGS += -lpthread -lz -lpng -lrt -lxml2 -lFLAC -lmpg123 -ldl -lmpeg2convert -lmpeg2
|
||||
LDFLAGS += -lSDL2 -lSDL2_image -lSDL2_ttf -lguisan -L/opt/vc/lib -Lsrc/guisan/lib
|
||||
|
||||
ifndef DEBUG
|
||||
MORE_CFLAGS += -Ofast -pipe -Wno-write-strings
|
||||
MORE_CFLAGS += -Ofast -pipe
|
||||
MORE_CFLAGS += -fweb -frename-registers
|
||||
MORE_CFLAGS += -funroll-loops -ftracer -funswitch-loops
|
||||
else
|
||||
MORE_CFLAGS += -g -DDEBUG -Wl,--export-dynamic
|
||||
MORE_CFLAGS += -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free
|
||||
LDFLAGS += -ltcmalloc -lprofiler
|
||||
MORE_CFLAGS += -g -rdynamic -funwind-tables -mapcs-frame -DDEBUG -Wl,--export-dynamic
|
||||
#MORE_CFLAGS += -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free
|
||||
#LDFLAGS += -ltcmalloc -lprofiler
|
||||
|
||||
endif
|
||||
|
||||
|
@ -57,6 +61,7 @@ CXXFLAGS += $(SDL_CFLAGS) $(CPU_FLAGS) $(DEFS) $(MORE_CFLAGS)
|
|||
|
||||
OBJS = \
|
||||
src/akiko.o \
|
||||
src/ar.o \
|
||||
src/aros.rom.o \
|
||||
src/audio.o \
|
||||
src/autoconf.o \
|
||||
|
@ -67,50 +72,70 @@ OBJS = \
|
|||
src/blkdev_cdimage.o \
|
||||
src/bsdsocket.o \
|
||||
src/calc.o \
|
||||
src/cd32_fmv.o \
|
||||
src/cd32_fmv_genlock.o \
|
||||
src/cdrom.o \
|
||||
src/cfgfile.o \
|
||||
src/cia.o \
|
||||
src/crc32.o \
|
||||
src/custom.o \
|
||||
src/def_icons.o \
|
||||
src/devices.o \
|
||||
src/disk.o \
|
||||
src/diskutil.o \
|
||||
src/drawing.o \
|
||||
src/events.o \
|
||||
src/expansion.o \
|
||||
src/fdi2raw.o \
|
||||
src/filesys.o \
|
||||
src/flashrom.o \
|
||||
src/fpp.o \
|
||||
src/fpp_native.o \
|
||||
src/fpp_softfloat.o \
|
||||
src/softfloat/softfloat.o \
|
||||
src/softfloat/softfloat_decimal.o \
|
||||
src/softfloat/softfloat_fpsp.o \
|
||||
src/fsdb.o \
|
||||
src/fsdb_unix.o \
|
||||
src/fsusage.o \
|
||||
src/gayle.o \
|
||||
src/gfxboard.o \
|
||||
src/gfxutil.o \
|
||||
src/hardfile.o \
|
||||
src/hrtmon.rom.o \
|
||||
src/ide.o \
|
||||
src/inputdevice.o \
|
||||
src/keybuf.o \
|
||||
src/main.o \
|
||||
src/memory.o \
|
||||
src/native2amiga.o \
|
||||
src/rommgr.o \
|
||||
src/rtc.o \
|
||||
src/savestate.o \
|
||||
src/scsi.o \
|
||||
src/statusline.o \
|
||||
src/traps.o \
|
||||
src/uaelib.o \
|
||||
src/uaeresource.o \
|
||||
src/zfile.o \
|
||||
src/zfile_archive.o \
|
||||
src/archivers/7z/7zAlloc.o \
|
||||
src/archivers/7z/7zDecode.o \
|
||||
src/archivers/7z/7zExtract.o \
|
||||
src/archivers/7z/7zHeader.o \
|
||||
src/archivers/7z/7zIn.o \
|
||||
src/archivers/7z/7zItem.o \
|
||||
src/archivers/7z/7zBuf.o \
|
||||
src/archivers/7z/7zCrc.o \
|
||||
src/archivers/7z/7zCrcOpt.o \
|
||||
src/archivers/7z/7zDec.o \
|
||||
src/archivers/7z/7zIn.o \
|
||||
src/archivers/7z/7zStream.o \
|
||||
src/archivers/7z/Bcj2.o \
|
||||
src/archivers/7z/Bra.o \
|
||||
src/archivers/7z/Bra86.o \
|
||||
src/archivers/7z/LzmaDec.o \
|
||||
src/archivers/7z/Lzma2Dec.o \
|
||||
src/archivers/7z/BraIA64.o \
|
||||
src/archivers/7z/Delta.o \
|
||||
src/archivers/7z/Sha256.o \
|
||||
src/archivers/7z/Xz.o \
|
||||
src/archivers/7z/XzCrc64.o \
|
||||
src/archivers/7z/XzDec.o \
|
||||
src/archivers/dms/crc_csum.o \
|
||||
src/archivers/dms/getbits.o \
|
||||
src/archivers/dms/maketbl.o \
|
||||
|
@ -134,6 +159,7 @@ OBJS = \
|
|||
src/archivers/lha/uae_lha.o \
|
||||
src/archivers/lha/util.o \
|
||||
src/archivers/lzx/unlzx.o \
|
||||
src/archivers/mp2/kjmp2.o \
|
||||
src/archivers/wrp/warp.o \
|
||||
src/archivers/zip/unzip.o \
|
||||
src/machdep/support.o \
|
||||
|
@ -144,6 +170,7 @@ OBJS = \
|
|||
src/osdep/hardfile_amiberry.o \
|
||||
src/osdep/keyboard_amiberry.o \
|
||||
src/osdep/mp3decoder.o \
|
||||
src/osdep/picasso96.o \
|
||||
src/osdep/writelog.o \
|
||||
src/osdep/amiberry.o \
|
||||
src/osdep/amiberry_filesys.o \
|
||||
|
@ -153,14 +180,14 @@ OBJS = \
|
|||
src/osdep/amiberry_rp9.o \
|
||||
src/osdep/amiberry_mem.o \
|
||||
src/osdep/sigsegv_handler.o \
|
||||
src/osdep/menu/menu_config.o \
|
||||
src/sounddep/sound_sdl_new.o \
|
||||
src/sounddep/sound.o \
|
||||
src/osdep/gui/UaeRadioButton.o \
|
||||
src/osdep/gui/UaeDropDown.o \
|
||||
src/osdep/gui/UaeCheckBox.o \
|
||||
src/osdep/gui/UaeListBox.o \
|
||||
src/osdep/gui/InGameMessage.o \
|
||||
src/osdep/gui/SelectorEntry.o \
|
||||
src/osdep/gui/ShowHelp.o \
|
||||
src/osdep/gui/ShowMessage.o \
|
||||
src/osdep/gui/SelectFolder.o \
|
||||
src/osdep/gui/SelectFile.o \
|
||||
|
@ -168,6 +195,7 @@ OBJS = \
|
|||
src/osdep/gui/EditFilesysVirtual.o \
|
||||
src/osdep/gui/EditFilesysHardfile.o \
|
||||
src/osdep/gui/PanelPaths.o \
|
||||
src/osdep/gui/PanelQuickstart.o \
|
||||
src/osdep/gui/PanelConfig.o \
|
||||
src/osdep/gui/PanelCPU.o \
|
||||
src/osdep/gui/PanelChipset.o \
|
||||
|
@ -183,8 +211,6 @@ OBJS = \
|
|||
src/osdep/gui/main_window.o \
|
||||
src/osdep/gui/Navigation.o
|
||||
|
||||
OBJS += src/osdep/picasso96.o
|
||||
|
||||
ifeq ($(PLATFORM),rpi1)
|
||||
OBJS += src/osdep/arm_helper.o
|
||||
else
|
||||
|
@ -199,16 +225,18 @@ OBJS += src/cpustbl.o
|
|||
OBJS += src/cpuemu_0.o
|
||||
OBJS += src/cpuemu_4.o
|
||||
OBJS += src/cpuemu_11.o
|
||||
OBJS += src/cpuemu_40.o
|
||||
OBJS += src/cpuemu_44.o
|
||||
OBJS += src/jit/compemu.o
|
||||
OBJS += src/jit/compstbl.o
|
||||
OBJS += src/jit/compemu_fpp.o
|
||||
OBJS += src/jit/compemu_support.o
|
||||
|
||||
src/osdep/neon_helper.o: src/osdep/neon_helper.s
|
||||
$(CXX) $(CPU_FLAGS) -Wall -o src/osdep/neon_helper.o -c src/osdep/neon_helper.s
|
||||
$(CXX) -falign-functions=32 $(CPU_FLAGS) -Wall -o src/osdep/neon_helper.o -c src/osdep/neon_helper.s
|
||||
|
||||
src/osdep/arm_helper.o: src/osdep/arm_helper.s
|
||||
$(CXX) $(CPU_FLAGS) -Wall -o src/osdep/arm_helper.o -c src/osdep/arm_helper.s
|
||||
$(CXX) -falign-functions=32 $(CPU_FLAGS) -Wall -o src/osdep/arm_helper.o -c src/osdep/arm_helper.s
|
||||
|
||||
$(PROG): $(OBJS)
|
||||
$(CXX) $(CXXFLAGS) -o $(PROG) $(OBJS) $(LDFLAGS)
|
||||
|
@ -218,3 +246,7 @@ endif
|
|||
|
||||
clean:
|
||||
$(RM) $(PROG) $(OBJS)
|
||||
|
||||
bootrom:
|
||||
od -v -t xC -w8 src/filesys |tail -n +5 | sed -e "s,^.......,," -e "s,[0123456789abcdefABCDEF][0123456789abcdefABCDEF],db(0x&);,g" > src/filesys_bootrom.cpp
|
||||
touch src/filesys.cpp
|
|
@ -51,18 +51,20 @@
|
|||
<ImportGroup Label="PropertySheets" />
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<RemoteBuildCommandLine>cd ~/projects/Amiberry; make</RemoteBuildCommandLine>
|
||||
<RemoteReBuildCommandLine>cd ~/projects/Amiberry; make clean; make</RemoteReBuildCommandLine>
|
||||
<RemoteBuildCommandLine>cd ~/projects/Amiberry; make -j4</RemoteBuildCommandLine>
|
||||
<RemoteReBuildCommandLine>cd ~/projects/Amiberry; make clean; make -j4</RemoteReBuildCommandLine>
|
||||
<RemoteCleanCommandLine>cd ~/projects/Amiberry; make clean</RemoteCleanCommandLine>
|
||||
<NMakeIncludeSearchPath>C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\libxml2;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\interface\vcos\pthreads;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\interface\vmcs_host\linux;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\SDL2;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\include\c++\4.9;C:\SysGCC\raspberry\lib\gcc\arm-linux-gnueabihf\4.9\include;C:\GitHub\amiberry\src\guisan\include;C:\GitHub\amiberry\src\threaddep;C:\GitHub\amiberry\src\osdep;C:\GitHub\amiberry\src;C:\GitHub\amiberry\src\include;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
|
||||
<NMakePreprocessorDefinitions>DEBUG;ARMV6T2;USE_ARMNEON;ARMV6_ASSEMBLY;AMIBERRY;CPU_arm;CAPSLOCK_DEBIAN_WORKAROUND;ROM_PATH_PREFIX=\"./\";DATA_PREFIX=\"./data/\";SAVE_PREFIX=\"./saves/\";USE_SDL;_REENTRANT;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
|
||||
<NMakeIncludeSearchPath>C:\SysGCC\raspberry\lib\gcc\arm-linux-gnueabihf\4.9\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\include\c++\4.9;C:\SysGCC\raspberry\arm-linux-gnueabihf\include;C:\GitHub\amiberry\src;C:\GitHub\amiberry\src\include;C:\GitHub\amiberry\src\osdep;C:\GitHub\amiberry\src\threaddep;C:\GitHub\amiberry\src\guisan\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\interface\vmcs_host\linux;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\interface\vcos\pthreads;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\SDL2;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\libxml2;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
|
||||
<NMakePreprocessorDefinitions>DEBUG;ARMV6T2;USE_ARMNEON;ARMV6_ASSEMBLY;AMIBERRY;CPU_arm;CAPSLOCK_DEBIAN_WORKAROUND;USE_SDL;_REENTRANT;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
|
||||
<RemoteBuildOutputs>
|
||||
</RemoteBuildOutputs>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<NMakeIncludeSearchPath>C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\libxml2;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\interface\vcos\pthreads;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\interface\vmcs_host\linux;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\SDL2;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\include\c++\4.9;C:\SysGCC\raspberry\lib\gcc\arm-linux-gnueabihf\4.9\include;D:\midwa\Projects\GitHub\amiberry\src\guisan\include;D:\midwa\Projects\GitHub\amiberry\src\threaddep;D:\midwa\Projects\GitHub\amiberry\src\osdep;D:\midwa\Projects\GitHub\amiberry\src;D:\midwa\Projects\GitHub\amiberry\src\include;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
|
||||
<RemoteBuildCommandLine>cd ~/projects/Amiberry; make</RemoteBuildCommandLine>
|
||||
<RemoteReBuildCommandLine>cd ~/projects/Amiberry; make clean; make</RemoteReBuildCommandLine>
|
||||
<NMakeIncludeSearchPath>C:\SysGCC\raspberry\lib\gcc\arm-linux-gnueabihf\4.9\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\include\c++\4.9;C:\SysGCC\raspberry\arm-linux-gnueabihf\include;C:\GitHub\amiberry\src;C:\GitHub\amiberry\src\include;C:\GitHub\amiberry\src\osdep;C:\GitHub\amiberry\src\threaddep;C:\GitHub\amiberry\src\guisan\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\interface\vmcs_host\linux;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\interface\vcos\pthreads;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\SDL2;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\libxml2;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
|
||||
<RemoteBuildCommandLine>cd ~/projects/Amiberry; make -j4</RemoteBuildCommandLine>
|
||||
<RemoteReBuildCommandLine>cd ~/projects/Amiberry; make clean; make -j4</RemoteReBuildCommandLine>
|
||||
<RemoteCleanCommandLine>cd ~/projects/Amiberry; make clean</RemoteCleanCommandLine>
|
||||
<NMakePreprocessorDefinitions>ARMV6T2;USE_ARMNEON;ARMV6_ASSEMBLY;AMIBERRY;CPU_arm;CAPSLOCK_DEBIAN_WORKAROUND;ROM_PATH_PREFIX=\"./\";DATA_PREFIX=\"./data/\";SAVE_PREFIX=\"./saves/\";USE_SDL;_REENTRANT;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
|
||||
<NMakePreprocessorDefinitions>ARMV6T2;USE_ARMNEON;ARMV6_ASSEMBLY;AMIBERRY;CPU_arm;CAPSLOCK_DEBIAN_WORKAROUND;USE_SDL;_REENTRANT;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="..\conf\dir.txt">
|
||||
|
@ -149,18 +151,13 @@
|
|||
<DeploymentContent>false</DeploymentContent>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\ar.cpp" />
|
||||
<ClCompile Include="..\src\archivers\7z\7zAlloc.cpp" />
|
||||
<ClCompile Include="..\src\archivers\7z\7zBuf.cpp" />
|
||||
<ClCompile Include="..\src\archivers\7z\7zBuf2.c" />
|
||||
<ClCompile Include="..\src\archivers\7z\7zCrc.cpp" />
|
||||
<ClCompile Include="..\src\archivers\7z\7zCrcOpt.cpp" />
|
||||
<ClCompile Include="..\src\archivers\7z\7zDec.cpp" />
|
||||
<ClCompile Include="..\src\archivers\7z\7zDecode.cpp" />
|
||||
<ClCompile Include="..\src\archivers\7z\7zExtract.cpp" />
|
||||
<ClCompile Include="..\src\archivers\7z\7zFile.c" />
|
||||
<ClCompile Include="..\src\archivers\7z\7zHeader.cpp" />
|
||||
<ClCompile Include="..\src\archivers\7z\7zIn.cpp" />
|
||||
<ClCompile Include="..\src\archivers\7z\7zItem.cpp" />
|
||||
<ClCompile Include="..\src\archivers\7z\7zStream.cpp" />
|
||||
<ClCompile Include="..\src\archivers\7z\Alloc.c" />
|
||||
<ClCompile Include="..\src\archivers\7z\Bcj2.cpp" />
|
||||
|
@ -418,7 +415,6 @@
|
|||
<ClCompile Include="..\src\osdep\gui\UaeRadioButton.cpp" />
|
||||
<ClCompile Include="..\src\osdep\hardfile_amiberry.cpp" />
|
||||
<ClCompile Include="..\src\osdep\keyboard_amiberry.cpp" />
|
||||
<ClCompile Include="..\src\osdep\menu\menu_config.cpp" />
|
||||
<ClCompile Include="..\src\osdep\mp3decoder.cpp" />
|
||||
<ClCompile Include="..\src\osdep\picasso96.cpp" />
|
||||
<ClCompile Include="..\src\osdep\sigsegv_handler.cpp" />
|
||||
|
@ -465,15 +461,9 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\archivers\7z\7z.h" />
|
||||
<ClInclude Include="..\src\archivers\7z\7zAlloc.h" />
|
||||
<ClInclude Include="..\src\archivers\7z\7zBuf.h" />
|
||||
<ClInclude Include="..\src\archivers\7z\7zCrc.h" />
|
||||
<ClInclude Include="..\src\archivers\7z\7zDecode.h" />
|
||||
<ClInclude Include="..\src\archivers\7z\7zExtract.h" />
|
||||
<ClInclude Include="..\src\archivers\7z\7zFile.h" />
|
||||
<ClInclude Include="..\src\archivers\7z\7zHeader.h" />
|
||||
<ClInclude Include="..\src\archivers\7z\7zIn.h" />
|
||||
<ClInclude Include="..\src\archivers\7z\7zItem.h" />
|
||||
<ClInclude Include="..\src\archivers\7z\7zVersion.h" />
|
||||
<ClInclude Include="..\src\archivers\7z\Alloc.h" />
|
||||
<ClInclude Include="..\src\archivers\7z\Bcj2.h" />
|
||||
|
|
|
@ -55,9 +55,6 @@
|
|||
<Filter Include="src\osdep\gui">
|
||||
<UniqueIdentifier>{b25f6ac8-afcb-45b8-a0fc-f0bc1c88fba1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="src\osdep\menu">
|
||||
<UniqueIdentifier>{32996091-d9d9-437f-8338-e15198404b91}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="src\sounddep">
|
||||
<UniqueIdentifier>{767f436f-8275-4c9f-abf9-a880ba80c1f2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
@ -333,30 +330,12 @@
|
|||
<ClCompile Include="..\src\zfile_archive.cpp">
|
||||
<Filter>src</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\archivers\7z\7zAlloc.cpp">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\archivers\7z\7zBuf.cpp">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\archivers\7z\7zCrc.cpp">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\archivers\7z\7zDecode.cpp">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\archivers\7z\7zExtract.cpp">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\archivers\7z\7zHeader.cpp">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\archivers\7z\7zIn.cpp">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\archivers\7z\7zItem.cpp">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\archivers\7z\7zStream.cpp">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
|
@ -606,9 +585,6 @@
|
|||
<ClCompile Include="..\src\osdep\gui\UaeRadioButton.cpp">
|
||||
<Filter>src\osdep\gui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\osdep\menu\menu_config.cpp">
|
||||
<Filter>src\osdep\menu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\sounddep\sound.cpp">
|
||||
<Filter>src\sounddep</Filter>
|
||||
</ClCompile>
|
||||
|
@ -762,32 +738,17 @@
|
|||
<ClCompile Include="..\src\osdep\gui\ShowHelp.cpp">
|
||||
<Filter>src\osdep\gui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\src\archivers\7z\7zIn.cpp">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\src\archivers\7z\7zAlloc.h">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\archivers\7z\7zBuf.h">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\archivers\7z\7zCrc.h">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\archivers\7z\7zDecode.h">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\archivers\7z\7zExtract.h">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\archivers\7z\7zHeader.h">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\archivers\7z\7zIn.h">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\archivers\7z\7zItem.h">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\archivers\7z\7zVersion.h">
|
||||
<Filter>src\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<RemoteDebuggerCommand>~/projects/amiberry/amiberry-sdl2</RemoteDebuggerCommand>
|
||||
<RemoteDebuggerWorkingDirectory>~/projects/amiberry</RemoteDebuggerWorkingDirectory>
|
||||
<RemoteDebuggerCommand>projects/amiberry/amiberry-sdl2</RemoteDebuggerCommand>
|
||||
<RemoteDebuggerWorkingDirectory>projects/amiberry</RemoteDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>LinuxDebugger</DebuggerFlavor>
|
||||
<PreLaunchCommand>
|
||||
</PreLaunchCommand>
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
</FileMasks>
|
||||
<TransferNewFilesOnly>true</TransferNewFilesOnly>
|
||||
<IncludeSubdirectories>true</IncludeSubdirectories>
|
||||
<SelectedDirectories />
|
||||
<DeleteDisappearedFiles>false</DeleteDisappearedFiles>
|
||||
</MainSourceTransferCommand>
|
||||
<AllowChangingHostForMainCommands>false</AllowChangingHostForMainCommands>
|
||||
|
|
|
@ -57,12 +57,12 @@
|
|||
<ClCompile>
|
||||
<CPPLanguageStandard>GNUPP14</CPPLanguageStandard>
|
||||
<AdditionalIncludeDirectories>C:\SysGCC\raspberry\lib\gcc\arm-linux-gnueabihf\4.9\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\include\c++\4.9;C:\SysGCC\raspberry\arm-linux-gnueabihf\include;../../src;../../src/include;../../src/osdep;../../src/threaddep;../../src/guisan/include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include;=/opt/vc/include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\interface\vmcs_host\linux;=/opt/vc/include/interface/vmcs_host/linux;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\interface\vcos\pthreads;=/opt/vc/include/interface/vcos/pthreads;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include;=/usr/include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\SDL2;=/usr/include/SDL2;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\libxml2;=/usr/include/libxml2;%(ClCompile.AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>DEBUG=1;_REENTRANT;CAPSLOCK_DEBIAN_WORKAROUND;ARMV6T2;USE_ARMNEON;ARMV6_ASSEMBLY;AMIBERRY;USE_SDL;CPU_arm;ROM_PATH_PREFIX=\"./\";DATA_PREFIX=\"./data/\";SAVE_PREFIX=\"./saves/\";GCCCONSTFUNC="__attribute__((const))";%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>DEBUG=1;_REENTRANT;CAPSLOCK_DEBIAN_WORKAROUND;ARMV6T2;USE_ARMNEON;ARMV6_ASSEMBLY;AMIBERRY;USE_SDL;CPU_arm;GCCCONSTFUNC="__attribute__((const))";%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalOptions>-march=armv8-a -mfpu=neon-fp-armv8 -mfloat-abi=hard -pipe -Wno-write-strings %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<LibrarySearchDirectories>../../src/guisan/lib;=/opt/vc/lib;=/usr/lib/arm-linux-gnueabihf;%(Link.LibrarySearchDirectories)</LibrarySearchDirectories>
|
||||
<AdditionalLibraryNames>SDL2;SDL2_image;SDL2_ttf;pthread;m;z;png;rt;xml2;FLAC;mpg123;dl;guisan;profiler;tcmalloc;%(Link.AdditionalLibraryNames)</AdditionalLibraryNames>
|
||||
<AdditionalLibraryNames>SDL2;SDL2_image;SDL2_ttf;pthread;z;png;rt;xml2;FLAC;mpg123;dl;guisan;mpeg2convert;mpeg2;%(Link.AdditionalLibraryNames)</AdditionalLibraryNames>
|
||||
<LinkerScript />
|
||||
<AdditionalLinkerInputs>-Wl,-gc-sections;%(Link.AdditionalLinkerInputs)</AdditionalLinkerInputs>
|
||||
</Link>
|
||||
|
@ -71,7 +71,7 @@
|
|||
<ClCompile>
|
||||
<CPPLanguageStandard>GNUPP14</CPPLanguageStandard>
|
||||
<AdditionalIncludeDirectories>C:\SysGCC\raspberry\lib\gcc\arm-linux-gnueabihf\4.9\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\include\c++\4.9;C:\SysGCC\raspberry\arm-linux-gnueabihf\include;../../src;../../src/include;../../src/osdep;../../src/threaddep;../../src/guisan/include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include;=/opt/vc/include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\interface\vmcs_host\linux;=/opt/vc/include/interface/vmcs_host/linux;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\interface\vcos\pthreads;=/opt/vc/include/interface/vcos/pthreads;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include;=/usr/include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\SDL2;=/usr/include/SDL2;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\libxml2;=/usr/include/libxml2;%(ClCompile.AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NDEBUG=1;RELEASE=1;_REENTRANT;CAPSLOCK_DEBIAN_WORKAROUND;ARMV6T2;USE_ARMNEON;ARMV6_ASSEMBLY;AMIBERRY;USE_SDL;CPU_arm;ROM_PATH_PREFIX=\"./\";DATA_PREFIX=\"./data/\";SAVE_PREFIX=\"./saves/\";GCCCONSTFUNC="__attribute__((const))";%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG=1;RELEASE=1;_REENTRANT;CAPSLOCK_DEBIAN_WORKAROUND;ARMV6T2;USE_ARMNEON;ARMV6_ASSEMBLY;AMIBERRY;USE_SDL;CPU_arm;GCCCONSTFUNC="__attribute__((const))";%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalOptions>-march=armv8-a -mfpu=neon-fp-armv8 -mfloat-abi=hard -pipe -Wno-write-strings %(AdditionalOptions)</AdditionalOptions>
|
||||
<OmitFramePointer>true</OmitFramePointer>
|
||||
<InlineFunctions>true</InlineFunctions>
|
||||
|
@ -79,7 +79,7 @@
|
|||
<Link>
|
||||
<AdditionalLinkerInputs>-Wl,-gc-sections;%(Link.AdditionalLinkerInputs)</AdditionalLinkerInputs>
|
||||
<LibrarySearchDirectories>../../src/guisan/lib;=/opt/vc/lib;=/usr/lib/arm-linux-gnueabihf;%(Link.LibrarySearchDirectories)</LibrarySearchDirectories>
|
||||
<AdditionalLibraryNames>SDL2;SDL2_image;SDL2_ttf;pthread;m;z;png;rt;xml2;FLAC;mpg123;dl;guisan;%(Link.AdditionalLibraryNames)</AdditionalLibraryNames>
|
||||
<AdditionalLibraryNames>SDL2;SDL2_image;SDL2_ttf;pthread;z;png;rt;xml2;FLAC;mpg123;dl;guisan;mpeg2convert;mpeg2;%(Link.AdditionalLibraryNames)</AdditionalLibraryNames>
|
||||
<LinkerScript />
|
||||
<ExtraRPATH>
|
||||
</ExtraRPATH>
|
||||
|
@ -89,7 +89,7 @@
|
|||
<ClCompile>
|
||||
<CPPLanguageStandard>GNUPP14</CPPLanguageStandard>
|
||||
<AdditionalIncludeDirectories>C:\SysGCC\raspberry\lib\gcc\arm-linux-gnueabihf\4.9\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\include\c++\4.9;C:\SysGCC\raspberry\arm-linux-gnueabihf\include;../../src;../../src/include;../../src/osdep;../../src/threaddep;../../src/guisan/include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include;=/opt/vc/include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\interface\vmcs_host\linux;=/opt/vc/include/interface/vmcs_host/linux;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\interface\vcos\pthreads;=/opt/vc/include/interface/vcos/pthreads;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include;=/usr/include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\SDL2;=/usr/include/SDL2;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\libxml2;=/usr/include/libxml2;%(ClCompile.AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NDEBUG=1;RELEASE=1;_REENTRANT;CAPSLOCK_DEBIAN_WORKAROUND;ARMV6T2;USE_ARMNEON;ARMV6_ASSEMBLY;AMIBERRY;USE_SDL;CPU_arm;ROM_PATH_PREFIX=\"./\";DATA_PREFIX=\"./data/\";SAVE_PREFIX=\"./saves/\";GCCCONSTFUNC="__attribute__((const))";%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG=1;RELEASE=1;_REENTRANT;CAPSLOCK_DEBIAN_WORKAROUND;ARMV6T2;USE_ARMNEON;ARMV6_ASSEMBLY;AMIBERRY;USE_SDL;CPU_arm;GCCCONSTFUNC="__attribute__((const))";%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalOptions>-march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -pipe -Wno-write-strings %(AdditionalOptions)</AdditionalOptions>
|
||||
<OmitFramePointer>true</OmitFramePointer>
|
||||
<InlineFunctions>true</InlineFunctions>
|
||||
|
@ -97,7 +97,7 @@
|
|||
<Link>
|
||||
<AdditionalLinkerInputs>-Wl,-gc-sections;%(Link.AdditionalLinkerInputs)</AdditionalLinkerInputs>
|
||||
<LibrarySearchDirectories>../../src/guisan/lib;=/opt/vc/lib;=/usr/lib/arm-linux-gnueabihf;%(Link.LibrarySearchDirectories)</LibrarySearchDirectories>
|
||||
<AdditionalLibraryNames>SDL2;SDL2_image;SDL2_ttf;pthread;m;z;png;rt;xml2;FLAC;mpg123;dl;guisan;%(Link.AdditionalLibraryNames)</AdditionalLibraryNames>
|
||||
<AdditionalLibraryNames>SDL2;SDL2_image;SDL2_ttf;pthread;z;png;rt;xml2;FLAC;mpg123;dl;guisan;mpeg2convert;mpeg2;%(Link.AdditionalLibraryNames)</AdditionalLibraryNames>
|
||||
<LinkerScript>
|
||||
</LinkerScript>
|
||||
<ExtraRPATH>
|
||||
|
@ -108,7 +108,7 @@
|
|||
<ClCompile>
|
||||
<CPPLanguageStandard>GNUPP14</CPPLanguageStandard>
|
||||
<AdditionalIncludeDirectories>C:\SysGCC\raspberry\lib\gcc\arm-linux-gnueabihf\4.9\include;C:\SysGCC\raspberry\arm-linux-gnueabihf\include\c++\4.9;C:\SysGCC\raspberry\arm-linux-gnueabihf\include;../../src;../../src/include;../../src/osdep;../../src/threaddep;../../src/guisan/include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include;=/opt/vc/include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\interface\vmcs_host\linux;=/opt/vc/include/interface/vmcs_host/linux;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\opt\vc\include\interface\vcos\pthreads;=/opt/vc/include/interface/vcos/pthreads;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include;=/usr/include;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\SDL2;=/usr/include/SDL2;C:\SysGCC\raspberry\arm-linux-gnueabihf\sysroot\usr\include\libxml2;=/usr/include/libxml2;%(ClCompile.AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NDEBUG=1;RELEASE=1;_REENTRANT;CAPSLOCK_DEBIAN_WORKAROUND;ARMV6_ASSEMBLY;AMIBERRY;USE_SDL;CPU_arm;ROM_PATH_PREFIX=\"./\";DATA_PREFIX=\"./data/\";SAVE_PREFIX=\"./saves/\";GCCCONSTFUNC="__attribute__((const))";%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>NDEBUG=1;RELEASE=1;_REENTRANT;CAPSLOCK_DEBIAN_WORKAROUND;ARMV6_ASSEMBLY;AMIBERRY;USE_SDL;CPU_arm;GCCCONSTFUNC="__attribute__((const))";%(ClCompile.PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalOptions>-march=armv6zk -mfpu=vfp -mfloat-abi=hard -pipe -Wno-write-strings %(AdditionalOptions)</AdditionalOptions>
|
||||
<OmitFramePointer>true</OmitFramePointer>
|
||||
<InlineFunctions>true</InlineFunctions>
|
||||
|
@ -116,7 +116,7 @@
|
|||
<Link>
|
||||
<AdditionalLinkerInputs>-Wl,-gc-sections;%(Link.AdditionalLinkerInputs)</AdditionalLinkerInputs>
|
||||
<LibrarySearchDirectories>../../src/guisan/lib;=/opt/vc/lib;=/usr/lib/arm-linux-gnueabihf;%(Link.LibrarySearchDirectories)</LibrarySearchDirectories>
|
||||
<AdditionalLibraryNames>SDL2;SDL2_image;SDL2_ttf;pthread;m;z;png;rt;xml2;FLAC;mpg123;dl;guisan;%(Link.AdditionalLibraryNames)</AdditionalLibraryNames>
|
||||
<AdditionalLibraryNames>SDL2;SDL2_image;SDL2_ttf;pthread;z;png;rt;xml2;FLAC;mpg123;dl;guisan;mpeg2convert;mpeg2;%(Link.AdditionalLibraryNames)</AdditionalLibraryNames>
|
||||
<LinkerScript>
|
||||
</LinkerScript>
|
||||
<ExtraRPATH>
|
||||
|
@ -130,18 +130,13 @@
|
|||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\akiko.cpp" />
|
||||
<ClCompile Include="..\..\src\ar.cpp" />
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zAlloc.cpp" />
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zBuf.cpp" />
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zBuf2.c" />
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zCrc.cpp" />
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zCrcOpt.cpp" />
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zDec.cpp" />
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zDecode.cpp" />
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zExtract.cpp" />
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zFile.c" />
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zHeader.cpp" />
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zIn.cpp" />
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zItem.cpp" />
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zStream.cpp" />
|
||||
<ClCompile Include="..\..\src\archivers\7z\Alloc.c" />
|
||||
<ClCompile Include="..\..\src\archivers\7z\Bcj2.cpp" />
|
||||
|
@ -291,7 +286,6 @@
|
|||
<ClCompile Include="..\..\src\osdep\gui\UaeRadioButton.cpp" />
|
||||
<ClCompile Include="..\..\src\osdep\hardfile_amiberry.cpp" />
|
||||
<ClCompile Include="..\..\src\osdep\keyboard_amiberry.cpp" />
|
||||
<ClCompile Include="..\..\src\osdep\menu\menu_config.cpp" />
|
||||
<ClCompile Include="..\..\src\osdep\mp3decoder.cpp" />
|
||||
<ClCompile Include="..\..\src\osdep\neon_helper.s" />
|
||||
<ClCompile Include="..\..\src\osdep\amiberry.cpp" />
|
||||
|
@ -373,15 +367,9 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\archivers\7z\7z.h" />
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zAlloc.h" />
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zBuf.h" />
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zCrc.h" />
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zDecode.h" />
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zExtract.h" />
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zFile.h" />
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zHeader.h" />
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zIn.h" />
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zItem.h" />
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zVersion.h" />
|
||||
<ClInclude Include="..\..\src\archivers\7z\Alloc.h" />
|
||||
<ClInclude Include="..\..\src\archivers\7z\Bcj2.h" />
|
||||
|
|
|
@ -95,9 +95,6 @@
|
|||
<Filter Include="Source files\osdep\gui">
|
||||
<UniqueIdentifier>{c55a2e76-0018-4e65-9d5c-199499145eef}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source files\osdep\menu">
|
||||
<UniqueIdentifier>{08cd7b24-548b-44cc-b832-e5c7a01f2527}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header files\guisan">
|
||||
<UniqueIdentifier>{d9ec068c-6c88-41d0-ada4-8f8d0eeb19c8}</UniqueIdentifier>
|
||||
</Filter>
|
||||
|
@ -486,9 +483,6 @@
|
|||
<ClCompile Include="..\..\src\osdep\gui\UaeRadioButton.cpp">
|
||||
<Filter>Source files\osdep\gui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\osdep\menu\menu_config.cpp">
|
||||
<Filter>Source files\osdep\menu</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\osdep\neon_helper.s">
|
||||
<Filter>Source files\osdep</Filter>
|
||||
</ClCompile>
|
||||
|
@ -522,30 +516,12 @@
|
|||
<ClCompile Include="..\..\src\osdep\keyboard_amiberry.cpp">
|
||||
<Filter>Source files\osdep</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zAlloc.cpp">
|
||||
<Filter>Source files\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zBuf.cpp">
|
||||
<Filter>Source files\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zCrc.cpp">
|
||||
<Filter>Source files\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zDecode.cpp">
|
||||
<Filter>Source files\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zExtract.cpp">
|
||||
<Filter>Source files\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zHeader.cpp">
|
||||
<Filter>Source files\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zIn.cpp">
|
||||
<Filter>Source files\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zItem.cpp">
|
||||
<Filter>Source files\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zStream.cpp">
|
||||
<Filter>Source files\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
|
@ -714,6 +690,9 @@
|
|||
<ClCompile Include="..\..\src\osdep\gui\ShowHelp.cpp">
|
||||
<Filter>Source files\osdep\gui</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\archivers\7z\7zIn.cpp">
|
||||
<Filter>Source files\archivers\7z</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="..\..\data\35floppy.ico">
|
||||
|
@ -1260,30 +1239,12 @@
|
|||
<ClInclude Include="..\..\src\osdep\amiberry_rp9.h">
|
||||
<Filter>Header files\osdep</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zAlloc.h">
|
||||
<Filter>Header files\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zBuf.h">
|
||||
<Filter>Header files\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zCrc.h">
|
||||
<Filter>Header files\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zDecode.h">
|
||||
<Filter>Header files\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zExtract.h">
|
||||
<Filter>Header files\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zHeader.h">
|
||||
<Filter>Header files\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zIn.h">
|
||||
<Filter>Header files\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zItem.h">
|
||||
<Filter>Header files\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\archivers\7z\7zVersion.h">
|
||||
<Filter>Header files\archivers\7z</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
@ -206,12 +206,12 @@
|
|||
|
||||
#include "options.h"
|
||||
#include "uae.h"
|
||||
#include "memory.h"
|
||||
#include "include/memory.h"
|
||||
#include "rommgr.h"
|
||||
#include "custom.h"
|
||||
#include "newcpu.h"
|
||||
#include "zfile.h"
|
||||
#include "ar.h"
|
||||
#include "include/ar.h"
|
||||
#include "savestate.h"
|
||||
#include "crc32.h"
|
||||
#include "akiko.h"
|
||||
|
|
|
@ -1,76 +0,0 @@
|
|||
/* 7zAlloc.c -- Allocation functions
|
||||
2010-10-29 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "7zAlloc.h"
|
||||
|
||||
/* #define _SZ_ALLOC_DEBUG */
|
||||
/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */
|
||||
|
||||
#ifdef _SZ_ALLOC_DEBUG
|
||||
|
||||
#ifdef _WIN32_
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
int g_allocCount = 0;
|
||||
int g_allocCountTemp = 0;
|
||||
|
||||
#endif
|
||||
|
||||
void *SzAlloc(void *p, size_t size)
|
||||
{
|
||||
p = p;
|
||||
if (size == 0)
|
||||
return 0;
|
||||
#ifdef _SZ_ALLOC_DEBUG
|
||||
fprintf(stderr, "\nAlloc %10d bytes; count = %10d", size, g_allocCount);
|
||||
g_allocCount++;
|
||||
#endif
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
void SzFree(void *p, void *address)
|
||||
{
|
||||
p = p;
|
||||
#ifdef _SZ_ALLOC_DEBUG
|
||||
if (address != 0)
|
||||
{
|
||||
g_allocCount--;
|
||||
fprintf(stderr, "\nFree; count = %10d", g_allocCount);
|
||||
}
|
||||
#endif
|
||||
free(address);
|
||||
}
|
||||
|
||||
void *SzAllocTemp(void *p, size_t size)
|
||||
{
|
||||
p = p;
|
||||
if (size == 0)
|
||||
return 0;
|
||||
#ifdef _SZ_ALLOC_DEBUG
|
||||
fprintf(stderr, "\nAlloc_temp %10d bytes; count = %10d", size, g_allocCountTemp);
|
||||
g_allocCountTemp++;
|
||||
#ifdef _WIN32_
|
||||
return HeapAlloc(GetProcessHeap(), 0, size);
|
||||
#endif
|
||||
#endif
|
||||
return malloc(size);
|
||||
}
|
||||
|
||||
void SzFreeTemp(void *p, void *address)
|
||||
{
|
||||
p = p;
|
||||
#ifdef _SZ_ALLOC_DEBUG
|
||||
if (address != 0)
|
||||
{
|
||||
g_allocCountTemp--;
|
||||
fprintf(stderr, "\nFree_temp; count = %10d", g_allocCountTemp);
|
||||
}
|
||||
#ifdef _WIN32_
|
||||
HeapFree(GetProcessHeap(), 0, address);
|
||||
return;
|
||||
#endif
|
||||
#endif
|
||||
free(address);
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
/* 7zAlloc.h -- Allocation functions
|
||||
2010-10-29 : Igor Pavlov : Public domain */
|
||||
|
||||
#ifndef __7Z_ALLOC_H
|
||||
#define __7Z_ALLOC_H
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
void *SzAlloc(void *p, size_t size);
|
||||
void SzFree(void *p, void *address);
|
||||
|
||||
void *SzAllocTemp(void *p, size_t size);
|
||||
void SzFreeTemp(void *p, void *address);
|
||||
|
||||
#endif
|
|
@ -1,254 +0,0 @@
|
|||
/* 7zDecode.c -- Decoding from 7z folder
|
||||
2008-11-23 : Igor Pavlov : Public domain */
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "Bcj2.h"
|
||||
#include "Bra.h"
|
||||
#include "LzmaDec.h"
|
||||
#include "7zDecode.h"
|
||||
|
||||
#define k_Copy 0
|
||||
#define k_LZMA 0x30101
|
||||
#define k_BCJ 0x03030103
|
||||
#define k_BCJ2 0x0303011B
|
||||
|
||||
static SRes SzDecodeLzma(CSzCoderInfo *coder, UInt64 inSize, ILookInStream *inStream,
|
||||
Byte *outBuffer, SizeT outSize, ISzAlloc *allocMain)
|
||||
{
|
||||
CLzmaDec state;
|
||||
SRes res = SZ_OK;
|
||||
|
||||
LzmaDec_Construct(&state);
|
||||
RINOK(LzmaDec_AllocateProbs(&state, coder->Props.data, unsigned(coder->Props.size), allocMain));
|
||||
state.dic = outBuffer;
|
||||
state.dicBufSize = outSize;
|
||||
LzmaDec_Init(&state);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
Byte *inBuf = nullptr;
|
||||
size_t lookahead = (1 << 18);
|
||||
if (lookahead > inSize)
|
||||
lookahead = size_t(inSize);
|
||||
res = inStream->Look((void *)inStream, (void **)&inBuf, &lookahead);
|
||||
if (res != SZ_OK)
|
||||
break;
|
||||
|
||||
{
|
||||
SizeT inProcessed = SizeT(lookahead), dicPos = state.dicPos;
|
||||
ELzmaStatus status;
|
||||
res = LzmaDec_DecodeToDic(&state, outSize, inBuf, &inProcessed, LZMA_FINISH_END, &status);
|
||||
lookahead -= inProcessed;
|
||||
inSize -= inProcessed;
|
||||
if (res != SZ_OK)
|
||||
break;
|
||||
if (state.dicPos == state.dicBufSize || (inProcessed == 0 && dicPos == state.dicPos))
|
||||
{
|
||||
if (state.dicBufSize != outSize || lookahead != 0 ||
|
||||
(status != LZMA_STATUS_FINISHED_WITH_MARK &&
|
||||
status != LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK))
|
||||
res = SZ_ERROR_DATA;
|
||||
break;
|
||||
}
|
||||
res = inStream->Skip((void *)inStream, inProcessed);
|
||||
if (res != SZ_OK)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
LzmaDec_FreeProbs(&state, allocMain);
|
||||
return res;
|
||||
}
|
||||
|
||||
static SRes SzDecodeCopy(UInt64 inSize, ILookInStream *inStream, Byte *outBuffer)
|
||||
{
|
||||
while (inSize > 0)
|
||||
{
|
||||
void *inBuf;
|
||||
size_t curSize = (1 << 18);
|
||||
if (curSize > inSize)
|
||||
curSize = size_t(inSize);
|
||||
RINOK(inStream->Look((void *)inStream, (void **)&inBuf, &curSize));
|
||||
if (curSize == 0)
|
||||
return SZ_ERROR_INPUT_EOF;
|
||||
memcpy(outBuffer, inBuf, curSize);
|
||||
outBuffer += curSize;
|
||||
inSize -= curSize;
|
||||
RINOK(inStream->Skip((void *)inStream, curSize));
|
||||
}
|
||||
return SZ_OK;
|
||||
}
|
||||
|
||||
#define IS_UNSUPPORTED_METHOD(m) ((m) != k_Copy && (m) != k_LZMA)
|
||||
#define IS_UNSUPPORTED_CODER(c) (IS_UNSUPPORTED_METHOD(c.MethodID) || c.NumInStreams != 1 || c.NumOutStreams != 1)
|
||||
#define IS_NO_BCJ(c) (c.MethodID != k_BCJ || c.NumInStreams != 1 || c.NumOutStreams != 1)
|
||||
#define IS_NO_BCJ2(c) (c.MethodID != k_BCJ2 || c.NumInStreams != 4 || c.NumOutStreams != 1)
|
||||
|
||||
SRes CheckSupportedFolder(const CSzFolder *f)
|
||||
{
|
||||
if (f->NumCoders < 1 || f->NumCoders > 4)
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
if (IS_UNSUPPORTED_CODER(f->Coders[0]))
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
if (f->NumCoders == 1)
|
||||
{
|
||||
if (f->NumPackStreams != 1 || f->PackStreams[0] != 0 || f->NumBindPairs != 0)
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
return SZ_OK;
|
||||
}
|
||||
if (f->NumCoders == 2)
|
||||
{
|
||||
if (IS_NO_BCJ(f->Coders[1]) ||
|
||||
f->NumPackStreams != 1 || f->PackStreams[0] != 0 ||
|
||||
f->NumBindPairs != 1 ||
|
||||
f->BindPairs[0].InIndex != 1 || f->BindPairs[0].OutIndex != 0)
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
return SZ_OK;
|
||||
}
|
||||
if (f->NumCoders == 4)
|
||||
{
|
||||
if (IS_UNSUPPORTED_CODER(f->Coders[1]) ||
|
||||
IS_UNSUPPORTED_CODER(f->Coders[2]) ||
|
||||
IS_NO_BCJ2(f->Coders[3]))
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
if (f->NumPackStreams != 4 ||
|
||||
f->PackStreams[0] != 2 ||
|
||||
f->PackStreams[1] != 6 ||
|
||||
f->PackStreams[2] != 1 ||
|
||||
f->PackStreams[3] != 0 ||
|
||||
f->NumBindPairs != 3 ||
|
||||
f->BindPairs[0].InIndex != 5 || f->BindPairs[0].OutIndex != 0 ||
|
||||
f->BindPairs[1].InIndex != 4 || f->BindPairs[1].OutIndex != 1 ||
|
||||
f->BindPairs[2].InIndex != 3 || f->BindPairs[2].OutIndex != 2)
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
return SZ_OK;
|
||||
}
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
UInt64 GetSum(const UInt64 *values, UInt32 index)
|
||||
{
|
||||
UInt64 sum = 0;
|
||||
UInt32 i;
|
||||
for (i = 0; i < index; i++)
|
||||
sum += values[i];
|
||||
return sum;
|
||||
}
|
||||
|
||||
SRes SzDecode2(const UInt64 *packSizes, const CSzFolder *folder,
|
||||
ILookInStream *inStream, UInt64 startPos,
|
||||
Byte *outBuffer, SizeT outSize, ISzAlloc *allocMain,
|
||||
Byte *tempBuf[])
|
||||
{
|
||||
UInt32 ci;
|
||||
SizeT tempSizes[3] = { 0, 0, 0};
|
||||
SizeT tempSize3 = 0;
|
||||
Byte *tempBuf3 = 0;
|
||||
|
||||
RINOK(CheckSupportedFolder(folder));
|
||||
|
||||
for (ci = 0; ci < folder->NumCoders; ci++)
|
||||
{
|
||||
CSzCoderInfo *coder = &folder->Coders[ci];
|
||||
|
||||
if (coder->MethodID == k_Copy || coder->MethodID == k_LZMA)
|
||||
{
|
||||
UInt32 si = 0;
|
||||
UInt64 offset;
|
||||
UInt64 inSize;
|
||||
Byte *outBufCur = outBuffer;
|
||||
SizeT outSizeCur = outSize;
|
||||
if (folder->NumCoders == 4)
|
||||
{
|
||||
UInt32 indices[] = { 3, 2, 0 };
|
||||
UInt64 unpackSize = folder->UnpackSizes[ci];
|
||||
si = indices[ci];
|
||||
if (ci < 2)
|
||||
{
|
||||
Byte *temp;
|
||||
outSizeCur = (SizeT)unpackSize;
|
||||
if (outSizeCur != unpackSize)
|
||||
return SZ_ERROR_MEM;
|
||||
temp = (Byte *)IAlloc_Alloc(allocMain, outSizeCur);
|
||||
if (temp == 0 && outSizeCur != 0)
|
||||
return SZ_ERROR_MEM;
|
||||
outBufCur = tempBuf[1 - ci] = temp;
|
||||
tempSizes[1 - ci] = outSizeCur;
|
||||
}
|
||||
else if (ci == 2)
|
||||
{
|
||||
if (unpackSize > outSize) /* check it */
|
||||
return SZ_ERROR_PARAM;
|
||||
tempBuf3 = outBufCur = outBuffer + (outSize - (size_t)unpackSize);
|
||||
tempSize3 = outSizeCur = (SizeT)unpackSize;
|
||||
}
|
||||
else
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
}
|
||||
offset = GetSum(packSizes, si);
|
||||
inSize = packSizes[si];
|
||||
RINOK(LookInStream_SeekTo(inStream, startPos + offset));
|
||||
|
||||
if (coder->MethodID == k_Copy)
|
||||
{
|
||||
if (inSize != outSizeCur) /* check it */
|
||||
return SZ_ERROR_DATA;
|
||||
RINOK(SzDecodeCopy(inSize, inStream, outBufCur));
|
||||
}
|
||||
else
|
||||
{
|
||||
RINOK(SzDecodeLzma(coder, inSize, inStream, outBufCur, outSizeCur, allocMain));
|
||||
}
|
||||
}
|
||||
else if (coder->MethodID == k_BCJ)
|
||||
{
|
||||
UInt32 state;
|
||||
if (ci != 1)
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
x86_Convert_Init(state);
|
||||
x86_Convert(outBuffer, outSize, 0, &state, 0);
|
||||
}
|
||||
else if (coder->MethodID == k_BCJ2)
|
||||
{
|
||||
UInt64 offset = GetSum(packSizes, 1);
|
||||
UInt64 s3Size = packSizes[1];
|
||||
SRes res;
|
||||
if (ci != 3)
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
RINOK(LookInStream_SeekTo(inStream, startPos + offset));
|
||||
tempSizes[2] = (SizeT)s3Size;
|
||||
if (tempSizes[2] != s3Size)
|
||||
return SZ_ERROR_MEM;
|
||||
tempBuf[2] = (Byte *)IAlloc_Alloc(allocMain, tempSizes[2]);
|
||||
if (tempBuf[2] == 0 && tempSizes[2] != 0)
|
||||
return SZ_ERROR_MEM;
|
||||
res = SzDecodeCopy(s3Size, inStream, tempBuf[2]);
|
||||
RINOK(res)
|
||||
|
||||
res = Bcj2_Decode(
|
||||
tempBuf3, tempSize3,
|
||||
tempBuf[0], tempSizes[0],
|
||||
tempBuf[1], tempSizes[1],
|
||||
tempBuf[2], tempSizes[2],
|
||||
outBuffer, outSize);
|
||||
RINOK(res)
|
||||
}
|
||||
else
|
||||
return SZ_ERROR_UNSUPPORTED;
|
||||
}
|
||||
return SZ_OK;
|
||||
}
|
||||
|
||||
SRes SzDecode(const UInt64 *packSizes, const CSzFolder *folder,
|
||||
ILookInStream *inStream, UInt64 startPos,
|
||||
Byte *outBuffer, size_t outSize, ISzAlloc *allocMain)
|
||||
{
|
||||
Byte *tempBuf[3] = { 0, 0, 0};
|
||||
int i;
|
||||
SRes res = SzDecode2(packSizes, folder, inStream, startPos,
|
||||
outBuffer, (SizeT)outSize, allocMain, tempBuf);
|
||||
for (i = 0; i < 3; i++)
|
||||
IAlloc_Free(allocMain, tempBuf[i]);
|
||||
return res;
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
/* 7zDecode.h -- Decoding from 7z folder
|
||||
2008-11-23 : Igor Pavlov : Public domain */
|
||||
|
||||
#ifndef __7Z_DECODE_H
|
||||
#define __7Z_DECODE_H
|
||||
|
||||
#include "7zItem.h"
|
||||
|
||||
SRes SzDecode(const UInt64 *packSizes, const CSzFolder *folder,
|
||||
ILookInStream *stream, UInt64 startPos,
|
||||
Byte *outBuffer, size_t outSize, ISzAlloc *allocMain);
|
||||
|
||||
#endif
|
|
@ -1,93 +0,0 @@
|
|||
/* 7zExtract.c -- Extracting from 7z archive
|
||||
2008-11-23 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "7zCrc.h"
|
||||
#include "7zDecode.h"
|
||||
#include "7zExtract.h"
|
||||
|
||||
SRes SzAr_Extract(
|
||||
const CSzArEx *p,
|
||||
ILookInStream *inStream,
|
||||
UInt32 fileIndex,
|
||||
UInt32 *blockIndex,
|
||||
Byte **outBuffer,
|
||||
size_t *outBufferSize,
|
||||
size_t *offset,
|
||||
size_t *outSizeProcessed,
|
||||
ISzAlloc *allocMain,
|
||||
ISzAlloc *allocTemp)
|
||||
{
|
||||
UInt32 folderIndex = p->FileIndexToFolderIndexMap[fileIndex];
|
||||
SRes res = SZ_OK;
|
||||
*offset = 0;
|
||||
*outSizeProcessed = 0;
|
||||
if (folderIndex == (UInt32)-1)
|
||||
{
|
||||
IAlloc_Free(allocMain, *outBuffer);
|
||||
*blockIndex = folderIndex;
|
||||
*outBuffer = 0;
|
||||
*outBufferSize = 0;
|
||||
return SZ_OK;
|
||||
}
|
||||
|
||||
if (*outBuffer == 0 || *blockIndex != folderIndex)
|
||||
{
|
||||
CSzFolder *folder = p->db.Folders + folderIndex;
|
||||
UInt64 unpackSizeSpec = SzFolder_GetUnpackSize(folder);
|
||||
size_t unpackSize = (size_t)unpackSizeSpec;
|
||||
UInt64 startOffset = SzArEx_GetFolderStreamPos(p, folderIndex, 0);
|
||||
|
||||
if (unpackSize != unpackSizeSpec)
|
||||
return SZ_ERROR_MEM;
|
||||
*blockIndex = folderIndex;
|
||||
IAlloc_Free(allocMain, *outBuffer);
|
||||
*outBuffer = 0;
|
||||
|
||||
RINOK(LookInStream_SeekTo(inStream, startOffset));
|
||||
|
||||
if (res == SZ_OK)
|
||||
{
|
||||
*outBufferSize = unpackSize;
|
||||
if (unpackSize != 0)
|
||||
{
|
||||
*outBuffer = (Byte *)IAlloc_Alloc(allocMain, unpackSize);
|
||||
if (*outBuffer == 0)
|
||||
res = SZ_ERROR_MEM;
|
||||
}
|
||||
if (res == SZ_OK)
|
||||
{
|
||||
res = SzDecode(p->db.PackSizes +
|
||||
p->FolderStartPackStreamIndex[folderIndex], folder,
|
||||
inStream, startOffset,
|
||||
*outBuffer, unpackSize, allocTemp);
|
||||
if (res == SZ_OK)
|
||||
{
|
||||
if (folder->UnpackCRCDefined)
|
||||
{
|
||||
if (CrcCalc(*outBuffer, unpackSize) != folder->UnpackCRC)
|
||||
res = SZ_ERROR_CRC;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (res == SZ_OK)
|
||||
{
|
||||
UInt32 i;
|
||||
CSzFileItem *fileItem = p->db.Files + fileIndex;
|
||||
*offset = 0;
|
||||
for (i = p->FolderStartFileIndex[folderIndex]; i < fileIndex; i++)
|
||||
*offset += (UInt32)p->db.Files[i].Size;
|
||||
*outSizeProcessed = (size_t)fileItem->Size;
|
||||
if (*offset + *outSizeProcessed > *outBufferSize)
|
||||
return SZ_ERROR_FAIL;
|
||||
{
|
||||
if (fileItem->FileCRCDefined)
|
||||
{
|
||||
if (CrcCalc(*outBuffer + *offset, *outSizeProcessed) != fileItem->FileCRC)
|
||||
res = SZ_ERROR_CRC;
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
/* 7zExtract.h -- Extracting from 7z archive
|
||||
2008-11-23 : Igor Pavlov : Public domain */
|
||||
|
||||
#ifndef __7Z_EXTRACT_H
|
||||
#define __7Z_EXTRACT_H
|
||||
|
||||
#include "7zIn.h"
|
||||
|
||||
/*
|
||||
SzExtract extracts file from archive
|
||||
|
||||
*outBuffer must be 0 before first call for each new archive.
|
||||
|
||||
Extracting cache:
|
||||
If you need to decompress more than one file, you can send
|
||||
these values from previous call:
|
||||
*blockIndex,
|
||||
*outBuffer,
|
||||
*outBufferSize
|
||||
You can consider "*outBuffer" as cache of solid block. If your archive is solid,
|
||||
it will increase decompression speed.
|
||||
|
||||
If you use external function, you can declare these 3 cache variables
|
||||
(blockIndex, outBuffer, outBufferSize) as static in that external function.
|
||||
|
||||
Free *outBuffer and set *outBuffer to 0, if you want to flush cache.
|
||||
*/
|
||||
|
||||
SRes SzAr_Extract(
|
||||
const CSzArEx *db,
|
||||
ILookInStream *inStream,
|
||||
UInt32 fileIndex, /* index of file */
|
||||
UInt32 *blockIndex, /* index of solid block */
|
||||
Byte **outBuffer, /* pointer to pointer to output buffer (allocated with allocMain) */
|
||||
size_t *outBufferSize, /* buffer size for output buffer */
|
||||
size_t *offset, /* offset of stream for required file in *outBuffer */
|
||||
size_t *outSizeProcessed, /* size of file in *outBuffer */
|
||||
ISzAlloc *allocMain,
|
||||
ISzAlloc *allocTemp);
|
||||
|
||||
#endif
|
|
@ -1,6 +0,0 @@
|
|||
/* 7zHeader.c -- 7z Headers
|
||||
2008-10-04 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "7zHeader.h"
|
||||
|
||||
Byte k7zSignature[k7zSignatureSize] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C};
|
|
@ -1,57 +0,0 @@
|
|||
/* 7zHeader.h -- 7z Headers
|
||||
2008-10-04 : Igor Pavlov : Public domain */
|
||||
|
||||
#ifndef __7Z_HEADER_H
|
||||
#define __7Z_HEADER_H
|
||||
|
||||
#include "Types.h"
|
||||
|
||||
#define k7zSignatureSize 6
|
||||
extern Byte k7zSignature[k7zSignatureSize];
|
||||
|
||||
#define k7zMajorVersion 0
|
||||
|
||||
#define k7zStartHeaderSize 0x20
|
||||
|
||||
enum EIdEnum
|
||||
{
|
||||
k7zIdEnd,
|
||||
|
||||
k7zIdHeader,
|
||||
|
||||
k7zIdArchiveProperties,
|
||||
|
||||
k7zIdAdditionalStreamsInfo,
|
||||
k7zIdMainStreamsInfo,
|
||||
k7zIdFilesInfo,
|
||||
|
||||
k7zIdPackInfo,
|
||||
k7zIdUnpackInfo,
|
||||
k7zIdSubStreamsInfo,
|
||||
|
||||
k7zIdSize,
|
||||
k7zIdCRC,
|
||||
|
||||
k7zIdFolder,
|
||||
|
||||
k7zIdCodersUnpackSize,
|
||||
k7zIdNumUnpackStream,
|
||||
|
||||
k7zIdEmptyStream,
|
||||
k7zIdEmptyFile,
|
||||
k7zIdAnti,
|
||||
|
||||
k7zIdName,
|
||||
k7zIdCTime,
|
||||
k7zIdATime,
|
||||
k7zIdMTime,
|
||||
k7zIdWinAttributes,
|
||||
k7zIdComment,
|
||||
|
||||
k7zIdEncodedHeader,
|
||||
|
||||
k7zIdStartPos,
|
||||
k7zIdDummy
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,41 +0,0 @@
|
|||
/* 7zIn.h -- 7z Input functions
|
||||
2008-11-23 : Igor Pavlov : Public domain */
|
||||
|
||||
#ifndef __7Z_IN_H
|
||||
#define __7Z_IN_H
|
||||
|
||||
#include "7zHeader.h"
|
||||
#include "7zItem.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CSzAr db;
|
||||
|
||||
UInt64 startPosAfterHeader;
|
||||
UInt64 dataPos;
|
||||
|
||||
UInt32 *FolderStartPackStreamIndex;
|
||||
UInt64 *PackStreamStartPositions;
|
||||
UInt32 *FolderStartFileIndex;
|
||||
UInt32 *FileIndexToFolderIndexMap;
|
||||
} CSzArEx;
|
||||
|
||||
void SzArEx_Init(CSzArEx *p);
|
||||
void SzArEx_Free(CSzArEx *p, ISzAlloc *alloc);
|
||||
UInt64 SzArEx_GetFolderStreamPos(const CSzArEx *p, UInt32 folderIndex, UInt32 indexInFolder);
|
||||
int SzArEx_GetFolderFullPackSize(const CSzArEx *p, UInt32 folderIndex, UInt64 *resSize);
|
||||
|
||||
/*
|
||||
Errors:
|
||||
SZ_ERROR_NO_ARCHIVE
|
||||
SZ_ERROR_ARCHIVE
|
||||
SZ_ERROR_UNSUPPORTED
|
||||
SZ_ERROR_MEM
|
||||
SZ_ERROR_CRC
|
||||
SZ_ERROR_INPUT_EOF
|
||||
SZ_ERROR_FAIL
|
||||
*/
|
||||
|
||||
SRes SzArEx_Open(CSzArEx *p, ILookInStream *inStream, ISzAlloc *allocMain, ISzAlloc *allocTemp);
|
||||
|
||||
#endif
|
|
@ -1,127 +0,0 @@
|
|||
/* 7zItem.c -- 7z Items
|
||||
2008-10-04 : Igor Pavlov : Public domain */
|
||||
|
||||
#include "7zItem.h"
|
||||
|
||||
void SzCoderInfo_Init(CSzCoderInfo *p)
|
||||
{
|
||||
Buf_Init(&p->Props);
|
||||
}
|
||||
|
||||
void SzCoderInfo_Free(CSzCoderInfo *p, ISzAlloc *alloc)
|
||||
{
|
||||
Buf_Free(&p->Props, alloc);
|
||||
SzCoderInfo_Init(p);
|
||||
}
|
||||
|
||||
void SzFolder_Init(CSzFolder *p)
|
||||
{
|
||||
p->Coders = 0;
|
||||
p->BindPairs = 0;
|
||||
p->PackStreams = 0;
|
||||
p->UnpackSizes = 0;
|
||||
p->NumCoders = 0;
|
||||
p->NumBindPairs = 0;
|
||||
p->NumPackStreams = 0;
|
||||
p->UnpackCRCDefined = 0;
|
||||
p->UnpackCRC = 0;
|
||||
p->NumUnpackStreams = 0;
|
||||
}
|
||||
|
||||
void SzFolder_Free(CSzFolder *p, ISzAlloc *alloc)
|
||||
{
|
||||
UInt32 i;
|
||||
if (p->Coders)
|
||||
for (i = 0; i < p->NumCoders; i++)
|
||||
SzCoderInfo_Free(&p->Coders[i], alloc);
|
||||
IAlloc_Free(alloc, p->Coders);
|
||||
IAlloc_Free(alloc, p->BindPairs);
|
||||
IAlloc_Free(alloc, p->PackStreams);
|
||||
IAlloc_Free(alloc, p->UnpackSizes);
|
||||
SzFolder_Init(p);
|
||||
}
|
||||
|
||||
UInt32 SzFolder_GetNumOutStreams(CSzFolder *p)
|
||||
{
|
||||
UInt32 result = 0;
|
||||
UInt32 i;
|
||||
for (i = 0; i < p->NumCoders; i++)
|
||||
result += p->Coders[i].NumOutStreams;
|
||||
return result;
|
||||
}
|
||||
|
||||
int SzFolder_FindBindPairForInStream(CSzFolder *p, UInt32 inStreamIndex)
|
||||
{
|
||||
UInt32 i;
|
||||
for (i = 0; i < p->NumBindPairs; i++)
|
||||
if (p->BindPairs[i].InIndex == inStreamIndex)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int SzFolder_FindBindPairForOutStream(CSzFolder *p, UInt32 outStreamIndex)
|
||||
{
|
||||
UInt32 i;
|
||||
for (i = 0; i < p->NumBindPairs; i++)
|
||||
if (p->BindPairs[i].OutIndex == outStreamIndex)
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
||||
UInt64 SzFolder_GetUnpackSize(CSzFolder *p)
|
||||
{
|
||||
int i = (int)SzFolder_GetNumOutStreams(p);
|
||||
if (i == 0)
|
||||
return 0;
|
||||
for (i--; i >= 0; i--)
|
||||
if (SzFolder_FindBindPairForOutStream(p, i) < 0)
|
||||
return p->UnpackSizes[i];
|
||||
/* throw 1; */
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SzFile_Init(CSzFileItem *p)
|
||||
{
|
||||
p->HasStream = 1;
|
||||
p->IsDir = 0;
|
||||
p->IsAnti = 0;
|
||||
p->FileCRCDefined = 0;
|
||||
p->MTimeDefined = 0;
|
||||
p->Name = 0;
|
||||
}
|
||||
|
||||
static void SzFile_Free(CSzFileItem *p, ISzAlloc *alloc)
|
||||
{
|
||||
IAlloc_Free(alloc, p->Name);
|
||||
SzFile_Init(p);
|
||||
}
|
||||
|
||||
void SzAr_Init(CSzAr *p)
|
||||
{
|
||||
p->PackSizes = 0;
|
||||
p->PackCRCsDefined = 0;
|
||||
p->PackCRCs = 0;
|
||||
p->Folders = 0;
|
||||
p->Files = 0;
|
||||
p->NumPackStreams = 0;
|
||||
p->NumFolders = 0;
|
||||
p->NumFiles = 0;
|
||||
}
|
||||
|
||||
void SzAr_Free(CSzAr *p, ISzAlloc *alloc)
|
||||
{
|
||||
UInt32 i;
|
||||
if (p->Folders)
|
||||
for (i = 0; i < p->NumFolders; i++)
|
||||
SzFolder_Free(&p->Folders[i], alloc);
|
||||
if (p->Files)
|
||||
for (i = 0; i < p->NumFiles; i++)
|
||||
SzFile_Free(&p->Files[i], alloc);
|
||||
IAlloc_Free(alloc, p->PackSizes);
|
||||
IAlloc_Free(alloc, p->PackCRCsDefined);
|
||||
IAlloc_Free(alloc, p->PackCRCs);
|
||||
IAlloc_Free(alloc, p->Folders);
|
||||
IAlloc_Free(alloc, p->Files);
|
||||
SzAr_Init(p);
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
/* 7zItem.h -- 7z Items
|
||||
2008-10-04 : Igor Pavlov : Public domain */
|
||||
|
||||
#ifndef __7Z_ITEM_H
|
||||
#define __7Z_ITEM_H
|
||||
|
||||
#include "7zBuf.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UInt32 NumInStreams;
|
||||
UInt32 NumOutStreams;
|
||||
UInt64 MethodID;
|
||||
CBuf Props;
|
||||
} CSzCoderInfo;
|
||||
|
||||
void SzCoderInfo_Init(CSzCoderInfo *p);
|
||||
void SzCoderInfo_Free(CSzCoderInfo *p, ISzAlloc *alloc);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UInt32 InIndex;
|
||||
UInt32 OutIndex;
|
||||
} CBindPair;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CSzCoderInfo *Coders;
|
||||
CBindPair *BindPairs;
|
||||
UInt32 *PackStreams;
|
||||
UInt64 *UnpackSizes;
|
||||
UInt32 NumCoders;
|
||||
UInt32 NumBindPairs;
|
||||
UInt32 NumPackStreams;
|
||||
int UnpackCRCDefined;
|
||||
UInt32 UnpackCRC;
|
||||
|
||||
UInt32 NumUnpackStreams;
|
||||
} CSzFolder;
|
||||
|
||||
void SzFolder_Init(CSzFolder *p);
|
||||
UInt64 SzFolder_GetUnpackSize(CSzFolder *p);
|
||||
int SzFolder_FindBindPairForInStream(CSzFolder *p, UInt32 inStreamIndex);
|
||||
UInt32 SzFolder_GetNumOutStreams(CSzFolder *p);
|
||||
UInt64 SzFolder_GetUnpackSize(CSzFolder *p);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UInt32 Low;
|
||||
UInt32 High;
|
||||
} CNtfsFileTime;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
CNtfsFileTime MTime;
|
||||
UInt64 Size;
|
||||
char *Name;
|
||||
UInt32 FileCRC;
|
||||
|
||||
Byte HasStream;
|
||||
Byte IsDir;
|
||||
Byte IsAnti;
|
||||
Byte FileCRCDefined;
|
||||
Byte MTimeDefined;
|
||||
} CSzFileItem;
|
||||
|
||||
void SzFile_Init(CSzFileItem *p);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UInt64 *PackSizes;
|
||||
Byte *PackCRCsDefined;
|
||||
UInt32 *PackCRCs;
|
||||
CSzFolder *Folders;
|
||||
CSzFileItem *Files;
|
||||
UInt32 NumPackStreams;
|
||||
UInt32 NumFolders;
|
||||
UInt32 NumFiles;
|
||||
} CSzAr;
|
||||
|
||||
void SzAr_Init(CSzAr *p);
|
||||
void SzAr_Free(CSzAr *p, ISzAlloc *alloc);
|
||||
|
||||
#endif
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#include "options.h"
|
||||
#include "uae.h"
|
||||
#include "memory.h"
|
||||
#include "include/memory.h"
|
||||
#include "custom.h"
|
||||
#include "newcpu.h"
|
||||
#include "autoconf.h"
|
||||
|
@ -33,7 +33,7 @@ DECLARE_MEMORY_FUNCTIONS(rtarea);
|
|||
addrbank rtarea_bank = {
|
||||
rtarea_lget, rtarea_wget, rtarea_bget,
|
||||
rtarea_lput, rtarea_wput, rtarea_bput,
|
||||
rtarea_xlate, rtarea_check, NULL, _T("rtarea"), _T("UAE Boot ROM"),
|
||||
rtarea_xlate, rtarea_check, nullptr, _T("rtarea"), _T("UAE Boot ROM"),
|
||||
rtarea_lget, rtarea_wget,
|
||||
ABFLAG_ROMIN, S_READ, S_WRITE
|
||||
};
|
||||
|
@ -123,7 +123,7 @@ static void REGPARAM2 rtarea_wput(uaecptr addr, uae_u32 value)
|
|||
uaecptr addr2 = addr - RTAREA_TRAP_STATUS;
|
||||
|
||||
rtarea_bank.baseaddr[addr + 0] = value >> 8;
|
||||
rtarea_bank.baseaddr[addr + 1] = (uae_u8)value;
|
||||
rtarea_bank.baseaddr[addr + 1] = uae_u8(value);
|
||||
}
|
||||
|
||||
static void REGPARAM2 rtarea_lput(uaecptr addr, uae_u32 value)
|
||||
|
@ -161,7 +161,7 @@ static int rt_straddr;
|
|||
|
||||
uae_u32 addr(int ptr)
|
||||
{
|
||||
return (uae_u32)ptr + rtarea_base;
|
||||
return uae_u32(ptr) + rtarea_base;
|
||||
}
|
||||
|
||||
void db(uae_u8 data)
|
||||
|
@ -171,8 +171,8 @@ void db(uae_u8 data)
|
|||
|
||||
void dw(uae_u16 data)
|
||||
{
|
||||
rtarea_bank.baseaddr[rt_addr++] = (uae_u8)(data >> 8);
|
||||
rtarea_bank.baseaddr[rt_addr++] = (uae_u8)data;
|
||||
rtarea_bank.baseaddr[rt_addr++] = uae_u8(data >> 8);
|
||||
rtarea_bank.baseaddr[rt_addr++] = uae_u8(data);
|
||||
}
|
||||
|
||||
void dl(uae_u32 data)
|
||||
|
@ -195,13 +195,11 @@ uae_u8 dbg(uaecptr addr)
|
|||
|
||||
uae_u32 ds_ansi(const uae_char *str)
|
||||
{
|
||||
int len;
|
||||
|
||||
if (!str)
|
||||
return addr(rt_straddr);
|
||||
len = strlen(str) + 1;
|
||||
int len = strlen(str) + 1;
|
||||
rt_straddr -= len;
|
||||
strcpy((uae_char*)rtarea_bank.baseaddr + rt_straddr, str);
|
||||
strcpy(reinterpret_cast<uae_char*>(rtarea_bank.baseaddr) + rt_straddr, str);
|
||||
return addr(rt_straddr);
|
||||
}
|
||||
|
||||
|
@ -215,14 +213,12 @@ uae_u32 ds(const TCHAR *str)
|
|||
|
||||
uae_u32 ds_bstr_ansi(const uae_char *str)
|
||||
{
|
||||
int len;
|
||||
|
||||
len = strlen(str) + 2;
|
||||
int len = strlen(str) + 2;
|
||||
rt_straddr -= len;
|
||||
while (rt_straddr & 3)
|
||||
rt_straddr--;
|
||||
rtarea_bank.baseaddr[rt_straddr] = len - 2;
|
||||
strcpy((uae_char*)rtarea_bank.baseaddr + rt_straddr + 1, str);
|
||||
strcpy(reinterpret_cast<uae_char*>(rtarea_bank.baseaddr) + rt_straddr + 1, str);
|
||||
return addr(rt_straddr) >> 2;
|
||||
}
|
||||
|
||||
|
@ -276,7 +272,7 @@ void rtarea_init_mem(void)
|
|||
if (!mapped_malloc(&rtarea_bank)) {
|
||||
write_log(_T("virtual memory exhausted (rtarea)!\n"));
|
||||
target_startup_msg(_T("Internal error"), _T("Virtual memory exhausted (rtarea)."));
|
||||
uae_restart(1, NULL);
|
||||
uae_restart(1, nullptr);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -288,7 +284,6 @@ void rtarea_free(void)
|
|||
|
||||
void rtarea_init(void)
|
||||
{
|
||||
uae_u32 a;
|
||||
TCHAR uaever[100];
|
||||
|
||||
rt_straddr = 0xFF00 - 2;
|
||||
|
@ -315,7 +310,7 @@ void rtarea_init(void)
|
|||
|
||||
deftrap(NULL); /* Generic emulator trap */
|
||||
|
||||
a = here();
|
||||
uae_u32 a = here();
|
||||
/* Dummy trap - removing this breaks the filesys emulation. */
|
||||
org(rtarea_base + 0xFF00);
|
||||
calltrap(deftrap2(nullfunc, TRAPFLAG_NO_RETVAL, _T("")));
|
||||
|
@ -334,7 +329,7 @@ void rtarea_init(void)
|
|||
if (uae_boot_rom_size >= RTAREA_TRAPS) {
|
||||
write_log(_T("RTAREA_TRAPS needs to be increased!"));
|
||||
target_startup_msg(_T("Internal error"), _T("RTAREA_TRAPS needs to be increased."));
|
||||
uae_restart(1, NULL);
|
||||
uae_restart(1, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "sysdeps.h"
|
||||
|
||||
#include "options.h"
|
||||
#include "memory.h"
|
||||
#include "include/memory.h"
|
||||
#include "rommgr.h"
|
||||
#include "custom.h"
|
||||
#include "newcpu.h"
|
||||
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include "cda_play.h"
|
||||
#include "archivers/mp2/kjmp2.h"
|
||||
#ifdef PANDORA
|
||||
#ifdef AMIBERRY
|
||||
extern "C" {
|
||||
#include "mpeg2dec/mpeg2.h"
|
||||
#include "mpeg2dec/mpeg2convert.h"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "sysdeps.h"
|
||||
|
||||
#include "options.h"
|
||||
#include "memory.h"
|
||||
#include "include/memory.h"
|
||||
#include "cd32_fmv.h"
|
||||
#include "custom.h"
|
||||
#include "xwin.h"
|
||||
|
@ -47,7 +47,7 @@ void cd32_fmv_new_image(int w, int h, int d, uae_u8 *s)
|
|||
{
|
||||
if (!mpeg_out_buffer)
|
||||
mpeg_out_buffer = xmalloc(uae_u8, MAX_MPEG_WIDTH * MAX_MPEG_HEIGHT * MPEG_PIXBYTES_32);
|
||||
if (s == NULL || w > MAX_MPEG_WIDTH || h > MAX_MPEG_HEIGHT) {
|
||||
if (s == nullptr || w > MAX_MPEG_WIDTH || h > MAX_MPEG_HEIGHT) {
|
||||
memset(mpeg_out_buffer, 0, MAX_MPEG_WIDTH * MAX_MPEG_HEIGHT * MPEG_PIXBYTES_32);
|
||||
mpeg_width = MAX_MPEG_WIDTH;
|
||||
mpeg_height = MAX_MPEG_HEIGHT;
|
||||
|
@ -72,11 +72,11 @@ static void genlock_32(struct vidbuffer *vbin, struct vidbuffer *vbout, int w, i
|
|||
for (int hh = 0, sh = -voffset; hh < h; sh++, hh += mult) {
|
||||
for (int h2 = 0; h2 < mult; h2++) {
|
||||
uae_u8 *d8 = vbout->bufmem + vbout->rowbytes * (hh + h2 + voffset);
|
||||
uae_u32 *d32 = (uae_u32*)d8;
|
||||
uae_u32 *d32 = reinterpret_cast<uae_u32*>(d8);
|
||||
uae_u8 *s8 = vbin->bufmem + vbin->rowbytes * (hh + h2 + voffset) ;
|
||||
uae_u32 *srcp = NULL;
|
||||
uae_u32 *srcp = nullptr;
|
||||
if (sh >= 0 && sh < mpeg_height)
|
||||
srcp = (uae_u32*)(mpeg_out_buffer + sh * mpeg_width * MPEG_PIXBYTES_32);
|
||||
srcp = reinterpret_cast<uae_u32*>(mpeg_out_buffer + sh * mpeg_width * MPEG_PIXBYTES_32);
|
||||
for (int ww = 0, sw = -hoffset; ww < w; sw++, ww += mult) {
|
||||
uae_u32 sv = fmv_border_color;
|
||||
if (sw >= 0 && sw < mpeg_width && srcp)
|
||||
|
@ -84,7 +84,7 @@ static void genlock_32(struct vidbuffer *vbin, struct vidbuffer *vbout, int w, i
|
|||
for (int w2 = 0; w2 < mult; w2++) {
|
||||
uae_u32 v;
|
||||
if (s8[0] >= GENLOCK_VAL_32) {
|
||||
v = *((uae_u32*)s8);
|
||||
v = *reinterpret_cast<uae_u32*>(s8);
|
||||
} else {
|
||||
v = sv;
|
||||
}
|
||||
|
@ -101,19 +101,19 @@ static void genlock_16(struct vidbuffer *vbin, struct vidbuffer *vbout, int w, i
|
|||
for (int hh = 0, sh = -voffset; hh < h; sh++, hh += mult) {
|
||||
for (int h2 = 0; h2 < mult; h2++) {
|
||||
uae_u8 *d8 = vbout->bufmem + vbout->rowbytes * (hh + h2 + voffset);
|
||||
uae_u16 *d16 = (uae_u16*)d8;
|
||||
uae_u16 *d16 = reinterpret_cast<uae_u16*>(d8);
|
||||
uae_u8 *s8 = vbin->bufmem + vbin->rowbytes * (hh + h2 + voffset) ;
|
||||
uae_u16 *srcp = NULL;
|
||||
uae_u16 *srcp = nullptr;
|
||||
if (sh >= 0 && sh < mpeg_height)
|
||||
srcp = (uae_u16*)(mpeg_out_buffer + sh * mpeg_width * MPEG_PIXBYTES_16);
|
||||
srcp = reinterpret_cast<uae_u16*>(mpeg_out_buffer + sh * mpeg_width * MPEG_PIXBYTES_16);
|
||||
for (int ww = 0, sw = -hoffset; ww < w; sw++, ww += mult) {
|
||||
uae_u16 sv = fmv_border_color_16;
|
||||
if (sw >= 0 && sw < mpeg_width && srcp)
|
||||
sv = srcp[sw];
|
||||
for (int w2 = 0; w2 < mult; w2++) {
|
||||
uae_u32 v;
|
||||
if ((((uae_u16*)s8)[0] >> 11) >= GENLOCK_VAL_16) {
|
||||
v = *((uae_u16*)s8);
|
||||
if ((reinterpret_cast<uae_u16*>(s8)[0] >> 11) >= GENLOCK_VAL_16) {
|
||||
v = *reinterpret_cast<uae_u16*>(s8);
|
||||
} else {
|
||||
v = sv;
|
||||
}
|
||||
|
@ -129,18 +129,18 @@ static void genlock_16_nomult(struct vidbuffer *vbin, struct vidbuffer *vbout, i
|
|||
{
|
||||
for (int hh = 0, sh = -voffset; hh < h; sh++, hh++) {
|
||||
uae_u8 *d8 = vbout->bufmem + vbout->rowbytes * (hh + voffset);
|
||||
uae_u16 *d16 = (uae_u16*)d8;
|
||||
uae_u16 *d16 = reinterpret_cast<uae_u16*>(d8);
|
||||
uae_u8 *s8 = vbin->bufmem + vbin->rowbytes * (hh + voffset) ;
|
||||
uae_u16 *srcp = NULL;
|
||||
if (sh >= 0 && sh < mpeg_height)
|
||||
srcp = (uae_u16*)(mpeg_out_buffer + sh * mpeg_width * MPEG_PIXBYTES_16);
|
||||
srcp = reinterpret_cast<uae_u16*>(mpeg_out_buffer + sh * mpeg_width * MPEG_PIXBYTES_16);
|
||||
for (int ww = 0, sw = -hoffset; ww < w; sw++, ww++) {
|
||||
uae_u16 sv = fmv_border_color_16;
|
||||
if (sw >= 0 && sw < mpeg_width && srcp)
|
||||
sv = srcp[sw];
|
||||
uae_u32 v;
|
||||
if ((((uae_u16*)s8)[0] >> 11) >= GENLOCK_VAL_16) {
|
||||
v = *((uae_u16*)s8);
|
||||
if ((reinterpret_cast<uae_u16*>(s8)[0] >> 11) >= GENLOCK_VAL_16) {
|
||||
v = *reinterpret_cast<uae_u16*>(s8);
|
||||
} else {
|
||||
v = sv;
|
||||
}
|
||||
|
@ -152,7 +152,6 @@ static void genlock_16_nomult(struct vidbuffer *vbin, struct vidbuffer *vbout, i
|
|||
|
||||
void cd32_fmv_genlock(struct vidbuffer *vbin, struct vidbuffer *vbout)
|
||||
{
|
||||
int hoffset, voffset, mult;
|
||||
int w = vbin->outwidth;
|
||||
int h = vbin->outheight;
|
||||
int d = vbin->pixbytes;
|
||||
|
@ -160,7 +159,7 @@ void cd32_fmv_genlock(struct vidbuffer *vbin, struct vidbuffer *vbout)
|
|||
if (!mpeg_out_buffer)
|
||||
return;
|
||||
|
||||
mult = 1;
|
||||
int mult = 1;
|
||||
for (;;) {
|
||||
if (mult < 4 && mpeg_width * (mult << 1) <= w + 8 && mpeg_height * (mult << 1) <= h + 8) {
|
||||
mult <<= 1;
|
||||
|
@ -170,8 +169,8 @@ void cd32_fmv_genlock(struct vidbuffer *vbin, struct vidbuffer *vbout)
|
|||
}
|
||||
}
|
||||
|
||||
hoffset = (w / mult - mpeg_width) / 2;
|
||||
voffset = (h / mult - mpeg_height) / 2;
|
||||
int hoffset = (w / mult - mpeg_width) / 2;
|
||||
int voffset = (h / mult - mpeg_height) / 2;
|
||||
|
||||
if (hoffset < 0)
|
||||
hoffset = 0;
|
||||
|
|
2268
src/cfgfile.cpp
2268
src/cfgfile.cpp
File diff suppressed because it is too large
Load diff
|
@ -20,7 +20,7 @@
|
|||
#include "gensound.h"
|
||||
#include "audio.h"
|
||||
#include "sounddep/sound.h"
|
||||
#include "memory.h"
|
||||
#include "include/memory.h"
|
||||
#include "custom.h"
|
||||
#include "newcpu.h"
|
||||
#include "cia.h"
|
||||
|
@ -34,7 +34,7 @@
|
|||
#include "gui.h"
|
||||
#include "picasso96.h"
|
||||
#include "drawing.h"
|
||||
#include "ar.h"
|
||||
#include "include/ar.h"
|
||||
#include "akiko.h"
|
||||
#include "devices.h"
|
||||
|
||||
|
@ -91,9 +91,6 @@ static int cia_hsync;
|
|||
#define LOF_TOGGLES_NEEDED 3
|
||||
static int lof_togglecnt_lace, lof_togglecnt_nlace;
|
||||
|
||||
static uae_u32 sprtaba[256], sprtabb[256];
|
||||
static uae_u32 sprite_ab_merge[256];
|
||||
|
||||
/* Stupid genlock-detection prevention hack.
|
||||
* We should stop calling vsync_handler() and
|
||||
* hstop_handler() completely but it is not
|
||||
|
|
|
@ -29,19 +29,20 @@ extern bool no_gui;
|
|||
#define LED_CD_ACTIVE2 2
|
||||
#define LED_CD_AUDIO 4
|
||||
|
||||
#define LED_POWER 0
|
||||
#define LED_DF0 1
|
||||
#define LED_DF1 2
|
||||
#define LED_DF2 3
|
||||
#define LED_DF3 4
|
||||
#define LED_HD 5
|
||||
#define LED_CD 6
|
||||
#define LED_FPS 7
|
||||
#define LED_CPU 8
|
||||
#define LED_SND 9
|
||||
#define LED_MD 10
|
||||
#define LED_NET 11
|
||||
#define LED_MAX 12
|
||||
#define LED_NONE 0
|
||||
#define LED_POWER 1
|
||||
#define LED_DF0 2
|
||||
#define LED_DF1 3
|
||||
#define LED_DF2 4
|
||||
#define LED_DF3 5
|
||||
#define LED_DFs 6 // Define for any DF* access
|
||||
#define LED_HD 7
|
||||
#define LED_CD 8
|
||||
#define LED_FPS 9
|
||||
#define LED_CPU 10
|
||||
#define LED_SND 11
|
||||
#define LED_MD 12
|
||||
#define LED_MAX 13
|
||||
|
||||
struct gui_info
|
||||
{
|
||||
|
|
|
@ -133,40 +133,28 @@
|
|||
#define KBLED_CAPSLOCKM (1 << KBLED_CAPSLOCKB)
|
||||
#define KBLED_SCROLLLOCKM (1 << KBLED_SCROLLLOCKB)
|
||||
|
||||
enum aks { AKS_ENTERGUI = 0x200, AKS_SCREENSHOT_FILE, AKS_SCREENSHOT_CLIPBOARD, AKS_FREEZEBUTTON,
|
||||
AKS_FLOPPY0, AKS_FLOPPY1, AKS_FLOPPY2, AKS_FLOPPY3,
|
||||
AKS_EFLOPPY0, AKS_EFLOPPY1, AKS_EFLOPPY2, AKS_EFLOPPY3,
|
||||
enum aks {
|
||||
AKS_ENTERGUI = 0x200,
|
||||
AKS_SCREENSHOT_FILE,
|
||||
AKS_SCREENSHOT_CLIPBOARD,
|
||||
AKS_FREEZEBUTTON,
|
||||
AKS_FLOPPY0, AKS_FLOPPY1, AKS_FLOPPY2, AKS_FLOPPY3,
|
||||
AKS_EFLOPPY0, AKS_EFLOPPY1, AKS_EFLOPPY2, AKS_EFLOPPY3,
|
||||
AKS_TOGGLEDEFAULTSCREEN,
|
||||
AKS_TOGGLEWINDOWEDFULLSCREEN, AKS_TOGGLEFULLWINDOWFULLSCREEN, AKS_TOGGLEWINDOWFULLWINDOW,
|
||||
AKS_ENTERDEBUGGER, AKS_IRQ7,
|
||||
AKS_PAUSE, AKS_WARP, AKS_INHIBITSCREEN,
|
||||
AKS_STATEREWIND, AKS_STATECURRENT, AKS_STATECAPTURE,
|
||||
AKS_VIDEORECORD,
|
||||
AKS_VOLDOWN, AKS_VOLUP, AKS_VOLMUTE,
|
||||
AKS_MVOLDOWN, AKS_MVOLUP, AKS_MVOLMUTE,
|
||||
AKS_QUIT, AKS_HARDRESET, AKS_SOFTRESET,
|
||||
AKS_STATESAVEQUICK, AKS_STATERESTOREQUICK,
|
||||
AKS_STATESAVEQUICK1, AKS_STATERESTOREQUICK1,
|
||||
AKS_STATESAVEQUICK2, AKS_STATERESTOREQUICK2,
|
||||
AKS_STATESAVEQUICK3, AKS_STATERESTOREQUICK3,
|
||||
AKS_STATESAVEQUICK4, AKS_STATERESTOREQUICK4,
|
||||
AKS_STATESAVEQUICK5, AKS_STATERESTOREQUICK5,
|
||||
AKS_STATESAVEQUICK6, AKS_STATERESTOREQUICK6,
|
||||
AKS_STATESAVEQUICK7, AKS_STATERESTOREQUICK7,
|
||||
AKS_STATESAVEQUICK8, AKS_STATERESTOREQUICK8,
|
||||
AKS_STATESAVEQUICK9, AKS_STATERESTOREQUICK9,
|
||||
AKS_STATESAVEDIALOG, AKS_STATERESTOREDIALOG,
|
||||
AKS_DECREASEREFRESHRATE,
|
||||
AKS_INCREASEREFRESHRATE,
|
||||
AKS_ARCADIADIAGNOSTICS, AKS_ARCADIAPLY1, AKS_ARCADIAPLY2, AKS_ARCADIACOIN1, AKS_ARCADIACOIN2,
|
||||
AKS_TOGGLEMOUSEGRAB, AKS_SWITCHINTERPOL, AKS_TOGGLERTG,
|
||||
AKS_INPUT_CONFIG_1,AKS_INPUT_CONFIG_2,AKS_INPUT_CONFIG_3,AKS_INPUT_CONFIG_4,
|
||||
AKS_DISKSWAPPER_NEXT,AKS_DISKSWAPPER_PREV,
|
||||
AKS_DISKSWAPPER_INSERT0,AKS_DISKSWAPPER_INSERT1,AKS_DISKSWAPPER_INSERT2,AKS_DISKSWAPPER_INSERT3,
|
||||
AKS_DISK_PREV0, AKS_DISK_PREV1, AKS_DISK_PREV2, AKS_DISK_PREV3,
|
||||
AKS_DISK_NEXT0, AKS_DISK_NEXT1, AKS_DISK_NEXT2, AKS_DISK_NEXT3,
|
||||
AKS_CDTV_FRONT_PANEL_STOP, AKS_CDTV_FRONT_PANEL_PLAYPAUSE, AKS_CDTV_FRONT_PANEL_PREV,
|
||||
AKS_CDTV_FRONT_PANEL_NEXT, AKS_CDTV_FRONT_PANEL_REW, AKS_CDTV_FRONT_PANEL_FF,
|
||||
AKS_TOGGLEWINDOWEDFULLSCREEN,
|
||||
AKS_IRQ7,
|
||||
AKS_PAUSE,
|
||||
AKS_INHIBITSCREEN,
|
||||
AKS_VOLDOWN, AKS_VOLUP, AKS_VOLMUTE,
|
||||
AKS_MVOLDOWN, AKS_MVOLUP, AKS_MVOLMUTE,
|
||||
AKS_QUIT, AKS_HARDRESET, AKS_SOFTRESET,
|
||||
AKS_STATESAVEDIALOG, AKS_STATERESTOREDIALOG,
|
||||
AKS_DECREASEREFRESHRATE,
|
||||
AKS_INCREASEREFRESHRATE,
|
||||
AKS_TOGGLEMOUSEGRAB, AKS_SWITCHINTERPOL,
|
||||
AKS_INPUT_CONFIG_1, AKS_INPUT_CONFIG_2, AKS_INPUT_CONFIG_3, AKS_INPUT_CONFIG_4,
|
||||
AKS_SWAPJOYPORTS,
|
||||
AKS_PASTE,
|
||||
AKS_QUALIFIER1, AKS_QUALIFIER2, AKS_QUALIFIER3, AKS_QUALIFIER4,
|
||||
AKS_QUALIFIER5, AKS_QUALIFIER6, AKS_QUALIFIER7, AKS_QUALIFIER8,
|
||||
AKS_QUALIFIER_SPECIAL, AKS_QUALIFIER_SHIFT, AKS_QUALIFIER_CONTROL,
|
||||
|
|
|
@ -22,13 +22,6 @@ typedef enum { KBD_LANG_US, KBD_LANG_DK, KBD_LANG_DE, KBD_LANG_SE, KBD_LANG_FR,
|
|||
|
||||
extern long int version;
|
||||
|
||||
#define MAX_PATHS 8
|
||||
|
||||
struct multipath
|
||||
{
|
||||
TCHAR path[MAX_PATHS][PATH_MAX];
|
||||
};
|
||||
|
||||
struct strlist {
|
||||
struct strlist *next;
|
||||
TCHAR *option, *value;
|
||||
|
@ -364,10 +357,10 @@ struct uae_prefs
|
|||
int cart_internal;
|
||||
struct cdslot cdslots[MAX_TOTAL_SCSI_DEVICES];
|
||||
|
||||
struct multipath path_floppy;
|
||||
struct multipath path_hardfile;
|
||||
struct multipath path_rom;
|
||||
struct multipath path_cd;
|
||||
TCHAR path_floppy[MAX_DPATH];
|
||||
TCHAR path_hardfile[MAX_DPATH];
|
||||
TCHAR path_rom[MAX_DPATH];
|
||||
TCHAR path_cd[MAX_DPATH];
|
||||
|
||||
int m68k_speed;
|
||||
int cpu_model;
|
||||
|
|
|
@ -40,7 +40,7 @@ extern uae_u32 getlocaltime (void);
|
|||
|
||||
extern int quit_program;
|
||||
|
||||
extern TCHAR start_path_data[256];
|
||||
extern TCHAR start_path_data[MAX_DPATH];
|
||||
|
||||
/* This structure is used to define menus. The val field can hold key
|
||||
* shortcuts, or one of these special codes:
|
||||
|
|
|
@ -26,11 +26,11 @@
|
|||
#include "custom.h"
|
||||
#include "xwin.h"
|
||||
#include "drawing.h"
|
||||
#include "memory.h"
|
||||
#include "include/memory.h"
|
||||
#include "newcpu.h"
|
||||
#include "uae.h"
|
||||
#include "picasso96.h"
|
||||
#include "ar.h"
|
||||
#include "include/ar.h"
|
||||
#include "gui.h"
|
||||
#include "savestate.h"
|
||||
#include "zfile.h"
|
||||
|
@ -39,12 +39,6 @@
|
|||
#include "statusline.h"
|
||||
#include "native2amiga_api.h"
|
||||
|
||||
#if SIZEOF_TCHAR != 1
|
||||
/* FIXME: replace strcasecmp with _tcsicmp in source code instead */
|
||||
#undef strcasecmp
|
||||
#define strcasecmp _tcsicmp
|
||||
#endif
|
||||
|
||||
// 01 = host events
|
||||
// 02 = joystick
|
||||
// 04 = cia buttons
|
||||
|
@ -71,9 +65,9 @@
|
|||
#define DEFEVENT(A, B, C, D, E, F) {_T(#A), B, NULL, C, D, E, F, 0 },
|
||||
#define DEFEVENT2(A, B, B2, C, D, E, F, G) {_T(#A), B, B2, C, D, E, F, G },
|
||||
static const struct inputevent events[] = {
|
||||
{0, 0, 0, AM_K, 0, 0, 0, 0},
|
||||
{nullptr, nullptr, nullptr, AM_K, 0, 0, 0, 0},
|
||||
#include "inputevents.def"
|
||||
{0, 0, 0, 0, 0, 0, 0, 0}
|
||||
{nullptr, nullptr, nullptr, 0, 0, 0, 0, 0}
|
||||
};
|
||||
#undef DEFEVENT
|
||||
#undef DEFEVENT2
|
||||
|
@ -124,9 +118,8 @@ static int temp_uid_cnt[IDTYPE_MAX];
|
|||
|
||||
static int isdevice (struct uae_input_device *id)
|
||||
{
|
||||
int i, j;
|
||||
for (i = 0; i < MAX_INPUT_DEVICE_EVENTS; i++) {
|
||||
for (j = 0; j < MAX_INPUT_SUB_EVENT; j++) {
|
||||
for (int i = 0; i < MAX_INPUT_DEVICE_EVENTS; i++) {
|
||||
for (int j = 0; j < MAX_INPUT_SUB_EVENT; j++) {
|
||||
if (id->eventid[i][j] > 0)
|
||||
return 1;
|
||||
}
|
||||
|
@ -141,16 +134,13 @@ int inputdevice_uaelib (const TCHAR *s, const TCHAR *parm)
|
|||
int i;
|
||||
|
||||
if (!_tcsncmp(s, _T("KEY_RAW_"), 8)) {
|
||||
// KEY_RAW_UP <code>
|
||||
// KEY_RAW_DOWN <code>
|
||||
int v;
|
||||
const TCHAR *value = parm;
|
||||
TCHAR *endptr;
|
||||
int base = 10;
|
||||
int state = _tcscmp(s, _T("KEY_RAW_UP")) ? 1 : 0;
|
||||
if (value[0] == '0' && _totupper(value[1]) == 'X')
|
||||
value += 2, base = 16;
|
||||
v = _tcstol(value, &endptr, base);
|
||||
int v = _tcstol(value, &endptr, base);
|
||||
for (i = 1; events[i].name; i++) {
|
||||
const struct inputevent *ie = &events[i];
|
||||
if (_tcsncmp(ie->confname, _T("KEY_"), 4))
|
||||
|
@ -219,14 +209,14 @@ static struct inputdevice_functions *getidf (int devnum)
|
|||
{
|
||||
int type = gettype (devnum);
|
||||
if (type < 0)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return &idev[type];
|
||||
}
|
||||
|
||||
const struct inputevent *inputdevice_get_eventinfo(int evt)
|
||||
{
|
||||
if (evt > 0 && !events[evt].name)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return &events[evt];
|
||||
}
|
||||
|
||||
|
@ -402,7 +392,7 @@ static struct jport *inputdevice_get_used_device(int portnum, int ageindex)
|
|||
int idx = -1;
|
||||
int used[MAX_STORED_JPORTS] = { 0 };
|
||||
if (ageindex < 0)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
while (ageindex >= 0) {
|
||||
uae_u32 age = 0;
|
||||
idx = -1;
|
||||
|
@ -414,7 +404,7 @@ static struct jport *inputdevice_get_used_device(int portnum, int ageindex)
|
|||
}
|
||||
}
|
||||
if (idx < 0)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
used[idx] = 1;
|
||||
ageindex--;
|
||||
}
|
||||
|
@ -529,7 +519,7 @@ static bool isemptykey(int keyboard, int scancode)
|
|||
for (int k = 0; k < MAX_INPUT_SUB_EVENT; k++) {
|
||||
if (na->eventid[j][k] > 0)
|
||||
return false;
|
||||
if (na->custom[j][k] != NULL)
|
||||
if (na->custom[j][k] != nullptr)
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
@ -548,7 +538,7 @@ static void out_config (struct zfile *f, int id, int num, const TCHAR *s1, const
|
|||
|
||||
static bool write_config_head (struct zfile *f, int idnum, int devnum, const TCHAR *name, struct uae_input_device *id, struct inputdevice_functions *idf)
|
||||
{
|
||||
TCHAR *s = NULL;
|
||||
TCHAR *s = nullptr;
|
||||
TCHAR tmp2[CONFIG_BLEN];
|
||||
|
||||
if (idnum == GAMEPORT_INPUT_SETTINGS) {
|
||||
|
@ -567,7 +557,7 @@ static bool write_config_head (struct zfile *f, int idnum, int devnum, const TCH
|
|||
cfgfile_write_str (f, tmp2, s);
|
||||
}
|
||||
|
||||
s = NULL;
|
||||
s = nullptr;
|
||||
if (id->configname)
|
||||
s = id->configname;
|
||||
else if (devnum < idf->get_num ())
|
||||
|
@ -665,9 +655,9 @@ static void write_config2 (struct zfile *f, int idnum, int i, int offset, const
|
|||
|
||||
evt = id->eventid[io][slotorder[j]];
|
||||
custom = id->custom[io][slotorder[j]];
|
||||
if (custom == NULL && evt <= 0) {
|
||||
if (custom == nullptr && evt <= 0) {
|
||||
for (k = j + 1; k < MAX_INPUT_SUB_EVENT; k++) {
|
||||
if ((id->port[io][k] == 0 || id->port[io][k] == MAX_JPORTS + 1) && (id->eventid[io][slotorder[k]] > 0 || id->custom[io][slotorder[k]] != NULL))
|
||||
if ((id->port[io][k] == 0 || id->port[io][k] == MAX_JPORTS + 1) && (id->eventid[io][slotorder[k]] > 0 || id->custom[io][slotorder[k]] != nullptr))
|
||||
break;
|
||||
}
|
||||
if (k == MAX_INPUT_SUB_EVENT)
|
||||
|
@ -758,7 +748,7 @@ static void write_kbr_config (struct zfile *f, int idnum, int devnum, struct uae
|
|||
isempty = false;
|
||||
break;
|
||||
}
|
||||
if (kbr->custom[i][j] != NULL) {
|
||||
if (kbr->custom[i][j] != nullptr) {
|
||||
isempty = false;
|
||||
break;
|
||||
}
|
||||
|
@ -774,9 +764,9 @@ static void write_kbr_config (struct zfile *f, int idnum, int devnum, struct uae
|
|||
for (j = 0; j < MAX_INPUT_SUB_EVENT; j++) {
|
||||
TCHAR *custom = kbr->custom[i][slotorder[j]];
|
||||
evt = kbr->eventid[i][slotorder[j]];
|
||||
if (custom == NULL && evt <= 0) {
|
||||
if (custom == nullptr && evt <= 0) {
|
||||
for (k = j + 1; k < MAX_INPUT_SUB_EVENT; k++) {
|
||||
if (kbr->eventid[i][slotorder[k]] > 0 || kbr->custom[i][slotorder[k]] != NULL)
|
||||
if (kbr->eventid[i][slotorder[k]] > 0 || kbr->custom[i][slotorder[k]] != nullptr)
|
||||
break;
|
||||
}
|
||||
if (k == MAX_INPUT_SUB_EVENT)
|
||||
|
@ -801,7 +791,7 @@ static void write_kbr_config (struct zfile *f, int idnum, int devnum, struct uae
|
|||
}
|
||||
}
|
||||
}
|
||||
idf->get_widget_type (devnum, i, tmp5, NULL);
|
||||
idf->get_widget_type (devnum, i, tmp5, nullptr);
|
||||
_stprintf (tmp3, _T("%d%s%s"), kbr->extra[i], tmp5[0] ? _T(".") : _T(""), tmp5[0] ? tmp5 : _T(""));
|
||||
kbrlabel (tmp3);
|
||||
_stprintf (tmp1, _T("keyboard.%d.button.%s"), devnum, tmp3);
|
||||
|
@ -827,7 +817,7 @@ static void write_config (struct zfile *f, int idnum, int devnum, const TCHAR *n
|
|||
write_config2 (f, idnum, i, ID_BUTTON_OFFSET, tmp1, id);
|
||||
}
|
||||
|
||||
static const TCHAR *kbtypes[] = { _T("amiga"), _T("pc"), NULL };
|
||||
static const TCHAR *kbtypes[] = { _T("amiga"), _T("pc"), nullptr };
|
||||
|
||||
void write_inputdevice_config (struct uae_prefs *p, struct zfile *f)
|
||||
{
|
||||
|
@ -913,7 +903,7 @@ static TCHAR *getstring (const TCHAR **pp)
|
|||
bool quotedd = false;
|
||||
|
||||
if (*p == 0)
|
||||
return 0;
|
||||
return nullptr;
|
||||
i = 0;
|
||||
while (*p != 0 && i < 1000 - 1) {
|
||||
if (*p == '\"')
|
||||
|
@ -941,7 +931,7 @@ static void reset_inputdevice_settings (struct uae_input_device *uid)
|
|||
uid->flags[l][i] = 0;
|
||||
if (uid->custom[l][i]) {
|
||||
xfree (uid->custom[l][i]);
|
||||
uid->custom[l][i] = NULL;
|
||||
uid->custom[l][i] = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1051,7 +1041,7 @@ static void set_kbr_default (struct uae_prefs *p, int index, int devnum, struct
|
|||
if (input_get_default_keyboard (j))
|
||||
kbr->enabled = 1;
|
||||
for (i = 0; i < id->get_widget_num (j); i++) {
|
||||
id->get_widget_type (j, i, 0, &scancode);
|
||||
id->get_widget_type (j, i, nullptr, &scancode);
|
||||
kbr->extra[i] = scancode;
|
||||
if (j == 0 || kbr->enabled)
|
||||
set_kbr_default_event (kbr, trans, i);
|
||||
|
@ -1126,7 +1116,7 @@ static void setcompakbevent(struct uae_prefs *p, struct uae_input_device *uid, i
|
|||
uid->flags[l][0] &= COMPA_RESERVED_FLAGS;
|
||||
uid->port[l][0] = port + 1;
|
||||
xfree(uid->custom[l][0]);
|
||||
uid->custom[l][0] = NULL;
|
||||
uid->custom[l][0] = nullptr;
|
||||
setautofireevent(uid, l, 0, af, port);
|
||||
}
|
||||
|
||||
|
@ -1233,7 +1223,7 @@ static bool read_slot (const TCHAR *parm, int num, int joystick, int button, str
|
|||
{
|
||||
int mask;
|
||||
|
||||
if (custom == NULL && ie->name == NULL) {
|
||||
if (custom == nullptr && ie->name == nullptr) {
|
||||
if (!_tcscmp (parm, _T("NULL"))) {
|
||||
if (joystick < 0) {
|
||||
id->eventid[keynum][subnum] = 0;
|
||||
|
@ -1301,7 +1291,7 @@ static const struct inputevent *readevent (const TCHAR *name, TCHAR **customp)
|
|||
while (*end && *end != '\'')
|
||||
end++;
|
||||
if (!customp || *end == 0)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
TCHAR *custom = my_strdup (name);
|
||||
custom[end - name] = 0;
|
||||
*customp = custom;
|
||||
|
@ -1311,43 +1301,43 @@ static const struct inputevent *readevent (const TCHAR *name, TCHAR **customp)
|
|||
|
||||
void read_inputdevice_config (struct uae_prefs *pr, const TCHAR *option, TCHAR *value)
|
||||
{
|
||||
struct uae_input_device *id = NULL;
|
||||
struct uae_input_device *id = nullptr;
|
||||
const struct inputevent *ie;
|
||||
int devnum, num, button, joystick, subnum, idnum, keynum, devtype;
|
||||
const TCHAR *p;
|
||||
TCHAR *p2, *custom;
|
||||
struct temp_uids *tid = &temp_uid;
|
||||
struct inputdevice_functions *idf = NULL;
|
||||
struct inputdevice_functions *idf = nullptr;
|
||||
|
||||
option += 6; /* "input." */
|
||||
p = getstring (&option);
|
||||
if (!strcasecmp (p, _T("config"))) {
|
||||
if (!_tcsicmp (p, _T("config"))) {
|
||||
pr->input_selected_setting = _tstol (value) - 1;
|
||||
if (pr->input_selected_setting == -1)
|
||||
pr->input_selected_setting = GAMEPORT_INPUT_SETTINGS;
|
||||
if (pr->input_selected_setting < 0 || pr->input_selected_setting > MAX_INPUT_SETTINGS)
|
||||
pr->input_selected_setting = 0;
|
||||
}
|
||||
if (!strcasecmp (p, _T("joymouse_speed_analog")))
|
||||
if (!_tcsicmp (p, _T("joymouse_speed_analog")))
|
||||
pr->input_joymouse_multiplier = _tstol (value);
|
||||
if (!strcasecmp (p, _T("joymouse_speed_digital")))
|
||||
if (!_tcsicmp (p, _T("joymouse_speed_digital")))
|
||||
pr->input_joymouse_speed = _tstol (value);
|
||||
if (!strcasecmp (p, _T("joystick_deadzone")))
|
||||
if (!_tcsicmp (p, _T("joystick_deadzone")))
|
||||
pr->input_joystick_deadzone = _tstol (value);
|
||||
if (!strcasecmp (p, _T("joymouse_deadzone")))
|
||||
if (!_tcsicmp (p, _T("joymouse_deadzone")))
|
||||
pr->input_joymouse_deadzone = _tstol (value);
|
||||
if (!strcasecmp (p, _T("mouse_speed")))
|
||||
if (!_tcsicmp (p, _T("mouse_speed")))
|
||||
pr->input_mouse_speed = _tstol (value);
|
||||
if (!strcasecmp (p, _T("autofire")))
|
||||
if (!_tcsicmp (p, _T("autofire")))
|
||||
pr->input_autofire_linecnt = _tstol (value) * 312;
|
||||
if (!strcasecmp (p, _T("autofire_speed")))
|
||||
if (!_tcsicmp (p, _T("autofire_speed")))
|
||||
pr->input_autofire_linecnt = _tstol (value);
|
||||
if (!strcasecmp (p, _T("analog_joystick_multiplier")))
|
||||
if (!_tcsicmp (p, _T("analog_joystick_multiplier")))
|
||||
pr->input_analog_joystick_mult = _tstol (value);
|
||||
if (!strcasecmp (p, _T("analog_joystick_offset")))
|
||||
if (!_tcsicmp (p, _T("analog_joystick_offset")))
|
||||
pr->input_analog_joystick_offset = _tstol (value);
|
||||
if (!strcasecmp (p, _T("keyboard_type"))) {
|
||||
cfgfile_strval (option, value, NULL, &pr->input_keyboard_type, kbtypes, 0);
|
||||
if (!_tcsicmp (p, _T("keyboard_type"))) {
|
||||
cfgfile_strval (option, value, nullptr, &pr->input_keyboard_type, kbtypes, 0);
|
||||
keyboard_default = keyboard_default_table[pr->input_keyboard_type];
|
||||
inputdevice_default_kb_all (pr);
|
||||
}
|
||||
|
@ -1534,8 +1524,8 @@ void read_inputdevice_config (struct uae_prefs *pr, const TCHAR *option, TCHAR *
|
|||
}
|
||||
xfree(tid->configname);
|
||||
xfree(tid->name);
|
||||
tid->configname = NULL;
|
||||
tid->name = NULL;
|
||||
tid->configname = nullptr;
|
||||
tid->name = nullptr;
|
||||
}
|
||||
|
||||
if (idnum == GAMEPORT_INPUT_SETTINGS && id->enabled == 0)
|
||||
|
@ -1565,12 +1555,12 @@ void read_inputdevice_config (struct uae_prefs *pr, const TCHAR *option, TCHAR *
|
|||
p = value;
|
||||
|
||||
bool oldcustommapping = false;
|
||||
custom = NULL;
|
||||
custom = nullptr;
|
||||
for (subnum = 0; subnum < MAX_INPUT_SUB_EVENT; subnum++) {
|
||||
uae_u64 flags;
|
||||
int port;
|
||||
xfree (custom);
|
||||
custom = NULL;
|
||||
custom = nullptr;
|
||||
p2 = getstring (&p);
|
||||
if (!p2)
|
||||
break;
|
||||
|
@ -1597,7 +1587,7 @@ void read_inputdevice_config (struct uae_prefs *pr, const TCHAR *option, TCHAR *
|
|||
flags2 = getnum (&p) & ID_FLAG_SAVE_MASK_CONFIG;
|
||||
if (p[-1] == '.' && (p[0] >= 'A' && p[0] <= 'Z') || (p[0] >= 'a' && p[0] <= 'z'))
|
||||
flags |= getqual (&p);
|
||||
TCHAR *custom2 = NULL;
|
||||
TCHAR *custom2 = nullptr;
|
||||
const struct inputevent *ie2 = readevent (p2, &custom2);
|
||||
read_slot (p2, num, joystick, button, id, keynum, SPARE_SUB_EVENT, ie2, flags2, MAX_JPORTS + 1, custom2);
|
||||
}
|
||||
|
@ -1610,7 +1600,7 @@ void read_inputdevice_config (struct uae_prefs *pr, const TCHAR *option, TCHAR *
|
|||
}
|
||||
if (!read_slot (p2, num, joystick, button, id, keynum, subnum, ie, flags, port, custom))
|
||||
continue;
|
||||
custom = NULL;
|
||||
custom = nullptr;
|
||||
}
|
||||
if (joystick < 0 && !oldcustommapping)
|
||||
tid->kbreventcnt[devnum]++;
|
||||
|
@ -1676,7 +1666,7 @@ static void mousehack_reset (void)
|
|||
if (mousehack_address)
|
||||
put_byte_host(mousehack_address + MH_E, 0);
|
||||
}
|
||||
mousehack_address = 0;
|
||||
mousehack_address = nullptr;
|
||||
mousehack_enabled = false;
|
||||
}
|
||||
|
||||
|
@ -2928,7 +2918,7 @@ static int switchdevice (struct uae_input_device *id, int num, bool buttonmode)
|
|||
int newport = 0;
|
||||
int newslot = -1;
|
||||
int flags = 0;
|
||||
TCHAR *name = NULL, *fname = NULL;
|
||||
TCHAR *name = nullptr, *fname = nullptr;
|
||||
int otherbuttonpressed = 0;
|
||||
int acc = input_acquired;
|
||||
|
||||
|
@ -3040,7 +3030,7 @@ static int switchdevice (struct uae_input_device *id, int num, bool buttonmode)
|
|||
} else {
|
||||
inputdevice_joyport_config (&changed_prefs, name, name, newport, -1, 1, true);
|
||||
}
|
||||
inputdevice_validate_jports (&changed_prefs, -1, NULL);
|
||||
inputdevice_validate_jports (&changed_prefs, -1, nullptr);
|
||||
inputdevice_copyconfig (&changed_prefs, &currprefs);
|
||||
if (acc)
|
||||
inputdevice_acquire (TRUE);
|
||||
|
@ -3108,7 +3098,7 @@ static int switchdevice (struct uae_input_device *id, int num, bool buttonmode)
|
|||
write_log (_T("inputdevice input change '%s':%d->%d\n"), name, num, newport);
|
||||
inputdevice_unacquire ();
|
||||
inputdevice_copyconfig (&currprefs, &changed_prefs);
|
||||
inputdevice_validate_jports (&changed_prefs, -1, NULL);
|
||||
inputdevice_validate_jports (&changed_prefs, -1, nullptr);
|
||||
inputdevice_copyconfig (&changed_prefs, &currprefs);
|
||||
if (acc)
|
||||
inputdevice_acquire (TRUE);
|
||||
|
@ -3295,7 +3285,7 @@ static void setbuttonstateall (struct uae_input_device *id, struct uae_input_dev
|
|||
handle_input_event (evt, toggled, 1, autofire);
|
||||
} else {
|
||||
#endif
|
||||
if (!checkqualifiers (evt, flags, qualmask, NULL)) {
|
||||
if (!checkqualifiers (evt, flags, qualmask, nullptr)) {
|
||||
if (!state && !(flags & ID_FLAG_CANRELEASE)) {
|
||||
if (!invert)
|
||||
continue;
|
||||
|
@ -3558,7 +3548,7 @@ int intputdevice_compa_get_eventtype (int evt, const int **axistablep)
|
|||
if (axistable[i + 2] == evt)
|
||||
return IDEV_WIDGET_BUTTONAXIS;
|
||||
}
|
||||
*axistablep = NULL;
|
||||
*axistablep = nullptr;
|
||||
return IDEV_WIDGET_BUTTON;
|
||||
}
|
||||
|
||||
|
@ -3734,17 +3724,17 @@ static void inputdevice_sparerestore (struct uae_input_device *uid, int num, int
|
|||
uid->eventid[num][sub] = 0;
|
||||
uid->flags[num][sub] = 0;
|
||||
xfree (uid->custom[num][sub]);
|
||||
uid->custom[num][sub] = 0;
|
||||
uid->custom[num][sub] = nullptr;
|
||||
}
|
||||
uid->eventid[num][SPARE_SUB_EVENT] = 0;
|
||||
uid->flags[num][SPARE_SUB_EVENT] = 0;
|
||||
uid->port[num][SPARE_SUB_EVENT] = 0;
|
||||
uid->custom[num][SPARE_SUB_EVENT] = 0;
|
||||
uid->custom[num][SPARE_SUB_EVENT] = nullptr;
|
||||
if (uid->flags[num][MAX_INPUT_SUB_EVENT - 1] & ID_FLAG_RESERVEDGAMEPORTSCUSTOM) {
|
||||
uid->eventid[num][MAX_INPUT_SUB_EVENT - 1] = 0;
|
||||
uid->flags[num][MAX_INPUT_SUB_EVENT - 1] = 0;
|
||||
uid->port[num][MAX_INPUT_SUB_EVENT - 1] = 0;
|
||||
uid->custom[num][MAX_INPUT_SUB_EVENT - 1] = 0;
|
||||
uid->custom[num][MAX_INPUT_SUB_EVENT - 1] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3752,19 +3742,19 @@ void inputdevice_sparecopy (struct uae_input_device *uid, int num, int sub)
|
|||
{
|
||||
if (uid->port[num][SPARE_SUB_EVENT] != 0)
|
||||
return;
|
||||
if (uid->eventid[num][sub] <= 0 && uid->custom[num][sub] == NULL) {
|
||||
if (uid->eventid[num][sub] <= 0 && uid->custom[num][sub] == nullptr) {
|
||||
uid->eventid[num][SPARE_SUB_EVENT] = 0;
|
||||
uid->flags[num][SPARE_SUB_EVENT] = 0;
|
||||
uid->port[num][SPARE_SUB_EVENT] = 0;
|
||||
xfree (uid->custom[num][SPARE_SUB_EVENT]);
|
||||
uid->custom[num][SPARE_SUB_EVENT] = NULL;
|
||||
uid->custom[num][SPARE_SUB_EVENT] = nullptr;
|
||||
} else {
|
||||
uid->eventid[num][SPARE_SUB_EVENT] = uid->eventid[num][sub];
|
||||
uid->flags[num][SPARE_SUB_EVENT] = uid->flags[num][sub];
|
||||
uid->port[num][SPARE_SUB_EVENT] = MAX_JPORTS + 1;
|
||||
xfree (uid->custom[num][SPARE_SUB_EVENT]);
|
||||
uid->custom[num][SPARE_SUB_EVENT] = uid->custom[num][sub];
|
||||
uid->custom[num][sub] = NULL;
|
||||
uid->custom[num][sub] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3798,11 +3788,11 @@ int inputdevice_get_compatibility_input (struct uae_prefs *prefs, int index, int
|
|||
{
|
||||
if (index >= MAX_JPORTS || joymodes[index] < 0)
|
||||
return -1;
|
||||
if (typelist != NULL)
|
||||
if (typelist != nullptr)
|
||||
*typelist = joymodes[index];
|
||||
if (at != NULL)
|
||||
if (at != nullptr)
|
||||
*at = axistable;
|
||||
if (inputlist == NULL)
|
||||
if (inputlist == nullptr)
|
||||
return -1;
|
||||
|
||||
//write_log (_T("%d %p %p\n"), *typelist, *inputlist, *at);
|
||||
|
@ -3820,7 +3810,7 @@ int inputdevice_get_compatibility_input (struct uae_prefs *prefs, int index, int
|
|||
int port, k, l;
|
||||
uae_u64 flags;
|
||||
bool ignore = false;
|
||||
int evtnum2 = inputdevice_get_mapping (devnum, j, &flags, &port, NULL, NULL, sub);
|
||||
int evtnum2 = inputdevice_get_mapping (devnum, j, &flags, &port, nullptr, nullptr, sub);
|
||||
if (port - 1 != index)
|
||||
continue;
|
||||
for (k = 0; axistable[k] >= 0; k += 3) {
|
||||
|
@ -3858,7 +3848,7 @@ static void clearevent (struct uae_input_device *uid, int evt)
|
|||
uid->eventid[i][j] = 0;
|
||||
uid->flags[i][j] &= COMPA_RESERVED_FLAGS;
|
||||
xfree (uid->custom[i][j]);
|
||||
uid->custom[i][j] = NULL;
|
||||
uid->custom[i][j] = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3871,7 +3861,7 @@ static void clearkbrevent (struct uae_input_device *uid, int evt)
|
|||
uid->eventid[i][j] = 0;
|
||||
uid->flags[i][j] &= COMPA_RESERVED_FLAGS;
|
||||
xfree (uid->custom[i][j]);
|
||||
uid->custom[i][j] = NULL;
|
||||
uid->custom[i][j] = nullptr;
|
||||
if (j == 0)
|
||||
set_kbr_default_event (uid, keyboard_default, i);
|
||||
}
|
||||
|
@ -3950,7 +3940,7 @@ static void cleardev_custom (struct uae_input_device *uid, int num, int index)
|
|||
uid[num].eventid[i][j] = 0;
|
||||
uid[num].flags[i][j] &= COMPA_RESERVED_FLAGS;
|
||||
xfree (uid[num].custom[i][j]);
|
||||
uid[num].custom[i][j] = NULL;
|
||||
uid[num].custom[i][j] = nullptr;
|
||||
uid[num].port[i][j] = 0;
|
||||
if (uid[num].port[i][SPARE_SUB_EVENT])
|
||||
inputdevice_sparerestore (&uid[num], i, j);
|
||||
|
@ -3966,7 +3956,7 @@ static void cleardevkbr_custom(struct uae_input_device *uid, int num, int index)
|
|||
uid[num].eventid[i][j] = 0;
|
||||
uid[num].flags[i][j] &= COMPA_RESERVED_FLAGS;
|
||||
xfree (uid[num].custom[i][j]);
|
||||
uid[num].custom[i][j] = NULL;
|
||||
uid[num].custom[i][j] = nullptr;
|
||||
uid[num].port[i][j] = 0;
|
||||
if (uid[num].port[i][SPARE_SUB_EVENT]) {
|
||||
inputdevice_sparerestore (&uid[num], i, j);
|
||||
|
@ -4020,7 +4010,7 @@ static void cleardev (struct uae_input_device *uid, int num)
|
|||
uid[num].eventid[i][j] = 0;
|
||||
uid[num].flags[i][j] = 0;
|
||||
xfree (uid[num].custom[i][j]);
|
||||
uid[num].custom[i][j] = NULL;
|
||||
uid[num].custom[i][j] = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4065,7 +4055,7 @@ static void setjoydevices (struct uae_prefs *prefs, bool gameportsmode, int port
|
|||
|
||||
static void setjoyinputs (struct uae_prefs *prefs, int port)
|
||||
{
|
||||
joyinputs[port] = NULL;
|
||||
joyinputs[port] = nullptr;
|
||||
switch (joymodes[port])
|
||||
{
|
||||
case JSEM_MODE_JOYSTICK:
|
||||
|
@ -4130,7 +4120,7 @@ static void compatibility_copy (struct uae_prefs *prefs, bool gameports)
|
|||
|
||||
for (i = 0; i < MAX_JPORTS; i++) {
|
||||
joymodes[i] = prefs->jports[i].mode;
|
||||
joyinputs[i]= NULL;
|
||||
joyinputs[i]= nullptr;
|
||||
// remove all mappings from this port
|
||||
if (gameports)
|
||||
remove_compa_config (prefs, i);
|
||||
|
@ -4317,7 +4307,7 @@ static void compatibility_copy (struct uae_prefs *prefs, bool gameports)
|
|||
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (prefs->jports[i].id >= 0) {
|
||||
int *kb = NULL;
|
||||
int *kb = nullptr;
|
||||
int mode = prefs->jports[i].mode;
|
||||
int af = prefs->jports[i].autofire;
|
||||
for (joy = 0; used[joy]; joy++);
|
||||
|
@ -4438,7 +4428,7 @@ static void disableifempty2 (struct uae_input_device *uid)
|
|||
{
|
||||
for (int i = 0; i < MAX_INPUT_DEVICE_EVENTS; i++) {
|
||||
for (int j = 0; j < MAX_INPUT_SUB_EVENT; j++) {
|
||||
if (uid->eventid[i][j] > 0 || uid->custom[i][j] != NULL)
|
||||
if (uid->eventid[i][j] > 0 || uid->custom[i][j] != nullptr)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -4542,9 +4532,9 @@ static void matchdevices (struct inputdevice_functions *inf, struct uae_input_de
|
|||
break;
|
||||
}
|
||||
for (i = 0; i < inf->get_num (); i++) {
|
||||
if (uid[i].name == NULL)
|
||||
if (uid[i].name == nullptr)
|
||||
uid[i].name = my_strdup (inf->get_friendlyname (i));
|
||||
if (uid[i].configname == NULL)
|
||||
if (uid[i].configname == nullptr)
|
||||
uid[i].configname = my_strdup (inf->get_uniquename (i));
|
||||
}
|
||||
}
|
||||
|
@ -4571,9 +4561,9 @@ bool inputdevice_set_gameports_mapping (struct uae_prefs *prefs, int devnum, int
|
|||
keyboards = prefs->keyboard_settings[input_selected_setting];
|
||||
for (sub = 0; sub < MAX_INPUT_SUB_EVENT; sub++) {
|
||||
int port2 = 0;
|
||||
inputdevice_get_mapping (devnum, num, NULL, &port2, NULL, NULL, sub);
|
||||
inputdevice_get_mapping (devnum, num, nullptr, &port2, nullptr, nullptr, sub);
|
||||
if (port2 == port + 1) {
|
||||
inputdevice_set_mapping (devnum, num, NULL, NULL, 0, 0, sub);
|
||||
inputdevice_set_mapping (devnum, num, nullptr, nullptr, 0, 0, sub);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -4586,19 +4576,19 @@ bool inputdevice_set_gameports_mapping (struct uae_prefs *prefs, int devnum, int
|
|||
keyboards = prefs->keyboard_settings[input_selected_setting];
|
||||
|
||||
sub = 0;
|
||||
if (inputdevice_get_widget_type (devnum, num, NULL, false) != IDEV_WIDGET_KEY) {
|
||||
if (inputdevice_get_widget_type (devnum, num, nullptr, false) != IDEV_WIDGET_KEY) {
|
||||
for (sub = 0; sub < MAX_INPUT_SUB_EVENT; sub++) {
|
||||
int port2 = 0;
|
||||
int evt = inputdevice_get_mapping (devnum, num, NULL, &port2, NULL, NULL, sub);
|
||||
int evt = inputdevice_get_mapping (devnum, num, nullptr, &port2, nullptr, nullptr, sub);
|
||||
if (port2 == port + 1 && evt == evtnum)
|
||||
break;
|
||||
if (!inputdevice_get_mapping (devnum, num, NULL, NULL, NULL, NULL, sub))
|
||||
if (!inputdevice_get_mapping (devnum, num, nullptr, nullptr, nullptr, nullptr, sub))
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sub >= MAX_INPUT_SUB_EVENT)
|
||||
sub = MAX_INPUT_SUB_EVENT - 1;
|
||||
inputdevice_set_mapping (devnum, num, name, NULL, IDEV_MAPPED_GAMEPORTSCUSTOM1 | flags, port + 1, sub);
|
||||
inputdevice_set_mapping (devnum, num, name, nullptr, IDEV_MAPPED_GAMEPORTSCUSTOM1 | flags, port + 1, sub);
|
||||
|
||||
joysticks = prefs->joystick_settings[prefs->input_selected_setting];
|
||||
mice = prefs->mouse_settings[prefs->input_selected_setting];
|
||||
|
@ -4611,7 +4601,7 @@ bool inputdevice_set_gameports_mapping (struct uae_prefs *prefs, int devnum, int
|
|||
inputdevice_get_mapping (devnum, num, &xflags, &xport, xname, xcustom, 0);
|
||||
if (xport == 0)
|
||||
inputdevice_set_mapping (devnum, num, xname, xcustom, xflags, MAX_JPORTS + 1, SPARE_SUB_EVENT);
|
||||
inputdevice_set_mapping (devnum, num, name, NULL, IDEV_MAPPED_GAMEPORTSCUSTOM1 | flags, port + 1, 0);
|
||||
inputdevice_set_mapping (devnum, num, name, nullptr, IDEV_MAPPED_GAMEPORTSCUSTOM1 | flags, port + 1, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -5073,7 +5063,7 @@ void inputdevice_close (void)
|
|||
|
||||
static struct uae_input_device *get_uid (const struct inputdevice_functions *id, int devnum)
|
||||
{
|
||||
struct uae_input_device *uid = 0;
|
||||
struct uae_input_device *uid = nullptr;
|
||||
if (id == &idev[IDTYPE_JOYSTICK]) {
|
||||
uid = &joysticks[devnum];
|
||||
} else if (id == &idev[IDTYPE_MOUSE]) {
|
||||
|
@ -5087,7 +5077,7 @@ static struct uae_input_device *get_uid (const struct inputdevice_functions *id,
|
|||
static int get_event_data (const struct inputdevice_functions *id, int devnum, int num, int *eventid, TCHAR **custom, uae_u64 *flags, int *port, int sub)
|
||||
{
|
||||
const struct uae_input_device *uid = get_uid (id, devnum);
|
||||
int type = id->get_widget_type (devnum, num, 0, 0);
|
||||
int type = id->get_widget_type (devnum, num, nullptr, nullptr);
|
||||
int i;
|
||||
if (type == IDEV_WIDGET_BUTTON || type == IDEV_WIDGET_BUTTONAXIS) {
|
||||
i = num - id->get_widget_first (devnum, IDEV_WIDGET_BUTTON) + ID_BUTTON_OFFSET;
|
||||
|
@ -5127,7 +5117,7 @@ static TCHAR *stripstrdup (const TCHAR *s)
|
|||
{
|
||||
TCHAR *out = my_strdup (s);
|
||||
if (!out)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
for (int i = 0; out[i]; i++) {
|
||||
if (out[i] < ' ')
|
||||
out[i] = ' ';
|
||||
|
@ -5138,7 +5128,7 @@ static TCHAR *stripstrdup (const TCHAR *s)
|
|||
static int put_event_data (const struct inputdevice_functions *id, int devnum, int num, int eventid, TCHAR *custom, uae_u64 flags, int port, int sub)
|
||||
{
|
||||
struct uae_input_device *uid = get_uid (id, devnum);
|
||||
int type = id->get_widget_type (devnum, num, 0, 0);
|
||||
int type = id->get_widget_type (devnum, num, nullptr, nullptr);
|
||||
int i, ret;
|
||||
|
||||
for (i = 0; i < MAX_INPUT_QUALIFIERS; i++) {
|
||||
|
@ -5148,7 +5138,7 @@ static int put_event_data (const struct inputdevice_functions *id, int devnum, i
|
|||
flags &= ~mask2;
|
||||
}
|
||||
if (custom && custom[0] == 0)
|
||||
custom = NULL;
|
||||
custom = nullptr;
|
||||
if (custom)
|
||||
eventid = 0;
|
||||
if (eventid <= 0 && !custom)
|
||||
|
@ -5191,7 +5181,7 @@ static int is_event_used (const struct inputdevice_functions *id, int devnum, in
|
|||
|
||||
for (num = 0; num < id->get_widget_num (devnum); num++) {
|
||||
for (sub = 0; sub < MAX_INPUT_SUB_EVENT; sub++) {
|
||||
if (get_event_data (id, devnum, num, &evt, NULL, NULL, NULL, sub) >= 0) {
|
||||
if (get_event_data (id, devnum, num, &evt, nullptr, nullptr, nullptr, sub) >= 0) {
|
||||
if (evt == isevent && isnum != num)
|
||||
return 1;
|
||||
}
|
||||
|
@ -5240,7 +5230,7 @@ TCHAR *inputdevice_get_device_unique_name (int type, int devnum)
|
|||
int inputdevice_get_device_status (int devnum)
|
||||
{
|
||||
const struct inputdevice_functions *idf = getidf (devnum);
|
||||
if (idf == NULL)
|
||||
if (idf == nullptr)
|
||||
return -1;
|
||||
struct uae_input_device *uid = get_uid (idf, inputdevice_get_device_index (devnum));
|
||||
return uid->enabled != 0;
|
||||
|
@ -5297,7 +5287,7 @@ int inputdevice_iterate (int devnum, int num, TCHAR *name, int *af)
|
|||
return 0;
|
||||
}
|
||||
mask = 0;
|
||||
type = idf->get_widget_type (devindex, num, NULL, NULL);
|
||||
type = idf->get_widget_type (devindex, num, nullptr, nullptr);
|
||||
if (type == IDEV_WIDGET_BUTTON || type == IDEV_WIDGET_BUTTONAXIS) {
|
||||
if (idf == &idev[IDTYPE_JOYSTICK]) {
|
||||
mask |= AM_JOY_BUT;
|
||||
|
@ -5329,7 +5319,7 @@ int inputdevice_iterate (int devnum, int num, TCHAR *name, int *af)
|
|||
}
|
||||
if (!(ie->allow_mask & mask))
|
||||
continue;
|
||||
get_event_data (idf, devindex, num, &data, NULL, &flags, NULL, 0);
|
||||
get_event_data (idf, devindex, num, &data, nullptr, &flags, nullptr, 0);
|
||||
inputdevice_get_eventname (ie, name);
|
||||
*af = (flags & ID_FLAG_AUTOFIRE) ? 1 : 0;
|
||||
return 1;
|
||||
|
@ -5344,7 +5334,7 @@ int inputdevice_get_mapping (int devnum, int num, uae_u64 *pflags, int *pport, T
|
|||
int port, data;
|
||||
uae_u64 flags = 0, flag;
|
||||
int devindex = inputdevice_get_device_index (devnum);
|
||||
TCHAR *customp = NULL;
|
||||
TCHAR *customp = nullptr;
|
||||
|
||||
if (name)
|
||||
_tcscpy (name, _T("<none>"));
|
||||
|
@ -5354,7 +5344,7 @@ int inputdevice_get_mapping (int devnum, int num, uae_u64 *pflags, int *pport, T
|
|||
*pflags = 0;
|
||||
if (pport)
|
||||
*pport = 0;
|
||||
if (uid == 0 || num < 0)
|
||||
if (uid == nullptr || num < 0)
|
||||
return 0;
|
||||
if (get_event_data (idf, devindex, num, &data, &customp, &flag, &port, sub) < 0)
|
||||
return 0;
|
||||
|
@ -5405,9 +5395,9 @@ int inputdevice_set_mapping (int devnum, int num, const TCHAR *name, TCHAR *cust
|
|||
uae_u64 flag;
|
||||
TCHAR ename[256];
|
||||
int devindex = inputdevice_get_device_index (devnum);
|
||||
TCHAR *customp = NULL;
|
||||
TCHAR *customp = nullptr;
|
||||
|
||||
if (uid == 0 || num < 0)
|
||||
if (uid == nullptr || num < 0)
|
||||
return 0;
|
||||
if (name) {
|
||||
eid = 1;
|
||||
|
@ -5563,7 +5553,7 @@ void inputdevice_swap_compa_ports (struct uae_prefs *prefs, int portswap)
|
|||
memcpy (&tmp, &prefs->jports[portswap], sizeof (struct jport));
|
||||
memcpy (&prefs->jports[portswap], &prefs->jports[portswap + 1], sizeof (struct jport));
|
||||
memcpy (&prefs->jports[portswap + 1], &tmp, sizeof (struct jport));
|
||||
inputdevice_updateconfig (NULL, prefs);
|
||||
inputdevice_updateconfig (nullptr, prefs);
|
||||
}
|
||||
|
||||
// swap device "devnum" ports 0<>1 and 2<>3
|
||||
|
@ -5807,7 +5797,7 @@ void setjoystickstate (int joy, int axis, int state, int max)
|
|||
static int prevdir;
|
||||
static struct timeval tv1;
|
||||
struct timeval tv2;
|
||||
gettimeofday (&tv2, NULL);
|
||||
gettimeofday (&tv2, nullptr);
|
||||
if ((uae_s64)tv2.tv_sec * 1000000 + tv2.tv_usec < (uae_s64)tv1.tv_sec * 1000000 + tv1.tv_usec + 500000 && prevdir == v1) {
|
||||
switchdevice (&joysticks[joy], v1 < 0 ? 0 : 1, false);
|
||||
tv1.tv_sec = 0;
|
||||
|
@ -5988,7 +5978,7 @@ static void inputdevice_get_previous_joy(struct uae_prefs *p, int portnum)
|
|||
if (jp->idc.configname[0]) {
|
||||
found = inputdevice_joyport_config(p, jp->idc.name, jp->idc.configname, portnum, jp->mode, 1, true) != 0;
|
||||
if (!found && jp->id == JPORT_UNPLUGGED)
|
||||
found = inputdevice_joyport_config(p, jp->idc.name, NULL, portnum, jp->mode, 1, true) != 0;
|
||||
found = inputdevice_joyport_config(p, jp->idc.name, nullptr, portnum, jp->mode, 1, true) != 0;
|
||||
} else if (jp->id < JSEM_JOYS && jp->id >= 0) {
|
||||
jpx->id = jp->id;
|
||||
found = true;
|
||||
|
@ -6049,7 +6039,7 @@ void inputdevice_validate_jports (struct uae_prefs *p, int changedport, bool *fi
|
|||
if (!other && p->jports[i].id != p->jports[j].id)
|
||||
break;
|
||||
|
||||
struct jport *jp = NULL;
|
||||
struct jport *jp = nullptr;
|
||||
for (;;) {
|
||||
jp = inputdevice_get_used_device(k, cnt);
|
||||
cnt++;
|
||||
|
@ -6164,7 +6154,7 @@ int inputdevice_joyport_config (struct uae_prefs *p, const TCHAR *value1, const
|
|||
{
|
||||
int start = JPORT_NONE, got = 0, max = -1;
|
||||
int type = -1;
|
||||
const TCHAR *pp = NULL;
|
||||
const TCHAR *pp = nullptr;
|
||||
if (_tcsncmp (value1, _T("kbd"), 3) == 0) {
|
||||
start = JSEM_KBDLAYOUT;
|
||||
pp = value1 + 3;
|
||||
|
@ -6283,7 +6273,7 @@ void inputdevice_fix_prefs(struct uae_prefs *p, bool userconfig)
|
|||
if (!matched[i]) {
|
||||
struct jport *jp = &jport_config_store[i];
|
||||
if (jp->idc.configname[0]) {
|
||||
if (inputdevice_joyport_config(p, NULL, jp->idc.configname, i, jp->mode, 1, userconfig)) {
|
||||
if (inputdevice_joyport_config(p, nullptr, jp->idc.configname, i, jp->mode, 1, userconfig)) {
|
||||
inputdevice_validate_jports(p, i, matched);
|
||||
inputdevice_store_used_device(&p->jports[i], i, defaultports);
|
||||
matched[i] = true;
|
||||
|
@ -6297,7 +6287,7 @@ void inputdevice_fix_prefs(struct uae_prefs *p, bool userconfig)
|
|||
if (!matched[i]) {
|
||||
struct jport *jp = &jport_config_store[i];
|
||||
if (jp->idc.name[0]) {
|
||||
if (inputdevice_joyport_config(p, jp->idc.name, NULL, i, jp->mode, 1, userconfig)) {
|
||||
if (inputdevice_joyport_config(p, jp->idc.name, nullptr, i, jp->mode, 1, userconfig)) {
|
||||
inputdevice_validate_jports(p, i, matched);
|
||||
inputdevice_store_used_device(&p->jports[i], i, defaultports);
|
||||
matched[i] = true;
|
||||
|
@ -6311,7 +6301,7 @@ void inputdevice_fix_prefs(struct uae_prefs *p, bool userconfig)
|
|||
if (!matched[i]) {
|
||||
struct jport *jp = &jport_config_store[i];
|
||||
if (jp->idc.shortid[0] && !jp->idc.name[0] && !jp->idc.configname[0]) {
|
||||
if (inputdevice_joyport_config(p, jp->idc.shortid, NULL, i, jp->mode, 0, userconfig)) {
|
||||
if (inputdevice_joyport_config(p, jp->idc.shortid, nullptr, i, jp->mode, 0, userconfig)) {
|
||||
inputdevice_validate_jports(p, i, matched);
|
||||
inputdevice_store_used_device(&p->jports[i], i, defaultports);
|
||||
matched[i] = true;
|
||||
|
|
|
@ -168,7 +168,7 @@ static blockinfo* hold_bi[MAX_HOLD_BI];
|
|||
blockinfo* active;
|
||||
blockinfo* dormant;
|
||||
|
||||
#ifdef PANDORA
|
||||
#ifdef AMIBERRY
|
||||
#include <sys/mman.h>
|
||||
|
||||
void cache_free (uae_u8 *cache, int size)
|
||||
|
|
|
@ -18,8 +18,8 @@ int64_t g_uae_epoch = 0;
|
|||
|
||||
int machdep_init (void)
|
||||
{
|
||||
picasso_requested_on = 0;
|
||||
picasso_on = 0;
|
||||
picasso_requested_on = false;
|
||||
picasso_on = false;
|
||||
screen_is_picasso = 0;
|
||||
|
||||
// Initialize timebase
|
||||
|
|
50
src/main.cpp
50
src/main.cpp
|
@ -63,17 +63,15 @@ TCHAR optionsfile[256];
|
|||
|
||||
void my_trim(TCHAR *s)
|
||||
{
|
||||
int len;
|
||||
while (_tcslen(s) > 0 && _tcscspn(s, _T("\t \r\n")) == 0)
|
||||
memmove(s, s + 1, (_tcslen(s + 1) + 1) * sizeof(TCHAR));
|
||||
len = _tcslen(s);
|
||||
int len = _tcslen(s);
|
||||
while (len > 0 && _tcscspn(s + len - 1, _T("\t \r\n")) == 0)
|
||||
s[--len] = '\0';
|
||||
}
|
||||
|
||||
TCHAR *my_strdup_trim(const TCHAR *s)
|
||||
{
|
||||
TCHAR *out;
|
||||
int len;
|
||||
|
||||
if (s[0] == 0)
|
||||
|
@ -83,7 +81,7 @@ TCHAR *my_strdup_trim(const TCHAR *s)
|
|||
len = _tcslen(s);
|
||||
while (len > 0 && _tcscspn(s + len - 1, _T("\t \r\n")) == 0)
|
||||
len--;
|
||||
out = xmalloc(TCHAR, len + 1);
|
||||
TCHAR *out = xmalloc(TCHAR, len + 1);
|
||||
memcpy(out, s, len * sizeof(TCHAR));
|
||||
out[len] = 0;
|
||||
return out;
|
||||
|
@ -435,10 +433,8 @@ void uae_restart(int opengui, const TCHAR *cfgfile)
|
|||
|
||||
static void parse_cmdline_2(int argc, TCHAR **argv)
|
||||
{
|
||||
int i;
|
||||
|
||||
cfgfile_addcfgparam(0);
|
||||
for (i = 1; i < argc; i++) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
if (_tcsncmp(argv[i], _T("-cfgparam="), 10) == 0) {
|
||||
cfgfile_addcfgparam(argv[i] + 10);
|
||||
}
|
||||
|
@ -466,9 +462,7 @@ static TCHAR *parsetext(const TCHAR *s)
|
|||
}
|
||||
return d;
|
||||
}
|
||||
else {
|
||||
return my_strdup(s);
|
||||
}
|
||||
return my_strdup(s);
|
||||
}
|
||||
static TCHAR *parsetextpath(const TCHAR *s)
|
||||
{
|
||||
|
@ -480,7 +474,6 @@ static TCHAR *parsetextpath(const TCHAR *s)
|
|||
|
||||
static void parse_cmdline(int argc, TCHAR **argv)
|
||||
{
|
||||
int i;
|
||||
static bool started;
|
||||
bool firstconfig = true;
|
||||
bool loaded = false;
|
||||
|
@ -490,7 +483,7 @@ static void parse_cmdline(int argc, TCHAR **argv)
|
|||
return;
|
||||
started = true;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
for (int i = 1; i < argc; i++) {
|
||||
if (_tcscmp(argv[i], _T("-cfgparam")) == 0) {
|
||||
if (i + 1 < argc)
|
||||
i++;
|
||||
|
@ -639,10 +632,8 @@ void check_error_sdl(bool check, const char* message) {
|
|||
}
|
||||
}
|
||||
|
||||
static int real_main2 (int argc, TCHAR **argv)
|
||||
static void initialize_sdl2()
|
||||
{
|
||||
printf("Amiberry-SDL2 by Dimitris (MiDWaN) Panokostas\n");
|
||||
|
||||
if (SDL_Init(SDL_INIT_EVERYTHING) != 0)
|
||||
{
|
||||
SDL_Log("SDL could not initialize! SDL_Error: %s\n", SDL_GetError());
|
||||
|
@ -650,11 +641,11 @@ static int real_main2 (int argc, TCHAR **argv)
|
|||
}
|
||||
|
||||
sdlWindow = SDL_CreateWindow("Amiberry-SDL2 v2",
|
||||
SDL_WINDOWPOS_UNDEFINED,
|
||||
SDL_WINDOWPOS_UNDEFINED,
|
||||
0,
|
||||
0,
|
||||
SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||
SDL_WINDOWPOS_UNDEFINED,
|
||||
SDL_WINDOWPOS_UNDEFINED,
|
||||
0,
|
||||
0,
|
||||
SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||
check_error_sdl(sdlWindow == nullptr, "Unable to create window");
|
||||
|
||||
renderer = SDL_CreateRenderer(sdlWindow, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
|
||||
|
@ -669,6 +660,13 @@ static int real_main2 (int argc, TCHAR **argv)
|
|||
SDL_Log("SDL could not grab the keyboard");
|
||||
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
}
|
||||
|
||||
static int real_main2 (int argc, TCHAR **argv)
|
||||
{
|
||||
printf("Amiberry-SDL2 by Dimitris (MiDWaN) Panokostas\n");
|
||||
|
||||
initialize_sdl2();
|
||||
|
||||
set_config_changed();
|
||||
if (restart_config[0]) {
|
||||
|
@ -699,9 +697,9 @@ static int real_main2 (int argc, TCHAR **argv)
|
|||
changed_prefs = currprefs;
|
||||
no_gui = !currprefs.start_gui;
|
||||
if (restart_program == 2)
|
||||
no_gui = 1;
|
||||
no_gui = true;
|
||||
else if (restart_program == 3)
|
||||
no_gui = 0;
|
||||
no_gui = false;
|
||||
restart_program = 0;
|
||||
if (!no_gui) {
|
||||
int err = gui_init();
|
||||
|
@ -711,23 +709,21 @@ static int real_main2 (int argc, TCHAR **argv)
|
|||
write_log(_T("Failed to initialize the GUI\n"));
|
||||
return -1;
|
||||
}
|
||||
else if (err == -2) {
|
||||
if (err == -2) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setCpuSpeed();
|
||||
update_display(&currprefs);
|
||||
}
|
||||
|
||||
memset(&gui_data, 0, sizeof gui_data);
|
||||
gui_data.cd = -1;
|
||||
gui_data.hd = -1;
|
||||
|
||||
if (!init_shm()) {
|
||||
if (currprefs.start_gui)
|
||||
uae_restart(-1, NULL);
|
||||
uae_restart(-1, nullptr);
|
||||
return 0;
|
||||
}
|
||||
#ifdef PICASSO96
|
||||
|
@ -774,7 +770,7 @@ void real_main(int argc, TCHAR **argv)
|
|||
{
|
||||
restart_program = 1;
|
||||
|
||||
fetch_configurationpath(restart_config, sizeof(restart_config) / sizeof(TCHAR));
|
||||
fetch_configurationpath(restart_config, sizeof restart_config / sizeof(TCHAR));
|
||||
_tcscat(restart_config, OPTIONSFILENAME);
|
||||
_tcscat(restart_config, ".uae");
|
||||
default_config = 1;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "options.h"
|
||||
#include "threaddep/thread.h"
|
||||
#include "gui.h"
|
||||
#include "memory.h"
|
||||
#include "include/memory.h"
|
||||
#include "inputdevice.h"
|
||||
#include "keyboard.h"
|
||||
#include "disk.h"
|
||||
|
@ -366,7 +366,7 @@ void fetch_configurationpath(char *out, int size)
|
|||
|
||||
void set_configurationpath(char *newpath)
|
||||
{
|
||||
strncpy(config_path, newpath, MAX_DPATH);
|
||||
strcpy(config_path, newpath);
|
||||
}
|
||||
|
||||
void fetch_rompath(char *out, int size)
|
||||
|
@ -376,7 +376,7 @@ void fetch_rompath(char *out, int size)
|
|||
|
||||
void set_rompath(char *newpath)
|
||||
{
|
||||
strncpy(rom_path, newpath, MAX_DPATH);
|
||||
strcpy(rom_path, newpath);
|
||||
}
|
||||
|
||||
|
||||
|
@ -460,12 +460,12 @@ int check_configfile(char *file)
|
|||
return 1;
|
||||
}
|
||||
|
||||
strncpy(tmp, file, MAX_PATH);
|
||||
strcpy(tmp, file);
|
||||
char *ptr = strstr(tmp, ".uae");
|
||||
if (ptr > 0)
|
||||
{
|
||||
*(ptr + 1) = '\0';
|
||||
strncat(tmp, "conf", MAX_PATH);
|
||||
strcat(tmp, "conf");
|
||||
f = fopen(tmp, "rt");
|
||||
if (f)
|
||||
{
|
||||
|
@ -482,12 +482,12 @@ void extractFileName(const char * str, char *buffer)
|
|||
while (*p != '/' && p > str)
|
||||
p--;
|
||||
p++;
|
||||
strncpy(buffer, p, MAX_PATH);
|
||||
strcpy(buffer, p);
|
||||
}
|
||||
|
||||
void extractPath(char *str, char *buffer)
|
||||
{
|
||||
strncpy(buffer, str, MAX_PATH);
|
||||
strcpy(buffer, str);
|
||||
char *p = buffer + strlen(buffer) - 1;
|
||||
while (*p != '/' && p > buffer)
|
||||
p--;
|
||||
|
@ -854,19 +854,7 @@ int handle_msgpump()
|
|||
|
||||
switch (rEvent.key.keysym.sym)
|
||||
{
|
||||
case SDLK_NUMLOCKCLEAR:
|
||||
if (currprefs.keyboard_leds[KBLED_NUMLOCKB] > 0)
|
||||
{
|
||||
//oldleds ^= KBLED_NUMLOCKM;
|
||||
//ch = true;
|
||||
}
|
||||
break;
|
||||
case SDLK_CAPSLOCK: // capslock
|
||||
if (currprefs.keyboard_leds[KBLED_CAPSLOCKB] > 0)
|
||||
{
|
||||
//oldleds ^= KBLED_CAPSLOCKM;
|
||||
//ch = true;
|
||||
}
|
||||
// Treat CAPSLOCK as a toggle. If on, set off and vice/versa
|
||||
ioctl(0, KDGKBLED, &kbd_flags);
|
||||
ioctl(0, KDGETLED, &kbd_led_status);
|
||||
|
@ -887,15 +875,6 @@ int handle_msgpump()
|
|||
ioctl(0, KDSETLED, kbd_led_status);
|
||||
ioctl(0, KDSKBLED, kbd_flags);
|
||||
break;
|
||||
|
||||
case SDLK_SCROLLLOCK:
|
||||
if (currprefs.keyboard_leds[KBLED_SCROLLLOCKB] > 0)
|
||||
{
|
||||
//oldleds ^= KBLED_SCROLLLOCKM;
|
||||
//ch = true;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (currprefs.customControls)
|
||||
{
|
||||
|
|
|
@ -275,6 +275,18 @@ void show_screen(int mode)
|
|||
//init_row_map();
|
||||
}
|
||||
|
||||
unsigned long target_lastsynctime(void)
|
||||
{
|
||||
return last_synctime;
|
||||
}
|
||||
|
||||
bool show_screen_maybe(bool show)
|
||||
{
|
||||
if (show)
|
||||
show_screen(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
static void graphics_subinit()
|
||||
{
|
||||
if (screen == nullptr)
|
||||
|
@ -339,7 +351,7 @@ int target_get_display(const TCHAR *name)
|
|||
const TCHAR *target_get_display_name(int num, bool friendlyname)
|
||||
{
|
||||
if (num <= 0)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
if (friendlyname)
|
||||
return "Raspberry Pi display";
|
||||
return "0";
|
||||
|
@ -562,18 +574,15 @@ bool target_graphics_buffer_update()
|
|||
|
||||
#ifdef PICASSO96
|
||||
|
||||
int picasso_palette()
|
||||
int picasso_palette(struct MyCLUTEntry *CLUT)
|
||||
{
|
||||
int changed = 0;
|
||||
for (int i = 0; i < 256; i++)
|
||||
{
|
||||
int r = picasso96_state.CLUT[i].Red;
|
||||
int g = picasso96_state.CLUT[i].Green;
|
||||
int b = picasso96_state.CLUT[i].Blue;
|
||||
int value = (r << 16 | g << 8 | b);
|
||||
uae_u32 v = CONVERT_RGB(value);
|
||||
if (v != picasso_vidinfo.clut[i])
|
||||
{
|
||||
for (int i = 0; i < 256; i++) {
|
||||
int r = CLUT[i].Red;
|
||||
int g = CLUT[i].Green;
|
||||
int b = CLUT[i].Blue;
|
||||
uae_u32 v = CONVERT_RGB(r << 16 | g << 8 | b);
|
||||
if (v != picasso_vidinfo.clut[i]) {
|
||||
picasso_vidinfo.clut[i] = v;
|
||||
changed = 1;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include "gui.h"
|
||||
#include "osdep/gui/SelectorEntry.hpp"
|
||||
#include "gui/gui_handling.h"
|
||||
#include "memory.h"
|
||||
#include "include/memory.h"
|
||||
#include "rommgr.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
|
@ -251,18 +251,13 @@ static int scan_rom_2(struct zfile* f, void* dummy)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void scan_rom(char* path)
|
||||
static void scan_rom(char *path)
|
||||
{
|
||||
if (!isromext(path))
|
||||
{
|
||||
if (!isromext(path)) {
|
||||
//write_log("ROMSCAN: skipping file '%s', unknown extension\n", path);
|
||||
return;
|
||||
}
|
||||
struct romdata* rd = getarcadiarombyname(path);
|
||||
if (rd)
|
||||
addrom(rd, path);
|
||||
else
|
||||
zfile_zopen(path, scan_rom_2, nullptr);
|
||||
zfile_zopen(path, scan_rom_2, 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -287,13 +282,15 @@ void RescanROMs()
|
|||
}
|
||||
|
||||
int id = 1;
|
||||
for (;;)
|
||||
{
|
||||
struct romdata* rd = getromdatabyid(id);
|
||||
for (;;) {
|
||||
struct romdata *rd = getromdatabyid(id);
|
||||
if (!rd)
|
||||
break;
|
||||
if (rd->crc32 == 0xffffffff && strncmp(rd->model, "AROS", 4) == 0)
|
||||
addrom(rd, ":AROS");
|
||||
if (rd->crc32 == 0xffffffff && rd->id == 63) {
|
||||
addrom(rd, ":HRTMon");
|
||||
}
|
||||
id++;
|
||||
}
|
||||
}
|
||||
|
@ -309,100 +306,44 @@ static void ClearConfigFileList()
|
|||
}
|
||||
|
||||
|
||||
void ReadConfigFileList()
|
||||
void ReadConfigFileList(void)
|
||||
{
|
||||
char path[MAX_DPATH];
|
||||
vector<string> files;
|
||||
const char* filter_rp9[] = {".rp9", "\0"};
|
||||
const char* filter_uae[] = {".uae", "\0"};
|
||||
const char* filter_conf[] = {".conf", "\0"};
|
||||
char path[MAX_PATH];
|
||||
std::vector<std::string> files;
|
||||
const char *filter_rp9[] = { ".rp9", "\0" };
|
||||
const char *filter_uae[] = { ".uae", "\0" };
|
||||
|
||||
ClearConfigFileList();
|
||||
|
||||
// Add built-in configs: A500
|
||||
ConfigFileInfo* buildin = new ConfigFileInfo();
|
||||
strcpy(buildin->FullPath, "");
|
||||
strcpy(buildin->Name, "Amiga 500");
|
||||
strcpy(buildin->Description, _T("Built-in, A500, OCS, 512KB"));
|
||||
buildin->BuiltInID = BUILTINID_A500;
|
||||
ConfigFilesList.push_back(buildin);
|
||||
|
||||
// A1200
|
||||
buildin = new ConfigFileInfo();
|
||||
strcpy(buildin->FullPath, "");
|
||||
strcpy(buildin->Name, "Amiga 1200");
|
||||
strcpy(buildin->Description, _T("Built-in, A1200"));
|
||||
buildin->BuiltInID = BUILTINID_A1200;
|
||||
ConfigFilesList.push_back(buildin);
|
||||
|
||||
// CD32
|
||||
buildin = new ConfigFileInfo();
|
||||
strcpy(buildin->FullPath, "");
|
||||
strcpy(buildin->Name, "CD32");
|
||||
strcpy(buildin->Description, _T("Built-in"));
|
||||
buildin->BuiltInID = BUILTINID_CD32;
|
||||
ConfigFilesList.push_back(buildin);
|
||||
|
||||
// Read rp9 files
|
||||
fetch_rp9path(path, sizeof path);
|
||||
ReadDirectory(path, nullptr, &files);
|
||||
fetch_rp9path(path, MAX_PATH);
|
||||
ReadDirectory(path, NULL, &files);
|
||||
FilterFiles(&files, filter_rp9);
|
||||
for (int i = 0; i < files.size(); ++i)
|
||||
for (int i = 0; i<files.size(); ++i)
|
||||
{
|
||||
ConfigFileInfo* tmp = new ConfigFileInfo();
|
||||
strcpy(tmp->FullPath, path);
|
||||
strcat(tmp->FullPath, files[i].c_str());
|
||||
strcpy(tmp->Name, files[i].c_str());
|
||||
ConfigFileInfo *tmp = new ConfigFileInfo();
|
||||
strncpy(tmp->FullPath, path, MAX_DPATH);
|
||||
strncat(tmp->FullPath, files[i].c_str(), MAX_DPATH);
|
||||
strncpy(tmp->Name, files[i].c_str(), MAX_DPATH);
|
||||
removeFileExtension(tmp->Name);
|
||||
strcpy(tmp->Description, _T("rp9"));
|
||||
tmp->BuiltInID = BUILTINID_NONE;
|
||||
strncpy(tmp->Description, _T("rp9"), MAX_PATH);
|
||||
ConfigFilesList.push_back(tmp);
|
||||
}
|
||||
|
||||
// Read standard config files
|
||||
fetch_configurationpath(path, sizeof path);
|
||||
ReadDirectory(path, nullptr, &files);
|
||||
fetch_configurationpath(path, MAX_PATH);
|
||||
ReadDirectory(path, NULL, &files);
|
||||
FilterFiles(&files, filter_uae);
|
||||
for (int i = 0; i < files.size(); ++i)
|
||||
for (int i = 0; i<files.size(); ++i)
|
||||
{
|
||||
ConfigFileInfo* tmp = new ConfigFileInfo();
|
||||
strcpy(tmp->FullPath, path);
|
||||
strcat(tmp->FullPath, files[i].c_str());
|
||||
strcpy(tmp->Name, files[i].c_str());
|
||||
ConfigFileInfo *tmp = new ConfigFileInfo();
|
||||
strncpy(tmp->FullPath, path, MAX_DPATH);
|
||||
strncat(tmp->FullPath, files[i].c_str(), MAX_DPATH);
|
||||
strncpy(tmp->Name, files[i].c_str(), MAX_DPATH);
|
||||
removeFileExtension(tmp->Name);
|
||||
cfgfile_get_description(tmp->FullPath, tmp->Description, nullptr, nullptr, nullptr);
|
||||
tmp->BuiltInID = BUILTINID_NONE;
|
||||
cfgfile_get_description(tmp->FullPath, tmp->Description);
|
||||
ConfigFilesList.push_back(tmp);
|
||||
}
|
||||
|
||||
// Read also old style configs
|
||||
ReadDirectory(path, nullptr, &files);
|
||||
FilterFiles(&files, filter_conf);
|
||||
for (int i = 0; i < files.size(); ++i)
|
||||
{
|
||||
if (strcmp(files[i].c_str(), "adfdir.conf"))
|
||||
{
|
||||
ConfigFileInfo* tmp = new ConfigFileInfo();
|
||||
strcpy(tmp->FullPath, path);
|
||||
strcat(tmp->FullPath, files[i].c_str());
|
||||
strcpy(tmp->Name, files[i].c_str());
|
||||
removeFileExtension(tmp->Name);
|
||||
strcpy(tmp->Description, "Old style configuration file");
|
||||
tmp->BuiltInID = BUILTINID_NONE;
|
||||
for (int j = 0; j < ConfigFilesList.size(); ++j)
|
||||
{
|
||||
if (!strcmp(ConfigFilesList[j]->Name, tmp->Name))
|
||||
{
|
||||
// Config in new style already in list
|
||||
delete tmp;
|
||||
tmp = nullptr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (tmp != nullptr)
|
||||
ConfigFilesList.push_back(tmp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ConfigFileInfo* SearchConfigInList(const char* name)
|
||||
|
@ -416,21 +357,20 @@ ConfigFileInfo* SearchConfigInList(const char* name)
|
|||
}
|
||||
|
||||
|
||||
static void prefs_to_gui(struct uae_prefs* p)
|
||||
static void prefs_to_gui()
|
||||
{
|
||||
workprefs = *p;
|
||||
/* filesys hack */
|
||||
workprefs.mountitems = currprefs.mountitems;
|
||||
memcpy(&workprefs.mountconfig, &currprefs.mountconfig, MOUNT_CONFIG_SIZE * sizeof(struct uaedev_config_info));
|
||||
changed_prefs.mountitems = currprefs.mountitems;
|
||||
memcpy(&changed_prefs.mountconfig, &currprefs.mountconfig, MOUNT_CONFIG_SIZE * sizeof(struct uaedev_config_info));
|
||||
}
|
||||
|
||||
|
||||
static void gui_to_prefs()
|
||||
static void gui_to_prefs(void)
|
||||
{
|
||||
/* filesys hack */
|
||||
currprefs.mountitems = changed_prefs.mountitems;
|
||||
memcpy(&currprefs.mountconfig, &changed_prefs.mountconfig, MOUNT_CONFIG_SIZE * sizeof(struct uaedev_config_info));
|
||||
fixup_prefs(&changed_prefs);
|
||||
fixup_prefs(&changed_prefs, true);
|
||||
}
|
||||
|
||||
|
||||
|
@ -464,7 +404,7 @@ int gui_init()
|
|||
if (lstAvailableROMs.size() == 0)
|
||||
RescanROMs();
|
||||
|
||||
prefs_to_gui(&changed_prefs);
|
||||
prefs_to_gui();
|
||||
run_gui();
|
||||
gui_to_prefs();
|
||||
if (quit_program < 0)
|
||||
|
@ -491,17 +431,6 @@ void gui_exit()
|
|||
|
||||
void gui_purge_events()
|
||||
{
|
||||
// TODO Test if this is still needed in SDL2 or should be removed!
|
||||
//int counter = 0;
|
||||
|
||||
//SDL_Event event;
|
||||
//SDL_Delay(150);
|
||||
//// Strangely PS3 controller always send events, so we need a maximum number of event to purge.
|
||||
//while (SDL_PollEvent(&event) && counter < 50)
|
||||
//{
|
||||
// counter++;
|
||||
// SDL_Delay(10);
|
||||
//}
|
||||
keybuf_init();
|
||||
}
|
||||
|
||||
|
@ -510,7 +439,7 @@ int gui_update()
|
|||
{
|
||||
char tmp[MAX_DPATH];
|
||||
|
||||
fetch_statefilepath(savestate_fname, sizeof savestate_fname);
|
||||
fetch_savestatepath(savestate_fname, sizeof savestate_fname);
|
||||
fetch_screenshotpath(screenshot_filename, MAX_DPATH);
|
||||
|
||||
if (strlen(currprefs.floppyslots[0].df) > 0)
|
||||
|
@ -519,7 +448,7 @@ int gui_update()
|
|||
strcpy(tmp, last_loaded_config);
|
||||
|
||||
strncat(savestate_fname, tmp, sizeof savestate_fname);
|
||||
strncat(screenshot_filename, tmp, MAX_DPATH);
|
||||
strncat(screenshot_filename, tmp, sizeof screenshot_filename);
|
||||
removeFileExtension(savestate_fname);
|
||||
removeFileExtension(screenshot_filename);
|
||||
|
||||
|
@ -557,10 +486,13 @@ void gui_display(int shortcut)
|
|||
if (lstAvailableROMs.size() == 0)
|
||||
RescanROMs();
|
||||
|
||||
prefs_to_gui(&changed_prefs);
|
||||
prefs_to_gui();
|
||||
run_gui();
|
||||
gui_to_prefs();
|
||||
|
||||
if (quit_program)
|
||||
screen_is_picasso = 0;
|
||||
|
||||
update_display(&changed_prefs);
|
||||
|
||||
reset_sound();
|
||||
|
@ -576,10 +508,6 @@ void gui_display(int shortcut)
|
|||
}
|
||||
|
||||
|
||||
void gui_disk_image_change(int unitnum, const char* name, bool writeprotected)
|
||||
{
|
||||
}
|
||||
|
||||
void gui_led(int led, int on)
|
||||
{
|
||||
unsigned char kbd_led_status;
|
||||
|
@ -629,16 +557,6 @@ void gui_flicker_led(int led, int unitnum, int status)
|
|||
gui_led(led, status);
|
||||
}
|
||||
|
||||
void gui_fps(int fps, int idle, int color)
|
||||
{
|
||||
gui_data.fps = fps;
|
||||
gui_data.idle = idle;
|
||||
gui_data.fps_color = color;
|
||||
gui_led(LED_FPS, 0);
|
||||
gui_led(LED_CPU, 0);
|
||||
gui_led(LED_SND, (gui_data.sndbuf_status > 1 || gui_data.sndbuf_status < 0) ? 0 : 1);
|
||||
}
|
||||
|
||||
void gui_filename(int num, const char* name)
|
||||
{
|
||||
}
|
||||
|
@ -669,6 +587,28 @@ void notify_user(int msg)
|
|||
}
|
||||
}
|
||||
|
||||
void notify_user_parms(int msg, const TCHAR *parms, ...)
|
||||
{
|
||||
TCHAR msgtxt[MAX_DPATH];
|
||||
TCHAR tmp[MAX_DPATH];
|
||||
int c = 0;
|
||||
va_list parms2;
|
||||
|
||||
int i = 0;
|
||||
while (gui_msglist[i].num >= 0)
|
||||
{
|
||||
if (gui_msglist[i].num == msg)
|
||||
{
|
||||
strncpy(tmp, gui_msglist[i].msg, MAX_DPATH);
|
||||
va_start(parms2, parms);
|
||||
_vsntprintf(msgtxt, sizeof msgtxt / sizeof(TCHAR), tmp, parms2);
|
||||
gui_message(msgtxt);
|
||||
va_end(parms2);
|
||||
break;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
int translate_message(int msg, TCHAR* out)
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "uae.h"
|
||||
#include "options.h"
|
||||
#include "gui.h"
|
||||
#include "memory.h"
|
||||
#include "include/memory.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
#include "autoconf.h"
|
||||
|
|
|
@ -185,7 +185,6 @@ static void parse_clip(struct uae_prefs *p, xmlNode *node)
|
|||
if (attr != NULL)
|
||||
{
|
||||
top = atoi((const char *)attr) / 2;
|
||||
p->pandora_vertical_offset = top - 41 + OFFSET_Y_ADJUST;
|
||||
xmlFree(attr);
|
||||
}
|
||||
attr = xmlGetProp(curr_node, (const xmlChar *)_T("width"));
|
||||
|
|
|
@ -33,7 +33,7 @@ int dos_errno(void)
|
|||
#endif
|
||||
|
||||
default:
|
||||
write_log(("Unimplemented error %s\n", strerror(e)));
|
||||
//write_log(("Unimplemented error %s\n", strerror(e)));
|
||||
return ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,11 +8,13 @@
|
|||
|
||||
#include "sysconfig.h"
|
||||
#include "sysdeps.h"
|
||||
#include "config.h"
|
||||
#include "options.h"
|
||||
#include "include/memory.h"
|
||||
#include "newcpu.h"
|
||||
#include "uae.h"
|
||||
#include "gui.h"
|
||||
#include "gui_handling.h"
|
||||
#include "newcpu.h"
|
||||
|
||||
static gcn::Window* grpCPU;
|
||||
static gcn::UaeRadioButton* optCPU68000;
|
||||
|
|
|
@ -9,8 +9,11 @@
|
|||
|
||||
#include "sysconfig.h"
|
||||
#include "sysdeps.h"
|
||||
#include "config.h"
|
||||
#include "options.h"
|
||||
#include "uae.h"
|
||||
#include "gui.h"
|
||||
#include "include/memory.h"
|
||||
#include "newcpu.h"
|
||||
#include "custom.h"
|
||||
#include "gui_handling.h"
|
||||
|
|
|
@ -336,7 +336,7 @@ void RefreshPanelConfig()
|
|||
{
|
||||
for (int i = 0; i < ConfigFilesList.size(); ++i)
|
||||
{
|
||||
if (!strcmp(ConfigFilesList[i]->Name, txtName->getText().c_str()))
|
||||
if (!_tcscmp(ConfigFilesList[i]->Name, txtName->getText().c_str()))
|
||||
{
|
||||
// Select current entry
|
||||
lstConfigs->setSelected(i);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#define DROPDOWN_HEIGHT 15
|
||||
#define SLIDER_HEIGHT 18
|
||||
#define TITLEBAR_HEIGHT 24
|
||||
#include "guisan/sdl/sdlinput.hpp"
|
||||
#include <guisan/sdl/sdlinput.hpp>
|
||||
|
||||
typedef struct _ConfigCategory
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#include <guisan.hpp>
|
||||
#include <SDL_ttf.h>
|
||||
#include <guisan/sdl.hpp>
|
||||
#include "guisan/sdl/sdltruetypefont.hpp"
|
||||
#include <guisan/sdl/sdltruetypefont.hpp>
|
||||
#include "SelectorEntry.hpp"
|
||||
|
||||
#include "sysconfig.h"
|
||||
|
@ -221,7 +221,7 @@ namespace sdl
|
|||
SDL_ShowCursor(SDL_ENABLE);
|
||||
|
||||
//-------------------------------------------------
|
||||
// Create helpers for guichan
|
||||
// Create helpers for guisan
|
||||
//-------------------------------------------------
|
||||
gui_imageLoader = new gcn::SDLImageLoader();
|
||||
// The ImageLoader in use is static and must be set to be
|
||||
|
@ -678,6 +678,9 @@ void run_gui()
|
|||
try
|
||||
{
|
||||
sdl::gui_init();
|
||||
#ifdef DEBUG
|
||||
printf("Calling widgets::gui_init\n");
|
||||
#endif
|
||||
widgets::gui_init();
|
||||
if (_tcslen(startup_message) > 0) {
|
||||
ShowMessage(startup_title, startup_message, _T(""), _T("Ok"), _T(""));
|
||||
|
|
|
@ -14,24 +14,22 @@
|
|||
#include "gui.h"
|
||||
#include <SDL.h>
|
||||
|
||||
char keyboard_type = 0;
|
||||
|
||||
static struct uae_input_device_kbr_default keytrans_amiga[] = {
|
||||
|
||||
{ VK_ESCAPE, INPUTEVENT_KEY_ESC },
|
||||
|
||||
{ SDLK_F1, INPUTEVENT_KEY_F1, 0, INPUTEVENT_SPC_FLOPPY0, ID_FLAG_QUALIFIER_SPECIAL, INPUTEVENT_SPC_EFLOPPY0, ID_FLAG_QUALIFIER_SPECIAL | ID_FLAG_QUALIFIER_SHIFT },
|
||||
{ SDLK_F2, INPUTEVENT_KEY_F2, 0, INPUTEVENT_SPC_FLOPPY1, ID_FLAG_QUALIFIER_SPECIAL, INPUTEVENT_SPC_EFLOPPY1, ID_FLAG_QUALIFIER_SPECIAL | ID_FLAG_QUALIFIER_SHIFT },
|
||||
{ SDLK_F3, INPUTEVENT_KEY_F3, 0, INPUTEVENT_SPC_FLOPPY2, ID_FLAG_QUALIFIER_SPECIAL, INPUTEVENT_SPC_EFLOPPY2, ID_FLAG_QUALIFIER_SPECIAL | ID_FLAG_QUALIFIER_SHIFT },
|
||||
{ SDLK_F4, INPUTEVENT_KEY_F4, 0, INPUTEVENT_SPC_FLOPPY3, ID_FLAG_QUALIFIER_SPECIAL, INPUTEVENT_SPC_EFLOPPY3, ID_FLAG_QUALIFIER_SPECIAL | ID_FLAG_QUALIFIER_SHIFT },
|
||||
{ SDLK_F1, INPUTEVENT_KEY_F1 },
|
||||
{ SDLK_F2, INPUTEVENT_KEY_F2 },
|
||||
{ SDLK_F3, INPUTEVENT_KEY_F3 },
|
||||
{ SDLK_F4, INPUTEVENT_KEY_F4 },
|
||||
|
||||
{ SDLK_F5, INPUTEVENT_KEY_F5, 0, INPUTEVENT_SPC_STATERESTOREDIALOG, ID_FLAG_QUALIFIER_SPECIAL, INPUTEVENT_SPC_STATESAVEDIALOG, ID_FLAG_QUALIFIER_SPECIAL | ID_FLAG_QUALIFIER_SHIFT },
|
||||
{ SDLK_F5, INPUTEVENT_KEY_F5 },
|
||||
{ SDLK_F6, INPUTEVENT_KEY_F6 },
|
||||
{ SDLK_F7, INPUTEVENT_KEY_F7 },
|
||||
{ SDLK_F8, INPUTEVENT_KEY_F8 },
|
||||
{ SDLK_F9, INPUTEVENT_KEY_F9 },
|
||||
{ SDLK_F10, INPUTEVENT_KEY_F10 },
|
||||
|
||||
|
||||
{ SDLK_1, INPUTEVENT_KEY_1 },
|
||||
{ SDLK_2, INPUTEVENT_KEY_2 },
|
||||
{ SDLK_3, INPUTEVENT_KEY_3 },
|
||||
|
@ -85,10 +83,10 @@ static struct uae_input_device_kbr_default keytrans_amiga[] = {
|
|||
{ SDLK_KP_9, INPUTEVENT_KEY_NP_9 },
|
||||
{ SDLK_KP_0, INPUTEVENT_KEY_NP_0 },
|
||||
{ SDLK_KP_PERIOD, INPUTEVENT_KEY_PERIOD },
|
||||
{ SDLK_KP_PLUS, INPUTEVENT_KEY_NP_ADD, 0, INPUTEVENT_SPC_VOLUME_UP, ID_FLAG_QUALIFIER_SPECIAL, INPUTEVENT_SPC_MASTER_VOLUME_UP, ID_FLAG_QUALIFIER_SPECIAL | ID_FLAG_QUALIFIER_CONTROL, INPUTEVENT_SPC_INCREASE_REFRESHRATE, ID_FLAG_QUALIFIER_SPECIAL | ID_FLAG_QUALIFIER_SHIFT },
|
||||
{ SDLK_KP_MINUS, INPUTEVENT_KEY_NP_SUB, 0, INPUTEVENT_SPC_VOLUME_DOWN, ID_FLAG_QUALIFIER_SPECIAL, INPUTEVENT_SPC_MASTER_VOLUME_DOWN, ID_FLAG_QUALIFIER_SPECIAL | ID_FLAG_QUALIFIER_CONTROL, INPUTEVENT_SPC_DECREASE_REFRESHRATE, ID_FLAG_QUALIFIER_SPECIAL | ID_FLAG_QUALIFIER_SHIFT },
|
||||
{ SDLK_KP_MULTIPLY, INPUTEVENT_KEY_NP_MUL, 0, INPUTEVENT_SPC_VOLUME_MUTE, ID_FLAG_QUALIFIER_SPECIAL, INPUTEVENT_SPC_MASTER_VOLUME_MUTE, ID_FLAG_QUALIFIER_SPECIAL | ID_FLAG_QUALIFIER_CONTROL },
|
||||
{ SDLK_KP_DIVIDE, INPUTEVENT_KEY_NP_DIV, 0, ID_FLAG_QUALIFIER_SPECIAL },
|
||||
{ SDLK_KP_PLUS, INPUTEVENT_KEY_NP_ADD },
|
||||
{ SDLK_KP_MINUS, INPUTEVENT_KEY_NP_SUB },
|
||||
{ SDLK_KP_MULTIPLY, INPUTEVENT_KEY_NP_MUL },
|
||||
{ SDLK_KP_DIVIDE, INPUTEVENT_KEY_NP_DIV },
|
||||
{ SDLK_KP_ENTER, INPUTEVENT_KEY_ENTER }, // The ENT from keypad..
|
||||
|
||||
{ SDLK_MINUS, INPUTEVENT_KEY_SUB },
|
||||
|
@ -127,12 +125,12 @@ static struct uae_input_device_kbr_default keytrans_amiga[] = {
|
|||
{ SDLK_COMMA, INPUTEVENT_KEY_COMMA },
|
||||
{ SDLK_PERIOD, INPUTEVENT_KEY_PERIOD },
|
||||
{ SDLK_SLASH, INPUTEVENT_KEY_DIV },
|
||||
{ SDLK_SYSREQ, INPUTEVENT_SPC_SCREENSHOT_CLIPBOARD, 0, INPUTEVENT_SPC_SCREENSHOT, ID_FLAG_QUALIFIER_SPECIAL },
|
||||
{ SDLK_SYSREQ, INPUTEVENT_SPC_SCREENSHOT_CLIPBOARD },
|
||||
|
||||
{SDLK_END, INPUTEVENT_SPC_QUALIFIER_SPECIAL },
|
||||
{SDLK_PAUSE, INPUTEVENT_SPC_PAUSE, 0, ID_FLAG_QUALIFIER_SPECIAL, INPUTEVENT_SPC_IRQ7, ID_FLAG_QUALIFIER_SPECIAL | ID_FLAG_QUALIFIER_SHIFT },
|
||||
{SDLK_PAUSE, INPUTEVENT_SPC_PAUSE },
|
||||
|
||||
{SDLK_F12, INPUTEVENT_SPC_ENTERGUI, 0, ID_FLAG_QUALIFIER_SPECIAL, ID_FLAG_QUALIFIER_SHIFT, INPUTEVENT_SPC_TOGGLEDEFAULTSCREEN, ID_FLAG_QUALIFIER_CONTROL },
|
||||
{SDLK_F12, INPUTEVENT_SPC_ENTERGUI },
|
||||
|
||||
{ -1, 0 }
|
||||
};
|
||||
|
@ -202,27 +200,6 @@ void setcapslockstate(int state)
|
|||
capslockstate = state;
|
||||
}
|
||||
|
||||
int getcapslock()
|
||||
{
|
||||
const Uint8 *state = SDL_GetKeyboardState(nullptr);
|
||||
|
||||
int capstable[7];
|
||||
|
||||
// this returns bogus state if caps change when in exclusive mode..
|
||||
host_capslockstate = state[SDL_SCANCODE_CAPSLOCK] & 1;
|
||||
host_numlockstate = state[SDL_SCANCODE_NUMLOCKCLEAR] & 1;
|
||||
host_scrolllockstate = state[SDL_SCANCODE_SCROLLLOCK] & 1;
|
||||
capstable[0] = SDLK_CAPSLOCK;
|
||||
capstable[1] = host_capslockstate;
|
||||
capstable[2] = SDLK_NUMLOCKCLEAR;
|
||||
capstable[3] = host_numlockstate;
|
||||
capstable[4] = SDLK_SCROLLLOCK;
|
||||
capstable[5] = host_scrolllockstate;
|
||||
capstable[6] = 0;
|
||||
capslockstate = inputdevice_synccapslock(capslockstate, capstable);
|
||||
return capslockstate;
|
||||
}
|
||||
|
||||
void clearallkeys()
|
||||
{
|
||||
inputdevice_updateconfig(&changed_prefs, &currprefs);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "custom.h"
|
||||
#include "uae.h"
|
||||
#include "disk.h"
|
||||
#include "SDL.h"
|
||||
#include <SDL.h>
|
||||
|
||||
static int kickstart;
|
||||
|
||||
|
@ -181,7 +181,7 @@ int loadconfig_old(struct uae_prefs* p, const char* orgpath)
|
|||
else
|
||||
p->chipset_refreshrate = 50;
|
||||
fscanf(f, "displayedLines=%d\n", &p->gfx_size.height);
|
||||
fscanf(f, "screenWidth=%d\n", &p->gfx_size_fs.width);
|
||||
fscanf(f, "screenWidth=%d\n", &p->gfx_size.width);
|
||||
fscanf(f, "amiberry.custom_controls=%d\n", &p->customControls);
|
||||
fscanf(f, "amiberry.custom_up=%d\n", &p->custom_up);
|
||||
fscanf(f, "amiberry.custom_down=%d\n", &p->custom_down);
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
#include "config.h"
|
||||
#include "options.h"
|
||||
#include "threaddep/thread.h"
|
||||
#include "memory.h"
|
||||
#include "include/memory.h"
|
||||
#include "custom.h"
|
||||
#include "newcpu.h"
|
||||
#include "xwin.h"
|
||||
|
@ -3181,8 +3181,6 @@ addrbank *gfxmem_banks[MAX_RTG_BOARDS];
|
|||
* Also put it in reset_drawing() for safe-keeping. */
|
||||
void InitPicasso96(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
gfxmem_banks[0] = &gfxmem_bank;
|
||||
|
||||
//fastscreen
|
||||
|
@ -3190,7 +3188,7 @@ void InitPicasso96(void)
|
|||
//fastscreen
|
||||
memset(&picasso96_state_uaegfx, 0, sizeof(struct picasso96_state_struct));
|
||||
|
||||
for (i = 0; i < 256; i++) {
|
||||
for (int i = 0; i < 256; i++) {
|
||||
p2ctab[i][0] = (((i & 128) ? 0x01000000 : 0)
|
||||
| ((i & 64) ? 0x010000 : 0)
|
||||
| ((i & 32) ? 0x0100 : 0)
|
||||
|
|
|
@ -36,18 +36,14 @@ unsigned long target_lastsynctime(void);
|
|||
extern int screen_is_picasso;
|
||||
|
||||
void saveAdfDir(void);
|
||||
bool SetVSyncRate(int hz);
|
||||
void setCpuSpeed(void);
|
||||
void resetCpuSpeed(void);
|
||||
void update_display(struct uae_prefs *);
|
||||
void black_screen_now(void);
|
||||
void graphics_subshutdown(void);
|
||||
void moveVertical(int value);
|
||||
|
||||
void amiberry_stop_sound();
|
||||
|
||||
void keyboard_settrans();
|
||||
void translate_amiberry_keys(int symbol, int *modifier);
|
||||
void translate_amiberry_keys(int symbol, int newstate);
|
||||
void SimulateMouseOrJoy(int code, int keypressed);
|
||||
|
||||
#define REMAP_MOUSEBUTTON_LEFT -1
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include "sysdeps.h"
|
||||
|
||||
#include "options.h"
|
||||
#include "memory.h"
|
||||
#include "include/memory.h"
|
||||
#include "custom.h"
|
||||
#include "newcpu.h"
|
||||
#include "threaddep/thread.h"
|
||||
|
@ -105,30 +105,25 @@ unsigned int define_trap(TrapHandler handler_func, int flags, const TCHAR *name)
|
|||
if (trap_count == MAX_TRAPS) {
|
||||
write_log(_T("Ran out of emulator traps\n"));
|
||||
target_startup_msg(_T("Internal error"), _T("Ran out of emulator traps."));
|
||||
uae_restart(1, NULL);
|
||||
uae_restart(1, nullptr);
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
int i;
|
||||
unsigned int trap_num;
|
||||
struct Trap *trap;
|
||||
uaecptr addr = here();
|
||||
uaecptr addr = here();
|
||||
|
||||
for (i = 0; i < trap_count; i++) {
|
||||
if (addr == traps[i].addr)
|
||||
return i;
|
||||
}
|
||||
|
||||
trap_num = trap_count++;
|
||||
trap = &traps[trap_num];
|
||||
|
||||
trap->handler = handler_func;
|
||||
trap->flags = flags;
|
||||
trap->name = name;
|
||||
trap->addr = addr;
|
||||
|
||||
return trap_num;
|
||||
for (int i = 0; i < trap_count; i++) {
|
||||
if (addr == traps[i].addr)
|
||||
return i;
|
||||
}
|
||||
|
||||
unsigned int trap_num = trap_count++;
|
||||
struct Trap *trap = &traps[trap_num];
|
||||
|
||||
trap->handler = handler_func;
|
||||
trap->flags = flags;
|
||||
trap->name = name;
|
||||
trap->addr = addr;
|
||||
|
||||
return trap_num;
|
||||
}
|
||||
|
||||
|
||||
|
@ -157,7 +152,7 @@ void REGPARAM2 m68k_handle_trap(unsigned int trap_num)
|
|||
}
|
||||
else {
|
||||
/* Handle simple trap */
|
||||
retval = (trap->handler) (NULL);
|
||||
retval = (trap->handler) (nullptr);
|
||||
|
||||
if (has_retval)
|
||||
m68k_dreg(regs, 0) = retval;
|
||||
|
@ -237,7 +232,7 @@ static uaecptr m68k_return_trapaddr;
|
|||
static uaecptr exit_trap_trapaddr;
|
||||
|
||||
/* For IPC between main thread and trap context */
|
||||
static uae_sem_t trap_mutex = 0;
|
||||
static uae_sem_t trap_mutex = nullptr;
|
||||
static TrapContext *current_context;
|
||||
|
||||
|
||||
|
@ -283,7 +278,7 @@ static void *trap_thread(void *arg)
|
|||
/* Good bye, cruel world... */
|
||||
|
||||
/* dummy return value */
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -466,11 +461,10 @@ static uae_u32 REGPARAM2 exit_trap_handler(TrapContext *dummy_ctx)
|
|||
*/
|
||||
uae_u32 CallLib(TrapContext *ctx, uaecptr base, uae_s16 offset)
|
||||
{
|
||||
uae_u32 retval;
|
||||
uaecptr olda6 = trap_get_areg(ctx, 6);
|
||||
|
||||
trap_set_areg(ctx, 6, base);
|
||||
retval = trap_Call68k(ctx, base + offset);
|
||||
uae_u32 retval = trap_Call68k(ctx, base + offset);
|
||||
trap_set_areg(ctx, 6, olda6);
|
||||
|
||||
return retval;
|
||||
|
@ -507,9 +501,9 @@ void init_extended_traps(void)
|
|||
exit_trap_trapaddr = here();
|
||||
calltrap(deftrap2(exit_trap_handler, TRAPFLAG_NO_RETVAL, _T("exit_trap")));
|
||||
|
||||
if (trap_mutex != 0)
|
||||
if (trap_mutex != nullptr)
|
||||
uae_sem_destroy(&trap_mutex);
|
||||
trap_mutex = 0;
|
||||
trap_mutex = nullptr;
|
||||
uae_sem_init(&trap_mutex, 0, 1);
|
||||
}
|
||||
|
||||
|
@ -549,7 +543,6 @@ uae_u32 trap_call_lib(TrapContext *ctx, uaecptr base, uae_s16 offset)
|
|||
}
|
||||
uae_u32 trap_call_func(TrapContext *ctx, uaecptr func)
|
||||
{
|
||||
uae_u32 v;
|
||||
uae_u32 storedregs[16];
|
||||
bool storedregsused[16];
|
||||
for (int i = 0; i < 16; i++) {
|
||||
|
@ -563,7 +556,7 @@ uae_u32 trap_call_func(TrapContext *ctx, uaecptr func)
|
|||
}
|
||||
ctx->calllib_reg_inuse[i] = 0;
|
||||
}
|
||||
v = CallFunc(ctx, func);
|
||||
uae_u32 v = CallFunc(ctx, func);
|
||||
for (int i = 0; i < 16; i++) {
|
||||
if (storedregsused[i]) {
|
||||
regs.regs[i] = storedregs[i];
|
||||
|
@ -598,7 +591,7 @@ void trap_put_quad(TrapContext *ctx, uaecptr addr, uae_u64 v)
|
|||
{
|
||||
uae_u8 out[8];
|
||||
put_long_host(out + 0, v >> 32);
|
||||
put_long_host(out + 4, (uae_u32)(v >> 0));
|
||||
put_long_host(out + 4, uae_u32(v >> 0));
|
||||
trap_put_bytes(ctx, out, addr, 8);
|
||||
}
|
||||
void trap_put_long(TrapContext *ctx, uaecptr addr, uae_u32 v)
|
||||
|
|
|
@ -789,9 +789,9 @@ static struct zfile *wrp(struct zfile *z, int *retcode)
|
|||
#endif
|
||||
|
||||
#ifdef A_7Z
|
||||
#include "7z/Xz.h"
|
||||
#include "7z/LzmaDec.h"
|
||||
#include "7z/7zCrc.h"
|
||||
#include "archivers/7z/Xz.h"
|
||||
#include "archivers/7z/LzmaDec.h"
|
||||
#include "archivers/7z/7zCrc.h"
|
||||
|
||||
static void *SzAlloc(void *p, size_t size)
|
||||
{
|
||||
|
|
|
@ -486,11 +486,11 @@ static struct zfile *archive_unpack_zip(struct zfile *zf)
|
|||
#ifdef A_7Z
|
||||
/* 7Z */
|
||||
|
||||
#include "7z/7z.h"
|
||||
#include "7z/Alloc.h"
|
||||
#include "7z/7zFile.h"
|
||||
#include "7z/7zVersion.h"
|
||||
#include "7z/7zCrc.h"
|
||||
#include "archivers/7z/7z.h"
|
||||
#include "archivers/7z/Alloc.h"
|
||||
#include "archivers/7z/7zFile.h"
|
||||
#include "archivers/7z/7zVersion.h"
|
||||
#include "archivers/7z/7zCrc.h"
|
||||
|
||||
static void *SzAlloc(void *p, size_t size)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue