diff --git a/.gitignore b/.gitignore
index 3477a908..e7c26475 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,17 @@
conf/*.uae
conf/*.conf
kickstarts/*.rom
+*.db
+*.dep
+*.ast
+*.rdb
+*.npd
+*.rsp
+*.suo
+*.alldeps
+*.log
+*.lck
+*.npa00
+*.psf
+*.000
+*.001
diff --git a/Amiberry/Amiberry.sln b/Amiberry/Amiberry.sln
new file mode 100644
index 00000000..d8f04d20
--- /dev/null
+++ b/Amiberry/Amiberry.sln
@@ -0,0 +1,21 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.25920.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Amiberry", "Amiberry\Amiberry.vcxproj", "{D76BB09D-FF2A-4028-A065-421C430CD238}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|VisualGDB = Debug|VisualGDB
+ Release|VisualGDB = Release|VisualGDB
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {D76BB09D-FF2A-4028-A065-421C430CD238}.Debug|VisualGDB.ActiveCfg = Debug|VisualGDB
+ {D76BB09D-FF2A-4028-A065-421C430CD238}.Debug|VisualGDB.Build.0 = Debug|VisualGDB
+ {D76BB09D-FF2A-4028-A065-421C430CD238}.Release|VisualGDB.ActiveCfg = Release|VisualGDB
+ {D76BB09D-FF2A-4028-A065-421C430CD238}.Release|VisualGDB.Build.0 = Release|VisualGDB
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Amiberry/Amiberry/Amiberry-Debug.vgdbsettings b/Amiberry/Amiberry/Amiberry-Debug.vgdbsettings
new file mode 100644
index 00000000..9ba96e0d
--- /dev/null
+++ b/Amiberry/Amiberry/Amiberry-Debug.vgdbsettings
@@ -0,0 +1,131 @@
+
+
+ Debug
+
+
+
+ MinGWUnixSlash
+
+
+ 192.168.1.152
+ SSH
+ pi
+
+ false
+ false
+ false
+ false
+ true
+ $(ProjectDir)
+
+
+
+ Raspberry PI
+ com.visualgdb.raspberry_pi
+ C:\SysGCC\raspberry
+ false
+ C:\SysGCC\raspberry\bin\arm-linux-gnueabihf-gcc.exe
+ C:\SysGCC\raspberry\bin\arm-linux-gnueabihf-g++.exe
+ C:\SysGCC\raspberry\bin\arm-linux-gnueabihf-gdb.exe
+ C:\SysGCC\raspberry\bin\arm-linux-gnueabihf-ar.exe
+ C:\SysGCC\raspberry\bin\arm-linux-gnueabihf-objcopy.exe
+ C:\SysGCC\raspberry\bin\make.exe
+
+ C:\SysGCC\raspberry\bin
+
+ true
+ false
+
+
+ MinGWUnixSlash
+
+
+ Amiberry.vcxproj
+
+
+
+ 1
+
+
+
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+
+ false
+ false
+ false
+ false
+ false
+ false
+ true
+ false
+ None
+ false
+ false
+ main
+ true
+ false
+ false
+ false
+
+
+
+
+
+ LANG
+ en_US.UTF-8
+
+
+ PATH
+ C:\SysGCC\raspberry\bin;%PATH%
+
+
+
+ $(TargetPath)
+ 2000
+
+
+ false
+ /tmp/$(TargetFileName)
+ Local
+ false
+ false
+ Auto
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+ Default
+
+
+
+ true
+
+
+
+
+ Unknown
+
+ true
+
+
+ VisualGDB\VisualGDBCache
+
\ No newline at end of file
diff --git a/Amiberry/Amiberry/Amiberry-Release.vgdbsettings b/Amiberry/Amiberry/Amiberry-Release.vgdbsettings
new file mode 100644
index 00000000..85b7343f
--- /dev/null
+++ b/Amiberry/Amiberry/Amiberry-Release.vgdbsettings
@@ -0,0 +1,131 @@
+
+
+ Release
+
+
+
+ MinGWUnixSlash
+
+
+ 192.168.1.152
+ SSH
+ pi
+
+ false
+ false
+ false
+ false
+ true
+ $(ProjectDir)
+
+
+
+ Raspberry PI
+ com.visualgdb.raspberry_pi
+ C:\SysGCC\raspberry
+ false
+ C:\SysGCC\raspberry\bin\arm-linux-gnueabihf-gcc.exe
+ C:\SysGCC\raspberry\bin\arm-linux-gnueabihf-g++.exe
+ C:\SysGCC\raspberry\bin\arm-linux-gnueabihf-gdb.exe
+ C:\SysGCC\raspberry\bin\arm-linux-gnueabihf-ar.exe
+ C:\SysGCC\raspberry\bin\arm-linux-gnueabihf-objcopy.exe
+ C:\SysGCC\raspberry\bin\make.exe
+
+ C:\SysGCC\raspberry\bin
+
+ true
+ false
+
+
+ MinGWUnixSlash
+
+
+ Amiberry.vcxproj
+
+
+
+ 1
+
+
+
+
+
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+ false
+
+ false
+ false
+ false
+ false
+ false
+ false
+ true
+ false
+ None
+ false
+ false
+ main
+ true
+ false
+ false
+ false
+
+
+
+
+
+ LANG
+ en_US.UTF-8
+
+
+ PATH
+ C:\SysGCC\raspberry\bin;%PATH%
+
+
+
+ $(TargetPath)
+ 2000
+
+
+ false
+ /tmp/$(TargetFileName)
+ Local
+ false
+ false
+ Auto
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+ Default
+
+
+
+ true
+
+
+
+
+ Unknown
+
+ true
+
+
+ VisualGDB\VisualGDBCache
+
\ No newline at end of file
diff --git a/Amiberry/Amiberry/Amiberry.vcxproj b/Amiberry/Amiberry/Amiberry.vcxproj
new file mode 100644
index 00000000..e4113288
--- /dev/null
+++ b/Amiberry/Amiberry/Amiberry.vcxproj
@@ -0,0 +1,383 @@
+
+
+
+
+ Debug
+ VisualGDB
+
+
+ Release
+ VisualGDB
+
+
+
+ {D76BB09D-FF2A-4028-A065-421C430CD238}
+
+
+
+
+
+
+
+
+
+ Debug
+ C:\SysGCC\raspberry
+
+
+ C:\SysGCC\raspberry
+
+
+
+ GNUPP14
+ ../../src;../../src/include;../../src/od-pandora;../../src/td-sdl;=/opt/vc/include;=/opt/vc/include/interface/vmcs_host/linux;=/opt/vc/include/interface/vcos/pthreads;=/usr/include/SDL;=/usr/include/libxml2;%(ClCompile.AdditionalIncludeDirectories)
+ DEBUG=1;_REENTRANT;RASPBERRY;CAPSLOCK_DEBIAN_WORKAROUND;ARMV6T2;PICASSO96;USE_ARMNEON;CPU_arm;ARM_ASSEMBLY;ARMV6_ASSEMBLY;PANDORA;WITH_INGAME_WARNING;USE_SDL;ROM_PATH_PREFIX=\"./\";DATA_PREFIX=\"./data/\";SAVE_PREFIX=\"./saves/\";GCCCONSTFUNC="__attribute__((const))";%(ClCompile.PreprocessorDefinitions)
+ -mcpu=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard %(AdditionalOptions)
+
+
+ ;%(Link.AdditionalLinkerInputs)
+ =/opt/vc/lib;%(Link.LibrarySearchDirectories)
+ bcm_host;SDL;pthread;m;z;SDL_image;png;rt;xml2;FLAC;mpg123;dl;SDL_ttf;guichan_sdl;guichan;%(Link.AdditionalLibraryNames)
+
+
+
+
+
+ GNUPP14
+ ../../src;../../src/include;../../src/od-pandora;../../src/td-sdl;=/opt/vc/include;=/opt/vc/include/interface/vmcs_host/linux;=/opt/vc/include/interface/vcos/pthreads;=/usr/include/SDL;=/usr/include/libxml2;%(ClCompile.AdditionalIncludeDirectories)
+ NDEBUG=1;RELEASE=1;_REENTRANT;RASPBERRY;CAPSLOCK_DEBIAN_WORKAROUND;ARMV6T2;PICASSO96;USE_ARMNEON;CPU_arm;ARM_ASSEMBLY;ARMV6_ASSEMBLY;PANDORA;WITH_INGAME_WARNING;USE_SDL;ROM_PATH_PREFIX=\"./\";DATA_PREFIX=\"./data/\";SAVE_PREFIX=\"./saves/\";GCCCONSTFUNC="__attribute__((const))";%(ClCompile.PreprocessorDefinitions)
+
+
+ ;%(Link.AdditionalLinkerInputs)
+ =/opt/vc/lib;%(Link.LibrarySearchDirectories)
+ bcm_host;SDL;pthread;m;z;SDL_image;png;rt;xml2;FLAC;mpg123;dl;SDL_ttf;guichan_sdl;guichan;%(Link.AdditionalLibraryNames)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+ true
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Amiberry/Amiberry/Amiberry.vcxproj.filters b/Amiberry/Amiberry/Amiberry.vcxproj.filters
new file mode 100644
index 00000000..f9dd485a
--- /dev/null
+++ b/Amiberry/Amiberry/Amiberry.vcxproj.filters
@@ -0,0 +1,964 @@
+
+
+
+
+ {b16b49e6-388b-4870-9138-6522821dc4fa}
+ cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
+
+
+ {f1c11b7b-16ac-4c33-afc7-f48cb566cc0a}
+ h;hpp;hxx;hm;inl;inc;xsd
+
+
+ {718f34a1-b5f0-471d-87bd-7830c504177f}
+ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav
+
+
+ {426e7bc2-9690-418f-88f1-d3fbd4286058}
+ *.vgdbsettings
+
+
+ {a3539168-deee-4fef-9e7e-6c265c4a1aaf}
+
+
+ {a72de7b6-114c-46c1-94dd-e1c6824e51ae}
+
+
+ {7a9137a1-118b-4810-891d-861d2c071939}
+
+
+ {7a9672f6-c9a7-458e-b273-0b24b0a19c11}
+
+
+ {37add0f8-d9ce-496d-b31b-7b4de37a28ba}
+
+
+ {11863c92-f5fb-41a7-8888-0133c42939f5}
+
+
+ {66889cab-a3cd-4751-a3b1-1cde1fffa8a9}
+
+
+ {2395dddd-7a9e-4763-a1e6-3e9bf0b87d85}
+
+
+ {125cb7d1-693b-43b8-88b6-704e2c862045}
+
+
+ {8d2e90b3-4227-4898-b701-b3d43547a46e}
+
+
+ {f4dc4c59-aa7a-4cce-88bb-d743d6918cb4}
+
+
+ {7c39070a-7b40-489a-9b73-d0a3393586b3}
+
+
+ {d30f8b54-3f88-446c-85e1-e892a326a06e}
+
+
+ {bbb7c3af-1d98-4d1c-a2b2-a5d9f3cbae36}
+
+
+ {accf56a1-83fd-49be-886a-f8bc35ec1ec8}
+
+
+ {af250902-faaf-4f93-bf17-3d044c9af644}
+
+
+ {bf9a1a81-7b9d-4c8e-945b-6fbf2f69cf65}
+
+
+ {4c76dc23-c710-47d0-b2c0-21fe5e3c9b84}
+
+
+ {4e7f85db-d3e3-4b65-b969-a7b829bc3281}
+
+
+ {b1a09498-1e4a-40d4-a986-9e09ad865690}
+
+
+ {dcfa291d-f91e-4f23-a259-791df4811cc0}
+
+
+ {7944e92f-3c23-4f86-842a-aa199a00dd35}
+
+
+ {ad85bf25-c171-40d2-ae9d-997bd5237bab}
+
+
+ {a44fad77-d044-486d-8a84-3f2f17c6bb49}
+
+
+ {2a0d7085-3d1a-4180-b2ad-5d7333af5e67}
+
+
+ {c902da66-3854-4a23-be3f-fbb4bc6ce351}
+
+
+ {299069a6-54c8-4b5a-bb2d-d38199ea1a49}
+
+
+ {c4235e7b-2e35-4514-a57e-4c86332ecc2b}
+
+
+ {f1a3ad08-e3bb-42f7-83b9-9597f31cf7f8}
+
+
+ {e1a264aa-b585-41b6-ac81-44f2f6b85a90}
+
+
+ {91d43e6e-b831-4e13-8316-d1dc2a15cc69}
+
+
+ {4e318f28-ff4d-4f7a-8a12-cbcf4b5032d7}
+
+
+
+
+ VisualGDB settings
+
+
+ VisualGDB settings
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files
+
+
+ Source files\sd-sdl
+
+
+ Source files\od-rasp
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\gui
+
+
+ Source files\od-pandora\menu
+
+
+ Source files\md-pandora
+
+
+ Source files\jit
+
+
+ Source files\jit
+
+
+ Source files\jit
+
+
+ Source files\jit
+
+
+ Source files\archivers\7z
+
+
+ Source files\archivers\7z
+
+
+ Source files\archivers\7z
+
+
+ Source files\archivers\7z
+
+
+ Source files\archivers\7z
+
+
+ Source files\archivers\7z
+
+
+ Source files\archivers\7z
+
+
+ Source files\archivers\7z\Archive\7z
+
+
+ Source files\archivers\7z\Archive\7z
+
+
+ Source files\archivers\7z\Archive\7z
+
+
+ Source files\archivers\7z\Archive\7z
+
+
+ Source files\archivers\7z\Archive\7z
+
+
+ Source files\archivers\7z\Archive\7z
+
+
+ Source files\archivers\dms
+
+
+ Source files\archivers\dms
+
+
+ Source files\archivers\dms
+
+
+ Source files\archivers\dms
+
+
+ Source files\archivers\dms
+
+
+ Source files\archivers\dms
+
+
+ Source files\archivers\dms
+
+
+ Source files\archivers\dms
+
+
+ Source files\archivers\dms
+
+
+ Source files\archivers\dms
+
+
+ Source files\archivers\dms
+
+
+ Source files\archivers\lha
+
+
+ Source files\archivers\lha
+
+
+ Source files\archivers\lha
+
+
+ Source files\archivers\lha
+
+
+ Source files\archivers\lha
+
+
+ Source files\archivers\lha
+
+
+ Source files\archivers\lha
+
+
+ Source files\archivers\lha
+
+
+ Source files\archivers\lha
+
+
+ Source files\archivers\lha
+
+
+ Source files\archivers\lha
+
+
+ Source files\archivers\lzx
+
+
+ Source files\archivers\wrp
+
+
+ Source files\archivers\zip
+
+
+
+
+ Resource files\data
+
+
+ Resource files\data
+
+
+ Resource files\data
+
+
+ Resource files\data
+
+
+ Resource files\data
+
+
+ Resource files\data
+
+
+ Resource files\data
+
+
+ Resource files\data
+
+
+ Resource files\data
+
+
+ Resource files\data
+
+
+ Resource files\data
+
+
+ Resource files\data
+
+
+ Resource files\data
+
+
+ Resource files\data
+
+
+ Resource files\data
+
+
+ Resource files\data
+
+
+
+
+ Resource files\data
+
+
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\include
+
+
+ Header files\td-sdl
+
+
+ Header files\sd-pandora
+
+
+ Header files\od-pandora
+
+
+ Header files\od-pandora
+
+
+ Header files\od-pandora
+
+
+ Header files\od-pandora
+
+
+ Header files\od-pandora
+
+
+ Header files\od-pandora
+
+
+ Header files\od-pandora\gui
+
+
+ Header files\od-pandora\gui
+
+
+ Header files\od-pandora\gui
+
+
+ Header files\od-pandora\gui
+
+
+ Header files\od-pandora\gui
+
+
+ Header files\od-pandora\gui
+
+
+ Header files\od-pandora\gui
+
+
+ Header files\md-pandora
+
+
+ Header files\md-pandora
+
+
+ Header files\md-pandora
+
+
+ Header files\md-pandora
+
+
+ Header files\jit
+
+
+ Header files\jit
+
+
+ Header files\jit
+
+
+ Header files\jit
+
+
+ Header files\jit
+
+
+ Header files\archivers\7z
+
+
+ Header files\archivers\7z
+
+
+ Header files\archivers\7z
+
+
+ Header files\archivers\7z
+
+
+ Header files\archivers\7z
+
+
+ Header files\archivers\7z
+
+
+ Header files\archivers\7z
+
+
+ Header files\archivers\7z
+
+
+ Header files\archivers\7z\Archive\7z
+
+
+ Header files\archivers\7z\Archive\7z
+
+
+ Header files\archivers\7z\Archive\7z
+
+
+ Header files\archivers\7z\Archive\7z
+
+
+ Header files\archivers\7z\Archive\7z
+
+
+ Header files\archivers\7z\Archive\7z
+
+
+ Header files\archivers\dms
+
+
+ Header files\archivers\dms
+
+
+ Header files\archivers\dms
+
+
+ Header files\archivers\dms
+
+
+ Header files\archivers\dms
+
+
+ Header files\archivers\dms
+
+
+ Header files\archivers\dms
+
+
+ Header files\archivers\dms
+
+
+ Header files\archivers\dms
+
+
+ Header files\archivers\dms
+
+
+ Header files\archivers\dms
+
+
+ Header files\archivers\dms
+
+
+ Header files\archivers\lha
+
+
+ Header files\archivers\lha
+
+
+ Header files\archivers\wrp
+
+
+ Header files\archivers\zip
+
+
+
\ No newline at end of file
diff --git a/Amiberry/Amiberry/Amiberry.vcxproj.user b/Amiberry/Amiberry/Amiberry.vcxproj.user
new file mode 100644
index 00000000..be250787
--- /dev/null
+++ b/Amiberry/Amiberry/Amiberry.vcxproj.user
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/src/gfxboard.cpp b/src/gfxboard.cpp
new file mode 100644
index 00000000..769a7410
--- /dev/null
+++ b/src/gfxboard.cpp
@@ -0,0 +1,32 @@
+/*
+* UAE - The Un*x Amiga Emulator
+*
+* Cirrus Logic based graphics board emulation
+*
+* Copyright 2013 Toni Wilen
+*
+*/
+
+#include "sysconfig.h"
+#include "sysdeps.h"
+
+#include "options.h"
+#include "uae.h"
+#include "include/memory.h"
+#include "debug.h"
+#include "custom.h"
+#include "newcpu.h"
+#include "picasso96.h"
+#include "statusline.h"
+#include "rommgr.h"
+#include "zfile.h"
+#include "gfxboard.h"
+
+bool gfxboard_is_z3 (int type)
+{
+ if (type == GFXBOARD_UAE_Z2)
+ return false;
+ if (type == GFXBOARD_UAE_Z3)
+ return true;
+ return false;
+}
diff --git a/src/include/gfxboard.h b/src/include/gfxboard.h
new file mode 100644
index 00000000..147ffb9e
--- /dev/null
+++ b/src/include/gfxboard.h
@@ -0,0 +1,5 @@
+
+extern bool gfxboard_is_z3 (int);
+
+#define GFXBOARD_UAE_Z2 0
+#define GFXBOARD_UAE_Z3 1
diff --git a/src/include/scsi.h b/src/include/scsi.h
new file mode 100644
index 00000000..a3de91a1
--- /dev/null
+++ b/src/include/scsi.h
@@ -0,0 +1,2 @@
+
+#define SCSI_DATA_BUFFER_SIZE (512 * 512)
diff --git a/src/newcpu_common.cpp b/src/newcpu_common.cpp
new file mode 100644
index 00000000..54e9a7ea
--- /dev/null
+++ b/src/newcpu_common.cpp
@@ -0,0 +1,660 @@
+#include "sysconfig.h"
+#include "sysdeps.h"
+
+#define MOVEC_DEBUG 0
+
+#include "options.h"
+#include "memory.h"
+#include "newcpu.h"
+#include "cpu_prefetch.h"
+
+int movec_illg (int regno)
+{
+ int regno2 = regno & 0x7ff;
+
+ if (currprefs.cpu_model == 68010) {
+ if (regno2 < 2)
+ return 0;
+ return 1;
+ } else if (currprefs.cpu_model == 68020) {
+ if (regno == 3)
+ return 1; /* 68040/060 only */
+ /* 4 is >=68040, but 0x804 is in 68020 */
+ if (regno2 < 4 || regno == 0x804)
+ return 0;
+ return 1;
+ } else if (currprefs.cpu_model == 68030) {
+ if (regno2 <= 2)
+ return 0;
+ if (regno == 0x803 || regno == 0x804)
+ return 0;
+ return 1;
+ } else if (currprefs.cpu_model == 68040) {
+ if (regno == 0x802)
+ return 1; /* 68020/030 only */
+ if (regno2 < 8) return 0;
+ return 1;
+ }
+ return 1;
+}
+
+int m68k_move2c (int regno, uae_u32 *regp)
+{
+ if (movec_illg (regno)) {
+ op_illg (0x4E7B);
+ return 0;
+ } else {
+ switch (regno) {
+ case 0: regs.sfc = *regp & 7; break;
+ case 1: regs.dfc = *regp & 7; break;
+ case 2:
+ {
+ uae_u32 cacr_mask = 0;
+ if (currprefs.cpu_model == 68020)
+ cacr_mask = 0x0000000f;
+ else if (currprefs.cpu_model == 68030)
+ cacr_mask = 0x00003f1f;
+ else if (currprefs.cpu_model == 68040)
+ cacr_mask = 0x80008000;
+ regs.cacr = *regp & cacr_mask;
+ set_cpu_caches(false);
+ }
+ break;
+ /* 68040/060 only */
+ case 3:
+ regs.tcr = *regp & 0xc000;
+ break;
+
+ /* no differences between 68040 and 68060 */
+ case 4: regs.itt0 = *regp & 0xffffe364; break;
+ case 5: regs.itt1 = *regp & 0xffffe364; break;
+ case 6: regs.dtt0 = *regp & 0xffffe364; break;
+ case 7: regs.dtt1 = *regp & 0xffffe364; break;
+ /* 68060 only */
+ case 8: regs.buscr = *regp & 0xf0000000; break;
+
+ case 0x800: regs.usp = *regp; break;
+ case 0x801: regs.vbr = *regp; break;
+ case 0x802: regs.caar = *regp; break;
+ case 0x803: regs.msp = *regp; if (regs.m == 1) m68k_areg(regs, 7) = regs.msp; break;
+ case 0x804: regs.isp = *regp; if (regs.m == 0) m68k_areg(regs, 7) = regs.isp; break;
+ /* 68040 only */
+ case 0x805: regs.mmusr = *regp; break;
+ /* 68040/060 */
+ case 0x806: regs.urp = *regp & 0xfffffe00; break;
+ case 0x807: regs.srp = *regp & 0xfffffe00; break;
+ /* 68060 only */
+ case 0x808:
+ {
+ uae_u32 opcr = regs.pcr;
+ regs.pcr &= ~(0x40 | 2 | 1);
+ regs.pcr |= (*regp) & (0x40 | 2 | 1);
+ if (currprefs.fpu_model <= 0)
+ regs.pcr |= 2;
+ if (((opcr ^ regs.pcr) & 2) == 2) {
+ write_log (_T("68060 FPU state: %s\n"), regs.pcr & 2 ? _T("disabled") : _T("enabled"));
+ /* flush possible already translated FPU instructions */
+ flush_icache (0, 3);
+ }
+ }
+ break;
+ default:
+ op_illg (0x4E7B);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+int m68k_movec2 (int regno, uae_u32 *regp)
+{
+ if (movec_illg (regno)) {
+ op_illg (0x4E7A);
+ return 0;
+ } else {
+ switch (regno) {
+ case 0: *regp = regs.sfc; break;
+ case 1: *regp = regs.dfc; break;
+ case 2:
+ {
+ uae_u32 v = regs.cacr;
+ uae_u32 cacr_mask = 0;
+ if (currprefs.cpu_model == 68020)
+ cacr_mask = 0x00000003;
+ else if (currprefs.cpu_model == 68030)
+ cacr_mask = 0x00003313;
+ else if (currprefs.cpu_model == 68040)
+ cacr_mask = 0x80008000;
+ *regp = v & cacr_mask;
+ }
+ break;
+ case 3: *regp = regs.tcr; break;
+ case 4: *regp = regs.itt0; break;
+ case 5: *regp = regs.itt1; break;
+ case 6: *regp = regs.dtt0; break;
+ case 7: *regp = regs.dtt1; break;
+ case 8: *regp = regs.buscr; break;
+
+ case 0x800: *regp = regs.usp; break;
+ case 0x801: *regp = regs.vbr; break;
+ case 0x802: *regp = regs.caar; break;
+ case 0x803: *regp = regs.m == 1 ? m68k_areg(regs, 7) : regs.msp; break;
+ case 0x804: *regp = regs.m == 0 ? m68k_areg(regs, 7) : regs.isp; break;
+ case 0x805: *regp = regs.mmusr; break;
+ case 0x806: *regp = regs.urp; break;
+ case 0x807: *regp = regs.srp; break;
+ case 0x808: *regp = regs.pcr; break;
+
+ default:
+ op_illg (0x4E7A);
+ return 0;
+ }
+ }
+ return 1;
+}
+
+/*
+* extract bitfield data from memory and return it in the MSBs
+* bdata caches the unmodified data for put_bitfield()
+*/
+uae_u32 REGPARAM2 get_bitfield (uae_u32 src, uae_u32 bdata[2], uae_s32 offset, int width)
+{
+ uae_u32 tmp, res, mask;
+
+ offset &= 7;
+ mask = 0xffffffffu << (32 - width);
+ switch ((offset + width + 7) >> 3) {
+ case 1:
+ tmp = get_byte (src);
+ res = tmp << (24 + offset);
+ bdata[0] = tmp & ~(mask >> (24 + offset));
+ break;
+ case 2:
+ tmp = get_word (src);
+ res = tmp << (16 + offset);
+ bdata[0] = tmp & ~(mask >> (16 + offset));
+ break;
+ case 3:
+ tmp = get_word (src);
+ res = tmp << (16 + offset);
+ bdata[0] = tmp & ~(mask >> (16 + offset));
+ tmp = get_byte (src + 2);
+ res |= tmp << (8 + offset);
+ bdata[1] = tmp & ~(mask >> (8 + offset));
+ break;
+ case 4:
+ tmp = get_long (src);
+ res = tmp << offset;
+ bdata[0] = tmp & ~(mask >> offset);
+ break;
+ case 5:
+ tmp = get_long (src);
+ res = tmp << offset;
+ bdata[0] = tmp & ~(mask >> offset);
+ tmp = get_byte (src + 4);
+ res |= tmp >> (8 - offset);
+ bdata[1] = tmp & ~(mask << (8 - offset));
+ break;
+ default:
+ /* Panic? */
+ write_log (_T("get_bitfield() can't happen %d\n"), (offset + width + 7) >> 3);
+ res = 0;
+ break;
+ }
+ return res;
+}
+/*
+* write bitfield data (in the LSBs) back to memory, upper bits
+* must be cleared already.
+*/
+void REGPARAM2 put_bitfield (uae_u32 dst, uae_u32 bdata[2], uae_u32 val, uae_s32 offset, int width)
+{
+ offset = (offset & 7) + width;
+ switch ((offset + 7) >> 3) {
+ case 1:
+ put_byte (dst, bdata[0] | (val << (8 - offset)));
+ break;
+ case 2:
+ put_word (dst, bdata[0] | (val << (16 - offset)));
+ break;
+ case 3:
+ put_word (dst, bdata[0] | (val >> (offset - 16)));
+ put_byte (dst + 2, bdata[1] | (val << (24 - offset)));
+ break;
+ case 4:
+ put_long (dst, bdata[0] | (val << (32 - offset)));
+ break;
+ case 5:
+ put_long (dst, bdata[0] | (val >> (offset - 32)));
+ put_byte (dst + 4, bdata[1] | (val << (40 - offset)));
+ break;
+ default:
+ write_log (_T("put_bitfield() can't happen %d\n"), (offset + 7) >> 3);
+ break;
+ }
+}
+
+uae_u32 REGPARAM2 _get_disp_ea_020 (uae_u32 base)
+{
+ uae_u16 dp = next_diword ();
+ int reg = (dp >> 12) & 15;
+ uae_s32 regd = regs.regs[reg];
+ if ((dp & 0x800) == 0)
+ regd = (uae_s32)(uae_s16)regd;
+ regd <<= (dp >> 9) & 3;
+ if (dp & 0x100) {
+ uae_s32 outer = 0;
+ if (dp & 0x80) base = 0;
+ if (dp & 0x40) regd = 0;
+
+ if ((dp & 0x30) == 0x20)
+ base += (uae_s32)(uae_s16) next_diword ();
+ if ((dp & 0x30) == 0x30)
+ base += next_dilong ();
+
+ if ((dp & 0x3) == 0x2)
+ outer = (uae_s32)(uae_s16) next_diword ();
+ if ((dp & 0x3) == 0x3)
+ outer = next_dilong ();
+
+ if ((dp & 0x4) == 0)
+ base += regd;
+ if (dp & 0x3)
+ base = get_long (base);
+ if (dp & 0x4)
+ base += regd;
+
+ return base + outer;
+ } else {
+ return base + (uae_s32)((uae_s8)dp) + regd;
+ }
+}
+
+/*
+* Compute exact number of CPU cycles taken
+* by DIVU and DIVS on a 68000 processor.
+*
+* Copyright (c) 2005 by Jorge Cwik, pasti@fxatari.com
+*
+* This is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this software; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*
+*/
+
+
+/*
+
+ The routines below take dividend and divisor as parameters.
+ They return 0 if division by zero, or exact number of cycles otherwise.
+
+ The number of cycles returned assumes a register operand.
+ Effective address time must be added if memory operand.
+
+ For 68000 only (not 68010, 68012, 68020, etc).
+ Probably valid for 68008 after adding the extra prefetch cycle.
+
+
+ Best and worst cases for register operand:
+ (Note the difference with the documented range.)
+
+
+ DIVU:
+
+ Overflow (always): 10 cycles.
+ Worst case: 136 cycles.
+ Best case: 76 cycles.
+
+
+ DIVS:
+
+ Absolute overflow: 16-18 cycles.
+ Signed overflow is not detected prematurely.
+
+ Worst case: 156 cycles.
+ Best case without signed overflow: 122 cycles.
+ Best case with signed overflow: 120 cycles
+
+
+ */
+
+int getDivu68kCycles (uae_u32 dividend, uae_u16 divisor)
+{
+ int mcycles;
+ uae_u32 hdivisor;
+ int i;
+
+ if(divisor == 0)
+ return 0;
+
+ // Overflow
+ if((dividend >> 16) >= divisor)
+ return (mcycles = 5) * 2;
+
+ mcycles = 38;
+ hdivisor = divisor << 16;
+
+ for( i = 0; i < 15; i++) {
+ uae_u32 temp;
+ temp = dividend;
+
+ dividend <<= 1;
+
+ // If carry from shift
+ if((uae_s32)temp < 0)
+ dividend -= hdivisor;
+ else {
+ mcycles += 2;
+ if(dividend >= hdivisor) {
+ dividend -= hdivisor;
+ mcycles--;
+ }
+ }
+ }
+ return mcycles * 2;
+}
+
+int getDivs68kCycles (uae_s32 dividend, uae_s16 divisor)
+{
+ int mcycles;
+ uae_u32 aquot;
+ int i;
+
+ if(divisor == 0)
+ return 0;
+
+ mcycles = 6;
+
+ if( dividend < 0)
+ mcycles++;
+
+ // Check for absolute overflow
+ if(((uae_u32)abs(dividend) >> 16) >= (uae_u16)abs(divisor))
+ return (mcycles + 2) * 2;
+
+ // Absolute quotient
+ aquot = (uae_u32) abs(dividend) / (uae_u16)abs(divisor);
+
+ mcycles += 55;
+
+ if(divisor >= 0) {
+ if(dividend >= 0)
+ mcycles--;
+ else
+ mcycles++;
+ }
+
+ // Count 15 msbits in absolute of quotient
+
+ for( i = 0; i < 15; i++) {
+ if((uae_s16)aquot >= 0)
+ mcycles++;
+ aquot <<= 1;
+ }
+
+ return mcycles * 2;
+}
+
+STATIC_INLINE int div_unsigned(uae_u32 src_hi, uae_u32 src_lo, uae_u32 div, uae_u32 *quot, uae_u32 *rem)
+{
+ uae_u32 q = 0, cbit = 0;
+ int i;
+
+ if (div <= src_hi) {
+ return 1;
+ }
+ for (i = 0 ; i < 32 ; i++) {
+ cbit = src_hi & 0x80000000ul;
+ src_hi <<= 1;
+ if (src_lo & 0x80000000ul) src_hi++;
+ src_lo <<= 1;
+ q = q << 1;
+ if (cbit || div <= src_hi) {
+ q |= 1;
+ src_hi -= div;
+ }
+ }
+ *quot = q;
+ *rem = src_hi;
+ return 0;
+}
+
+void m68k_divl (uae_u32 opcode, uae_u32 src, uae_u16 extra)
+{
+ // Done in caller
+ //if (src == 0) {
+ // Exception (5);
+ // return;
+ //}
+#if defined(uae_s64)
+ if (extra & 0x800) {
+ /* signed variant */
+ uae_s64 a = (uae_s64)(uae_s32)m68k_dreg(regs, (extra >> 12) & 7);
+ uae_s64 quot, rem;
+
+ if (extra & 0x400) {
+ a &= 0xffffffffu;
+ a |= (uae_s64)m68k_dreg(regs, extra & 7) << 32;
+ }
+ if (a == 0x8000000000000000 && src == -1) {
+ SET_VFLG (1);
+ SET_NFLG (1);
+ SET_CFLG (0);
+ } else {
+ rem = a % (uae_s64)(uae_s32)src;
+ quot = a / (uae_s64)(uae_s32)src;
+ if ((quot & UVAL64(0xffffffff80000000)) != 0
+ && (quot & UVAL64(0xffffffff80000000)) != UVAL64(0xffffffff80000000))
+ {
+ SET_VFLG (1);
+ SET_NFLG (1);
+ SET_CFLG (0);
+ } else {
+ if (((uae_s32)rem < 0) != ((uae_s64)a < 0)) rem = -rem;
+ SET_VFLG (0);
+ SET_CFLG (0);
+ SET_ZFLG (((uae_s32)quot) == 0);
+ SET_NFLG (((uae_s32)quot) < 0);
+ m68k_dreg(regs, extra & 7) = (uae_u32)rem;
+ m68k_dreg(regs, (extra >> 12) & 7) = (uae_u32)quot;
+ }
+ }
+ } else {
+ /* unsigned */
+ uae_u64 a = (uae_u64)(uae_u32)m68k_dreg(regs, (extra >> 12) & 7);
+ uae_u64 quot, rem;
+
+ if (extra & 0x400) {
+ a &= 0xffffffffu;
+ a |= (uae_u64)m68k_dreg(regs, extra & 7) << 32;
+ }
+ rem = a % (uae_u64)src;
+ quot = a / (uae_u64)src;
+ if (quot > 0xffffffffu) {
+ SET_VFLG (1);
+ SET_NFLG (1);
+ SET_CFLG (0);
+ } else {
+ SET_VFLG (0);
+ SET_CFLG (0);
+ SET_ZFLG (((uae_s32)quot) == 0);
+ SET_NFLG (((uae_s32)quot) < 0);
+ m68k_dreg(regs, extra & 7) = (uae_u32)rem;
+ m68k_dreg(regs, (extra >> 12) & 7) = (uae_u32)quot;
+ }
+ }
+#else
+ if (extra & 0x800) {
+ /* signed variant */
+ uae_s32 lo = (uae_s32)m68k_dreg(regs, (extra >> 12) & 7);
+ uae_s32 hi = lo < 0 ? -1 : 0;
+ uae_s32 save_high;
+ uae_u32 quot, rem;
+ uae_u32 sign;
+
+ if (extra & 0x400) {
+ hi = (uae_s32)m68k_dreg(regs, extra & 7);
+ }
+ save_high = hi;
+ sign = (hi ^ src);
+ if (hi < 0) {
+ hi = ~hi;
+ lo = -lo;
+ if (lo == 0) hi++;
+ }
+ if ((uae_s32)src < 0) src = -src;
+ if (div_unsigned(hi, lo, src, ", &rem) ||
+ (sign & 0x80000000) ? quot > 0x80000000 : quot > 0x7fffffff) {
+ SET_VFLG (1);
+ SET_NFLG (1);
+ SET_CFLG (0);
+ } else {
+ if (sign & 0x80000000) quot = -quot;
+ if (((uae_s32)rem < 0) != (save_high < 0)) rem = -rem;
+ SET_VFLG (0);
+ SET_CFLG (0);
+ SET_ZFLG (((uae_s32)quot) == 0);
+ SET_NFLG (((uae_s32)quot) < 0);
+ m68k_dreg(regs, extra & 7) = rem;
+ m68k_dreg(regs, (extra >> 12) & 7) = quot;
+ }
+ } else {
+ /* unsigned */
+ uae_u32 lo = (uae_u32)m68k_dreg(regs, (extra >> 12) & 7);
+ uae_u32 hi = 0;
+ uae_u32 quot, rem;
+
+ if (extra & 0x400) {
+ hi = (uae_u32)m68k_dreg(regs, extra & 7);
+ }
+ if (div_unsigned(hi, lo, src, ", &rem)) {
+ SET_VFLG (1);
+ SET_NFLG (1);
+ SET_CFLG (0);
+ } else {
+ SET_VFLG (0);
+ SET_CFLG (0);
+ SET_ZFLG (((uae_s32)quot) == 0);
+ SET_NFLG (((uae_s32)quot) < 0);
+ m68k_dreg(regs, extra & 7) = rem;
+ m68k_dreg(regs, (extra >> 12) & 7) = quot;
+ }
+ }
+#endif
+}
+
+STATIC_INLINE void mul_unsigned(uae_u32 src1, uae_u32 src2, uae_u32 *dst_hi, uae_u32 *dst_lo)
+{
+ uae_u32 r0 = (src1 & 0xffff) * (src2 & 0xffff);
+ uae_u32 r1 = ((src1 >> 16) & 0xffff) * (src2 & 0xffff);
+ uae_u32 r2 = (src1 & 0xffff) * ((src2 >> 16) & 0xffff);
+ uae_u32 r3 = ((src1 >> 16) & 0xffff) * ((src2 >> 16) & 0xffff);
+ uae_u32 lo;
+
+ lo = r0 + ((r1 << 16) & 0xffff0000ul);
+ if (lo < r0) r3++;
+ r0 = lo;
+ lo = r0 + ((r2 << 16) & 0xffff0000ul);
+ if (lo < r0) r3++;
+ r3 += ((r1 >> 16) & 0xffff) + ((r2 >> 16) & 0xffff);
+ *dst_lo = lo;
+ *dst_hi = r3;
+}
+
+void m68k_mull (uae_u32 opcode, uae_u32 src, uae_u16 extra)
+{
+#if defined(uae_s64)
+ if (extra & 0x800) {
+ /* signed variant */
+ uae_s64 a = (uae_s64)(uae_s32)m68k_dreg(regs, (extra >> 12) & 7);
+
+ a *= (uae_s64)(uae_s32)src;
+ SET_VFLG (0);
+ SET_CFLG (0);
+ SET_ZFLG (a == 0);
+ SET_NFLG (a < 0);
+ if (extra & 0x400)
+ m68k_dreg(regs, extra & 7) = (uae_u32)(a >> 32);
+ else if ((a & UVAL64(0xffffffff80000000)) != 0
+ && (a & UVAL64(0xffffffff80000000)) != UVAL64(0xffffffff80000000))
+ {
+ SET_VFLG (1);
+ }
+ m68k_dreg(regs, (extra >> 12) & 7) = (uae_u32)a;
+ } else {
+ /* unsigned */
+ uae_u64 a = (uae_u64)(uae_u32)m68k_dreg(regs, (extra >> 12) & 7);
+
+ a *= (uae_u64)src;
+ SET_VFLG (0);
+ SET_CFLG (0);
+ SET_ZFLG (a == 0);
+ SET_NFLG (((uae_s64)a) < 0);
+ if (extra & 0x400)
+ m68k_dreg(regs, extra & 7) = (uae_u32)(a >> 32);
+ else if ((a & UVAL64(0xffffffff00000000)) != 0) {
+ SET_VFLG (1);
+ }
+ m68k_dreg(regs, (extra >> 12) & 7) = (uae_u32)a;
+ }
+#else
+ if (extra & 0x800) {
+ /* signed variant */
+ uae_s32 src1,src2;
+ uae_u32 dst_lo,dst_hi;
+ uae_u32 sign;
+
+ src1 = (uae_s32)src;
+ src2 = (uae_s32)m68k_dreg(regs, (extra >> 12) & 7);
+ sign = (src1 ^ src2);
+ if (src1 < 0) src1 = -src1;
+ if (src2 < 0) src2 = -src2;
+ mul_unsigned((uae_u32)src1,(uae_u32)src2,&dst_hi,&dst_lo);
+ if (sign & 0x80000000) {
+ dst_hi = ~dst_hi;
+ dst_lo = -dst_lo;
+ if (dst_lo == 0) dst_hi++;
+ }
+ SET_VFLG (0);
+ SET_CFLG (0);
+ SET_ZFLG (dst_hi == 0 && dst_lo == 0);
+ SET_NFLG (((uae_s32)dst_hi) < 0);
+ if (extra & 0x400)
+ m68k_dreg(regs, extra & 7) = dst_hi;
+ else if ((dst_hi != 0 || (dst_lo & 0x80000000) != 0)
+ && ((dst_hi & 0xffffffff) != 0xffffffff
+ || (dst_lo & 0x80000000) != 0x80000000))
+ {
+ SET_VFLG (1);
+ }
+ m68k_dreg(regs, (extra >> 12) & 7) = dst_lo;
+ } else {
+ /* unsigned */
+ uae_u32 dst_lo,dst_hi;
+
+ mul_unsigned(src,(uae_u32)m68k_dreg(regs, (extra >> 12) & 7),&dst_hi,&dst_lo);
+
+ SET_VFLG (0);
+ SET_CFLG (0);
+ SET_ZFLG (dst_hi == 0 && dst_lo == 0);
+ SET_NFLG (((uae_s32)dst_hi) < 0);
+ if (extra & 0x400)
+ m68k_dreg(regs, extra & 7) = dst_hi;
+ else if (dst_hi != 0) {
+ SET_VFLG (1);
+ }
+ m68k_dreg(regs, (extra >> 12) & 7) = dst_lo;
+ }
+#endif
+}
+