mirror of
https://github.com/libretro/Mu.git
synced 2026-02-14 05:35:20 +00:00
Compare commits
230 Commits
tungstenCS
...
wip-macosa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d0651a450d | ||
|
|
4a3fee96e7 | ||
|
|
4d084a03d7 | ||
|
|
aadb0a29ff | ||
|
|
90a9a94257 | ||
|
|
679626b58f | ||
|
|
1361da0401 | ||
|
|
c13324e9c7 | ||
|
|
9d23f9bb67 | ||
|
|
f16e54e879 | ||
|
|
2954a42bba | ||
|
|
b066eb856d | ||
|
|
be844bf74d | ||
|
|
7ead066572 | ||
|
|
304c0855c1 | ||
|
|
932f224580 | ||
|
|
6fd0600446 | ||
|
|
ebd397f5ba | ||
|
|
f631649bf7 | ||
|
|
5795ade531 | ||
|
|
ff746b8196 | ||
|
|
e053b170d2 | ||
|
|
df5a0c63bc | ||
|
|
d93c8c0efc | ||
|
|
62a7f6f2b3 | ||
|
|
e4209e1044 | ||
|
|
e140a25c5b | ||
|
|
3d408f3b37 | ||
|
|
5a7750163f | ||
|
|
c9af673bf4 | ||
|
|
cb2dcc1740 | ||
|
|
bda022c63a | ||
|
|
5022d08ffb | ||
|
|
95ebb37e5f | ||
|
|
ec3ba7e2cd | ||
|
|
41e0edcaa3 | ||
|
|
223255e2e1 | ||
|
|
1705a0ddd6 | ||
|
|
6ffa4d1d66 | ||
|
|
9057820fbc | ||
|
|
254212a229 | ||
|
|
87c8cfce6b | ||
|
|
96e70d964f | ||
|
|
855504f180 | ||
|
|
6870d8b7ab | ||
|
|
be386ff05d | ||
|
|
5a86c5ccf9 | ||
|
|
3e4829f443 | ||
|
|
f6c7944c64 | ||
|
|
d9437c28cb | ||
|
|
1a6d22086d | ||
|
|
46b29248dc | ||
|
|
e7da587071 | ||
|
|
4ac406874c | ||
|
|
c2ffd5a04a | ||
|
|
d29d1978ee | ||
|
|
f66e5613b3 | ||
|
|
865b1d5f86 | ||
|
|
815f061683 | ||
|
|
97f8f85021 | ||
|
|
e9385a62ab | ||
|
|
b18cc463b6 | ||
|
|
2ece2d56d4 | ||
|
|
4738d36119 | ||
|
|
4b836d98db | ||
|
|
c8c4539e6f | ||
|
|
aed3be3b80 | ||
|
|
c6df0303c8 | ||
|
|
126b2cf20f | ||
|
|
0c8e6fdebc | ||
|
|
daf0aede3d | ||
|
|
f768615984 | ||
|
|
c427a607ec | ||
|
|
aff2d76148 | ||
|
|
9d41480371 | ||
|
|
de8c733340 | ||
|
|
8d386d8027 | ||
|
|
3b009d7131 | ||
|
|
c303c7426b | ||
|
|
0372fdbaff | ||
|
|
863cd964bd | ||
|
|
a06d013f33 | ||
|
|
c08bdd573a | ||
|
|
4712e77413 | ||
|
|
57d19df30d | ||
|
|
dd09261b53 | ||
|
|
c72edbfa1b | ||
|
|
20348abf85 | ||
|
|
6b1e293c44 | ||
|
|
d0292b312f | ||
|
|
2b982cee22 | ||
|
|
2c072ded8a | ||
|
|
309f91312f | ||
|
|
4450ac9402 | ||
|
|
01bebf5418 | ||
|
|
4c7d34facf | ||
|
|
16924bb811 | ||
|
|
e9d6d21625 | ||
|
|
6b351c67fd | ||
|
|
7be8825f96 | ||
|
|
02778eeb08 | ||
|
|
f76abf87a1 | ||
|
|
0bb3287d6d | ||
|
|
64950ac431 | ||
|
|
85e9a03796 | ||
|
|
14e0d66101 | ||
|
|
eea4c328d2 | ||
|
|
9143759c29 | ||
|
|
9289232dd0 | ||
|
|
a2dbb98d88 | ||
|
|
fd572858e2 | ||
|
|
d5b6664c73 | ||
|
|
ff46e40ded | ||
|
|
f00cfd057b | ||
|
|
12ed98e68b | ||
|
|
e277ae8a3b | ||
|
|
80850117e6 | ||
|
|
09ae1544e4 | ||
|
|
c4e9edf702 | ||
|
|
dbf1341597 | ||
|
|
5af248eaef | ||
|
|
afa5b13d14 | ||
|
|
68c9e28c08 | ||
|
|
7962bee8bf | ||
|
|
e6535b546c | ||
|
|
696874b42a | ||
|
|
ab608e1d78 | ||
|
|
7ccef9020c | ||
|
|
65e12a2b7b | ||
|
|
7ab964efcb | ||
|
|
4129e74af0 | ||
|
|
8dcf19d2e1 | ||
|
|
aa196cb87f | ||
|
|
136cdca5d7 | ||
|
|
d4b9997d43 | ||
|
|
8de283a87d | ||
|
|
c860faa9e7 | ||
|
|
0d87bf2610 | ||
|
|
99da94a143 | ||
|
|
ca89c58c1a | ||
|
|
771856944b | ||
|
|
814d180642 | ||
|
|
ad53041077 | ||
|
|
6bfae8fcb2 | ||
|
|
9eb415c4ac | ||
|
|
632a57a38f | ||
|
|
430ebc01a0 | ||
|
|
cc882d2141 | ||
|
|
5ad9760c52 | ||
|
|
d67233cc8e | ||
|
|
07d8ee95f1 | ||
|
|
a6f3ec5c1f | ||
|
|
631111ce25 | ||
|
|
4237ae0eb8 | ||
|
|
07b4aa53a8 | ||
|
|
81bbcd20f0 | ||
|
|
58d59a9964 | ||
|
|
e601bf1e15 | ||
|
|
369b2ebaf4 | ||
|
|
bc47eee5c0 | ||
|
|
943dfb3b09 | ||
|
|
a23df8f79a | ||
|
|
e0c1cb9d6b | ||
|
|
7b6fcdb0e1 | ||
|
|
e70d84fac4 | ||
|
|
d67b44130a | ||
|
|
1567cbce67 | ||
|
|
3059dfda06 | ||
|
|
94f4c09d54 | ||
|
|
452d5030a1 | ||
|
|
1bb71d8aec | ||
|
|
0337882c4f | ||
|
|
33f7cb8948 | ||
|
|
51e405fc84 | ||
|
|
d0ccc7115f | ||
|
|
61602de392 | ||
|
|
29ca09302f | ||
|
|
4c8649da4e | ||
|
|
9723c83381 | ||
|
|
37f4b859aa | ||
|
|
7ba0cb5dca | ||
|
|
c95792b146 | ||
|
|
c111be3f64 | ||
|
|
b145a329c0 | ||
|
|
0ca5627ee3 | ||
|
|
a1fd0799be | ||
|
|
4fb3bed984 | ||
|
|
9ed1d0c21d | ||
|
|
1405e2a681 | ||
|
|
55013870ca | ||
|
|
912210695d | ||
|
|
5c89783ea0 | ||
|
|
c68fac77cc | ||
|
|
d0ca2655bb | ||
|
|
5c1547467b | ||
|
|
8e9ef22f42 | ||
|
|
892359f226 | ||
|
|
d46e146ae7 | ||
|
|
fc6b32d065 | ||
|
|
66f32cdb94 | ||
|
|
3601c471cf | ||
|
|
9384fc37a8 | ||
|
|
02fe7809ff | ||
|
|
5f3ace9b6b | ||
|
|
967c2f3ec1 | ||
|
|
99dfc62823 | ||
|
|
f0b9d524a6 | ||
|
|
80026cb33e | ||
|
|
5f1e8a53c1 | ||
|
|
b068d6ed53 | ||
|
|
b222b23bd0 | ||
|
|
7e0399ad17 | ||
|
|
f355c82d0b | ||
|
|
535c9254f6 | ||
|
|
4476697b4b | ||
|
|
92d6a857a8 | ||
|
|
6e8005cf56 | ||
|
|
eb4a241ef4 | ||
|
|
ec66577b53 | ||
|
|
41a305f0bd | ||
|
|
e9f7a40c53 | ||
|
|
b1914d9586 | ||
|
|
a63000884f | ||
|
|
5a38b67708 | ||
|
|
97e00aaef2 | ||
|
|
82c767a7a0 | ||
|
|
ab4788c921 | ||
|
|
c4eec6864b | ||
|
|
9b09d19e19 | ||
|
|
48ff83d3af |
@@ -1,15 +0,0 @@
|
||||
# Use the latest 2.1 version of CircleCI pipeline processing engine, see https://circleci.com/docs/2.0/configuration-reference/
|
||||
version: 2.1
|
||||
|
||||
# Use a package of configuration called an orb, see https://circleci.com/docs/2.0/orb-intro/
|
||||
orbs:
|
||||
# Declare a dependency on the welcome-orb
|
||||
welcome: circleci/welcome-orb@0.3.1
|
||||
|
||||
# Orchestrate or schedule a set of jobs, see https://circleci.com/docs/2.0/workflows/
|
||||
workflows:
|
||||
# Name the workflow "Welcome"
|
||||
Welcome:
|
||||
# Run the welcome/run job in its own container
|
||||
jobs:
|
||||
- welcome/run
|
||||
29
.gitignore
vendored
29
.gitignore
vendored
@@ -11,15 +11,30 @@
|
||||
/tools/palm/hwTestSuite/*.bin
|
||||
/tools/palm/hwTestSuite/*.grc
|
||||
/tools/palm/hwTestSuite/*.prc
|
||||
/tools/palm/hwTestSuite/armCode
|
||||
/tools/palm/hwTestSuite/TstSuite
|
||||
/tools/palm/hwTestSuite/TstSuite-sections.s
|
||||
/tools/palm/hwTestSuite/TstSuite-sections.ld
|
||||
/tools/palm/muExpansionDriver/*.bin
|
||||
/tools/palm/muExpansionDriver/*.grc
|
||||
/tools/palm/muExpansionDriver/*.prc
|
||||
/tools/palm/muExpansionDriver/muExpDriver
|
||||
/tools/palm/muExpansionDriver/blobs/*.S68
|
||||
/tools/palm/muExpansionDriver/blobs/*.L68
|
||||
/tools/desktop/build-BufferGraphViewer-*
|
||||
/tools/desktop/build-MakePalmBitmap-*
|
||||
/tools/desktop/export16BitImageProperly/convert
|
||||
/tools/desktop/export16BitImageProperly/convert
|
||||
|
||||
# CLion
|
||||
.idea/workspace.xml
|
||||
.idea/discord.xml
|
||||
|
||||
# CMake
|
||||
cmake-build-debug/
|
||||
cmake-build-release/
|
||||
cmake-build-debug-mingw/
|
||||
cmake-build-release-mingw/
|
||||
cmake-build-debug-visual-studio/
|
||||
cmake-build-release-visual-studio/
|
||||
cmake-build-debug-visual-studio-1/
|
||||
cmake-build-release-visual-studio-1/
|
||||
|
||||
# Test ROM
|
||||
userdata-palmos41-en-m515.ram
|
||||
userdata-en-m515.ram
|
||||
palmos41-en-m515.rom
|
||||
default-palmos41-en-m515.ram
|
||||
249
.gitlab-ci.yml
Normal file
249
.gitlab-ci.yml
Normal file
@@ -0,0 +1,249 @@
|
||||
##############################################################################
|
||||
################################# BOILERPLATE ################################
|
||||
##############################################################################
|
||||
|
||||
# Core definitions
|
||||
.core-defs:
|
||||
variables:
|
||||
CORENAME: mu
|
||||
JNI_PATH: libretroBuildSystem
|
||||
MAKEFILE_PATH: libretroBuildSystem
|
||||
MAKEFILE: Makefile.libretro
|
||||
|
||||
# Inclusion templates, required for the build to work
|
||||
include:
|
||||
################################## DESKTOPS ################################
|
||||
# Windows 64-bit
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/windows-x64-mingw.yml'
|
||||
|
||||
# Windows 32-bit
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/windows-i686-mingw.yml'
|
||||
|
||||
# Windows msvc10 64-bit
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/windows-x64-msvc10-msys2.yml'
|
||||
|
||||
# Windows msvc10 32-bit
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/windows-i686-msvc10-msys2.yml'
|
||||
|
||||
# Windows msvc05 32-bit
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/windows-i686-msvc05-msys2.yml'
|
||||
|
||||
# Linux 64-bit
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/linux-x64.yml'
|
||||
|
||||
# MacOS 64-bit
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/osx-x64.yml'
|
||||
|
||||
# MacOS ARM 64-bit
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/osx-arm64.yml'
|
||||
|
||||
################################## CELLULAR ################################
|
||||
# Android
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/android-jni.yml'
|
||||
|
||||
# iOS 9
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/ios9.yml'
|
||||
|
||||
# iOS
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/ios-arm64.yml'
|
||||
|
||||
################################## CONSOLES ################################
|
||||
# Dingux (GCW Zero)
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/dingux-mips32.yml'
|
||||
|
||||
# Nintendo 3DS
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/ctr-static.yml'
|
||||
|
||||
# Nintendo GameCube
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/ngc-static.yml'
|
||||
|
||||
# Nintendo Wii
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/wii-static.yml'
|
||||
|
||||
# Nintendo WiiU
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/wiiu-static.yml'
|
||||
|
||||
# Nintendo Switch
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/libnx-static.yml'
|
||||
|
||||
# PLayStation 2
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/ps2-static.yml'
|
||||
|
||||
# PlayStation Vita
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/vita-static.yml'
|
||||
|
||||
#################################### MISC ##################################
|
||||
# Emscripten
|
||||
- project: 'libretro-infrastructure/ci-templates'
|
||||
file: '/emscripten-static.yml'
|
||||
|
||||
# Stages for building
|
||||
stages:
|
||||
- build-prepare
|
||||
- build-shared
|
||||
- build-static
|
||||
|
||||
##############################################################################
|
||||
#################################### STAGES ##################################
|
||||
##############################################################################
|
||||
|
||||
################################### DESKTOPS #################################
|
||||
# Windows 64-bit
|
||||
libretro-build-windows-x64:
|
||||
extends:
|
||||
- .libretro-windows-x64-mingw-make-default
|
||||
- .core-defs
|
||||
|
||||
# Windows 32-bit
|
||||
libretro-build-windows-i686:
|
||||
extends:
|
||||
- .libretro-windows-i686-mingw-make-default
|
||||
- .core-defs
|
||||
|
||||
# Windows msvc10 64-bit
|
||||
libretro-build-windows-msvc10-x64:
|
||||
extends:
|
||||
- .libretro-windows-x64-msvc10-msys2-make-default
|
||||
- .core-defs
|
||||
|
||||
# Windows msvc10 32-bit
|
||||
libretro-build-windows-msvc10-i686:
|
||||
extends:
|
||||
- .libretro-windows-i686-msvc10-msys2-make-default
|
||||
- .core-defs
|
||||
|
||||
# Windows msvc05 32-bit
|
||||
libretro-build-windows-msvc05-i686:
|
||||
extends:
|
||||
- .libretro-windows-i686-msvc05-msys2-make-default
|
||||
- .core-defs
|
||||
|
||||
# Linux 64-bit
|
||||
libretro-build-linux-x64:
|
||||
extends:
|
||||
- .libretro-linux-x64-make-default
|
||||
- .core-defs
|
||||
|
||||
# MacOS 64-bit
|
||||
libretro-build-osx-x64:
|
||||
extends:
|
||||
- .libretro-osx-x64-make-default
|
||||
- .core-defs
|
||||
|
||||
# MacOS ARM 64-bit
|
||||
libretro-build-osx-arm64:
|
||||
extends:
|
||||
- .libretro-osx-arm64-make-default
|
||||
- .core-defs
|
||||
|
||||
################################### CELLULAR #################################
|
||||
# Android ARMv7a
|
||||
android-armeabi-v7a:
|
||||
extends:
|
||||
- .libretro-android-jni-armeabi-v7a
|
||||
- .core-defs
|
||||
|
||||
# Android ARMv8a
|
||||
android-arm64-v8a:
|
||||
extends:
|
||||
- .libretro-android-jni-arm64-v8a
|
||||
- .core-defs
|
||||
|
||||
# Android 64-bit x86
|
||||
android-x86_64:
|
||||
extends:
|
||||
- .libretro-android-jni-x86_64
|
||||
- .core-defs
|
||||
|
||||
# Android 32-bit x86
|
||||
android-x86:
|
||||
extends:
|
||||
- .libretro-android-jni-x86
|
||||
- .core-defs
|
||||
|
||||
# iOS 9
|
||||
libretro-build-ios9:
|
||||
extends:
|
||||
- .libretro-ios9-make-default
|
||||
- .core-defs
|
||||
|
||||
# iOS
|
||||
libretro-build-ios-arm64:
|
||||
extends:
|
||||
- .libretro-ios-arm64-make-default
|
||||
- .core-defs
|
||||
|
||||
################################### CONSOLES #################################
|
||||
# Dingux (GCW Zero)
|
||||
libretro-build-dingux-mips32:
|
||||
extends:
|
||||
- .libretro-dingux-mips32-make-default
|
||||
- .core-defs
|
||||
|
||||
# Nintendo 3DS
|
||||
libretro-build-ctr:
|
||||
extends:
|
||||
- .libretro-ctr-static-retroarch-master
|
||||
- .core-defs
|
||||
|
||||
# Nintendo GameCube
|
||||
libretro-build-ngc:
|
||||
extends:
|
||||
- .libretro-ngc-static-retroarch-master
|
||||
- .core-defs
|
||||
|
||||
# Nintendo Wii
|
||||
libretro-build-wii:
|
||||
extends:
|
||||
- .libretro-wii-static-retroarch-master
|
||||
- .core-defs
|
||||
|
||||
# Nintendo Wii U
|
||||
libretro-build-wiiu:
|
||||
extends:
|
||||
- .libretro-wiiu-static-retroarch-master
|
||||
- .core-defs
|
||||
|
||||
# Nintendo Switch
|
||||
libretro-build-libnx-aarch64:
|
||||
extends:
|
||||
- .libretro-libnx-static-retroarch-master
|
||||
- .core-defs
|
||||
|
||||
# PlayStation 2
|
||||
libretro-build-ps2:
|
||||
extends:
|
||||
- .libretro-ps2-static-retroarch-master
|
||||
- .core-defs
|
||||
|
||||
# PlayStation Vita
|
||||
libretro-build-vita:
|
||||
extends:
|
||||
- .libretro-vita-static-retroarch-master
|
||||
- .core-defs
|
||||
|
||||
#################################### MISC ##################################
|
||||
# Emscripten
|
||||
libretro-build-emscripten:
|
||||
extends:
|
||||
- .libretro-emscripten-static-retroarch-master
|
||||
- .core-defs
|
||||
0
src/tungstenCBus.c → .idea/.gitignore
generated
vendored
0
src/tungstenCBus.c → .idea/.gitignore
generated
vendored
2
.idea/Mu.iml
generated
Normal file
2
.idea/Mu.iml
generated
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module classpath="CMake" type="CPP_MODULE" version="4" />
|
||||
19
.idea/misc.xml
generated
Normal file
19
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||
<component name="CidrRootsConfiguration">
|
||||
<sourceRoots>
|
||||
<file path="$PROJECT_DIR$/include" />
|
||||
<file path="$PROJECT_DIR$/src" />
|
||||
</sourceRoots>
|
||||
<excludeRoots>
|
||||
<file path="$PROJECT_DIR$/.github" />
|
||||
<file path="$PROJECT_DIR$/.idea" />
|
||||
<file path="$PROJECT_DIR$/bugs" />
|
||||
<file path="$PROJECT_DIR$/cmake-build-debug-visual-studio-1" />
|
||||
<file path="$PROJECT_DIR$/debugDumps" />
|
||||
<file path="$PROJECT_DIR$/images" />
|
||||
<file path="$PROJECT_DIR$/tools" />
|
||||
</excludeRoots>
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/Mu.iml" filepath="$PROJECT_DIR$/.idea/Mu.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
27
CMakeLists.txt
Normal file
27
CMakeLists.txt
Normal file
@@ -0,0 +1,27 @@
|
||||
cmake_minimum_required (VERSION 3.13)
|
||||
project(Mu
|
||||
VERSION 1.3.0
|
||||
DESCRIPTION "Classic Palm OS Emulator."
|
||||
HOMEPAGE_URL https://github.com/libretro/Mu
|
||||
LANGUAGES C CXX)
|
||||
|
||||
# Requires C99
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
|
||||
# To Emily...
|
||||
message("******************************")
|
||||
message("The continuation of the Mu along with the RetroArch Core is dedicated to")
|
||||
message("Emily (1998-2020), your friendship was very important to me and I hope")
|
||||
message("that you are resting well.")
|
||||
message(" -- Your friend, Stephanie")
|
||||
message("******************************")
|
||||
|
||||
# Main project sources
|
||||
add_subdirectory(src)
|
||||
|
||||
# LibRetro Build
|
||||
add_subdirectory(libretroBuildSystem)
|
||||
|
||||
# QT Build
|
||||
add_subdirectory(qtBuildSystem)
|
||||
334
LICENSE
Normal file
334
LICENSE
Normal file
@@ -0,0 +1,334 @@
|
||||
Creative Commons Legal Code
|
||||
|
||||
Attribution-NonCommercial 3.0 Unported
|
||||
|
||||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||
LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN
|
||||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||
REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR
|
||||
DAMAGES RESULTING FROM ITS USE.
|
||||
|
||||
License
|
||||
|
||||
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE
|
||||
COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY
|
||||
COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS
|
||||
AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
|
||||
|
||||
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE
|
||||
TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY
|
||||
BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS
|
||||
CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND
|
||||
CONDITIONS.
|
||||
|
||||
1. Definitions
|
||||
|
||||
a. "Adaptation" means a work based upon the Work, or upon the Work and
|
||||
other pre-existing works, such as a translation, adaptation,
|
||||
derivative work, arrangement of music or other alterations of a
|
||||
literary or artistic work, or phonogram or performance and includes
|
||||
cinematographic adaptations or any other form in which the Work may be
|
||||
recast, transformed, or adapted including in any form recognizably
|
||||
derived from the original, except that a work that constitutes a
|
||||
Collection will not be considered an Adaptation for the purpose of
|
||||
this License. For the avoidance of doubt, where the Work is a musical
|
||||
work, performance or phonogram, the synchronization of the Work in
|
||||
timed-relation with a moving image ("synching") will be considered an
|
||||
Adaptation for the purpose of this License.
|
||||
b. "Collection" means a collection of literary or artistic works, such as
|
||||
encyclopedias and anthologies, or performances, phonograms or
|
||||
broadcasts, or other works or subject matter other than works listed
|
||||
in Section 1(f) below, which, by reason of the selection and
|
||||
arrangement of their contents, constitute intellectual creations, in
|
||||
which the Work is included in its entirety in unmodified form along
|
||||
with one or more other contributions, each constituting separate and
|
||||
independent works in themselves, which together are assembled into a
|
||||
collective whole. A work that constitutes a Collection will not be
|
||||
considered an Adaptation (as defined above) for the purposes of this
|
||||
License.
|
||||
c. "Distribute" means to make available to the public the original and
|
||||
copies of the Work or Adaptation, as appropriate, through sale or
|
||||
other transfer of ownership.
|
||||
d. "Licensor" means the individual, individuals, entity or entities that
|
||||
offer(s) the Work under the terms of this License.
|
||||
e. "Original Author" means, in the case of a literary or artistic work,
|
||||
the individual, individuals, entity or entities who created the Work
|
||||
or if no individual or entity can be identified, the publisher; and in
|
||||
addition (i) in the case of a performance the actors, singers,
|
||||
musicians, dancers, and other persons who act, sing, deliver, declaim,
|
||||
play in, interpret or otherwise perform literary or artistic works or
|
||||
expressions of folklore; (ii) in the case of a phonogram the producer
|
||||
being the person or legal entity who first fixes the sounds of a
|
||||
performance or other sounds; and, (iii) in the case of broadcasts, the
|
||||
organization that transmits the broadcast.
|
||||
f. "Work" means the literary and/or artistic work offered under the terms
|
||||
of this License including without limitation any production in the
|
||||
literary, scientific and artistic domain, whatever may be the mode or
|
||||
form of its expression including digital form, such as a book,
|
||||
pamphlet and other writing; a lecture, address, sermon or other work
|
||||
of the same nature; a dramatic or dramatico-musical work; a
|
||||
choreographic work or entertainment in dumb show; a musical
|
||||
composition with or without words; a cinematographic work to which are
|
||||
assimilated works expressed by a process analogous to cinematography;
|
||||
a work of drawing, painting, architecture, sculpture, engraving or
|
||||
lithography; a photographic work to which are assimilated works
|
||||
expressed by a process analogous to photography; a work of applied
|
||||
art; an illustration, map, plan, sketch or three-dimensional work
|
||||
relative to geography, topography, architecture or science; a
|
||||
performance; a broadcast; a phonogram; a compilation of data to the
|
||||
extent it is protected as a copyrightable work; or a work performed by
|
||||
a variety or circus performer to the extent it is not otherwise
|
||||
considered a literary or artistic work.
|
||||
g. "You" means an individual or entity exercising rights under this
|
||||
License who has not previously violated the terms of this License with
|
||||
respect to the Work, or who has received express permission from the
|
||||
Licensor to exercise rights under this License despite a previous
|
||||
violation.
|
||||
h. "Publicly Perform" means to perform public recitations of the Work and
|
||||
to communicate to the public those public recitations, by any means or
|
||||
process, including by wire or wireless means or public digital
|
||||
performances; to make available to the public Works in such a way that
|
||||
members of the public may access these Works from a place and at a
|
||||
place individually chosen by them; to perform the Work to the public
|
||||
by any means or process and the communication to the public of the
|
||||
performances of the Work, including by public digital performance; to
|
||||
broadcast and rebroadcast the Work by any means including signs,
|
||||
sounds or images.
|
||||
i. "Reproduce" means to make copies of the Work by any means including
|
||||
without limitation by sound or visual recordings and the right of
|
||||
fixation and reproducing fixations of the Work, including storage of a
|
||||
protected performance or phonogram in digital form or other electronic
|
||||
medium.
|
||||
|
||||
2. Fair Dealing Rights. Nothing in this License is intended to reduce,
|
||||
limit, or restrict any uses free from copyright or rights arising from
|
||||
limitations or exceptions that are provided for in connection with the
|
||||
copyright protection under copyright law or other applicable laws.
|
||||
|
||||
3. License Grant. Subject to the terms and conditions of this License,
|
||||
Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
|
||||
perpetual (for the duration of the applicable copyright) license to
|
||||
exercise the rights in the Work as stated below:
|
||||
|
||||
a. to Reproduce the Work, to incorporate the Work into one or more
|
||||
Collections, and to Reproduce the Work as incorporated in the
|
||||
Collections;
|
||||
b. to create and Reproduce Adaptations provided that any such Adaptation,
|
||||
including any translation in any medium, takes reasonable steps to
|
||||
clearly label, demarcate or otherwise identify that changes were made
|
||||
to the original Work. For example, a translation could be marked "The
|
||||
original work was translated from English to Spanish," or a
|
||||
modification could indicate "The original work has been modified.";
|
||||
c. to Distribute and Publicly Perform the Work including as incorporated
|
||||
in Collections; and,
|
||||
d. to Distribute and Publicly Perform Adaptations.
|
||||
|
||||
The above rights may be exercised in all media and formats whether now
|
||||
known or hereafter devised. The above rights include the right to make
|
||||
such modifications as are technically necessary to exercise the rights in
|
||||
other media and formats. Subject to Section 8(f), all rights not expressly
|
||||
granted by Licensor are hereby reserved, including but not limited to the
|
||||
rights set forth in Section 4(d).
|
||||
|
||||
4. Restrictions. The license granted in Section 3 above is expressly made
|
||||
subject to and limited by the following restrictions:
|
||||
|
||||
a. You may Distribute or Publicly Perform the Work only under the terms
|
||||
of this License. You must include a copy of, or the Uniform Resource
|
||||
Identifier (URI) for, this License with every copy of the Work You
|
||||
Distribute or Publicly Perform. You may not offer or impose any terms
|
||||
on the Work that restrict the terms of this License or the ability of
|
||||
the recipient of the Work to exercise the rights granted to that
|
||||
recipient under the terms of the License. You may not sublicense the
|
||||
Work. You must keep intact all notices that refer to this License and
|
||||
to the disclaimer of warranties with every copy of the Work You
|
||||
Distribute or Publicly Perform. When You Distribute or Publicly
|
||||
Perform the Work, You may not impose any effective technological
|
||||
measures on the Work that restrict the ability of a recipient of the
|
||||
Work from You to exercise the rights granted to that recipient under
|
||||
the terms of the License. This Section 4(a) applies to the Work as
|
||||
incorporated in a Collection, but this does not require the Collection
|
||||
apart from the Work itself to be made subject to the terms of this
|
||||
License. If You create a Collection, upon notice from any Licensor You
|
||||
must, to the extent practicable, remove from the Collection any credit
|
||||
as required by Section 4(c), as requested. If You create an
|
||||
Adaptation, upon notice from any Licensor You must, to the extent
|
||||
practicable, remove from the Adaptation any credit as required by
|
||||
Section 4(c), as requested.
|
||||
b. You may not exercise any of the rights granted to You in Section 3
|
||||
above in any manner that is primarily intended for or directed toward
|
||||
commercial advantage or private monetary compensation. The exchange of
|
||||
the Work for other copyrighted works by means of digital file-sharing
|
||||
or otherwise shall not be considered to be intended for or directed
|
||||
toward commercial advantage or private monetary compensation, provided
|
||||
there is no payment of any monetary compensation in connection with
|
||||
the exchange of copyrighted works.
|
||||
c. If You Distribute, or Publicly Perform the Work or any Adaptations or
|
||||
Collections, You must, unless a request has been made pursuant to
|
||||
Section 4(a), keep intact all copyright notices for the Work and
|
||||
provide, reasonable to the medium or means You are utilizing: (i) the
|
||||
name of the Original Author (or pseudonym, if applicable) if supplied,
|
||||
and/or if the Original Author and/or Licensor designate another party
|
||||
or parties (e.g., a sponsor institute, publishing entity, journal) for
|
||||
attribution ("Attribution Parties") in Licensor's copyright notice,
|
||||
terms of service or by other reasonable means, the name of such party
|
||||
or parties; (ii) the title of the Work if supplied; (iii) to the
|
||||
extent reasonably practicable, the URI, if any, that Licensor
|
||||
specifies to be associated with the Work, unless such URI does not
|
||||
refer to the copyright notice or licensing information for the Work;
|
||||
and, (iv) consistent with Section 3(b), in the case of an Adaptation,
|
||||
a credit identifying the use of the Work in the Adaptation (e.g.,
|
||||
"French translation of the Work by Original Author," or "Screenplay
|
||||
based on original Work by Original Author"). The credit required by
|
||||
this Section 4(c) may be implemented in any reasonable manner;
|
||||
provided, however, that in the case of a Adaptation or Collection, at
|
||||
a minimum such credit will appear, if a credit for all contributing
|
||||
authors of the Adaptation or Collection appears, then as part of these
|
||||
credits and in a manner at least as prominent as the credits for the
|
||||
other contributing authors. For the avoidance of doubt, You may only
|
||||
use the credit required by this Section for the purpose of attribution
|
||||
in the manner set out above and, by exercising Your rights under this
|
||||
License, You may not implicitly or explicitly assert or imply any
|
||||
connection with, sponsorship or endorsement by the Original Author,
|
||||
Licensor and/or Attribution Parties, as appropriate, of You or Your
|
||||
use of the Work, without the separate, express prior written
|
||||
permission of the Original Author, Licensor and/or Attribution
|
||||
Parties.
|
||||
d. For the avoidance of doubt:
|
||||
|
||||
i. Non-waivable Compulsory License Schemes. In those jurisdictions in
|
||||
which the right to collect royalties through any statutory or
|
||||
compulsory licensing scheme cannot be waived, the Licensor
|
||||
reserves the exclusive right to collect such royalties for any
|
||||
exercise by You of the rights granted under this License;
|
||||
ii. Waivable Compulsory License Schemes. In those jurisdictions in
|
||||
which the right to collect royalties through any statutory or
|
||||
compulsory licensing scheme can be waived, the Licensor reserves
|
||||
the exclusive right to collect such royalties for any exercise by
|
||||
You of the rights granted under this License if Your exercise of
|
||||
such rights is for a purpose or use which is otherwise than
|
||||
noncommercial as permitted under Section 4(b) and otherwise waives
|
||||
the right to collect royalties through any statutory or compulsory
|
||||
licensing scheme; and,
|
||||
iii. Voluntary License Schemes. The Licensor reserves the right to
|
||||
collect royalties, whether individually or, in the event that the
|
||||
Licensor is a member of a collecting society that administers
|
||||
voluntary licensing schemes, via that society, from any exercise
|
||||
by You of the rights granted under this License that is for a
|
||||
purpose or use which is otherwise than noncommercial as permitted
|
||||
under Section 4(c).
|
||||
e. Except as otherwise agreed in writing by the Licensor or as may be
|
||||
otherwise permitted by applicable law, if You Reproduce, Distribute or
|
||||
Publicly Perform the Work either by itself or as part of any
|
||||
Adaptations or Collections, You must not distort, mutilate, modify or
|
||||
take other derogatory action in relation to the Work which would be
|
||||
prejudicial to the Original Author's honor or reputation. Licensor
|
||||
agrees that in those jurisdictions (e.g. Japan), in which any exercise
|
||||
of the right granted in Section 3(b) of this License (the right to
|
||||
make Adaptations) would be deemed to be a distortion, mutilation,
|
||||
modification or other derogatory action prejudicial to the Original
|
||||
Author's honor and reputation, the Licensor will waive or not assert,
|
||||
as appropriate, this Section, to the fullest extent permitted by the
|
||||
applicable national law, to enable You to reasonably exercise Your
|
||||
right under Section 3(b) of this License (right to make Adaptations)
|
||||
but not otherwise.
|
||||
|
||||
5. Representations, Warranties and Disclaimer
|
||||
|
||||
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR
|
||||
OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY
|
||||
KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE,
|
||||
INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF
|
||||
LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS,
|
||||
WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
|
||||
OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
|
||||
|
||||
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE
|
||||
LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR
|
||||
ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES
|
||||
ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS
|
||||
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
7. Termination
|
||||
|
||||
a. This License and the rights granted hereunder will terminate
|
||||
automatically upon any breach by You of the terms of this License.
|
||||
Individuals or entities who have received Adaptations or Collections
|
||||
from You under this License, however, will not have their licenses
|
||||
terminated provided such individuals or entities remain in full
|
||||
compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
|
||||
survive any termination of this License.
|
||||
b. Subject to the above terms and conditions, the license granted here is
|
||||
perpetual (for the duration of the applicable copyright in the Work).
|
||||
Notwithstanding the above, Licensor reserves the right to release the
|
||||
Work under different license terms or to stop distributing the Work at
|
||||
any time; provided, however that any such election will not serve to
|
||||
withdraw this License (or any other license that has been, or is
|
||||
required to be, granted under the terms of this License), and this
|
||||
License will continue in full force and effect unless terminated as
|
||||
stated above.
|
||||
|
||||
8. Miscellaneous
|
||||
|
||||
a. Each time You Distribute or Publicly Perform the Work or a Collection,
|
||||
the Licensor offers to the recipient a license to the Work on the same
|
||||
terms and conditions as the license granted to You under this License.
|
||||
b. Each time You Distribute or Publicly Perform an Adaptation, Licensor
|
||||
offers to the recipient a license to the original Work on the same
|
||||
terms and conditions as the license granted to You under this License.
|
||||
c. If any provision of this License is invalid or unenforceable under
|
||||
applicable law, it shall not affect the validity or enforceability of
|
||||
the remainder of the terms of this License, and without further action
|
||||
by the parties to this agreement, such provision shall be reformed to
|
||||
the minimum extent necessary to make such provision valid and
|
||||
enforceable.
|
||||
d. No term or provision of this License shall be deemed waived and no
|
||||
breach consented to unless such waiver or consent shall be in writing
|
||||
and signed by the party to be charged with such waiver or consent.
|
||||
e. This License constitutes the entire agreement between the parties with
|
||||
respect to the Work licensed here. There are no understandings,
|
||||
agreements or representations with respect to the Work not specified
|
||||
here. Licensor shall not be bound by any additional provisions that
|
||||
may appear in any communication from You. This License may not be
|
||||
modified without the mutual written agreement of the Licensor and You.
|
||||
f. The rights granted under, and the subject matter referenced, in this
|
||||
License were drafted utilizing the terminology of the Berne Convention
|
||||
for the Protection of Literary and Artistic Works (as amended on
|
||||
September 28, 1979), the Rome Convention of 1961, the WIPO Copyright
|
||||
Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996
|
||||
and the Universal Copyright Convention (as revised on July 24, 1971).
|
||||
These rights and subject matter take effect in the relevant
|
||||
jurisdiction in which the License terms are sought to be enforced
|
||||
according to the corresponding provisions of the implementation of
|
||||
those treaty provisions in the applicable national law. If the
|
||||
standard suite of rights granted under applicable copyright law
|
||||
includes additional rights not granted under this License, such
|
||||
additional rights are deemed to be included in the License; this
|
||||
License is not intended to restrict the license of any rights under
|
||||
applicable law.
|
||||
|
||||
|
||||
Creative Commons Notice
|
||||
|
||||
Creative Commons is not a party to this License, and makes no warranty
|
||||
whatsoever in connection with the Work. Creative Commons will not be
|
||||
liable to You or any party on any legal theory for any damages
|
||||
whatsoever, including without limitation any general, special,
|
||||
incidental or consequential damages arising in connection to this
|
||||
license. Notwithstanding the foregoing two (2) sentences, if Creative
|
||||
Commons has expressly identified itself as the Licensor hereunder, it
|
||||
shall have all rights and obligations of Licensor.
|
||||
|
||||
Except for the limited purpose of indicating to the public that the
|
||||
Work is licensed under the CCPL, Creative Commons does not authorize
|
||||
the use by either party of the trademark "Creative Commons" or any
|
||||
related trademark or logo of Creative Commons without the prior
|
||||
written consent of Creative Commons. Any permitted use will be in
|
||||
compliance with Creative Commons' then-current trademark usage
|
||||
guidelines, as may be published on its website or otherwise made
|
||||
available upon request from time to time. For the avoidance of doubt,
|
||||
this trademark restriction does not form part of the License.
|
||||
|
||||
Creative Commons may be contacted at https://creativecommons.org/.
|
||||
@@ -2,5 +2,6 @@ Bugs in other peoples code I found while writing Mu, haven't followed up on them
|
||||
(RetroArch)RETRO_ENVIRONMENT_GET_MIDI_INTERFACE states its passed a pointer to a pointer but its just a pointer to a struct
|
||||
(RetroArch)"led_driver" setting is not exposed to GUI
|
||||
(RetroArch)retro_set_environment will sometimes be called multiple times and provide invalid values fetching environment variables on the subsequent calls, this will cause function pointers to be corrupted if they are not checked for validity first
|
||||
QT will clobber object files when there are 2 source files with the same name even if they are in different folders
|
||||
|
||||
Fixed:
|
||||
@@ -1,6 +1,7 @@
|
||||
Lakka(needs makefile)
|
||||
xbox(don't know)
|
||||
xbox360(don't know)
|
||||
Android armv5/6, the NDK dropped support for them and they broke when the buildbot was updated
|
||||
|
||||
Fixed:
|
||||
classics/new haxchi
|
||||
|
||||
5
bugs/currentBug.txt
Normal file
5
bugs/currentBug.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
T3 locks up endlessly checking TSC2101 interrupts
|
||||
QT release build is broken
|
||||
|
||||
Fixed:
|
||||
68K Palm OS randomly locks up for 1-2 seconds(caused by interrupt handling code not turning the CPU back on for masked interrupts when it should because of faulty interrupt cacheing, Caused by commit: 1567cbce674741bc13be92b0847f59a5cc68335a)
|
||||
6
bugs/fixed/T3Crash.txt
Normal file
6
bugs/fixed/T3Crash.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
10:32:11: Debugging starts
|
||||
mincore\com\oleaut32\dispatch\ups.cpp(2125)\OLEAUT32.dll!00007FFE26F51D23: (caller: 00007FFE26F51E9A) ReturnHr(1) tid(1870) 8002801D Library not registered.
|
||||
QObject::~QObject: Timers cannot be stopped from another thread
|
||||
10:32:24: Debugging has finished
|
||||
|
||||
Just a crash from killing the program due to a buffer overflow.
|
||||
@@ -1,5 +1,6 @@
|
||||
This is like unimplementedHardware.txt but only lists things that have functionality issues not accuracy issues.
|
||||
|
||||
UGUI file picker for RetroArch
|
||||
State manager goes bezerk and crashes when saving on android, also can't close the window or it won't open again(also only on Android)
|
||||
If there is no userdata-en-m515.ram on Android the emu won't create it(this is likely because theres no graceful exit being done on Android only goto home menu and kill process)
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
Fixed:
|
||||
Endian compatibility is broken(the CPU state needs to be standardized)
|
||||
RetroArch port crashes on exit(needed to check if environ_cb returned true, switched to libretro-common filestreams too)
|
||||
@@ -1,7 +1,5 @@
|
||||
CPU:
|
||||
Test what bits of IMR are writable
|
||||
sandbox isnt notified about switches to Thumb mode
|
||||
function name finders for ARMv5 and Thumb are unimplemented
|
||||
hardware registers don't have there names printed in sandbox
|
||||
|
||||
CPU I/O:
|
||||
@@ -19,11 +17,13 @@ RxOverflow on SPI1, don't know if back or front of FIFO is overwritten on overfl
|
||||
ICR POL(1,2,3,6) may flip the pin value as well as the interrupt, POL5 does not flip the INT5 pin though, this was confirmed with a hardware test(it doesnt seem to but there is instability on the pin when the SD card is plugged in, this may have to do with card detect also being a data line on the SD pinout)
|
||||
PWM2 is not implemented
|
||||
while it is stated that the PLL is turned off "30 clocks" after the DISPLL bit is set, it doesnt state where the clocks come from, CLK32 or SYSCLK
|
||||
UART1 USTCNT1
|
||||
should also not transfer data to SD card when MOSI, MISO or SPICLK1 are disabled
|
||||
port d data register INT* bits seem to have there data bits cleared when an edge triggered interrupt is cleared(according to MC68VZ328UM.pdf Page 10-15)
|
||||
sound plays too long when the category's menu is selected on the home screen and the pen is pressed and held in the middle of the screen(only happens there, other views of the same type don't have this issue)(effected by CPU speed, turning it up reduces the duration of the excess squeal)(the home menu may be changing the clock speed when this menu is released since it refreshes a bunch of icons which is CPU intensive, if it is it would distort the audio since sysclks are only calculated at the begining of a frame the new value would not take effect until a new frame began, and since it works properly sometimes that is probably when the change occurs just at the end of the last frame and the sysclk duration refresh happens at the intended time due to the new frame starting)
|
||||
trying to beam anything will lock up the OS
|
||||
UART1 OLD DATA interrupt uses timing, may just have this be the same a DATA READY
|
||||
SPI1 rxOverflow is may not be emulated exactly as its supposed to be, the overflow data is written to the newest FIFO byte when it should probably be written to the oldest
|
||||
UART CTS pin is not emulated
|
||||
since actual UART hardware is not being used should be safe to ignore the parity bit and timing
|
||||
|
||||
Memory:
|
||||
unknown if DRAM bit expanded address space is used for CSC when its not an extension of CSD
|
||||
@@ -39,6 +39,9 @@ electrical noise on lines(conversions probably should have +-20 added to values)
|
||||
in the edge case that SPICLK2 is disabled while using ADS7846 and a 1 was the last bit shifted out 0s will still be shifted in
|
||||
need to to verify behavior of differential mode bit
|
||||
|
||||
TSC2101:
|
||||
values of AUX1 and AUX2 are unknown an need to be tested, emulation has issues with the USB port shortly after and it would make sense that since the T3 has the same connector as the m515 AUX1 is the device type resistor in the bottom connector
|
||||
|
||||
SD Card:
|
||||
block specific write protect bits don't work
|
||||
IRQ2 may actually be attached to the SD Card data out pin, triggering an interrupt when a 0 is received to process the return data
|
||||
@@ -47,17 +50,30 @@ This thing: case SEND_STATUS://HACK, need to add real write protection, this com
|
||||
|
||||
Debug tools:
|
||||
ADS7846 channels can't be read in single reference mode in hwTestSuite
|
||||
Mu sandbox dosent have memory and opcode hooks setup when in ARMv5 mode
|
||||
|
||||
MakePalmBitmap:
|
||||
|
||||
Other:
|
||||
Support for Silkyboard 2 silkscreen:https://archive.org/details/tucows_228076_SILKYBOARD_II
|
||||
Qt port dosent support Windows touchscreen input
|
||||
Qt GUI dosent resize properly with 320x320 framebuffer
|
||||
File Installer isnt working yet
|
||||
Qt dosent have a hybrid file/folder selector so apps will always have to be launched from folders for now
|
||||
T3 I2C currently has no ACK bits(should work without them its just inaccurate)(I2C works fine though)
|
||||
T3 emulation attempts to set GPIO1(reset button) as an output
|
||||
GPIO lines from misc chips to CPU are not implemented
|
||||
PXA260 idle mode is unimplemented
|
||||
0x0E071F16 MCR P15, #0, R1, C7, C2, #5 is unimplemented along with several other unknown CP15 opcodes
|
||||
|
||||
|
||||
Fixed:
|
||||
memory dumping dosent work for OS 5 yet
|
||||
Endian compatibility is broken(the CPU state needs to be standardized)
|
||||
RetroArch port crashes on exit(needed to check if environ_cb returned true, switched to libretro-common filestreams too)
|
||||
make the headers belong to the main file of the target chip being emulated for specs
|
||||
remove specs folder
|
||||
UART1 USTCNT1
|
||||
trying to beam anything will lock up the OS
|
||||
Qt dosent have a hybrid file/folder selector so apps will always have to be launched from folders for now
|
||||
File Installer isnt working yet
|
||||
Qt GUI dosent resize properly with 320x320 framebuffer
|
||||
PLLFSR has a hack that makes busy wait loops finish faster by toggling the CLK32 bit on read, for power button issue(removed, power button works as expected if you wait at least 2 seconds before pushing it again(makes sence that it cnat read the new press while its turning off the CPU))
|
||||
(CPU)VFP(floating point) coprocessor for ARM(dont think the ARM Palms even used VFP)
|
||||
(Other)need to get rid of buffer_t, its not used much anyway
|
||||
|
||||
6
include/armv5te/armsnippets.h
Normal file
6
include/armv5te/armsnippets.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef H_ARMSNIPPETS
|
||||
#define H_ARMSNIPPETS
|
||||
|
||||
#define armloader_cb()
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Declarations for asmcode.S */
|
||||
|
||||
#ifndef _H_ASMCODE
|
||||
#define _H_ASMCODE
|
||||
#ifndef H_ASMCODE
|
||||
#define H_ASMCODE
|
||||
|
||||
#include "emu.h"
|
||||
|
||||
@@ -4,18 +4,24 @@
|
||||
/* Portable and safe implementation of C bitfields
|
||||
Source: http://blog.codef00.com/2014/12/06/portable-bitfields-using-c11/ */
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
//Mac OS RetroArch port is lacking <type_traits>
|
||||
template<bool B, class T, class F>
|
||||
struct typeConditional { typedef T type; };
|
||||
|
||||
template<class T, class F>
|
||||
struct typeConditional<false, T, F> { typedef F type; };
|
||||
|
||||
template <size_t LastBit>
|
||||
struct MinimumTypeHelper {
|
||||
typedef
|
||||
typename std::conditional<LastBit == 0 , void,
|
||||
typename std::conditional<LastBit <= 8 , uint8_t,
|
||||
typename std::conditional<LastBit <= 16, uint16_t,
|
||||
typename std::conditional<LastBit <= 32, uint32_t,
|
||||
typename std::conditional<LastBit <= 64, uint64_t,
|
||||
typename typeConditional<LastBit == 0 , void,
|
||||
typename typeConditional<LastBit <= 8 , uint8_t,
|
||||
typename typeConditional<LastBit <= 16, uint16_t,
|
||||
typename typeConditional<LastBit <= 32, uint32_t,
|
||||
typename typeConditional<LastBit <= 64, uint64_t,
|
||||
void>::type>::type>::type>::type>::type type;
|
||||
};
|
||||
|
||||
@@ -7,10 +7,16 @@
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "fixings.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
__pragma(pack(push, 1))
|
||||
#endif
|
||||
|
||||
typedef struct arm_state { // Remember to update asmcode.S if this gets rearranged
|
||||
uint32_t reg[16]; // Registers for current mode.
|
||||
|
||||
@@ -41,10 +47,16 @@ typedef struct arm_state { // Remember to update asmcode.S if this gets rearran
|
||||
uint8_t interrupts;
|
||||
uint32_t cpu_events_state; // Only used for suspend and resume!
|
||||
}
|
||||
#ifndef __EMSCRIPTEN__
|
||||
|
||||
#if !defined(__EMSCRIPTEN__) && !defined(_MSC_VER)
|
||||
__attribute__((packed))
|
||||
#endif
|
||||
arm_state;
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
__pragma(pack(pop))
|
||||
#endif
|
||||
|
||||
extern struct arm_state arm __asm__("arm");
|
||||
|
||||
#define MODE_USR 0x10
|
||||
@@ -78,10 +90,10 @@ extern struct arm_state arm __asm__("arm");
|
||||
#endif
|
||||
|
||||
void cpu_int_check();
|
||||
uint32_t FASTCALL get_cpsr() __asm__("get_cpsr");
|
||||
uint32_t get_cpsr() __asm__("get_cpsr");
|
||||
void set_cpsr_full(uint32_t cpsr);
|
||||
void FASTCALL set_cpsr(uint32_t cpsr, uint32_t mask);
|
||||
uint32_t FASTCALL get_spsr();
|
||||
uint32_t get_spsr();
|
||||
void FASTCALL set_spsr(uint32_t cpsr, uint32_t mask);
|
||||
uint32_t *ptr_spsr();
|
||||
uint32_t get_cpsr_flags();
|
||||
@@ -151,6 +151,7 @@ enum DataOp {
|
||||
void do_arm_instruction(Instruction i);
|
||||
// Defined in coproc.cpp
|
||||
void do_cp15_instruction(Instruction i);
|
||||
void do_cp14_instruction(Instruction i);
|
||||
|
||||
#endif // CPUDEFS_H
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Declarations for debug.c */
|
||||
#ifndef _H_DEBUG
|
||||
#define _H_DEBUG
|
||||
#ifndef H_DEBUG
|
||||
#define H_DEBUG
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
@@ -10,21 +10,16 @@
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <string>
|
||||
//extern std::string ln_target_folder;
|
||||
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern FILE *debugger_input;
|
||||
|
||||
/*
|
||||
extern bool gdb_connected;
|
||||
extern bool in_debugger;
|
||||
extern int rdbg_port;
|
||||
*/
|
||||
extern FILE *debugger_input;
|
||||
#define gdb_connected false
|
||||
#define in_debugger false
|
||||
#define rdbg_port 0
|
||||
*/
|
||||
|
||||
enum DBG_REASON {
|
||||
DBG_USER,
|
||||
@@ -43,13 +38,7 @@ void rdebug_recv(void);
|
||||
bool rdebug_bind(unsigned int port);
|
||||
void rdebug_quit();
|
||||
*/
|
||||
#define virt_mem_ptr(x, y) NULL
|
||||
#define backtrace(x)
|
||||
#define process_debug_cmd(x) 0
|
||||
#define debugger(x, y)
|
||||
#define rdebug_recv()
|
||||
#define rdebug_bind(x) false
|
||||
#define rdebug_quit()
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
19
include/armv5te/disasm.h
Normal file
19
include/armv5te/disasm.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef H_DISASM
|
||||
#define H_DISASM
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern char disasmReturnBuf[80];
|
||||
|
||||
uint32_t disasm_arm_insn(uint32_t pc);
|
||||
uint32_t disasm_thumb_insn(uint32_t pc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,10 +1,11 @@
|
||||
#ifndef _H_EMU
|
||||
#define _H_EMU
|
||||
#ifndef H_EMU
|
||||
#define H_EMU
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
#include "cpu.h"
|
||||
#include "mem.h"
|
||||
@@ -16,16 +17,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Can also be set manually
|
||||
#if !defined(__i386__) && !defined(__x86_64__) && !(defined(__arm__) && !defined(__thumb__)) && !(defined(__aarch64__))
|
||||
#define NO_TRANSLATION
|
||||
#endif
|
||||
|
||||
// on iOS, setjmp and longjmp are broken
|
||||
#ifdef IS_IOS_BUILD
|
||||
#define NO_SETJMP
|
||||
#endif
|
||||
|
||||
static inline uint16_t BSWAP16(uint16_t x) { return x << 8 | x >> 8; }
|
||||
#define BSWAP32(x) __builtin_bswap32(x)
|
||||
|
||||
@@ -43,17 +34,17 @@ extern bool do_translate;
|
||||
|
||||
enum { LOG_CPU, LOG_IO, LOG_FLASH, LOG_INTS, LOG_ICOUNT, LOG_USB, LOG_GDB, MAX_LOG };
|
||||
#define LOG_TYPE_TBL "CIFQ#UG"
|
||||
void logprintf(int type, const char *str, ...);
|
||||
void emuprintf(const char *format, ...);
|
||||
//void logprintf(int type, const char *str, ...);
|
||||
//void emuprintf(const char *format, ...);
|
||||
#define logprintf(type, ...) debugLog(__VA_ARGS__)
|
||||
#define emuprintf(...) debugLog(__VA_ARGS__)
|
||||
|
||||
//void warn(const char *fmt, ...);
|
||||
#define warn(...) debugLog(__VA_ARGS__)
|
||||
//__attribute__((noreturn)) void error(const char *fmt, ...);
|
||||
#define warn(...) debugLog(__VA_ARGS__)
|
||||
#define error(...) abort()
|
||||
|
||||
// Is actually a jmp_buf, but __builtin_*jmp is used instead
|
||||
// as the MinGW variant is buggy
|
||||
extern void *restart_after_exception[32];
|
||||
extern jmp_buf restart_after_exception;
|
||||
|
||||
// GUI callbacks
|
||||
#define gui_debug_printf(...) debugLog(__VA_ARGS__)
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Declarations for memory.c */
|
||||
|
||||
#ifndef _H_MEM
|
||||
#define _H_MEM
|
||||
#ifndef H_MEM
|
||||
#define H_MEM
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define MEM_MAXSIZE (70*1024*1024) // also defined as RAM_FLAGS in asmcode.S
|
||||
#define MEM_MAXSIZE (80*1024*1024) // also defined as RAM_FLAGS in asmcode.S
|
||||
|
||||
extern uint8_t (*read_byte_map[64])(uint32_t addr);
|
||||
extern uint16_t (*read_half_map[64])(uint32_t addr);
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef _H_MMU
|
||||
#define _H_MMU
|
||||
#ifndef H_MMU
|
||||
#define H_MMU
|
||||
|
||||
#include "cpu.h"
|
||||
#include "emu.h"
|
||||
@@ -68,7 +68,7 @@ extern ac_entry *addr_cache __asm__("addr_cache");
|
||||
|
||||
bool addr_cache_pagefault(void *addr);
|
||||
void *addr_cache_miss(uint32_t addr, bool writing, fault_proc *fault) __asm__("addr_cache_miss");
|
||||
void addr_cache_flush();
|
||||
void addr_cache_flush(void);
|
||||
void mmu_dump_tables(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -1,21 +1,36 @@
|
||||
/* Declarations for translate.c */
|
||||
|
||||
#ifndef _H_TRANSLATE
|
||||
#define _H_TRANSLATE
|
||||
#ifndef H_TRANSLATE
|
||||
#define H_TRANSLATE
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "fixings.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
__pragma(pack(push, 1))
|
||||
#endif
|
||||
|
||||
struct translation {
|
||||
uintptr_t unused;
|
||||
void** jump_table;
|
||||
uint32_t *start_ptr;
|
||||
uint32_t *end_ptr;
|
||||
} __attribute__((packed));
|
||||
}
|
||||
#if !defined(_MSC_VER)
|
||||
__attribute__((packed))
|
||||
#endif
|
||||
;
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
__pragma(pack(pop))
|
||||
#endif
|
||||
|
||||
extern struct translation translation_table[] __asm__("translation_table");
|
||||
#define INSN_BUFFER_SIZE 0x1000000
|
||||
|
||||
179
include/armv5te/uArm/CPU_2.h
Normal file
179
include/armv5te/uArm/CPU_2.h
Normal file
@@ -0,0 +1,179 @@
|
||||
#ifndef _CPU_H_
|
||||
#define _CPU_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//#define ARM_V6 //define to allow v6 instructions
|
||||
//#define THUMB_2 //define to allow Thumb2
|
||||
|
||||
#include "../../pxa260/pxa260_types.h"
|
||||
|
||||
struct ArmCpu;
|
||||
|
||||
#define ARM_SR_N 0x80000000UL
|
||||
#define ARM_SR_Z 0x40000000UL
|
||||
#define ARM_SR_C 0x20000000UL
|
||||
#define ARM_SR_V 0x10000000UL
|
||||
#define ARM_SR_Q 0x08000000UL
|
||||
#ifdef ARM_V6 //V6KT2, but without T2 to be exact (we implement things like MLS, but not Thumb2 or ThumbEE)
|
||||
#define ARM_SR_J 0x01000000UL
|
||||
#define ARM_SR_E 0x00000200UL
|
||||
#define ARM_SR_A 0x00000100UL
|
||||
#define ARM_SR_GE_0 0x00010000UL
|
||||
#define ARM_SR_GE_1 0x00020000UL
|
||||
#define ARM_SR_GE_2 0x00040000UL
|
||||
#define ARM_SR_GE_3 0x00080000UL
|
||||
#define ARM_SR_GE_MASK 0x000F0000UL
|
||||
#define ARM_SR_GE_SHIFT 16
|
||||
#endif
|
||||
#define ARM_SR_I 0x00000080UL
|
||||
#define ARM_SR_F 0x00000040UL
|
||||
#define ARM_SR_T 0x00000020UL
|
||||
#define ARM_SR_M 0x0000001FUL
|
||||
|
||||
#define ARM_SR_MODE_USR 0x00000010UL
|
||||
#define ARM_SR_MODE_FIQ 0x00000011UL
|
||||
#define ARM_SR_MODE_IRQ 0x00000012UL
|
||||
#define ARM_SR_MODE_SVC 0x00000013UL
|
||||
#define ARM_SR_MODE_ABT 0x00000017UL
|
||||
#define ARM_SR_MODE_UND 0x0000001BUL
|
||||
#define ARM_SR_MODE_SYS 0x0000001FUL
|
||||
|
||||
#define ARV_VECTOR_OFFT_RST 0x00000000UL
|
||||
#define ARM_VECTOR_OFFT_UND 0x00000004UL
|
||||
#define ARM_VECTOR_OFFT_SWI 0x00000008UL
|
||||
#define ARM_VECTOR_OFFT_P_ABT 0x0000000CUL
|
||||
#define ARM_VECTOR_OFFT_D_ABT 0x00000010UL
|
||||
#define ARM_VECTOR_OFFT_UNUSED 0x00000014UL
|
||||
#define ARM_VECTOR_OFFT_IRQ 0x00000018UL
|
||||
#define ARM_VECTOR_OFFT_FIQ 0x0000001CUL
|
||||
|
||||
#define HYPERCALL_ARM 0xF7BBBBBBUL
|
||||
#define HYPERCALL_THUMB 0xBBBBUL
|
||||
|
||||
//the following are for cpuGetRegExternal() and are generally used for debugging purposes
|
||||
#define ARM_REG_NUM_CPSR 16
|
||||
#define ARM_REG_NUM_SPSR 17
|
||||
|
||||
struct ArmCpu;
|
||||
|
||||
typedef Boolean (*ArmCoprocRegXferF) (struct ArmCpu* cpu, void* userData, Boolean two/* MCR2/MRC2 ? */, Boolean MRC, UInt8 op1, UInt8 Rx, UInt8 CRn, UInt8 CRm, UInt8 op2);
|
||||
typedef Boolean (*ArmCoprocDatProcF) (struct ArmCpu* cpu, void* userData, Boolean two/* CDP2 ? */, UInt8 op1, UInt8 CRd, UInt8 CRn, UInt8 CRm, UInt8 op2);
|
||||
typedef Boolean (*ArmCoprocMemAccsF) (struct ArmCpu* cpu, void* userData, Boolean two /* LDC2/STC2 ? */, Boolean N, Boolean store, UInt8 CRd, UInt32 addr, UInt8* option /* NULL if none */);
|
||||
typedef Boolean (*ArmCoprocTwoRegF) (struct ArmCpu* cpu, void* userData, Boolean MRRC, UInt8 op, UInt8 Rd, UInt8 Rn, UInt8 CRm);
|
||||
|
||||
typedef Boolean (*ArmCpuMemF) (struct ArmCpu* cpu, void* buf, UInt32 vaddr, UInt8 size, Boolean write, Boolean priviledged, UInt8* fsr); //read/write
|
||||
typedef Boolean (*ArmCpuHypercall) (struct ArmCpu* cpu); //return true if handled
|
||||
typedef void (*ArmCpuEmulErr) (struct ArmCpu* cpu, const char* err_str);
|
||||
|
||||
typedef void (*ArmSetFaultAdrF) (struct ArmCpu* cpu, UInt32 adr, UInt8 faultStatus);
|
||||
|
||||
#include "icache.h"
|
||||
|
||||
|
||||
/*
|
||||
|
||||
coprocessors:
|
||||
|
||||
0 - DSP (pxa only)
|
||||
0, 1 - WMMX (pxa only)
|
||||
11 - VFP (arm standard)
|
||||
15 - system control (arm standard)
|
||||
*/
|
||||
|
||||
|
||||
typedef struct{
|
||||
|
||||
ArmCoprocRegXferF regXfer;
|
||||
ArmCoprocDatProcF dataProcessing;
|
||||
ArmCoprocMemAccsF memAccess;
|
||||
ArmCoprocTwoRegF twoRegF;
|
||||
void* userData;
|
||||
|
||||
}ArmCoprocessor;
|
||||
|
||||
typedef struct{
|
||||
|
||||
UInt32 R13, R14;
|
||||
UInt32 SPSR; //usr mode doesn't have an SPSR
|
||||
}ArmBankedRegs;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct ArmCpu{
|
||||
|
||||
UInt32 regs[16]; //current active regs as per current mode
|
||||
UInt32 CPSR, SPSR;
|
||||
|
||||
ArmBankedRegs bank_usr; //usr regs when in another mode
|
||||
ArmBankedRegs bank_svc; //svc regs when in another mode
|
||||
ArmBankedRegs bank_abt; //abt regs when in another mode
|
||||
ArmBankedRegs bank_und; //und regs when in another mode
|
||||
ArmBankedRegs bank_irq; //irq regs when in another mode
|
||||
ArmBankedRegs bank_fiq; //fiq regs when in another mode
|
||||
UInt32 extra_regs[5]; //fiq regs when not in fiq mode, usr regs when in fiq mode. R8-12
|
||||
|
||||
UInt16 waitingIrqs;
|
||||
UInt16 waitingFiqs;
|
||||
UInt16 CPAR;
|
||||
|
||||
ArmCoprocessor coproc[16]; //coprocessors
|
||||
|
||||
// various other cpu config options
|
||||
UInt32 vectorBase; //address of vector base
|
||||
|
||||
#ifdef ARM_V6
|
||||
|
||||
Boolean EEE; //endianness one exception entry
|
||||
Boolean impreciseAbtWaiting;
|
||||
#endif
|
||||
|
||||
ArmCpuMemF memF;
|
||||
ArmCpuEmulErr emulErrF;
|
||||
ArmCpuHypercall hypercallF;
|
||||
ArmSetFaultAdrF setFaultAdrF;
|
||||
|
||||
icache ic;
|
||||
|
||||
void* userData; //shared by all callbacks
|
||||
}ArmCpu;
|
||||
|
||||
|
||||
Err cpuInit(ArmCpu* cpu, UInt32 pc, ArmCpuMemF memF, ArmCpuEmulErr emulErrF, ArmCpuHypercall hypercallF, ArmSetFaultAdrF setFaultAdrF);
|
||||
Err cpuDeinit(ArmCpu* cp);
|
||||
void cpuCycle(ArmCpu* cpu);
|
||||
void cpuIrq(ArmCpu* cpu, Boolean fiq, Boolean raise); //unraise when acknowledged
|
||||
|
||||
#ifdef ARM_V6
|
||||
|
||||
void cpuSignalImpreciseAbt(ArmCpu* cpu, Boolean raise);
|
||||
|
||||
#endif
|
||||
|
||||
UInt32 cpuGetRegExternal(ArmCpu* cpu, UInt8 reg);
|
||||
void cpuSetReg(ArmCpu* cpu, UInt8 reg, UInt32 val);
|
||||
|
||||
void cpuCoprocessorRegister(ArmCpu* cpu, UInt8 cpNum, ArmCoprocessor* coproc);
|
||||
void cpuCoprocessorUnregister(ArmCpu* cpu, UInt8 cpNum);
|
||||
|
||||
void cpuSetVectorAddr(ArmCpu* cpu, UInt32 adr);
|
||||
|
||||
UInt16 cpuGetCPAR(ArmCpu* cpu);
|
||||
void cpuSetCPAR(ArmCpu* cpu, UInt16 cpar);
|
||||
|
||||
void cpuIcacheInval(ArmCpu* cpu);
|
||||
void cpuIcacheInvalAddr(ArmCpu* cpu, UInt32 addr);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
47
include/armv5te/uArm/icache.h
Normal file
47
include/armv5te/uArm/icache.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#ifndef ICACHE_H
|
||||
#define ICACHE_H
|
||||
|
||||
|
||||
#include "../../pxa260/pxa260_types.h"
|
||||
#include "CPU_2.h"
|
||||
|
||||
|
||||
#define ICACHE_L 5UL //line size is 2^L bytes
|
||||
#define ICACHE_S 6UL //number of sets is 2^S
|
||||
#define ICACHE_A 3UL //set associativity
|
||||
|
||||
|
||||
#define ICACHE_LINE_SZ (1UL << ICACHE_L)
|
||||
#define ICACHE_BUCKET_NUM (1UL << ICACHE_S)
|
||||
#define ICACHE_BUCKET_SZ (ICACHE_A)
|
||||
|
||||
|
||||
#define ICACHE_ADDR_MASK ((UInt32)-ICACHE_LINE_SZ)
|
||||
#define ICACHE_USED_MASK 1UL
|
||||
#define ICACHE_PRIV_MASK 2UL
|
||||
|
||||
typedef struct{
|
||||
|
||||
UInt32 info; //addr, masks
|
||||
UInt8 data[ICACHE_LINE_SZ];
|
||||
|
||||
}icacheLine;
|
||||
|
||||
typedef struct{
|
||||
|
||||
struct ArmCpu* cpu;
|
||||
ArmCpuMemF memF;
|
||||
icacheLine lines[ICACHE_BUCKET_NUM][ICACHE_BUCKET_SZ];
|
||||
UInt8 ptr[ICACHE_BUCKET_NUM];
|
||||
|
||||
}icache;
|
||||
|
||||
|
||||
void icacheInit(icache* ic, struct ArmCpu* cpu, ArmCpuMemF memF);
|
||||
Boolean icacheFetch(icache* ic, UInt32 va, UInt8 sz, Boolean priviledged, UInt8* fsr, void* buf);
|
||||
void icacheInval(icache* ic);
|
||||
void icacheInvalAddr(icache* ic, UInt32 addr);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
21
include/armv5te/uArm/uArmGlue.h
Normal file
21
include/armv5te/uArm/uArmGlue.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef UARM_GLUE_H
|
||||
#define UARM_GLUE_H
|
||||
|
||||
#include "CPU_2.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
Boolean uArmMemAccess(struct ArmCpu* cpu, void* buf, UInt32 vaddr, UInt8 size, Boolean write, Boolean priviledged, UInt8* fsr); //read/write
|
||||
Boolean uArmHypercall(struct ArmCpu* cpu);//return true if handled
|
||||
void uArmEmulErr (struct ArmCpu* cpu, const char* err_str);
|
||||
void uArmSetFaultAddr(struct ArmCpu* cpu, UInt32 adr, UInt8 faultStatus);
|
||||
|
||||
void uArmInitCpXX(ArmCpu* cpu);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -42,7 +42,7 @@ enum{
|
||||
DBVZ_CHIP_B1_NIL,
|
||||
//DBVZ_CHIP_CX_RAM, //CSC* is owned by CSD during normal operation
|
||||
DBVZ_CHIP_DX_RAM,
|
||||
DBVZ_CHIP_00_EMU, //used for EMUCS on hardware, used by the emu registers here
|
||||
DBVZ_CHIP_00_EMU,
|
||||
DBVZ_CHIP_REGISTERS,
|
||||
DBVZ_CHIP_NONE,
|
||||
DBVZ_CHIP_END
|
||||
@@ -64,43 +64,21 @@ typedef struct{
|
||||
}dbvz_chip_t;
|
||||
|
||||
//variables
|
||||
extern uint8_t dbvzReg[];
|
||||
extern dbvz_chip_t dbvzChipSelects[];
|
||||
extern double dbvzSysclksPerClk32;
|
||||
extern uint32_t dbvzFrameClk32s;
|
||||
extern double dbvzClk32Sysclks;
|
||||
extern int8_t pllSleepWait;
|
||||
extern int8_t pllWakeWait;
|
||||
extern uint32_t clk32Counter;
|
||||
extern double pctlrCpuClockDivider;
|
||||
extern double timerCycleCounter[];
|
||||
extern uint16_t timerStatusReadAcknowledge[];
|
||||
extern uint8_t portDInterruptLastValue;
|
||||
extern uint16_t spi1RxFifo[];
|
||||
extern uint16_t spi1TxFifo[];
|
||||
extern uint8_t spi1RxReadPosition;
|
||||
extern uint8_t spi1RxWritePosition;
|
||||
extern bool spi1RxOverflowed;
|
||||
extern uint8_t spi1TxReadPosition;
|
||||
extern uint8_t spi1TxWritePosition;
|
||||
extern int32_t pwm1ClocksToNextSample;
|
||||
extern uint8_t pwm1Fifo[];
|
||||
extern uint8_t pwm1ReadPosition;
|
||||
extern uint8_t pwm1WritePosition;
|
||||
|
||||
//timing
|
||||
void dbvzBeginClk32(void);
|
||||
void dbvzEndClk32(void);
|
||||
void dbvzAddSysclks(double value);//only call between begin/endClk32
|
||||
extern uint8_t dbvzReg[];//needed for direct execution of the DBVZ regs without a RAM access function
|
||||
extern uint16_t* dbvzFramebuffer;
|
||||
extern uint16_t dbvzFramebufferWidth;
|
||||
extern uint16_t dbvzFramebufferHeight;
|
||||
|
||||
//CPU
|
||||
void dbvzLcdRender(void);
|
||||
bool dbvzIsPllOn(void);
|
||||
bool m515BacklightAmplifierState(void);
|
||||
bool dbvzAreRegistersXXFFMapped(void);
|
||||
bool sed1376ClockConnected(void);
|
||||
void ads7846OverridePenState(bool value);
|
||||
void m515RefreshTouchState(void);//just refreshes the touchscreen
|
||||
void m515RefreshInputState(void);//refreshes touchscreen, buttons and docked status
|
||||
void m5XXRefreshTouchState(void);//just refreshes the touchscreen
|
||||
void m5XXRefreshInputState(void);//refreshes touchscreen, buttons and docked status
|
||||
//int32_t interruptAcknowledge(int32_t intLevel);//this is in m68kexternal.h
|
||||
|
||||
//memory errors
|
||||
@@ -85,6 +85,82 @@ static void spi1TxFifoFlush(void){
|
||||
spi1TxReadPosition = spi1TxWritePosition;
|
||||
}
|
||||
|
||||
//UART1 FIFO accessors
|
||||
static uint8_t uart1RxFifoEntrys(void){
|
||||
if(palmIrDataSize){
|
||||
uint32_t fifoEntrys = palmIrDataSize();
|
||||
|
||||
return FAST_MIN(fifoEntrys, 12);
|
||||
}
|
||||
return 0x00;
|
||||
}
|
||||
|
||||
static uint16_t uart1RxFifoRead(void){
|
||||
if(palmIrDataReceive)
|
||||
return palmIrDataReceive();
|
||||
return 0x0000;
|
||||
}
|
||||
|
||||
//no uart1RxFifoWrite, RX FIFO is written to externally
|
||||
|
||||
static void uart1RxFifoFlush(void){
|
||||
if(palmIrDataFlush)
|
||||
palmIrDataFlush();
|
||||
}
|
||||
|
||||
static uint8_t uart1TxFifoEntrys(void){
|
||||
return 0;//all entrys are transmitted instantly so none are left inside the CPU
|
||||
}
|
||||
|
||||
//no uart1TxFifoRead, TX FIFO is read externally
|
||||
|
||||
static void uart1TxFifoWrite(uint16_t value){
|
||||
if(palmIrDataSend)
|
||||
palmIrDataSend(value);
|
||||
}
|
||||
|
||||
static void uart1TxFifoFlush(void){
|
||||
//do nothing, its always empty
|
||||
}
|
||||
|
||||
//UART2 FIFO accessors
|
||||
static uint8_t uart2RxFifoEntrys(void){
|
||||
if(palmSerialDataSize){
|
||||
uint32_t fifoEntrys = palmSerialDataSize();
|
||||
|
||||
return FAST_MIN(fifoEntrys, 64);
|
||||
}
|
||||
return 0x00;
|
||||
}
|
||||
|
||||
static uint16_t uart2RxFifoRead(void){
|
||||
if(palmSerialDataReceive)
|
||||
return palmSerialDataReceive();
|
||||
return 0x0000;
|
||||
}
|
||||
|
||||
//no uart2RxFifoWrite, RX FIFO is written to externally
|
||||
|
||||
static void uart2RxFifoFlush(void){
|
||||
if(palmSerialDataFlush)
|
||||
palmSerialDataFlush();
|
||||
}
|
||||
|
||||
static uint8_t uart2TxFifoEntrys(void){
|
||||
return 0;//all entrys are transmitted instantly so none are left inside the CPU
|
||||
}
|
||||
|
||||
//no uart2TxFifoRead, TX FIFO is read externally
|
||||
|
||||
static void uart2TxFifoWrite(uint16_t value){
|
||||
if(palmSerialDataSend)
|
||||
palmSerialDataSend(value);
|
||||
}
|
||||
|
||||
static void uart2TxFifoFlush(void){
|
||||
//do nothing, its always empty
|
||||
}
|
||||
|
||||
//PWM1 FIFO accessors
|
||||
static uint8_t pwm1FifoEntrys(void){
|
||||
//check for wraparound
|
||||
@@ -107,11 +183,11 @@ int32_t pwm1FifoRunSample(int32_t now, int32_t clockOffset){
|
||||
//try to get next sample, if none are available play old sample
|
||||
if(pwm1FifoEntrys() > 0)
|
||||
pwm1ReadPosition = (pwm1ReadPosition + 1) % 6;
|
||||
dutyCycle = floatMin((float)pwm1Fifo[pwm1ReadPosition] / period, 1.00);
|
||||
dutyCycle = FAST_MIN((float)pwm1Fifo[pwm1ReadPosition] / period, 1.00);
|
||||
|
||||
for(index = 0; index < repeat; index++){
|
||||
#if !defined(EMU_NO_SAFETY)
|
||||
if(audioNow + audioSampleDuration >= AUDIO_CLOCK_RATE)
|
||||
if(audioNow + audioSampleDuration >= DBVZ_AUDIO_MAX_CLOCK_RATE)
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -261,11 +337,11 @@ static void updateCsdAddressLines(void){
|
||||
dbvzChipSelects[DBVZ_CHIP_DX_RAM].mask = 0x003FFFFF;
|
||||
|
||||
//address line 23 is enabled
|
||||
if((sdctrl & 0x000C) == 0x0008)
|
||||
if(!palmEmulatingM500 && (sdctrl & 0x000C) == 0x0008)
|
||||
dbvzChipSelects[DBVZ_CHIP_DX_RAM].mask |= 0x00800000;
|
||||
|
||||
//address line 22 is enabled
|
||||
if((sdctrl & 0x0030) == 0x0010)
|
||||
if(palmEmulatingM500 || (sdctrl & 0x0030) == 0x0010)
|
||||
dbvzChipSelects[DBVZ_CHIP_DX_RAM].mask |= 0x00400000;
|
||||
}
|
||||
else{
|
||||
@@ -348,7 +424,7 @@ static void setSpiIntCs(uint16_t value){
|
||||
newSpiIntCs |= (rxEntrys >= 4) << 4;//RH
|
||||
newSpiIntCs |= (rxEntrys > 0) << 3;//RR
|
||||
newSpiIntCs |= (txEntrys == 8) << 2;//TF
|
||||
newSpiIntCs |= (txEntrys >= 4) << 1;//TH, the datasheet contradicts itself on whether its more than or equal to 4 empty or full slots
|
||||
newSpiIntCs |= (txEntrys >= 4) << 1;//TH, TODO: the datasheet contradicts itself on whether its more than or equal to 4 empty or full slots
|
||||
newSpiIntCs |= txEntrys == 0;//TE
|
||||
|
||||
//if interrupt state changed update interrupts too, top 8 bits are just the enable bits for the bottom 8
|
||||
@@ -477,6 +553,165 @@ static void setSpiCont2(uint16_t value){
|
||||
registerArrayWrite16(SPICONT2, value & 0xE3FF);
|
||||
}
|
||||
|
||||
static void updateUart1PortState(void){
|
||||
if(palmIrSetPortProperties){
|
||||
uint16_t ustcnt1 = registerArrayRead16(USTCNT1);
|
||||
uint16_t ubaud1 = registerArrayRead16(UBAUD1);
|
||||
uint8_t divider = 1 << (ubaud1 >> 8 & 0x07);
|
||||
uint8_t prescaler = 65 - (ubaud1 & 0x001F);
|
||||
bool baudSrc = !!(ubaud1 & 0x0800);
|
||||
serial_port_properties_t properties;
|
||||
|
||||
properties.enable = !!(ustcnt1 & 0x8000);
|
||||
properties.enableParity = !!(ustcnt1 & 0x0800);
|
||||
properties.oddParity = !!(ustcnt1 & 0x0400);
|
||||
properties.stopBits = !!(ustcnt1 & 0x0200) ? 2 : 1;
|
||||
properties.use8BitMode = !!(ustcnt1 & 0x0100);
|
||||
properties.baudRate = (baudSrc ? EMU_SERIAL_USE_EXTERNAL_CLOCK_SOURCE : sysclksPerClk32() * M5XX_CRYSTAL_FREQUENCY) / prescaler / divider;
|
||||
|
||||
palmIrSetPortProperties(&properties);
|
||||
}
|
||||
}
|
||||
|
||||
static void updateUart1Interrupt(void){
|
||||
//the UART1 interrupt has a rather complex set of trigger methods so they all have to be checked after one changes to prevent clearing a valid interrupt thats on the same line
|
||||
uint16_t ustcnt1 = registerArrayRead16(USTCNT1);
|
||||
bool interruptState = false;
|
||||
|
||||
//is enabled
|
||||
if(ustcnt1 & 0x8000){
|
||||
//RX is enabled
|
||||
if(ustcnt1 & 0x4000){
|
||||
uint16_t urx1 = registerArrayRead16(URX1);
|
||||
uint8_t entrys = uart1RxFifoEntrys();
|
||||
|
||||
//TODO: old data timer is unemualted
|
||||
//if(ustcnt1 & 0x0080 && entrys > 0)
|
||||
// interruptState = true;
|
||||
|
||||
if(ustcnt1 & 0x0020 && entrys == 12)
|
||||
interruptState = true;
|
||||
if(ustcnt1 & 0x0010 && entrys > 6)
|
||||
interruptState = true;
|
||||
if(ustcnt1 & 0x0008 && entrys > 0)
|
||||
interruptState = true;
|
||||
}
|
||||
|
||||
//TX is enabled
|
||||
if(ustcnt1 & 0x2000){
|
||||
uint16_t utx1 = registerArrayRead16(UTX1);
|
||||
uint8_t entrys = uart1TxFifoEntrys();
|
||||
|
||||
if(ustcnt1 & 0x0004 && entrys == 0)
|
||||
interruptState = true;
|
||||
if(ustcnt1 & 0x0002 && entrys < 4)
|
||||
interruptState = true;
|
||||
if(ustcnt1 & 0x0001 && entrys < 8)
|
||||
interruptState = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(interruptState)
|
||||
setIprIsrBit(DBVZ_INT_UART1);
|
||||
else
|
||||
clearIprIsrBit(DBVZ_INT_UART1);
|
||||
checkInterrupts();
|
||||
}
|
||||
|
||||
static void setUstcnt1(uint16_t value){
|
||||
//flush RX FIFO if disabled
|
||||
if(!((value & 0xC000) == 0xC000))
|
||||
uart1RxFifoFlush();
|
||||
|
||||
//flush TX FIFO if disabled
|
||||
if(!((value & 0xA000) == 0xA000))
|
||||
uart1TxFifoFlush();
|
||||
|
||||
registerArrayWrite16(USTCNT1, value);
|
||||
updateUart1Interrupt();
|
||||
}
|
||||
|
||||
static void updateUart2PortState(void){
|
||||
if(palmSerialSetPortProperties){
|
||||
uint16_t ustcnt2 = registerArrayRead16(USTCNT2);
|
||||
uint16_t ubaud2 = registerArrayRead16(UBAUD2);
|
||||
uint8_t divider = 1 << (ubaud2 >> 8 & 0x07);
|
||||
uint8_t prescaler = 65 - (ubaud2 & 0x001F);
|
||||
bool baudSrc = !!(ubaud2 & 0x0800);
|
||||
serial_port_properties_t properties;
|
||||
|
||||
properties.enable = !!(ustcnt2 & 0x8000);
|
||||
properties.enableParity = !!(ustcnt2 & 0x0800);
|
||||
properties.oddParity = !!(ustcnt2 & 0x0400);
|
||||
properties.stopBits = !!(ustcnt2 & 0x0200) ? 2 : 1;
|
||||
properties.use8BitMode = !!(ustcnt2 & 0x0100);
|
||||
properties.baudRate = (baudSrc ? EMU_SERIAL_USE_EXTERNAL_CLOCK_SOURCE : sysclksPerClk32() * M5XX_CRYSTAL_FREQUENCY) / prescaler / divider;
|
||||
|
||||
palmSerialSetPortProperties(&properties);
|
||||
}
|
||||
}
|
||||
|
||||
static void updateUart2Interrupt(void){
|
||||
//the UART2 interrupt has a rather complex set of trigger methods so they all have to be checked after one changes to prevent clearing a valid interrupt thats on the same line
|
||||
uint16_t ustcnt2 = registerArrayRead16(USTCNT2);
|
||||
uint16_t hmark = registerArrayRead16(HMARK);
|
||||
uint8_t hmarkRx = (hmark & 0x0F) * 4;
|
||||
uint8_t hmarkTx = (hmark >> 8) * 4;
|
||||
bool interruptState = false;
|
||||
|
||||
//is enabled
|
||||
if(ustcnt2 & 0x8000){
|
||||
//RX is enabled
|
||||
if(ustcnt2 & 0x4000){
|
||||
uint16_t urx2 = registerArrayRead16(URX2);
|
||||
uint8_t entrys = uart2RxFifoEntrys();
|
||||
|
||||
//TODO: old data timer is unemualted
|
||||
//if(ustcnt2 & 0x0080 && entrys > 0)
|
||||
// interruptState = true;
|
||||
|
||||
if(ustcnt2 & 0x0020 && entrys == 64)
|
||||
interruptState = true;
|
||||
if(ustcnt2 & 0x0010 && entrys > hmarkRx && hmarkRx != 0x00)
|
||||
interruptState = true;
|
||||
if(ustcnt2 & 0x0008 && entrys > 0)
|
||||
interruptState = true;
|
||||
}
|
||||
|
||||
//TX is enabled
|
||||
if(ustcnt2 & 0x2000){
|
||||
uint16_t utx2 = registerArrayRead16(UTX2);
|
||||
uint8_t entrys = uart2TxFifoEntrys();
|
||||
|
||||
if(ustcnt2 & 0x0004 && entrys == 0)
|
||||
interruptState = true;
|
||||
if(ustcnt2 & 0x0002 && entrys < hmarkTx && hmarkTx != 0x00)
|
||||
interruptState = true;
|
||||
if(ustcnt2 & 0x0001 && entrys < 64)
|
||||
interruptState = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(interruptState)
|
||||
setIprIsrBit(DBVZ_INT_UART2);
|
||||
else
|
||||
clearIprIsrBit(DBVZ_INT_UART2);
|
||||
checkInterrupts();
|
||||
}
|
||||
|
||||
static void setUstcnt2(uint16_t value){
|
||||
//flush RX FIFO if disabled
|
||||
if(!((value & 0xC000) == 0xC000))
|
||||
uart2RxFifoFlush();
|
||||
|
||||
//flush TX FIFO if disabled
|
||||
if(!((value & 0xA000) == 0xA000))
|
||||
uart2TxFifoFlush();
|
||||
|
||||
registerArrayWrite16(USTCNT2, value);
|
||||
updateUart2Interrupt();
|
||||
}
|
||||
|
||||
static void setTstat1(uint16_t value){
|
||||
uint16_t oldTstat1 = registerArrayRead16(TSTAT1);
|
||||
uint16_t newTstat1 = (value & timerStatusReadAcknowledge[0]) | (oldTstat1 & ~timerStatusReadAcknowledge[0]);
|
||||
@@ -676,7 +911,7 @@ static uint8_t getPortKValue(void){
|
||||
uint8_t portKDir = registerArrayRead8(PKDIR);
|
||||
uint8_t portKSel = registerArrayRead8(PKSEL);
|
||||
|
||||
portKValue |= !(palmMisc.dataPort == PORT_USB_CRADLE || palmMisc.dataPort == PORT_SERIAL_CRADLE) << 2;//true if charging
|
||||
portKValue |= !palmMisc.batteryCharging << 2;//false if chargeing
|
||||
portKValue |= 0xFB;//floating pins are high
|
||||
portKValue &= ~portKDir & portKSel;
|
||||
portKValue |= portKData & portKDir & portKSel;
|
||||
@@ -734,7 +969,7 @@ static uint16_t getPwmc1(void){
|
||||
|
||||
//updaters
|
||||
static void updatePowerButtonLedStatus(void){
|
||||
palmMisc.powerButtonLed = !!(getPortBValue() & 0x40) != palmMisc.batteryCharging;
|
||||
palmMisc.greenLed = !!(getPortBValue() & 0x40) != palmMisc.batteryCharging;
|
||||
}
|
||||
|
||||
static void updateVibratorStatus(void){
|
||||
@@ -749,10 +984,6 @@ static void updateSdCardChipSelectStatus(void){
|
||||
sdCardSetChipSelect(!!(getPortJValue() & 0x08));
|
||||
}
|
||||
|
||||
static void updateBacklightAmplifierStatus(void){
|
||||
palmMisc.backlightLevel = (palmMisc.backlightLevel > 0) ? (1 + m515BacklightAmplifierState()) : 0;
|
||||
}
|
||||
|
||||
static void updateTouchState(void){
|
||||
if(!(registerArrayRead8(PFSEL) & registerArrayRead8(PFDIR) & 0x02)){
|
||||
if((ads7846PenIrqEnabled ? !palmInput.touchscreenTouched : true) == !!(registerArrayRead16(ICR) & 0x0080))
|
||||
@@ -1,8 +1,4 @@
|
||||
#ifndef DRAGONBALL_VZ_REGISTER_SPEC_H
|
||||
#define DRAGONBALL_VZ_REGISTER_SPEC_H
|
||||
|
||||
/*Dragonball VZ Register Definitions*/
|
||||
#define HW_REG_ADDR(x) (0xFFFFF000 | (x))
|
||||
|
||||
/*SIM - System Integration Module*/
|
||||
#define SCR 0x000/*System Control Register*/
|
||||
@@ -154,12 +150,16 @@
|
||||
#define LCWCH 0xA1C/*Cursor Width & Height Register*/
|
||||
#define LBLKC 0xA1F/*Blink Control Register*/
|
||||
#define LPICF 0xA20/*Panel Interface Config Register*/
|
||||
#define LPOLCF 0xA21/*LCD Polarity Configuration Register*/
|
||||
#define LACDRC 0xA23/*LACD Rate Control Register*/
|
||||
#define LPXCD 0xA25/*Pixel Clock Divider Register*/
|
||||
#define LCKCON 0xA27/*Clocking Control Register*/
|
||||
#define LRRA 0xA28/*LCD Refresh Rate Adjustment Register*/
|
||||
/*Reserved 0xA2B Octet Terminal Count Register On Original Dragonball*/
|
||||
#define LPOSR 0xA2D/*LCD Panning Offset Register*/
|
||||
#define LFRCM 0xA31/*Frame Rate Control Modulation Register*/
|
||||
#define LGPMR 0xA33/*Gray Palette Mapping Register*/
|
||||
#define PWMR 0xA36/*PWM Contrast Control Register*/
|
||||
#define DMACR 0xA39/*DMA Control Register*/
|
||||
|
||||
/*RTC - Real Time Clock*/
|
||||
@@ -176,5 +176,3 @@
|
||||
#define DRAMMC 0xC00/*DRAM Memory Configuration Register*/
|
||||
#define DRAMC 0xC02/*DRAM Control Register*/
|
||||
#define SDCTRL 0xC04/*SDRAM Control Register*/
|
||||
|
||||
#endif
|
||||
@@ -1,6 +1,6 @@
|
||||
//both timer functions can call eachother define them here
|
||||
static void timer1(uint8_t reason, double sysclk);
|
||||
static void timer2(uint8_t reason, double sysclk);
|
||||
static void timer1(uint8_t reason, double sysclks);
|
||||
static void timer2(uint8_t reason, double sysclks);
|
||||
|
||||
static void timer1(uint8_t reason, double sysclks){
|
||||
uint16_t timer1Control = registerArrayRead16(TCTL1);
|
||||
@@ -169,35 +169,35 @@ static void rtiInterruptClk32(void){
|
||||
//this function is part of endClk32();
|
||||
uint16_t triggeredRtiInterrupts = 0x0000;
|
||||
|
||||
if(clk32Counter % (M515_CRYSTAL_FREQUENCY / 512) == 0){
|
||||
if(clk32Counter % (M5XX_CRYSTAL_FREQUENCY / 512) == 0){
|
||||
//RIS7 - 512HZ
|
||||
triggeredRtiInterrupts |= 0x8000;
|
||||
}
|
||||
if(clk32Counter % (M515_CRYSTAL_FREQUENCY / 256) == 0){
|
||||
if(clk32Counter % (M5XX_CRYSTAL_FREQUENCY / 256) == 0){
|
||||
//RIS6 - 256HZ
|
||||
triggeredRtiInterrupts |= 0x4000;
|
||||
}
|
||||
if(clk32Counter % (M515_CRYSTAL_FREQUENCY / 128) == 0){
|
||||
if(clk32Counter % (M5XX_CRYSTAL_FREQUENCY / 128) == 0){
|
||||
//RIS5 - 128HZ
|
||||
triggeredRtiInterrupts |= 0x2000;
|
||||
}
|
||||
if(clk32Counter % (M515_CRYSTAL_FREQUENCY / 64) == 0){
|
||||
if(clk32Counter % (M5XX_CRYSTAL_FREQUENCY / 64) == 0){
|
||||
//RIS4 - 64HZ
|
||||
triggeredRtiInterrupts |= 0x1000;
|
||||
}
|
||||
if(clk32Counter % (M515_CRYSTAL_FREQUENCY / 32) == 0){
|
||||
if(clk32Counter % (M5XX_CRYSTAL_FREQUENCY / 32) == 0){
|
||||
//RIS3 - 32HZ
|
||||
triggeredRtiInterrupts |= 0x0800;
|
||||
}
|
||||
if(clk32Counter % (M515_CRYSTAL_FREQUENCY / 16) == 0){
|
||||
if(clk32Counter % (M5XX_CRYSTAL_FREQUENCY / 16) == 0){
|
||||
//RIS2 - 16HZ
|
||||
triggeredRtiInterrupts |= 0x0400;
|
||||
}
|
||||
if(clk32Counter % (M515_CRYSTAL_FREQUENCY / 8) == 0){
|
||||
if(clk32Counter % (M5XX_CRYSTAL_FREQUENCY / 8) == 0){
|
||||
//RIS1 - 8HZ
|
||||
triggeredRtiInterrupts |= 0x0200;
|
||||
}
|
||||
if(clk32Counter % (M515_CRYSTAL_FREQUENCY / 4) == 0){
|
||||
if(clk32Counter % (M5XX_CRYSTAL_FREQUENCY / 4) == 0){
|
||||
//RIS0 - 4HZ
|
||||
triggeredRtiInterrupts |= 0x0100;
|
||||
}
|
||||
@@ -249,16 +249,36 @@ static void rtcAddSecondClk32(void){
|
||||
uint8_t minutes = oldRtcTime >> 16 & 0x0000003F;
|
||||
uint8_t seconds = oldRtcTime & 0x0000003F;
|
||||
|
||||
seconds++;
|
||||
rtcInterruptEvents |= 0x0010;
|
||||
if(seconds >= 60){
|
||||
if(palmSyncRtc && palmGetRtcFromHost){
|
||||
//get new RTC value from system
|
||||
uint16_t stopwatch = registerArrayRead16(STPWCH);
|
||||
uint8_t alarmHours = rtcAlrm >> 24;
|
||||
uint8_t alarmMinutes = rtcAlrm >> 16 & 0x0000003F;
|
||||
uint8_t alarmSeconds = rtcAlrm & 0x0000003F;
|
||||
uint8_t time[3];
|
||||
|
||||
palmGetRtcFromHost(time);
|
||||
|
||||
//day rollover happened
|
||||
if(hours > time[0]){
|
||||
days++;
|
||||
rtcInterruptEvents |= 0x0008;
|
||||
}
|
||||
|
||||
if(time[0] != hours)
|
||||
rtcInterruptEvents |= 0x0020;
|
||||
|
||||
if(time[1] != minutes)
|
||||
rtcInterruptEvents |= 0x0002;
|
||||
|
||||
if(time[2] != seconds)
|
||||
rtcInterruptEvents |= 0x0010;
|
||||
|
||||
if(stopwatch != 0x003F){
|
||||
if(stopwatch == 0x0000)
|
||||
stopwatch -= FAST_ABS(time[1] - minutes);
|
||||
|
||||
if(stopwatch <= 0x0000)
|
||||
stopwatch = 0x003F;
|
||||
else
|
||||
stopwatch--;
|
||||
registerArrayWrite16(STPWCH, stopwatch);
|
||||
}
|
||||
|
||||
@@ -266,27 +286,63 @@ static void rtcAddSecondClk32(void){
|
||||
if(stopwatch == 0x003F)
|
||||
rtcInterruptEvents |= 0x0001;
|
||||
|
||||
minutes++;
|
||||
seconds = 0;
|
||||
rtcInterruptEvents |= 0x0002;
|
||||
if(minutes >= 60){
|
||||
hours++;
|
||||
minutes = 0;
|
||||
rtcInterruptEvents |= 0x0020;
|
||||
if(hours >= 24){
|
||||
hours = 0;
|
||||
days++;
|
||||
rtcInterruptEvents |= 0x0008;
|
||||
newRtcTime = time[2];//seconds
|
||||
newRtcTime |= time[1] << 16;//minutes
|
||||
newRtcTime |= time[0] << 24;//hours
|
||||
|
||||
//check alarm range to see if it triggered in the time that has passed
|
||||
if(days == dayAlrm){
|
||||
if(hours < alarmHours || hours == alarmHours && minutes < alarmMinutes || hours == alarmHours && minutes == alarmMinutes && seconds < alarmSeconds){
|
||||
//old time is before alarm
|
||||
if(time[0] > alarmHours || time[0] == alarmHours && time[1] > alarmMinutes || time[0] == alarmHours && time[1] == alarmMinutes && time[0] >= alarmSeconds){
|
||||
//new time is after alarm
|
||||
rtcInterruptEvents |= 0x0040;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
//standard frame based time increment
|
||||
|
||||
newRtcTime = seconds;
|
||||
newRtcTime |= minutes << 16;
|
||||
newRtcTime |= hours << 24;
|
||||
seconds++;
|
||||
rtcInterruptEvents |= 0x0010;
|
||||
if(seconds >= 60){
|
||||
uint16_t stopwatch = registerArrayRead16(STPWCH);
|
||||
|
||||
if(newRtcTime == rtcAlrm && days == dayAlrm)
|
||||
rtcInterruptEvents |= 0x0040;
|
||||
if(stopwatch != 0x003F){
|
||||
if(stopwatch == 0x0000)
|
||||
stopwatch = 0x003F;
|
||||
else
|
||||
stopwatch--;
|
||||
registerArrayWrite16(STPWCH, stopwatch);
|
||||
}
|
||||
|
||||
//if stopwatch ran out above or was enabled with 0x003F in the register trigger interrupt
|
||||
if(stopwatch == 0x003F)
|
||||
rtcInterruptEvents |= 0x0001;
|
||||
|
||||
minutes++;
|
||||
seconds = 0;
|
||||
rtcInterruptEvents |= 0x0002;
|
||||
if(minutes >= 60){
|
||||
hours++;
|
||||
minutes = 0;
|
||||
rtcInterruptEvents |= 0x0020;
|
||||
if(hours >= 24){
|
||||
hours = 0;
|
||||
days++;
|
||||
rtcInterruptEvents |= 0x0008;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
newRtcTime = seconds;
|
||||
newRtcTime |= minutes << 16;
|
||||
newRtcTime |= hours << 24;
|
||||
|
||||
if(newRtcTime == rtcAlrm && days == dayAlrm)
|
||||
rtcInterruptEvents |= 0x0040;
|
||||
}
|
||||
|
||||
rtcInterruptEvents &= registerArrayRead16(RTCIENR);
|
||||
if(rtcInterruptEvents){
|
||||
@@ -301,13 +357,13 @@ static void rtcAddSecondClk32(void){
|
||||
watchdogSecondTickClk32();
|
||||
}
|
||||
|
||||
void dbvzBeginClk32(void){
|
||||
static void dbvzBeginClk32(void){
|
||||
dbvzClk32Sysclks = 0.0;
|
||||
}
|
||||
|
||||
void dbvzEndClk32(void){
|
||||
static void dbvzEndClk32(void){
|
||||
//second position counter
|
||||
if(clk32Counter >= M515_CRYSTAL_FREQUENCY - 1){
|
||||
if(clk32Counter >= M5XX_CRYSTAL_FREQUENCY - 1){
|
||||
clk32Counter = 0;
|
||||
rtcAddSecondClk32();
|
||||
}
|
||||
@@ -344,10 +400,14 @@ void dbvzEndClk32(void){
|
||||
pllWakeWait--;
|
||||
}
|
||||
|
||||
//UART1/2, these are polled to remain thread safe
|
||||
updateUart1Interrupt();
|
||||
updateUart2Interrupt();
|
||||
|
||||
checkInterrupts();
|
||||
}
|
||||
|
||||
void dbvzAddSysclks(double count){
|
||||
static void dbvzAddSysclks(double count){
|
||||
timer1(DBVZ_TIMER_REASON_SYSCLK, count);
|
||||
timer2(DBVZ_TIMER_REASON_SYSCLK, count);
|
||||
samplePwm1(false/*forClk32*/, count);
|
||||
@@ -357,15 +417,15 @@ void dbvzAddSysclks(double count){
|
||||
}
|
||||
|
||||
static int32_t audioGetFramePercentIncrementFromClk32s(int32_t count){
|
||||
return (double)count / ((double)M515_CRYSTAL_FREQUENCY / EMU_FPS) * AUDIO_END_OF_FRAME;
|
||||
return (double)count / ((double)M5XX_CRYSTAL_FREQUENCY / EMU_FPS) * DBVZ_AUDIO_END_OF_FRAME;
|
||||
}
|
||||
|
||||
static int32_t audioGetFramePercentIncrementFromSysclks(double count){
|
||||
return count / (dbvzSysclksPerClk32 * ((double)M515_CRYSTAL_FREQUENCY / EMU_FPS)) * AUDIO_END_OF_FRAME;
|
||||
return count / (dbvzSysclksPerClk32 * ((double)M5XX_CRYSTAL_FREQUENCY / EMU_FPS)) * DBVZ_AUDIO_END_OF_FRAME;
|
||||
}
|
||||
|
||||
static int32_t audioGetFramePercentage(void){
|
||||
//returns how much of the frame has executed
|
||||
//0% = 0, 100% = AUDIO_END_OF_FRAME
|
||||
//0% = 0, 100% = DBVZ_AUDIO_END_OF_FRAME
|
||||
return audioGetFramePercentIncrementFromClk32s(dbvzFrameClk32s) + (dbvzIsPllOn() ? audioGetFramePercentIncrementFromSysclks(dbvzClk32Sysclks) : 0);
|
||||
}
|
||||
@@ -12,18 +12,16 @@ extern "C" {
|
||||
#include <stdio.h>
|
||||
|
||||
#include "audio/blip_buf.h"
|
||||
#include "m515Bus.h"//for size macros
|
||||
#include "specs/emuFeatureRegisterSpec.h"//for feature names
|
||||
#include "m5XXBus.h"//for size macros
|
||||
|
||||
//DEFINE INFO!!!
|
||||
//define EMU_SUPPORT_PALM_OS5 to compile in Tungsten C support(not reccomended for low power devices)
|
||||
//define EMU_SUPPORT_PALM_OS5 to compile in Tungsten T3 support(not reccomended for low power devices)
|
||||
//define EMU_MULTITHREADED to speed up long loops
|
||||
//define EMU_MANAGE_HOST_CPU_PIPELINE to optimize the CPU pipeline for the most common cases
|
||||
//define EMU_NO_SAFETY to remove all safety checks
|
||||
//define EMU_BIG_ENDIAN on big endian systems
|
||||
//define EMU_HAVE_FILE_LAUNCHER to enable launching files from the host system
|
||||
//to enable degguging define EMU_DEBUG, all options below do nothing unless EMU_DEBUG is defined
|
||||
//to enable sandbox debugging define EMU_SANDBOX
|
||||
//to enable memory access logging define EMU_SANDBOX_LOG_MEMORY_ACCESSES
|
||||
//to enable opcode level debugging define EMU_SANDBOX_OPCODE_LEVEL_DEBUG
|
||||
//to enable flow control logging define EMU_SANDBOX_LOG_JUMPS, EMU_SANDBOX_OPCODE_LEVEL_DEBUG must also be defined for this to work
|
||||
@@ -47,28 +45,30 @@ static void debugLog(char* str, ...){};
|
||||
//config options
|
||||
#define EMU_FPS 60
|
||||
#define DBVZ_SYSCLK_PRECISION 2000000//the amount of cycles to run before adding SYSCLKs, higher = faster, higher values may skip timer events and lower audio accuracy
|
||||
#define DBVZ_CPU_PERCENT_WAITING 0.30//account for wait states when reading memory, tested with SysInfo.prc
|
||||
#define AUDIO_SAMPLE_RATE 48000
|
||||
#define AUDIO_CLOCK_RATE 235929600//smallest amount of time a second can be split into:(2.0 * (14.0 * (255 + 1.0) + 15 + 1.0)) * 32768 == 235929600, used to convert the variable timing of SYSCLK and CLK32 to a fixed location in the current frame 0<->AUDIO_END_OF_FRAME
|
||||
#define AUDIO_SPEAKER_RANGE 0x6000//prevent hitting the top or bottom of the speaker when switching direction rapidly
|
||||
#define SD_CARD_NCR_BYTES 1//how many 0xFF bytes come before the R1 response
|
||||
#define SAVE_STATE_VERSION 0x00000001
|
||||
|
||||
//shared constants
|
||||
#define AUDIO_SAMPLES_PER_FRAME (AUDIO_SAMPLE_RATE / EMU_FPS)
|
||||
#define SD_CARD_BLOCK_SIZE 512//all newer SDSC cards have this fixed at 512
|
||||
#define SD_CARD_BLOCK_DATA_PACKET_SIZE (1 + SD_CARD_BLOCK_SIZE + 2)
|
||||
#define SD_CARD_RESPONSE_FIFO_SIZE (SD_CARD_BLOCK_DATA_PACKET_SIZE * 3)
|
||||
#define SD_CARD_NCR_BYTES 1//how many 0xFF bytes come before the R1 response
|
||||
#define SAVE_STATE_VERSION 0x00000001
|
||||
#if defined(EMU_SUPPORT_PALM_OS5)
|
||||
#define SAVE_STATE_FOR_TUNGSTEN_C 0x80000000
|
||||
#endif
|
||||
|
||||
|
||||
//system constants
|
||||
#define DBVZ_CPU_PERCENT_WAITING 0.30//account for wait states when reading memory, tested with SysInfo.prc
|
||||
#define DBVZ_AUDIO_MAX_CLOCK_RATE 235929600//smallest amount of time a second can be split into:(2.0 * (14.0 * (255 + 1.0) + 15 + 1.0)) * 32768 == 235929600, used to convert the variable timing of SYSCLK and CLK32 to a fixed location in the current frame 0<->AUDIO_END_OF_FRAME
|
||||
#define DBVZ_AUDIO_END_OF_FRAME (DBVZ_AUDIO_MAX_CLOCK_RATE / EMU_FPS)
|
||||
#define M5XX_CRYSTAL_FREQUENCY 32768
|
||||
#define SAVE_STATE_FOR_M500 0x40000000
|
||||
#if defined(EMU_SUPPORT_PALM_OS5)
|
||||
#define TUNGSTEN_C_CPU_CRYSTAL_FREQUENCY 3686400
|
||||
#define TUNGSTEN_C_RTC_CRYSTAL_FREQUENCY 32768
|
||||
#define TUNGSTEN_T3_CPU_PERCENT_WAITING 0.30//TODO: dont know ARM CPU speeds yet
|
||||
#define TUNGSTEN_T3_CPU_CRYSTAL_FREQUENCY 3686400
|
||||
#define TUNGSTEN_T3_CPU_PLL_FREQUENCY 368640000//TODO: dont know ARM CPU speeds yet
|
||||
#define TUNGSTEN_T3_RTC_CRYSTAL_FREQUENCY 32768
|
||||
#define SAVE_STATE_FOR_TUNGSTEN_T3 0x80000000
|
||||
#endif
|
||||
#define M515_CRYSTAL_FREQUENCY 32768
|
||||
#define AUDIO_SAMPLES_PER_FRAME (AUDIO_SAMPLE_RATE / EMU_FPS)
|
||||
#define AUDIO_END_OF_FRAME (AUDIO_CLOCK_RATE / EMU_FPS)
|
||||
|
||||
//emu errors
|
||||
enum{
|
||||
@@ -83,23 +83,55 @@ enum{
|
||||
|
||||
//port types
|
||||
enum{
|
||||
PORT_NONE = 0,
|
||||
PORT_USB_CRADLE,
|
||||
PORT_SERIAL_CRADLE,
|
||||
PORT_USB_PERIPHERAL,
|
||||
PORT_SERIAL_PERIPHERAL,
|
||||
PORT_END
|
||||
EMU_PORT_NONE = 0,
|
||||
EMU_PORT_USB_CRADLE,
|
||||
EMU_PORT_SERIAL_CRADLE,
|
||||
EMU_PORT_USB_PERIPHERAL,
|
||||
EMU_PORT_SERIAL_PERIPHERAL,
|
||||
EMU_PORT_END
|
||||
};
|
||||
|
||||
//serial codes, behaviors of a serial connection other then the raw bytes, the data bytes are stored as uint16_t's with the top 8 bits being the special codes
|
||||
#define EMU_SERIAL_USE_EXTERNAL_CLOCK_SOURCE 0//check baud rate against this when a serial port is reconfigured, if its equal use the clock from the other device
|
||||
#define EMU_SERIAL_PARITY_ERROR 0x100
|
||||
#define EMU_SERIAL_FRAME_ERROR 0x200
|
||||
#define EMU_SERIAL_BREAK (EMU_SERIAL_PARITY_ERROR | 0x00)
|
||||
|
||||
//emulated devices
|
||||
enum{
|
||||
EMU_DEVICE_PALM_M500 = 0,
|
||||
EMU_DEVICE_PALM_M515
|
||||
#if defined(EMU_SUPPORT_PALM_OS5)
|
||||
,EMU_DEVICE_TUNGSTEN_T3
|
||||
#endif
|
||||
};
|
||||
|
||||
//types
|
||||
typedef struct{
|
||||
bool enable;
|
||||
bool enableParity;
|
||||
bool oddParity;
|
||||
uint8_t stopBits;
|
||||
bool use8BitMode;
|
||||
uint32_t baudRate;
|
||||
}serial_port_properties_t;
|
||||
|
||||
typedef struct{
|
||||
bool buttonUp;
|
||||
bool buttonDown;
|
||||
#if defined(EMU_SUPPORT_PALM_OS5)
|
||||
bool buttonLeft;
|
||||
bool buttonRight;
|
||||
bool buttonCenter;
|
||||
#endif
|
||||
|
||||
bool buttonCalendar;//hw button 1
|
||||
bool buttonAddress;//hw button 2
|
||||
bool buttonTodo;//hw button 3
|
||||
bool buttonNotes;//hw button 4
|
||||
#if defined(EMU_SUPPORT_PALM_OS5)
|
||||
bool buttonVoiceMemo;
|
||||
#endif
|
||||
|
||||
bool buttonPower;
|
||||
|
||||
@@ -137,7 +169,10 @@ typedef struct{
|
||||
}sd_card_t;
|
||||
|
||||
typedef struct{
|
||||
bool powerButtonLed;
|
||||
bool greenLed;
|
||||
#if defined(EMU_SUPPORT_PALM_OS5)
|
||||
bool redLed;
|
||||
#endif
|
||||
bool lcdOn;
|
||||
uint8_t backlightLevel;
|
||||
bool vibratorOn;
|
||||
@@ -146,25 +181,16 @@ typedef struct{
|
||||
uint8_t dataPort;
|
||||
}misc_hw_t;
|
||||
|
||||
typedef struct{
|
||||
uint32_t info;
|
||||
uint32_t src;
|
||||
uint32_t dst;
|
||||
uint32_t size;
|
||||
uint32_t value;
|
||||
//uint32_t cmd;//one time use, has no variable
|
||||
}emu_reg_t;
|
||||
|
||||
//emulator data, some are GUI interface variables, some should be left alone
|
||||
#if defined(EMU_SUPPORT_PALM_OS5)
|
||||
extern bool palmEmulatingTungstenC;//read allowed, but not advised
|
||||
extern bool palmEmulatingTungstenT3;//read allowed, but not advised
|
||||
#endif
|
||||
extern bool palmEmulatingM500;//dont touch
|
||||
extern uint8_t* palmRom;//dont touch
|
||||
extern uint8_t* palmRam;//access allowed to read save RAM without allocating a giant buffer, but endianness must be taken into account
|
||||
extern input_t palmInput;//write allowed
|
||||
extern sd_card_t palmSdCard;//access allowed to read flash chip data without allocating a giant buffer
|
||||
extern misc_hw_t palmMisc;//read/write allowed
|
||||
extern emu_reg_t palmEmuFeatures;//dont touch
|
||||
extern uint16_t* palmFramebuffer;//read allowed
|
||||
extern uint16_t palmFramebufferWidth;//read allowed
|
||||
extern uint16_t palmFramebufferHeight;//read allowed
|
||||
@@ -172,13 +198,27 @@ extern int16_t* palmAudio;//read allowed, 2 channel signed 16 bit audio
|
||||
extern blip_t* palmAudioResampler;//dont touch
|
||||
extern double palmCycleCounter;//dont touch
|
||||
extern double palmClockMultiplier;//dont touch
|
||||
extern bool palmSyncRtc;//dont touch
|
||||
extern bool palmAllowInvalidBehavior;//dont touch
|
||||
extern void (*palmIrSetPortProperties)(serial_port_properties_t* properties);//configure port I/O behavior, used for proxyed native I/R connections
|
||||
extern uint32_t (*palmIrDataSize)(void);//returns the current number of bytes in the hosts IR receive FIFO
|
||||
extern uint16_t (*palmIrDataReceive)(void);//called by the emulator to read the hosts IR receive FIFO
|
||||
extern void (*palmIrDataSend)(uint16_t data);//called by the emulator to send IR data
|
||||
extern void (*palmIrDataFlush)(void);//called by the emulator to delete all data in the hosts IR receive FIFO
|
||||
extern void (*palmSerialSetPortProperties)(serial_port_properties_t* properties);//configure port I/O behavior, used for proxyed native serial connections
|
||||
extern uint32_t (*palmSerialDataSize)(void);//returns the current number of bytes in the hosts serial receive FIFO
|
||||
extern uint16_t (*palmSerialDataReceive)(void);//called by the emulator to read the hosts serial receive FIFO
|
||||
extern void (*palmSerialDataSend)(uint16_t data);//called by the emulator to send serial data
|
||||
extern void (*palmSerialDataFlush)(void);//called by the emulator to delete all data in the hosts serial receive FIFO
|
||||
extern void (*palmGetRtcFromHost)(uint8_t* writeBack);//[0] = hours, [1] = minutes, [2] = seconds
|
||||
|
||||
//functions
|
||||
uint32_t emulatorInit(uint8_t* palmRomData, uint32_t palmRomSize, uint8_t* palmBootloaderData, uint32_t palmBootloaderSize, uint32_t enabledEmuFeatures);
|
||||
uint32_t emulatorInit(uint8_t emulatedDevice, uint8_t* palmRomData, uint32_t palmRomSize, uint8_t* palmBootloaderData, uint32_t palmBootloaderSize, bool syncRtc, bool allowInvalidBehavior);
|
||||
void emulatorDeinit(void);
|
||||
void emulatorHardReset(void);
|
||||
void emulatorSoftReset(void);
|
||||
void emulatorSetRtc(uint16_t days, uint8_t hours, uint8_t minutes, uint8_t seconds);
|
||||
void emulatorSetCpuSpeed(double speed);
|
||||
uint32_t emulatorGetStateSize(void);
|
||||
bool emulatorSaveState(uint8_t* data, uint32_t size);//true = success
|
||||
bool emulatorLoadState(uint8_t* data, uint32_t size);//true = success
|
||||
@@ -190,6 +230,7 @@ uint32_t emulatorGetSdCardSize(void);
|
||||
uint32_t emulatorGetSdCardData(uint8_t* data, uint32_t size);
|
||||
void emulatorEjectSdCard(void);
|
||||
void emulatorRunFrame(void);
|
||||
void emulatorSkipFrame(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
26
include/fileLauncher/launcher.h
Normal file
26
include/fileLauncher/launcher.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef LAUNCHER_H
|
||||
#define LAUNCHER_H
|
||||
//this is the only header a frontend needs to include from the launcher
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "../emulator.h"
|
||||
|
||||
void launcherBootInstantly(bool hasSram);//fastforwards through the boot sequence
|
||||
uint32_t launcherInstallFile(uint8_t* data, uint32_t size);//only call after the emu has booted, launcherBootInstantly() will ensure a full boot has completed otherwise this is up to the frontend to be safe
|
||||
bool launcherIsExecutable(uint8_t* data, uint32_t size);
|
||||
uint32_t launcherGetAppId(uint8_t* data, uint32_t size);
|
||||
uint32_t launcherExecute(uint32_t appId);//must first be installed with launcherInstallFile
|
||||
|
||||
void launcherGetSdCardInfoFromInfoFile(uint8_t* data, uint32_t size, sd_card_info_t* returnValue);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
18
include/fixings.h
Normal file
18
include/fixings.h
Normal file
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// Created by xer on 2021-07-15.
|
||||
//
|
||||
|
||||
#ifndef MU_FIXINGS_H
|
||||
#define MU_FIXINGS_H
|
||||
|
||||
/* Fixes for Visual Studio. */
|
||||
#if defined(_MSC_VER)
|
||||
/* Prevent any assembly references from being used. */
|
||||
#define __asm__(what)
|
||||
|
||||
/* GCC's __builtin_popcount */
|
||||
#include <intrin.h>
|
||||
#define __builtin_popcount __popcnt
|
||||
#endif
|
||||
|
||||
#endif // MU_FIXINGS_H
|
||||
5
src/flx68000.h → include/flx68000.h
Executable file → Normal file
5
src/flx68000.h → include/flx68000.h
Executable file → Normal file
@@ -15,8 +15,9 @@ void flx68000SetIrq(uint8_t irqLevel);
|
||||
bool flx68000IsSupervisor(void);
|
||||
void flx68000BusError(uint32_t address, bool isWrite);
|
||||
|
||||
uint32_t flx68000GetRegister(uint8_t reg);//only for debugging
|
||||
#define flx68000GetPc() flx68000GetRegister(29/*M68K_REG_PPC*/)//only for debugging
|
||||
uint32_t flx68000GetRegister(uint8_t reg);//only for debugging, D0<->7 come first then A0<->7
|
||||
uint32_t flx68000GetPc(void);//only for debugging
|
||||
uint32_t flx68000GetStatusRegister(void);//only for debugging
|
||||
uint64_t flx68000ReadArbitraryMemory(uint32_t address, uint8_t size);//only for debugging
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,8 @@
|
||||
#ifndef M515_BUS_H
|
||||
#define M515_BUS_H
|
||||
#ifndef M5XX_BUS_H
|
||||
#define M5XX_BUS_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
//address space
|
||||
//new bank size (0x4000)
|
||||
@@ -19,7 +20,8 @@
|
||||
//and the SED1376 is at 0x1FF80000(+ 0x20000 for framebuffer)
|
||||
#define DBVZ_EMUCS_START_ADDRESS 0xFFFC0000
|
||||
#define DBVZ_REG_START_ADDRESS 0xFFFFF000
|
||||
#define M515_ROM_SIZE (4 * 0x100000)//4mb ROM
|
||||
#define M5XX_ROM_SIZE (4 * 0x100000)//4mb ROM
|
||||
#define M500_RAM_SIZE (8 * 0x100000)//16mb RAM
|
||||
#define M515_RAM_SIZE (16 * 0x100000)//16mb RAM
|
||||
#define DBVZ_EMUCS_SIZE 0x20000
|
||||
#define DBVZ_REG_SIZE 0x1000//is actually 0xE00 without bootloader
|
||||
5
src/m68k/m68k.h → include/m68k/m68k.h
Executable file → Normal file
5
src/m68k/m68k.h → include/m68k/m68k.h
Executable file → Normal file
@@ -86,7 +86,8 @@ enum
|
||||
M68K_CPU_TYPE_68EC020,
|
||||
M68K_CPU_TYPE_68020,
|
||||
M68K_CPU_TYPE_68030, /* Supported by disassembler ONLY */
|
||||
M68K_CPU_TYPE_68040 /* Supported by disassembler ONLY */
|
||||
M68K_CPU_TYPE_68040, /* Supported by disassembler ONLY */
|
||||
M68K_CPU_TYPE_DBVZ
|
||||
};
|
||||
|
||||
/* Registers used by m68k_get_reg() and m68k_set_reg() */
|
||||
@@ -338,7 +339,7 @@ void m68k_set_reg(m68k_register_t reg, uint32_t value);
|
||||
/* Check if an instruction is valid for the specified CPU type */
|
||||
uint32_t m68k_is_valid_instruction(uint32_t instruction, uint32_t cpu_type);
|
||||
|
||||
/* Disassemble 1 instruction using the epecified CPU type at pc. Stores
|
||||
/* Disassemble 1 instruction using the specified CPU type at pc. Stores
|
||||
* disassembly in str_buff and returns the size of the instruction in bytes.
|
||||
*/
|
||||
uint32_t m68k_disassemble(char* str_buff, uint32_t pc, uint32_t cpu_type);
|
||||
16
src/m68k/m68kconf.h → include/m68k/m68kconf.h
Executable file → Normal file
16
src/m68k/m68kconf.h → include/m68k/m68kconf.h
Executable file → Normal file
@@ -133,12 +133,8 @@
|
||||
/* If ON, CPU will call the instruction hook callback before every
|
||||
* instruction.
|
||||
*/
|
||||
#if defined(EMU_DEBUG) && defined(EMU_SANDBOX) && defined(EMU_SANDBOX_OPCODE_LEVEL_DEBUG)
|
||||
#define M68K_INSTRUCTION_HOOK OPT_SPECIFY_HANDLER
|
||||
#else
|
||||
#define M68K_INSTRUCTION_HOOK OPT_OFF
|
||||
#endif
|
||||
#define M68K_INSTRUCTION_CALLBACK() sandboxOnOpcodeRun()
|
||||
#define M68K_INSTRUCTION_CALLBACK() on_opcode_run()
|
||||
|
||||
|
||||
/* If ON, the CPU will emulate the 4-byte prefetch queue of a real 68000.
|
||||
@@ -183,16 +179,6 @@
|
||||
*/
|
||||
|
||||
|
||||
/* Set to your compiler's static inline keyword to enable it, or
|
||||
* set it to blank to disable it.
|
||||
* If you define MUSASHI_INLINE in the makefile, it will override this value.
|
||||
* NOTE: not enabling inline functions will SEVERELY slow down emulation.
|
||||
*/
|
||||
#ifndef MUSASHI_INLINE
|
||||
#define MUSASHI_INLINE static inline
|
||||
#endif /* MUSASHI_INLINE */
|
||||
|
||||
|
||||
/* ======================================================================== */
|
||||
/* ============================== END OF FILE ============================= */
|
||||
/* ======================================================================== */
|
||||
372
src/m68k/m68kcpu.h → include/m68k/m68kcpu.h
Executable file → Normal file
372
src/m68k/m68kcpu.h → include/m68k/m68kcpu.h
Executable file → Normal file
@@ -836,120 +836,120 @@ extern uint m68ki_aerr_write_mode;
|
||||
extern uint m68ki_aerr_fc;
|
||||
|
||||
/* Read data immediately after the program counter */
|
||||
MUSASHI_INLINE uint m68ki_read_imm_16(void);
|
||||
MUSASHI_INLINE uint m68ki_read_imm_32(void);
|
||||
static inline uint m68ki_read_imm_16(void);
|
||||
static inline uint m68ki_read_imm_32(void);
|
||||
|
||||
/* Read data with specific function code */
|
||||
MUSASHI_INLINE uint m68ki_read_8_fc (uint address, uint fc);
|
||||
MUSASHI_INLINE uint m68ki_read_16_fc (uint address, uint fc);
|
||||
MUSASHI_INLINE uint m68ki_read_32_fc (uint address, uint fc);
|
||||
static inline uint m68ki_read_8_fc (uint address, uint fc);
|
||||
static inline uint m68ki_read_16_fc (uint address, uint fc);
|
||||
static inline uint m68ki_read_32_fc (uint address, uint fc);
|
||||
|
||||
/* Write data with specific function code */
|
||||
MUSASHI_INLINE void m68ki_write_8_fc (uint address, uint fc, uint value);
|
||||
MUSASHI_INLINE void m68ki_write_16_fc(uint address, uint fc, uint value);
|
||||
MUSASHI_INLINE void m68ki_write_32_fc(uint address, uint fc, uint value);
|
||||
static inline void m68ki_write_8_fc (uint address, uint fc, uint value);
|
||||
static inline void m68ki_write_16_fc(uint address, uint fc, uint value);
|
||||
static inline void m68ki_write_32_fc(uint address, uint fc, uint value);
|
||||
#if M68K_SIMULATE_PD_WRITES
|
||||
MUSASHI_INLINE void m68ki_write_32_pd_fc(uint address, uint fc, uint value);
|
||||
static inline void m68ki_write_32_pd_fc(uint address, uint fc, uint value);
|
||||
#endif /* M68K_SIMULATE_PD_WRITES */
|
||||
|
||||
/* Indexed and PC-relative ea fetching */
|
||||
MUSASHI_INLINE uint m68ki_get_ea_pcdi(void);
|
||||
MUSASHI_INLINE uint m68ki_get_ea_pcix(void);
|
||||
MUSASHI_INLINE uint m68ki_get_ea_ix(uint An);
|
||||
static inline uint m68ki_get_ea_pcdi(void);
|
||||
static inline uint m68ki_get_ea_pcix(void);
|
||||
static inline uint m68ki_get_ea_ix(uint An);
|
||||
|
||||
/* Operand fetching */
|
||||
MUSASHI_INLINE uint OPER_AY_AI_8(void);
|
||||
MUSASHI_INLINE uint OPER_AY_AI_16(void);
|
||||
MUSASHI_INLINE uint OPER_AY_AI_32(void);
|
||||
MUSASHI_INLINE uint OPER_AY_PI_8(void);
|
||||
MUSASHI_INLINE uint OPER_AY_PI_16(void);
|
||||
MUSASHI_INLINE uint OPER_AY_PI_32(void);
|
||||
MUSASHI_INLINE uint OPER_AY_PD_8(void);
|
||||
MUSASHI_INLINE uint OPER_AY_PD_16(void);
|
||||
MUSASHI_INLINE uint OPER_AY_PD_32(void);
|
||||
MUSASHI_INLINE uint OPER_AY_DI_8(void);
|
||||
MUSASHI_INLINE uint OPER_AY_DI_16(void);
|
||||
MUSASHI_INLINE uint OPER_AY_DI_32(void);
|
||||
MUSASHI_INLINE uint OPER_AY_IX_8(void);
|
||||
MUSASHI_INLINE uint OPER_AY_IX_16(void);
|
||||
MUSASHI_INLINE uint OPER_AY_IX_32(void);
|
||||
static inline uint OPER_AY_AI_8(void);
|
||||
static inline uint OPER_AY_AI_16(void);
|
||||
static inline uint OPER_AY_AI_32(void);
|
||||
static inline uint OPER_AY_PI_8(void);
|
||||
static inline uint OPER_AY_PI_16(void);
|
||||
static inline uint OPER_AY_PI_32(void);
|
||||
static inline uint OPER_AY_PD_8(void);
|
||||
static inline uint OPER_AY_PD_16(void);
|
||||
static inline uint OPER_AY_PD_32(void);
|
||||
static inline uint OPER_AY_DI_8(void);
|
||||
static inline uint OPER_AY_DI_16(void);
|
||||
static inline uint OPER_AY_DI_32(void);
|
||||
static inline uint OPER_AY_IX_8(void);
|
||||
static inline uint OPER_AY_IX_16(void);
|
||||
static inline uint OPER_AY_IX_32(void);
|
||||
|
||||
MUSASHI_INLINE uint OPER_AX_AI_8(void);
|
||||
MUSASHI_INLINE uint OPER_AX_AI_16(void);
|
||||
MUSASHI_INLINE uint OPER_AX_AI_32(void);
|
||||
MUSASHI_INLINE uint OPER_AX_PI_8(void);
|
||||
MUSASHI_INLINE uint OPER_AX_PI_16(void);
|
||||
MUSASHI_INLINE uint OPER_AX_PI_32(void);
|
||||
MUSASHI_INLINE uint OPER_AX_PD_8(void);
|
||||
MUSASHI_INLINE uint OPER_AX_PD_16(void);
|
||||
MUSASHI_INLINE uint OPER_AX_PD_32(void);
|
||||
MUSASHI_INLINE uint OPER_AX_DI_8(void);
|
||||
MUSASHI_INLINE uint OPER_AX_DI_16(void);
|
||||
MUSASHI_INLINE uint OPER_AX_DI_32(void);
|
||||
MUSASHI_INLINE uint OPER_AX_IX_8(void);
|
||||
MUSASHI_INLINE uint OPER_AX_IX_16(void);
|
||||
MUSASHI_INLINE uint OPER_AX_IX_32(void);
|
||||
static inline uint OPER_AX_AI_8(void);
|
||||
static inline uint OPER_AX_AI_16(void);
|
||||
static inline uint OPER_AX_AI_32(void);
|
||||
static inline uint OPER_AX_PI_8(void);
|
||||
static inline uint OPER_AX_PI_16(void);
|
||||
static inline uint OPER_AX_PI_32(void);
|
||||
static inline uint OPER_AX_PD_8(void);
|
||||
static inline uint OPER_AX_PD_16(void);
|
||||
static inline uint OPER_AX_PD_32(void);
|
||||
static inline uint OPER_AX_DI_8(void);
|
||||
static inline uint OPER_AX_DI_16(void);
|
||||
static inline uint OPER_AX_DI_32(void);
|
||||
static inline uint OPER_AX_IX_8(void);
|
||||
static inline uint OPER_AX_IX_16(void);
|
||||
static inline uint OPER_AX_IX_32(void);
|
||||
|
||||
MUSASHI_INLINE uint OPER_A7_PI_8(void);
|
||||
MUSASHI_INLINE uint OPER_A7_PD_8(void);
|
||||
static inline uint OPER_A7_PI_8(void);
|
||||
static inline uint OPER_A7_PD_8(void);
|
||||
|
||||
MUSASHI_INLINE uint OPER_AW_8(void);
|
||||
MUSASHI_INLINE uint OPER_AW_16(void);
|
||||
MUSASHI_INLINE uint OPER_AW_32(void);
|
||||
MUSASHI_INLINE uint OPER_AL_8(void);
|
||||
MUSASHI_INLINE uint OPER_AL_16(void);
|
||||
MUSASHI_INLINE uint OPER_AL_32(void);
|
||||
MUSASHI_INLINE uint OPER_PCDI_8(void);
|
||||
MUSASHI_INLINE uint OPER_PCDI_16(void);
|
||||
MUSASHI_INLINE uint OPER_PCDI_32(void);
|
||||
MUSASHI_INLINE uint OPER_PCIX_8(void);
|
||||
MUSASHI_INLINE uint OPER_PCIX_16(void);
|
||||
MUSASHI_INLINE uint OPER_PCIX_32(void);
|
||||
static inline uint OPER_AW_8(void);
|
||||
static inline uint OPER_AW_16(void);
|
||||
static inline uint OPER_AW_32(void);
|
||||
static inline uint OPER_AL_8(void);
|
||||
static inline uint OPER_AL_16(void);
|
||||
static inline uint OPER_AL_32(void);
|
||||
static inline uint OPER_PCDI_8(void);
|
||||
static inline uint OPER_PCDI_16(void);
|
||||
static inline uint OPER_PCDI_32(void);
|
||||
static inline uint OPER_PCIX_8(void);
|
||||
static inline uint OPER_PCIX_16(void);
|
||||
static inline uint OPER_PCIX_32(void);
|
||||
|
||||
/* Stack operations */
|
||||
MUSASHI_INLINE void m68ki_push_16(uint value);
|
||||
MUSASHI_INLINE void m68ki_push_32(uint value);
|
||||
MUSASHI_INLINE uint m68ki_pull_16(void);
|
||||
MUSASHI_INLINE uint m68ki_pull_32(void);
|
||||
static inline void m68ki_push_16(uint value);
|
||||
static inline void m68ki_push_32(uint value);
|
||||
static inline uint m68ki_pull_16(void);
|
||||
static inline uint m68ki_pull_32(void);
|
||||
|
||||
/* Program flow operations */
|
||||
MUSASHI_INLINE void m68ki_jump(uint new_pc);
|
||||
MUSASHI_INLINE void m68ki_jump_vector(uint vector);
|
||||
MUSASHI_INLINE void m68ki_branch_8(uint offset);
|
||||
MUSASHI_INLINE void m68ki_branch_16(uint offset);
|
||||
MUSASHI_INLINE void m68ki_branch_32(uint offset);
|
||||
static inline void m68ki_jump(uint new_pc);
|
||||
static inline void m68ki_jump_vector(uint vector);
|
||||
static inline void m68ki_branch_8(uint offset);
|
||||
static inline void m68ki_branch_16(uint offset);
|
||||
static inline void m68ki_branch_32(uint offset);
|
||||
|
||||
/* Status register operations. */
|
||||
MUSASHI_INLINE void m68ki_set_s_flag(uint value); /* Only bit 2 of value should be set (i.e. 4 or 0) */
|
||||
MUSASHI_INLINE void m68ki_set_sm_flag(uint value); /* only bits 1 and 2 of value should be set */
|
||||
MUSASHI_INLINE void m68ki_set_ccr(uint value); /* set the condition code register */
|
||||
MUSASHI_INLINE void m68ki_set_sr(uint value); /* set the status register */
|
||||
MUSASHI_INLINE void m68ki_set_sr_noint(uint value); /* set the status register */
|
||||
static inline void m68ki_set_s_flag(uint value); /* Only bit 2 of value should be set (i.e. 4 or 0) */
|
||||
static inline void m68ki_set_sm_flag(uint value); /* only bits 1 and 2 of value should be set */
|
||||
static inline void m68ki_set_ccr(uint value); /* set the condition code register */
|
||||
static inline void m68ki_set_sr(uint value); /* set the status register */
|
||||
static inline void m68ki_set_sr_noint(uint value); /* set the status register */
|
||||
|
||||
/* Exception processing */
|
||||
MUSASHI_INLINE uint m68ki_init_exception(void); /* Initial exception processing */
|
||||
static inline uint m68ki_init_exception(void); /* Initial exception processing */
|
||||
|
||||
MUSASHI_INLINE void m68ki_stack_frame_3word(uint pc, uint sr); /* Stack various frame types */
|
||||
MUSASHI_INLINE void m68ki_stack_frame_buserr(uint sr);
|
||||
static inline void m68ki_stack_frame_3word(uint pc, uint sr); /* Stack various frame types */
|
||||
static inline void m68ki_stack_frame_buserr(uint sr);
|
||||
|
||||
MUSASHI_INLINE void m68ki_stack_frame_0000(uint pc, uint sr, uint vector);
|
||||
MUSASHI_INLINE void m68ki_stack_frame_0001(uint pc, uint sr, uint vector);
|
||||
MUSASHI_INLINE void m68ki_stack_frame_0010(uint sr, uint vector);
|
||||
MUSASHI_INLINE void m68ki_stack_frame_1000(uint pc, uint sr, uint vector);
|
||||
MUSASHI_INLINE void m68ki_stack_frame_1010(uint sr, uint vector, uint pc);
|
||||
MUSASHI_INLINE void m68ki_stack_frame_1011(uint sr, uint vector, uint pc);
|
||||
static inline void m68ki_stack_frame_0000(uint pc, uint sr, uint vector);
|
||||
static inline void m68ki_stack_frame_0001(uint pc, uint sr, uint vector);
|
||||
static inline void m68ki_stack_frame_0010(uint sr, uint vector);
|
||||
static inline void m68ki_stack_frame_1000(uint pc, uint sr, uint vector);
|
||||
static inline void m68ki_stack_frame_1010(uint sr, uint vector, uint pc);
|
||||
static inline void m68ki_stack_frame_1011(uint sr, uint vector, uint pc);
|
||||
|
||||
MUSASHI_INLINE void m68ki_exception_trap(uint vector);
|
||||
MUSASHI_INLINE void m68ki_exception_trapN(uint vector);
|
||||
MUSASHI_INLINE void m68ki_exception_trace(void);
|
||||
MUSASHI_INLINE void m68ki_exception_privilege_violation(void);
|
||||
MUSASHI_INLINE void m68ki_exception_1010(void);
|
||||
MUSASHI_INLINE void m68ki_exception_1111(void);
|
||||
MUSASHI_INLINE void m68ki_exception_illegal(void);
|
||||
MUSASHI_INLINE void m68ki_exception_format_error(void);
|
||||
MUSASHI_INLINE void m68ki_exception_address_error(void);
|
||||
MUSASHI_INLINE void m68ki_exception_interrupt(uint int_level);
|
||||
MUSASHI_INLINE void m68ki_check_interrupts(void); /* ASG: check for interrupts */
|
||||
static inline void m68ki_exception_trap(uint vector);
|
||||
static inline void m68ki_exception_trapN(uint vector);
|
||||
static inline void m68ki_exception_trace(void);
|
||||
static inline void m68ki_exception_privilege_violation(void);
|
||||
static inline void m68ki_exception_1010(void);
|
||||
static inline void m68ki_exception_1111(void);
|
||||
static inline void m68ki_exception_illegal(void);
|
||||
static inline void m68ki_exception_format_error(void);
|
||||
static inline void m68ki_exception_address_error(void);
|
||||
static inline void m68ki_exception_interrupt(uint int_level);
|
||||
static inline void m68ki_check_interrupts(void); /* ASG: check for interrupts */
|
||||
|
||||
/* quick disassembly (used for logging) */
|
||||
char* m68ki_disassemble_quick(uint32_t pc, uint32_t cpu_type);
|
||||
@@ -965,7 +965,7 @@ char* m68ki_disassemble_quick(uint32_t pc, uint32_t cpu_type);
|
||||
/* Handles all immediate reads, does address error check, function code setting,
|
||||
* and prefetching if they are enabled in m68kconf.h
|
||||
*/
|
||||
MUSASHI_INLINE uint m68ki_read_imm_16(void)
|
||||
static inline uint m68ki_read_imm_16(void)
|
||||
{
|
||||
m68ki_set_fc(FLAG_S | FUNCTION_CODE_USER_PROGRAM); /* auto-disable (see m68kcpu.h) */
|
||||
m68ki_check_address_error(REG_PC, MODE_READ, FLAG_S | FUNCTION_CODE_USER_PROGRAM); /* auto-disable (see m68kcpu.h) */
|
||||
@@ -982,7 +982,7 @@ MUSASHI_INLINE uint m68ki_read_imm_16(void)
|
||||
return m68k_read_immediate_16(ADDRESS_68K(REG_PC-2));
|
||||
#endif /* M68K_EMULATE_PREFETCH */
|
||||
}
|
||||
MUSASHI_INLINE uint m68ki_read_imm_32(void)
|
||||
static inline uint m68ki_read_imm_32(void)
|
||||
{
|
||||
#if M68K_EMULATE_PREFETCH
|
||||
uint temp_val;
|
||||
@@ -1023,36 +1023,36 @@ MUSASHI_INLINE uint m68ki_read_imm_32(void)
|
||||
* These functions will also check for address error and set the function
|
||||
* code if they are enabled in m68kconf.h.
|
||||
*/
|
||||
MUSASHI_INLINE uint m68ki_read_8_fc(uint address, uint fc)
|
||||
static inline uint m68ki_read_8_fc(uint address, uint fc)
|
||||
{
|
||||
m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */
|
||||
return m68k_read_memory_8(ADDRESS_68K(address));
|
||||
}
|
||||
MUSASHI_INLINE uint m68ki_read_16_fc(uint address, uint fc)
|
||||
static inline uint m68ki_read_16_fc(uint address, uint fc)
|
||||
{
|
||||
m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */
|
||||
m68ki_check_address_error(address, MODE_READ, fc); /* auto-disable (see m68kcpu.h) */
|
||||
return m68k_read_memory_16(ADDRESS_68K(address));
|
||||
}
|
||||
MUSASHI_INLINE uint m68ki_read_32_fc(uint address, uint fc)
|
||||
static inline uint m68ki_read_32_fc(uint address, uint fc)
|
||||
{
|
||||
m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */
|
||||
m68ki_check_address_error(address, MODE_READ, fc); /* auto-disable (see m68kcpu.h) */
|
||||
return m68k_read_memory_32(ADDRESS_68K(address));
|
||||
}
|
||||
|
||||
MUSASHI_INLINE void m68ki_write_8_fc(uint address, uint fc, uint value)
|
||||
static inline void m68ki_write_8_fc(uint address, uint fc, uint value)
|
||||
{
|
||||
m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */
|
||||
m68k_write_memory_8(ADDRESS_68K(address), value);
|
||||
}
|
||||
MUSASHI_INLINE void m68ki_write_16_fc(uint address, uint fc, uint value)
|
||||
static inline void m68ki_write_16_fc(uint address, uint fc, uint value)
|
||||
{
|
||||
m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */
|
||||
m68ki_check_address_error(address, MODE_WRITE, fc); /* auto-disable (see m68kcpu.h) */
|
||||
m68k_write_memory_16(ADDRESS_68K(address), value);
|
||||
}
|
||||
MUSASHI_INLINE void m68ki_write_32_fc(uint address, uint fc, uint value)
|
||||
static inline void m68ki_write_32_fc(uint address, uint fc, uint value)
|
||||
{
|
||||
m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */
|
||||
m68ki_check_address_error(address, MODE_WRITE, fc); /* auto-disable (see m68kcpu.h) */
|
||||
@@ -1060,7 +1060,7 @@ MUSASHI_INLINE void m68ki_write_32_fc(uint address, uint fc, uint value)
|
||||
}
|
||||
|
||||
#if M68K_SIMULATE_PD_WRITES
|
||||
MUSASHI_INLINE void m68ki_write_32_pd_fc(uint address, uint fc, uint value)
|
||||
static inline void m68ki_write_32_pd_fc(uint address, uint fc, uint value)
|
||||
{
|
||||
m68ki_set_fc(fc); /* auto-disable (see m68kcpu.h) */
|
||||
m68ki_check_address_error(address, MODE_WRITE, fc); /* auto-disable (see m68kcpu.h) */
|
||||
@@ -1074,7 +1074,7 @@ MUSASHI_INLINE void m68ki_write_32_pd_fc(uint address, uint fc, uint value)
|
||||
/* The program counter relative addressing modes cause operands to be
|
||||
* retrieved from program space, not data space.
|
||||
*/
|
||||
MUSASHI_INLINE uint m68ki_get_ea_pcdi(void)
|
||||
static inline uint m68ki_get_ea_pcdi(void)
|
||||
{
|
||||
uint old_pc = REG_PC;
|
||||
m68ki_use_program_space(); /* auto-disable */
|
||||
@@ -1082,7 +1082,7 @@ MUSASHI_INLINE uint m68ki_get_ea_pcdi(void)
|
||||
}
|
||||
|
||||
|
||||
MUSASHI_INLINE uint m68ki_get_ea_pcix(void)
|
||||
static inline uint m68ki_get_ea_pcix(void)
|
||||
{
|
||||
m68ki_use_program_space(); /* auto-disable */
|
||||
return m68ki_get_ea_ix(REG_PC);
|
||||
@@ -1130,7 +1130,7 @@ MUSASHI_INLINE uint m68ki_get_ea_pcix(void)
|
||||
* 1 011 mem indir with long outer
|
||||
* 1 100-111 reserved
|
||||
*/
|
||||
MUSASHI_INLINE uint m68ki_get_ea_ix(uint An)
|
||||
static inline uint m68ki_get_ea_ix(uint An)
|
||||
{
|
||||
/* An = base register */
|
||||
uint extension = m68ki_read_imm_16();
|
||||
@@ -1203,78 +1203,78 @@ MUSASHI_INLINE uint m68ki_get_ea_ix(uint An)
|
||||
|
||||
|
||||
/* Fetch operands */
|
||||
MUSASHI_INLINE uint OPER_AY_AI_8(void) {uint ea = EA_AY_AI_8(); return m68ki_read_8(ea); }
|
||||
MUSASHI_INLINE uint OPER_AY_AI_16(void) {uint ea = EA_AY_AI_16(); return m68ki_read_16(ea);}
|
||||
MUSASHI_INLINE uint OPER_AY_AI_32(void) {uint ea = EA_AY_AI_32(); return m68ki_read_32(ea);}
|
||||
MUSASHI_INLINE uint OPER_AY_PI_8(void) {uint ea = EA_AY_PI_8(); return m68ki_read_8(ea); }
|
||||
MUSASHI_INLINE uint OPER_AY_PI_16(void) {uint ea = EA_AY_PI_16(); return m68ki_read_16(ea);}
|
||||
MUSASHI_INLINE uint OPER_AY_PI_32(void) {uint ea = EA_AY_PI_32(); return m68ki_read_32(ea);}
|
||||
MUSASHI_INLINE uint OPER_AY_PD_8(void) {uint ea = EA_AY_PD_8(); return m68ki_read_8(ea); }
|
||||
MUSASHI_INLINE uint OPER_AY_PD_16(void) {uint ea = EA_AY_PD_16(); return m68ki_read_16(ea);}
|
||||
MUSASHI_INLINE uint OPER_AY_PD_32(void) {uint ea = EA_AY_PD_32(); return m68ki_read_32(ea);}
|
||||
MUSASHI_INLINE uint OPER_AY_DI_8(void) {uint ea = EA_AY_DI_8(); return m68ki_read_8(ea); }
|
||||
MUSASHI_INLINE uint OPER_AY_DI_16(void) {uint ea = EA_AY_DI_16(); return m68ki_read_16(ea);}
|
||||
MUSASHI_INLINE uint OPER_AY_DI_32(void) {uint ea = EA_AY_DI_32(); return m68ki_read_32(ea);}
|
||||
MUSASHI_INLINE uint OPER_AY_IX_8(void) {uint ea = EA_AY_IX_8(); return m68ki_read_8(ea); }
|
||||
MUSASHI_INLINE uint OPER_AY_IX_16(void) {uint ea = EA_AY_IX_16(); return m68ki_read_16(ea);}
|
||||
MUSASHI_INLINE uint OPER_AY_IX_32(void) {uint ea = EA_AY_IX_32(); return m68ki_read_32(ea);}
|
||||
static inline uint OPER_AY_AI_8(void) {uint ea = EA_AY_AI_8(); return m68ki_read_8(ea); }
|
||||
static inline uint OPER_AY_AI_16(void) {uint ea = EA_AY_AI_16(); return m68ki_read_16(ea);}
|
||||
static inline uint OPER_AY_AI_32(void) {uint ea = EA_AY_AI_32(); return m68ki_read_32(ea);}
|
||||
static inline uint OPER_AY_PI_8(void) {uint ea = EA_AY_PI_8(); return m68ki_read_8(ea); }
|
||||
static inline uint OPER_AY_PI_16(void) {uint ea = EA_AY_PI_16(); return m68ki_read_16(ea);}
|
||||
static inline uint OPER_AY_PI_32(void) {uint ea = EA_AY_PI_32(); return m68ki_read_32(ea);}
|
||||
static inline uint OPER_AY_PD_8(void) {uint ea = EA_AY_PD_8(); return m68ki_read_8(ea); }
|
||||
static inline uint OPER_AY_PD_16(void) {uint ea = EA_AY_PD_16(); return m68ki_read_16(ea);}
|
||||
static inline uint OPER_AY_PD_32(void) {uint ea = EA_AY_PD_32(); return m68ki_read_32(ea);}
|
||||
static inline uint OPER_AY_DI_8(void) {uint ea = EA_AY_DI_8(); return m68ki_read_8(ea); }
|
||||
static inline uint OPER_AY_DI_16(void) {uint ea = EA_AY_DI_16(); return m68ki_read_16(ea);}
|
||||
static inline uint OPER_AY_DI_32(void) {uint ea = EA_AY_DI_32(); return m68ki_read_32(ea);}
|
||||
static inline uint OPER_AY_IX_8(void) {uint ea = EA_AY_IX_8(); return m68ki_read_8(ea); }
|
||||
static inline uint OPER_AY_IX_16(void) {uint ea = EA_AY_IX_16(); return m68ki_read_16(ea);}
|
||||
static inline uint OPER_AY_IX_32(void) {uint ea = EA_AY_IX_32(); return m68ki_read_32(ea);}
|
||||
|
||||
MUSASHI_INLINE uint OPER_AX_AI_8(void) {uint ea = EA_AX_AI_8(); return m68ki_read_8(ea); }
|
||||
MUSASHI_INLINE uint OPER_AX_AI_16(void) {uint ea = EA_AX_AI_16(); return m68ki_read_16(ea);}
|
||||
MUSASHI_INLINE uint OPER_AX_AI_32(void) {uint ea = EA_AX_AI_32(); return m68ki_read_32(ea);}
|
||||
MUSASHI_INLINE uint OPER_AX_PI_8(void) {uint ea = EA_AX_PI_8(); return m68ki_read_8(ea); }
|
||||
MUSASHI_INLINE uint OPER_AX_PI_16(void) {uint ea = EA_AX_PI_16(); return m68ki_read_16(ea);}
|
||||
MUSASHI_INLINE uint OPER_AX_PI_32(void) {uint ea = EA_AX_PI_32(); return m68ki_read_32(ea);}
|
||||
MUSASHI_INLINE uint OPER_AX_PD_8(void) {uint ea = EA_AX_PD_8(); return m68ki_read_8(ea); }
|
||||
MUSASHI_INLINE uint OPER_AX_PD_16(void) {uint ea = EA_AX_PD_16(); return m68ki_read_16(ea);}
|
||||
MUSASHI_INLINE uint OPER_AX_PD_32(void) {uint ea = EA_AX_PD_32(); return m68ki_read_32(ea);}
|
||||
MUSASHI_INLINE uint OPER_AX_DI_8(void) {uint ea = EA_AX_DI_8(); return m68ki_read_8(ea); }
|
||||
MUSASHI_INLINE uint OPER_AX_DI_16(void) {uint ea = EA_AX_DI_16(); return m68ki_read_16(ea);}
|
||||
MUSASHI_INLINE uint OPER_AX_DI_32(void) {uint ea = EA_AX_DI_32(); return m68ki_read_32(ea);}
|
||||
MUSASHI_INLINE uint OPER_AX_IX_8(void) {uint ea = EA_AX_IX_8(); return m68ki_read_8(ea); }
|
||||
MUSASHI_INLINE uint OPER_AX_IX_16(void) {uint ea = EA_AX_IX_16(); return m68ki_read_16(ea);}
|
||||
MUSASHI_INLINE uint OPER_AX_IX_32(void) {uint ea = EA_AX_IX_32(); return m68ki_read_32(ea);}
|
||||
static inline uint OPER_AX_AI_8(void) {uint ea = EA_AX_AI_8(); return m68ki_read_8(ea); }
|
||||
static inline uint OPER_AX_AI_16(void) {uint ea = EA_AX_AI_16(); return m68ki_read_16(ea);}
|
||||
static inline uint OPER_AX_AI_32(void) {uint ea = EA_AX_AI_32(); return m68ki_read_32(ea);}
|
||||
static inline uint OPER_AX_PI_8(void) {uint ea = EA_AX_PI_8(); return m68ki_read_8(ea); }
|
||||
static inline uint OPER_AX_PI_16(void) {uint ea = EA_AX_PI_16(); return m68ki_read_16(ea);}
|
||||
static inline uint OPER_AX_PI_32(void) {uint ea = EA_AX_PI_32(); return m68ki_read_32(ea);}
|
||||
static inline uint OPER_AX_PD_8(void) {uint ea = EA_AX_PD_8(); return m68ki_read_8(ea); }
|
||||
static inline uint OPER_AX_PD_16(void) {uint ea = EA_AX_PD_16(); return m68ki_read_16(ea);}
|
||||
static inline uint OPER_AX_PD_32(void) {uint ea = EA_AX_PD_32(); return m68ki_read_32(ea);}
|
||||
static inline uint OPER_AX_DI_8(void) {uint ea = EA_AX_DI_8(); return m68ki_read_8(ea); }
|
||||
static inline uint OPER_AX_DI_16(void) {uint ea = EA_AX_DI_16(); return m68ki_read_16(ea);}
|
||||
static inline uint OPER_AX_DI_32(void) {uint ea = EA_AX_DI_32(); return m68ki_read_32(ea);}
|
||||
static inline uint OPER_AX_IX_8(void) {uint ea = EA_AX_IX_8(); return m68ki_read_8(ea); }
|
||||
static inline uint OPER_AX_IX_16(void) {uint ea = EA_AX_IX_16(); return m68ki_read_16(ea);}
|
||||
static inline uint OPER_AX_IX_32(void) {uint ea = EA_AX_IX_32(); return m68ki_read_32(ea);}
|
||||
|
||||
MUSASHI_INLINE uint OPER_A7_PI_8(void) {uint ea = EA_A7_PI_8(); return m68ki_read_8(ea); }
|
||||
MUSASHI_INLINE uint OPER_A7_PD_8(void) {uint ea = EA_A7_PD_8(); return m68ki_read_8(ea); }
|
||||
static inline uint OPER_A7_PI_8(void) {uint ea = EA_A7_PI_8(); return m68ki_read_8(ea); }
|
||||
static inline uint OPER_A7_PD_8(void) {uint ea = EA_A7_PD_8(); return m68ki_read_8(ea); }
|
||||
|
||||
MUSASHI_INLINE uint OPER_AW_8(void) {uint ea = EA_AW_8(); return m68ki_read_8(ea); }
|
||||
MUSASHI_INLINE uint OPER_AW_16(void) {uint ea = EA_AW_16(); return m68ki_read_16(ea);}
|
||||
MUSASHI_INLINE uint OPER_AW_32(void) {uint ea = EA_AW_32(); return m68ki_read_32(ea);}
|
||||
MUSASHI_INLINE uint OPER_AL_8(void) {uint ea = EA_AL_8(); return m68ki_read_8(ea); }
|
||||
MUSASHI_INLINE uint OPER_AL_16(void) {uint ea = EA_AL_16(); return m68ki_read_16(ea);}
|
||||
MUSASHI_INLINE uint OPER_AL_32(void) {uint ea = EA_AL_32(); return m68ki_read_32(ea);}
|
||||
MUSASHI_INLINE uint OPER_PCDI_8(void) {uint ea = EA_PCDI_8(); return m68ki_read_pcrel_8(ea); }
|
||||
MUSASHI_INLINE uint OPER_PCDI_16(void) {uint ea = EA_PCDI_16(); return m68ki_read_pcrel_16(ea);}
|
||||
MUSASHI_INLINE uint OPER_PCDI_32(void) {uint ea = EA_PCDI_32(); return m68ki_read_pcrel_32(ea);}
|
||||
MUSASHI_INLINE uint OPER_PCIX_8(void) {uint ea = EA_PCIX_8(); return m68ki_read_pcrel_8(ea); }
|
||||
MUSASHI_INLINE uint OPER_PCIX_16(void) {uint ea = EA_PCIX_16(); return m68ki_read_pcrel_16(ea);}
|
||||
MUSASHI_INLINE uint OPER_PCIX_32(void) {uint ea = EA_PCIX_32(); return m68ki_read_pcrel_32(ea);}
|
||||
static inline uint OPER_AW_8(void) {uint ea = EA_AW_8(); return m68ki_read_8(ea); }
|
||||
static inline uint OPER_AW_16(void) {uint ea = EA_AW_16(); return m68ki_read_16(ea);}
|
||||
static inline uint OPER_AW_32(void) {uint ea = EA_AW_32(); return m68ki_read_32(ea);}
|
||||
static inline uint OPER_AL_8(void) {uint ea = EA_AL_8(); return m68ki_read_8(ea); }
|
||||
static inline uint OPER_AL_16(void) {uint ea = EA_AL_16(); return m68ki_read_16(ea);}
|
||||
static inline uint OPER_AL_32(void) {uint ea = EA_AL_32(); return m68ki_read_32(ea);}
|
||||
static inline uint OPER_PCDI_8(void) {uint ea = EA_PCDI_8(); return m68ki_read_pcrel_8(ea); }
|
||||
static inline uint OPER_PCDI_16(void) {uint ea = EA_PCDI_16(); return m68ki_read_pcrel_16(ea);}
|
||||
static inline uint OPER_PCDI_32(void) {uint ea = EA_PCDI_32(); return m68ki_read_pcrel_32(ea);}
|
||||
static inline uint OPER_PCIX_8(void) {uint ea = EA_PCIX_8(); return m68ki_read_pcrel_8(ea); }
|
||||
static inline uint OPER_PCIX_16(void) {uint ea = EA_PCIX_16(); return m68ki_read_pcrel_16(ea);}
|
||||
static inline uint OPER_PCIX_32(void) {uint ea = EA_PCIX_32(); return m68ki_read_pcrel_32(ea);}
|
||||
|
||||
|
||||
|
||||
/* ---------------------------- Stack Functions --------------------------- */
|
||||
|
||||
/* Push/pull data from the stack */
|
||||
MUSASHI_INLINE void m68ki_push_16(uint value)
|
||||
static inline void m68ki_push_16(uint value)
|
||||
{
|
||||
REG_SP = MASK_OUT_ABOVE_32(REG_SP - 2);
|
||||
m68ki_write_16(REG_SP, value);
|
||||
}
|
||||
|
||||
MUSASHI_INLINE void m68ki_push_32(uint value)
|
||||
static inline void m68ki_push_32(uint value)
|
||||
{
|
||||
REG_SP = MASK_OUT_ABOVE_32(REG_SP - 4);
|
||||
m68ki_write_32(REG_SP, value);
|
||||
}
|
||||
|
||||
MUSASHI_INLINE uint m68ki_pull_16(void)
|
||||
static inline uint m68ki_pull_16(void)
|
||||
{
|
||||
REG_SP = MASK_OUT_ABOVE_32(REG_SP + 2);
|
||||
return m68ki_read_16(REG_SP-2);
|
||||
}
|
||||
|
||||
MUSASHI_INLINE uint m68ki_pull_32(void)
|
||||
static inline uint m68ki_pull_32(void)
|
||||
{
|
||||
REG_SP = MASK_OUT_ABOVE_32(REG_SP + 4);
|
||||
return m68ki_read_32(REG_SP-4);
|
||||
@@ -1284,22 +1284,22 @@ MUSASHI_INLINE uint m68ki_pull_32(void)
|
||||
/* Increment/decrement the stack as if doing a push/pull but
|
||||
* don't do any memory access.
|
||||
*/
|
||||
MUSASHI_INLINE void m68ki_fake_push_16(void)
|
||||
static inline void m68ki_fake_push_16(void)
|
||||
{
|
||||
REG_SP = MASK_OUT_ABOVE_32(REG_SP - 2);
|
||||
}
|
||||
|
||||
MUSASHI_INLINE void m68ki_fake_push_32(void)
|
||||
static inline void m68ki_fake_push_32(void)
|
||||
{
|
||||
REG_SP = MASK_OUT_ABOVE_32(REG_SP - 4);
|
||||
}
|
||||
|
||||
MUSASHI_INLINE void m68ki_fake_pull_16(void)
|
||||
static inline void m68ki_fake_pull_16(void)
|
||||
{
|
||||
REG_SP = MASK_OUT_ABOVE_32(REG_SP + 2);
|
||||
}
|
||||
|
||||
MUSASHI_INLINE void m68ki_fake_pull_32(void)
|
||||
static inline void m68ki_fake_pull_32(void)
|
||||
{
|
||||
REG_SP = MASK_OUT_ABOVE_32(REG_SP + 4);
|
||||
}
|
||||
@@ -1311,13 +1311,13 @@ MUSASHI_INLINE void m68ki_fake_pull_32(void)
|
||||
* These functions will also call the pc_changed callback if it was enabled
|
||||
* in m68kconf.h.
|
||||
*/
|
||||
MUSASHI_INLINE void m68ki_jump(uint new_pc)
|
||||
static inline void m68ki_jump(uint new_pc)
|
||||
{
|
||||
REG_PC = new_pc;
|
||||
m68ki_pc_changed(REG_PC);
|
||||
}
|
||||
|
||||
MUSASHI_INLINE void m68ki_jump_vector(uint vector)
|
||||
static inline void m68ki_jump_vector(uint vector)
|
||||
{
|
||||
REG_PC = (vector<<2) + REG_VBR;
|
||||
REG_PC = m68ki_read_data_32(REG_PC);
|
||||
@@ -1330,17 +1330,17 @@ MUSASHI_INLINE void m68ki_jump_vector(uint vector)
|
||||
* So far I've found no problems with not calling pc_changed for 8 or 16
|
||||
* bit branches.
|
||||
*/
|
||||
MUSASHI_INLINE void m68ki_branch_8(uint offset)
|
||||
static inline void m68ki_branch_8(uint offset)
|
||||
{
|
||||
REG_PC += MAKE_INT_8(offset);
|
||||
}
|
||||
|
||||
MUSASHI_INLINE void m68ki_branch_16(uint offset)
|
||||
static inline void m68ki_branch_16(uint offset)
|
||||
{
|
||||
REG_PC += MAKE_INT_16(offset);
|
||||
}
|
||||
|
||||
MUSASHI_INLINE void m68ki_branch_32(uint offset)
|
||||
static inline void m68ki_branch_32(uint offset)
|
||||
{
|
||||
REG_PC += offset;
|
||||
m68ki_pc_changed(REG_PC);
|
||||
@@ -1353,7 +1353,7 @@ MUSASHI_INLINE void m68ki_branch_32(uint offset)
|
||||
/* Set the S flag and change the active stack pointer.
|
||||
* Note that value MUST be 4 or 0.
|
||||
*/
|
||||
MUSASHI_INLINE void m68ki_set_s_flag(uint value)
|
||||
static inline void m68ki_set_s_flag(uint value)
|
||||
{
|
||||
/* Backup the old stack pointer */
|
||||
REG_SP_BASE[FLAG_S | ((FLAG_S>>1) & FLAG_M)] = REG_SP;
|
||||
@@ -1366,7 +1366,7 @@ MUSASHI_INLINE void m68ki_set_s_flag(uint value)
|
||||
/* Set the S and M flags and change the active stack pointer.
|
||||
* Note that value MUST be 0, 2, 4, or 6 (bit2 = S, bit1 = M).
|
||||
*/
|
||||
MUSASHI_INLINE void m68ki_set_sm_flag(uint value)
|
||||
static inline void m68ki_set_sm_flag(uint value)
|
||||
{
|
||||
/* Backup the old stack pointer */
|
||||
REG_SP_BASE[FLAG_S | ((FLAG_S>>1) & FLAG_M)] = REG_SP;
|
||||
@@ -1378,7 +1378,7 @@ MUSASHI_INLINE void m68ki_set_sm_flag(uint value)
|
||||
}
|
||||
|
||||
/* Set the S and M flags. Don't touch the stack pointer. */
|
||||
MUSASHI_INLINE void m68ki_set_sm_flag_nosp(uint value)
|
||||
static inline void m68ki_set_sm_flag_nosp(uint value)
|
||||
{
|
||||
/* Set the S and M flags */
|
||||
FLAG_S = value & SFLAG_SET;
|
||||
@@ -1387,7 +1387,7 @@ MUSASHI_INLINE void m68ki_set_sm_flag_nosp(uint value)
|
||||
|
||||
|
||||
/* Set the condition code register */
|
||||
MUSASHI_INLINE void m68ki_set_ccr(uint value)
|
||||
static inline void m68ki_set_ccr(uint value)
|
||||
{
|
||||
FLAG_X = BIT_4(value) << 4;
|
||||
FLAG_N = BIT_3(value) << 4;
|
||||
@@ -1397,7 +1397,7 @@ MUSASHI_INLINE void m68ki_set_ccr(uint value)
|
||||
}
|
||||
|
||||
/* Set the status register but don't check for interrupts */
|
||||
MUSASHI_INLINE void m68ki_set_sr_noint(uint value)
|
||||
static inline void m68ki_set_sr_noint(uint value)
|
||||
{
|
||||
/* Mask out the "unimplemented" bits */
|
||||
value &= CPU_SR_MASK;
|
||||
@@ -1413,7 +1413,7 @@ MUSASHI_INLINE void m68ki_set_sr_noint(uint value)
|
||||
/* Set the status register but don't check for interrupts nor
|
||||
* change the stack pointer
|
||||
*/
|
||||
MUSASHI_INLINE void m68ki_set_sr_noint_nosp(uint value)
|
||||
static inline void m68ki_set_sr_noint_nosp(uint value)
|
||||
{
|
||||
/* Mask out the "unimplemented" bits */
|
||||
value &= CPU_SR_MASK;
|
||||
@@ -1427,7 +1427,7 @@ MUSASHI_INLINE void m68ki_set_sr_noint_nosp(uint value)
|
||||
}
|
||||
|
||||
/* Set the status register and check for interrupts */
|
||||
MUSASHI_INLINE void m68ki_set_sr(uint value)
|
||||
static inline void m68ki_set_sr(uint value)
|
||||
{
|
||||
m68ki_set_sr_noint(value);
|
||||
m68ki_check_interrupts();
|
||||
@@ -1437,7 +1437,7 @@ MUSASHI_INLINE void m68ki_set_sr(uint value)
|
||||
/* ------------------------- Exception Processing ------------------------- */
|
||||
|
||||
/* Initiate exception processing */
|
||||
MUSASHI_INLINE uint m68ki_init_exception(void)
|
||||
static inline uint m68ki_init_exception(void)
|
||||
{
|
||||
/* Save the old status register */
|
||||
uint sr = m68ki_get_sr();
|
||||
@@ -1452,7 +1452,7 @@ MUSASHI_INLINE uint m68ki_init_exception(void)
|
||||
}
|
||||
|
||||
/* 3 word stack frame (68000 only) */
|
||||
MUSASHI_INLINE void m68ki_stack_frame_3word(uint pc, uint sr)
|
||||
static inline void m68ki_stack_frame_3word(uint pc, uint sr)
|
||||
{
|
||||
m68ki_push_32(pc);
|
||||
m68ki_push_16(sr);
|
||||
@@ -1461,7 +1461,7 @@ MUSASHI_INLINE void m68ki_stack_frame_3word(uint pc, uint sr)
|
||||
/* Format 0 stack frame.
|
||||
* This is the standard stack frame for 68010+.
|
||||
*/
|
||||
MUSASHI_INLINE void m68ki_stack_frame_0000(uint pc, uint sr, uint vector)
|
||||
static inline void m68ki_stack_frame_0000(uint pc, uint sr, uint vector)
|
||||
{
|
||||
/* Stack a 3-word frame if we are 68000 */
|
||||
if(CPU_TYPE == CPU_TYPE_000)
|
||||
@@ -1477,7 +1477,7 @@ MUSASHI_INLINE void m68ki_stack_frame_0000(uint pc, uint sr, uint vector)
|
||||
/* Format 1 stack frame (68020).
|
||||
* For 68020, this is the 4 word throwaway frame.
|
||||
*/
|
||||
MUSASHI_INLINE void m68ki_stack_frame_0001(uint pc, uint sr, uint vector)
|
||||
static inline void m68ki_stack_frame_0001(uint pc, uint sr, uint vector)
|
||||
{
|
||||
m68ki_push_16(0x1000 | (vector<<2));
|
||||
m68ki_push_32(pc);
|
||||
@@ -1487,7 +1487,7 @@ MUSASHI_INLINE void m68ki_stack_frame_0001(uint pc, uint sr, uint vector)
|
||||
/* Format 2 stack frame.
|
||||
* This is used only by 68020 for trap exceptions.
|
||||
*/
|
||||
MUSASHI_INLINE void m68ki_stack_frame_0010(uint sr, uint vector)
|
||||
static inline void m68ki_stack_frame_0010(uint sr, uint vector)
|
||||
{
|
||||
m68ki_push_32(REG_PPC);
|
||||
m68ki_push_16(0x2000 | (vector<<2));
|
||||
@@ -1498,7 +1498,7 @@ MUSASHI_INLINE void m68ki_stack_frame_0010(uint sr, uint vector)
|
||||
|
||||
/* Bus error stack frame (68000 only).
|
||||
*/
|
||||
MUSASHI_INLINE void m68ki_stack_frame_buserr(uint sr)
|
||||
static inline void m68ki_stack_frame_buserr(uint sr)
|
||||
{
|
||||
m68ki_push_32(REG_PC);
|
||||
m68ki_push_16(sr);
|
||||
@@ -1687,7 +1687,7 @@ void m68ki_stack_frame_1011(uint sr, uint vector, uint pc)
|
||||
/* Used for Group 2 exceptions.
|
||||
* These stack a type 2 frame on the 020.
|
||||
*/
|
||||
MUSASHI_INLINE void m68ki_exception_trap(uint vector)
|
||||
static inline void m68ki_exception_trap(uint vector)
|
||||
{
|
||||
uint sr = m68ki_init_exception();
|
||||
|
||||
@@ -1703,7 +1703,7 @@ MUSASHI_INLINE void m68ki_exception_trap(uint vector)
|
||||
}
|
||||
|
||||
/* Trap#n stacks a 0 frame but behaves like group2 otherwise */
|
||||
MUSASHI_INLINE void m68ki_exception_trapN(uint vector)
|
||||
static inline void m68ki_exception_trapN(uint vector)
|
||||
{
|
||||
uint sr = m68ki_init_exception();
|
||||
m68ki_stack_frame_0000(REG_PC, sr, vector);
|
||||
@@ -1714,7 +1714,7 @@ MUSASHI_INLINE void m68ki_exception_trapN(uint vector)
|
||||
}
|
||||
|
||||
/* Exception for trace mode */
|
||||
MUSASHI_INLINE void m68ki_exception_trace(void)
|
||||
static inline void m68ki_exception_trace(void)
|
||||
{
|
||||
uint sr = m68ki_init_exception();
|
||||
|
||||
@@ -1741,7 +1741,7 @@ MUSASHI_INLINE void m68ki_exception_trace(void)
|
||||
}
|
||||
|
||||
/* Exception for privilege violation */
|
||||
MUSASHI_INLINE void m68ki_exception_privilege_violation(void)
|
||||
static inline void m68ki_exception_privilege_violation(void)
|
||||
{
|
||||
uint sr = m68ki_init_exception();
|
||||
|
||||
@@ -1760,11 +1760,11 @@ MUSASHI_INLINE void m68ki_exception_privilege_violation(void)
|
||||
}
|
||||
|
||||
/* Exception for A-Line instructions */
|
||||
MUSASHI_INLINE void m68ki_exception_1010(void)
|
||||
static inline void m68ki_exception_1010(void)
|
||||
{
|
||||
uint sr;
|
||||
#if M68K_LOG_1010_1111 == OPT_ON
|
||||
M68K_DO_LOG_EMU((M68K_LOG_FILEHANDLE "%s at %08x: called 1010 instruction %04x (%s)\n",
|
||||
M68K_DO_LOG_EMU((M68K_LOG_FILEHANDLE "%s at %08X: called 1010 instruction %04X (%s)\n",
|
||||
m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PPC), REG_IR,
|
||||
m68ki_disassemble_quick(ADDRESS_68K(REG_PPC))));
|
||||
#endif
|
||||
@@ -1778,12 +1778,12 @@ MUSASHI_INLINE void m68ki_exception_1010(void)
|
||||
}
|
||||
|
||||
/* Exception for F-Line instructions */
|
||||
MUSASHI_INLINE void m68ki_exception_1111(void)
|
||||
static inline void m68ki_exception_1111(void)
|
||||
{
|
||||
uint sr;
|
||||
|
||||
#if M68K_LOG_1010_1111 == OPT_ON
|
||||
M68K_DO_LOG_EMU((M68K_LOG_FILEHANDLE "%s at %08x: called 1111 instruction %04x (%s)\n",
|
||||
M68K_DO_LOG_EMU((M68K_LOG_FILEHANDLE "%s at %08X: called 1111 instruction %04X (%s)\n",
|
||||
m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PPC), REG_IR,
|
||||
m68ki_disassemble_quick(ADDRESS_68K(REG_PPC))));
|
||||
#endif
|
||||
@@ -1797,11 +1797,11 @@ MUSASHI_INLINE void m68ki_exception_1111(void)
|
||||
}
|
||||
|
||||
/* Exception for illegal instructions */
|
||||
MUSASHI_INLINE void m68ki_exception_illegal(void)
|
||||
static inline void m68ki_exception_illegal(void)
|
||||
{
|
||||
uint sr;
|
||||
|
||||
M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08x: illegal instruction %04x (%s)\n",
|
||||
M68K_DO_LOG((M68K_LOG_FILEHANDLE "%s at %08X: illegal instruction %04X (%s)\n",
|
||||
m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PPC), REG_IR,
|
||||
m68ki_disassemble_quick(ADDRESS_68K(REG_PPC))));
|
||||
|
||||
@@ -1822,7 +1822,7 @@ MUSASHI_INLINE void m68ki_exception_illegal(void)
|
||||
}
|
||||
|
||||
/* Exception for format errror in RTE */
|
||||
MUSASHI_INLINE void m68ki_exception_format_error(void)
|
||||
static inline void m68ki_exception_format_error(void)
|
||||
{
|
||||
uint sr = m68ki_init_exception();
|
||||
m68ki_stack_frame_0000(REG_PC, sr, EXCEPTION_FORMAT_ERROR);
|
||||
@@ -1833,7 +1833,7 @@ MUSASHI_INLINE void m68ki_exception_format_error(void)
|
||||
}
|
||||
|
||||
/* Exception for address error */
|
||||
MUSASHI_INLINE void m68ki_exception_address_error(void)
|
||||
static inline void m68ki_exception_address_error(void)
|
||||
{
|
||||
uint sr = m68ki_init_exception();
|
||||
|
||||
@@ -1895,7 +1895,7 @@ void m68ki_exception_interrupt(uint int_level)
|
||||
vector = EXCEPTION_SPURIOUS_INTERRUPT;
|
||||
else if(vector > 255)
|
||||
{
|
||||
M68K_DO_LOG_EMU((M68K_LOG_FILEHANDLE "%s at %08x: Interrupt acknowledge returned invalid vector $%x\n",
|
||||
M68K_DO_LOG_EMU((M68K_LOG_FILEHANDLE "%s at %08X: Interrupt acknowledge returned invalid vector $%x\n",
|
||||
m68ki_cpu_names[CPU_TYPE], ADDRESS_68K(REG_PC), vector));
|
||||
return;
|
||||
}
|
||||
@@ -1936,7 +1936,7 @@ void m68ki_exception_interrupt(uint int_level)
|
||||
|
||||
|
||||
/* ASG: Check for interrupts */
|
||||
MUSASHI_INLINE void m68ki_check_interrupts(void)
|
||||
static inline void m68ki_check_interrupts(void)
|
||||
{
|
||||
if(CPU_INT_LEVEL > FLAG_INT_MASK)
|
||||
m68ki_exception_interrupt(CPU_INT_LEVEL>>8);
|
||||
1
src/m68k/m68kexternal.h → include/m68k/m68kexternal.h
Executable file → Normal file
1
src/m68k/m68kexternal.h → include/m68k/m68kexternal.h
Executable file → Normal file
@@ -6,6 +6,5 @@
|
||||
int32_t interruptAcknowledge(int32_t intLevel);
|
||||
void emulatorSoftReset(void);
|
||||
void flx68000PcLongJump(uint32_t newPc);
|
||||
void sandboxOnOpcodeRun(void);
|
||||
|
||||
#endif
|
||||
0
src/m68k/m68kops.h → include/m68k/m68kops.h
Executable file → Normal file
0
src/m68k/m68kops.h → include/m68k/m68kops.h
Executable file → Normal file
@@ -1,5 +1,3 @@
|
||||
#ifndef PDI_USB_D12_COMMAND_SPEC_H
|
||||
#define PDI_USB_D12_COMMAND_SPEC_H
|
||||
/*PDIUSBD12 Commands*/
|
||||
|
||||
#define SELECT_ENDPOINT_CTRL_OUT 0x00
|
||||
@@ -19,5 +17,3 @@
|
||||
#define READ_INTERRUPT_REGISTER 0xF4
|
||||
|
||||
#define SET_DMA 0xFB
|
||||
|
||||
#endif
|
||||
@@ -1,8 +1,40 @@
|
||||
#ifndef PORTABILITY_H
|
||||
#define PORTABILITY_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <limits.h>
|
||||
|
||||
//threads
|
||||
#if defined(EMU_MULTITHREADED)
|
||||
#define PRAGMA_STRINGIFY(x) _Pragma(#x)
|
||||
#define MULTITHREAD_LOOP(x) PRAGMA_STRINGIFY(omp parallel for private(x))
|
||||
#define MULTITHREAD_DOUBLE_LOOP(x, y) PRAGMA_STRINGIFY(omp parallel for collapse(2) private(x, y))
|
||||
#else
|
||||
#define MULTITHREAD_LOOP(x)
|
||||
#define MULTITHREAD_DOUBLE_LOOP(x, y)
|
||||
#endif
|
||||
|
||||
//pipeline
|
||||
#if defined(EMU_MANAGE_HOST_CPU_PIPELINE)
|
||||
#define unlikely(x) __builtin_expect(!!(x), false)
|
||||
#define likely(x) __builtin_expect(!!(x), true)
|
||||
#define likely_equal(x, y) __builtin_expect((x), (y))
|
||||
#else
|
||||
#define unlikely(x) x
|
||||
#define likely(x) x
|
||||
#define likely_equal(x, y) x
|
||||
#endif
|
||||
|
||||
// PS2 is lacking intmax_t and uintmax_t!
|
||||
#if !defined(UINTMAX_MAX)
|
||||
typedef intmax_t signed long long int;
|
||||
typedef uintmax_t unsigned long long int;
|
||||
|
||||
#define INTMAX_MAX LONG_LONG_MAX
|
||||
#define UINTMAX_MAX ULONG_LONG_MAX
|
||||
#endif
|
||||
|
||||
//endian
|
||||
#define SWAP_16(x) ((uint16_t)((((uint16_t)(x) & 0x00FF) << 8) | (((uint16_t)(x) & 0xFF00) >> 8)))
|
||||
@@ -14,7 +46,7 @@ static inline void swap16(uint8_t* buffer, uint32_t count){
|
||||
|
||||
//count specifys the number of uint16_t's that need to be swapped, the uint8_t* is because of alignment restrictions that crash on some platforms
|
||||
count *= sizeof(uint16_t);
|
||||
for(index = 0; index < count; index += 2){
|
||||
MULTITHREAD_LOOP(index) for(index = 0; index < count; index += 2){
|
||||
uint8_t temp = buffer[index];
|
||||
buffer[index] = buffer[index + 1];
|
||||
buffer[index + 1] = temp;
|
||||
@@ -60,66 +92,10 @@ static inline uintmax_t rightShiftUse1s(uintmax_t value, uint8_t count){
|
||||
return fillTopWith1s(value >> count, count);
|
||||
}
|
||||
|
||||
//threads
|
||||
#if defined(EMU_MULTITHREADED)
|
||||
#define PRAGMA_STRINGIFY(x) _Pragma(#x)
|
||||
#define MULTITHREAD_LOOP(x) PRAGMA_STRINGIFY(omp parallel for private(x))
|
||||
#define MULTITHREAD_DOUBLE_LOOP(x, y) PRAGMA_STRINGIFY(omp parallel for collapse(2) private(x, y))
|
||||
#else
|
||||
#define MULTITHREAD_LOOP(x)
|
||||
#define MULTITHREAD_DOUBLE_LOOP(x, y)
|
||||
#endif
|
||||
|
||||
//pipeline
|
||||
#if defined(EMU_MANAGE_HOST_CPU_PIPELINE)
|
||||
#define unlikely(x) __builtin_expect(!!(x), false)
|
||||
#define likely(x) __builtin_expect(!!(x), true)
|
||||
#define likely_equal(x, y) __builtin_expect((x), (y))
|
||||
#else
|
||||
#define unlikely(x) x
|
||||
#define likely(x) x
|
||||
#define likely_equal(x, y) x
|
||||
#endif
|
||||
|
||||
//range capping
|
||||
static inline uintmax_t uintMin(uintmax_t x, uintmax_t y){
|
||||
return x < y ? x : y;
|
||||
}
|
||||
|
||||
static inline uintmax_t uintMax(uintmax_t x, uintmax_t y){
|
||||
return x > y ? x : y;
|
||||
}
|
||||
|
||||
static inline uintmax_t uintClamp(uintmax_t low, uintmax_t value, uintmax_t high){
|
||||
//low must always be less than high!
|
||||
return uintMax(low, uintMin(value, high));
|
||||
}
|
||||
|
||||
static inline intmax_t intMin(intmax_t x, intmax_t y){
|
||||
return x < y ? x : y;
|
||||
}
|
||||
|
||||
static inline intmax_t intMax(intmax_t x, intmax_t y){
|
||||
return x > y ? x : y;
|
||||
}
|
||||
|
||||
static inline intmax_t intClamp(intmax_t low, intmax_t value, intmax_t high){
|
||||
//low must always be less than high!
|
||||
return intMax(low, intMin(value, high));
|
||||
}
|
||||
|
||||
static inline double floatMin(double x, double y){
|
||||
return x < y ? x : y;
|
||||
}
|
||||
|
||||
static inline double floatMax(double x, double y){
|
||||
return x > y ? x : y;
|
||||
}
|
||||
|
||||
static inline double floatClamp(double low, double value, double high){
|
||||
//low must always be less than high!
|
||||
return floatMax(low, floatMin(value, high));
|
||||
}
|
||||
#define FAST_MIN(x, y) ((x) < (y) ? (x) : (y))
|
||||
#define FAST_MAX(x, y) ((x) > (y) ? (x) : (y))
|
||||
#define FAST_ABS(x) ((x) < 0 ? -(x) : (x))
|
||||
|
||||
//float platform safety
|
||||
static inline uint64_t getUint64FromDouble(double data){
|
||||
44
include/pxa260/pxa260.h
Normal file
44
include/pxa260/pxa260.h
Normal file
@@ -0,0 +1,44 @@
|
||||
#ifndef PXA260_H
|
||||
#define PXA260_H
|
||||
|
||||
//this is the main module for the PXA260, with all the files it may be kind of confusing
|
||||
//this is the only file from this directory that the emu should interface with
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "pxa260_IC.h"
|
||||
#include "pxa260_PwrClk.h"
|
||||
#include "pxa260_GPIO.h"
|
||||
#include "pxa260_TIMR.h"
|
||||
#if !defined(EMU_NO_SAFETY)
|
||||
#include "../armv5te/uArm/CPU_2.h"
|
||||
#endif
|
||||
|
||||
#if !defined(EMU_NO_SAFETY)
|
||||
extern ArmCpu pxa260CpuState;
|
||||
#endif
|
||||
|
||||
extern uint16_t* pxa260Framebuffer;
|
||||
extern Pxa260pwrClk pxa260PwrClk;
|
||||
extern Pxa260ic pxa260Ic;
|
||||
extern Pxa260gpio pxa260Gpio;
|
||||
extern Pxa260timr pxa260Timer;
|
||||
|
||||
bool pxa260Init(uint8_t** returnRom, uint8_t** returnRam);
|
||||
void pxa260Deinit(void);
|
||||
void pxa260Reset(void);
|
||||
void pxa260SetRtc(uint16_t days, uint8_t hours, uint8_t minutes, uint8_t seconds);
|
||||
uint32_t pxa260StateSize(void);
|
||||
void pxa260SaveState(uint8_t* data);
|
||||
void pxa260LoadState(uint8_t* data);
|
||||
|
||||
void pxa260Execute(bool wantVideo);//runs the CPU for 1 frame
|
||||
|
||||
uint32_t pxa260GetRegister(uint8_t reg);//only for debugging
|
||||
#define pxa260GetPc() pxa260GetRegister(15)//only for debugging
|
||||
uint32_t pxa260GetCpsr(void);//only for debugging
|
||||
uint32_t pxa260GetSpsr(void);//only for debugging
|
||||
uint64_t pxa260ReadArbitraryMemory(uint32_t address, uint8_t size);//only for debugging, uses physical address not MMU mapped
|
||||
|
||||
#endif
|
||||
185
include/pxa260/pxa260Accessors.c.h
Normal file
185
include/pxa260/pxa260Accessors.c.h
Normal file
@@ -0,0 +1,185 @@
|
||||
#include "../w86l488.h"
|
||||
|
||||
static uint8_t pxa260_io_read_byte(uint32_t addr){
|
||||
debugLog("Invalid 8 bit PXA260 register read:0x%08X, PC:0x%08X\n", addr, pxa260GetPc());
|
||||
return 0x00;
|
||||
}
|
||||
|
||||
static uint16_t pxa260_io_read_half(uint32_t addr){
|
||||
debugLog("Invalid 16 bit PXA260 register read:0x%08X, PC:0x%08X\n", addr, pxa260GetPc());
|
||||
return 0x0000;
|
||||
}
|
||||
|
||||
static uint32_t pxa260_io_read_word(uint32_t addr){
|
||||
uint32_t out;
|
||||
|
||||
switch(addr >> 16){
|
||||
case PXA260_CLOCK_MANAGER_BASE >> 16:
|
||||
pxa260pwrClkPrvClockMgrMemAccessF(&pxa260PwrClk, addr, 4, false, &out);
|
||||
break;
|
||||
case PXA260_POWER_MANAGER_BASE >> 16:
|
||||
pxa260pwrClkPrvPowerMgrMemAccessF(&pxa260PwrClk, addr, 4, false, &out);
|
||||
break;
|
||||
case PXA260_TIMR_BASE >> 16:
|
||||
pxa260timrPrvMemAccessF(&pxa260Timer, addr, 4, false, &out);
|
||||
break;
|
||||
case PXA260_GPIO_BASE >> 16:
|
||||
pxa260gpioPrvMemAccessF(&pxa260Gpio, addr, 4, false, &out);
|
||||
break;
|
||||
case PXA260_I2C_BASE >> 16:
|
||||
out = pxa260I2cReadWord(addr);
|
||||
break;
|
||||
case PXA260_SSP_BASE >> 16:
|
||||
out = pxa260SspReadWord(addr);
|
||||
break;
|
||||
case PXA260_UDC_BASE >> 16:
|
||||
out = pxa260UdcReadWord(addr);
|
||||
break;
|
||||
case PXA260_IC_BASE >> 16:
|
||||
pxa260icPrvMemAccessF(&pxa260Ic, addr, 4, false, &out);
|
||||
break;
|
||||
|
||||
case PXA260_DMA_BASE >> 16:
|
||||
case PXA260_RTC_BASE >> 16:
|
||||
case PXA260_FFUART_BASE >> 16:
|
||||
case PXA260_BTUART_BASE >> 16:
|
||||
case PXA260_STUART_BASE >> 16:
|
||||
//need to implement these
|
||||
debugLog("Unimplemented 32 bit PXA260 register read:0x%08X, PC:0x%08X\n", addr, pxa260GetPc());
|
||||
out = 0x00000000;
|
||||
break;
|
||||
|
||||
default:
|
||||
debugLog("Invalid 32 bit PXA260 register read:0x%08X, PC:0x%08X\n", addr, pxa260GetPc());
|
||||
out = 0x00000000;
|
||||
break;
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
static void pxa260_io_write_byte(uint32_t addr, uint8_t value){
|
||||
debugLog("Invalid 8 bit PXA260 register write:0x%08X, value:0x%02X, PC:0x%08X\n", addr, value, pxa260GetPc());
|
||||
}
|
||||
|
||||
static void pxa260_io_write_half(uint32_t addr, uint16_t value){
|
||||
debugLog("Invalid 16 bit PXA260 register write:0x%08X, value:0x%04X, PC:0x%08X\n", addr, value, pxa260GetPc());
|
||||
}
|
||||
|
||||
static void pxa260_io_write_word(uint32_t addr, uint32_t value){
|
||||
switch(addr >> 16){
|
||||
case PXA260_CLOCK_MANAGER_BASE >> 16:
|
||||
pxa260pwrClkPrvClockMgrMemAccessF(&pxa260PwrClk, addr, 4, true, &value);
|
||||
break;
|
||||
case PXA260_POWER_MANAGER_BASE >> 16:
|
||||
pxa260pwrClkPrvPowerMgrMemAccessF(&pxa260PwrClk, addr, 4, true, &value);
|
||||
break;
|
||||
case PXA260_TIMR_BASE >> 16:
|
||||
pxa260timrPrvMemAccessF(&pxa260Timer, addr, 4, true, &value);
|
||||
break;
|
||||
case PXA260_GPIO_BASE >> 16:
|
||||
pxa260gpioPrvMemAccessF(&pxa260Gpio, addr, 4, true, &value);
|
||||
break;
|
||||
case PXA260_I2C_BASE >> 16:
|
||||
pxa260I2cWriteWord(addr, value);
|
||||
break;
|
||||
case PXA260_SSP_BASE >> 16:
|
||||
pxa260SspWriteWord(addr, value);
|
||||
break;
|
||||
case PXA260_UDC_BASE >> 16:
|
||||
pxa260UdcWriteWord(addr, value);
|
||||
break;
|
||||
case PXA260_IC_BASE >> 16:
|
||||
pxa260icPrvMemAccessF(&pxa260Ic, addr, 4, true, &value);
|
||||
break;
|
||||
|
||||
case PXA260_DMA_BASE >> 16:
|
||||
case PXA260_RTC_BASE >> 16:
|
||||
case PXA260_FFUART_BASE >> 16:
|
||||
case PXA260_BTUART_BASE >> 16:
|
||||
case PXA260_STUART_BASE >> 16:
|
||||
//need to implement these
|
||||
debugLog("Unimplemented 32 bit PXA260 register write:0x%08X, value:0x%08X, PC:0x%08X\n", addr, value, pxa260GetPc());
|
||||
break;
|
||||
|
||||
default:
|
||||
debugLog("Invalid 32 bit PXA260 register write:0x%08X, value:0x%08X, PC:0x%08X\n", addr, value, pxa260GetPc());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static uint32_t pxa260_lcd_read_word(uint32_t addr){
|
||||
uint32_t out;
|
||||
|
||||
pxa260lcdPrvMemAccessF(&pxa260Lcd, addr, 4, false, &out);
|
||||
debugLog("32 bit PXA260 LCD register read:0x%08X\n", addr);
|
||||
return out;
|
||||
}
|
||||
|
||||
static void pxa260_lcd_write_word(uint32_t addr, uint32_t value){
|
||||
pxa260lcdPrvMemAccessF(&pxa260Lcd, addr, 4, true, &value);
|
||||
debugLog("32 bit PXA260 LCD register write:0x%08X, value:0x%08X\n", addr, value);
|
||||
}
|
||||
|
||||
static uint8_t pxa260_pcmcia0_read_byte(uint32_t addr){
|
||||
debugLog("PCMCIA0 8 bit read:0x%08X, PC:0x%08X\n", addr, pxa260GetPc());
|
||||
return 0x00;
|
||||
}
|
||||
|
||||
static uint16_t pxa260_pcmcia0_read_half(uint32_t addr){
|
||||
debugLog("PCMCIA0 16 bit read:0x%08X, PC:0x%08X\n", addr, pxa260GetPc());
|
||||
return 0x0000;
|
||||
}
|
||||
|
||||
static uint32_t pxa260_pcmcia0_read_word(uint32_t addr){
|
||||
debugLog("PCMCIA0 32 bit read:0x%08X, PC:0x%08X\n", addr, pxa260GetPc());
|
||||
return 0x00000000;
|
||||
}
|
||||
|
||||
static void pxa260_pcmcia0_write_byte(uint32_t addr, uint8_t value){
|
||||
debugLog("PCMCIA0 8 bit write:0x%08X, value:0x%02X, PC:0x%08X\n", addr, value, pxa260GetPc());
|
||||
}
|
||||
|
||||
static void pxa260_pcmcia0_write_half(uint32_t addr, uint16_t value){
|
||||
debugLog("PCMCIA0 16 bit write:0x%08X, value:0x%04X, PC:0x%08X\n", addr, value, pxa260GetPc());
|
||||
}
|
||||
|
||||
static void pxa260_pcmcia0_write_word(uint32_t addr, uint32_t value){
|
||||
debugLog("PCMCIA0 32 bit write:0x%08X, value:0x%08X, PC:0x%08X\n", addr, value, pxa260GetPc());
|
||||
}
|
||||
|
||||
static uint8_t pxa260_pcmcia1_read_byte(uint32_t addr){
|
||||
debugLog("PCMCIA1 8 bit read:0x%08X, PC:0x%08X\n", addr, pxa260GetPc());
|
||||
return 0x00;
|
||||
}
|
||||
|
||||
static uint16_t pxa260_pcmcia1_read_half(uint32_t addr){
|
||||
debugLog("PCMCIA1 16 bit read:0x%08X, PC:0x%08X\n", addr, pxa260GetPc());
|
||||
return 0x0000;
|
||||
}
|
||||
|
||||
static uint32_t pxa260_pcmcia1_read_word(uint32_t addr){
|
||||
debugLog("PCMCIA1 32 bit read:0x%08X, PC:0x%08X\n", addr, pxa260GetPc());
|
||||
return 0x00000000;
|
||||
}
|
||||
|
||||
static void pxa260_pcmcia1_write_byte(uint32_t addr, uint8_t value){
|
||||
debugLog("PCMCIA1 8 bit write:0x%08X, value:0x%02X, PC:0x%08X\n", addr, value, pxa260GetPc());
|
||||
}
|
||||
|
||||
static void pxa260_pcmcia1_write_half(uint32_t addr, uint16_t value){
|
||||
debugLog("PCMCIA1 16 bit write:0x%08X, value:0x%04X, PC:0x%08X\n", addr, value, pxa260GetPc());
|
||||
}
|
||||
|
||||
static void pxa260_pcmcia1_write_word(uint32_t addr, uint32_t value){
|
||||
debugLog("PCMCIA1 32 bit write:0x%08X, value:0x%08X, PC:0x%08X\n", addr, value, pxa260GetPc());
|
||||
}
|
||||
|
||||
static uint16_t pxa260_static_chip_select_2_read_half(uint32_t addr){
|
||||
return w86l488Read16(addr & 0x0E);
|
||||
}
|
||||
|
||||
static void pxa260_static_chip_select_2_write_half(uint32_t addr, uint16_t value){
|
||||
w86l488Write16(addr & 0x0E, value);
|
||||
}
|
||||
|
||||
39
include/pxa260/pxa260I2c.h
Normal file
39
include/pxa260/pxa260I2c.h
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef PXA260_I2C_H
|
||||
#define PXA260_I2C_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define PXA260_I2C_BASE 0x40300000
|
||||
#define PXA260_I2C_SIZE 0x00010000
|
||||
|
||||
enum{
|
||||
I2C_0 = 0x00,
|
||||
I2C_1,
|
||||
I2C_START,
|
||||
I2C_STOP,
|
||||
I2C_FLOATING_BUS = 0x07
|
||||
};
|
||||
|
||||
enum{
|
||||
I2C_WAIT_FOR_ADDR = 0,
|
||||
I2C_NOT_SELECTED,
|
||||
I2C_RECEIVING,
|
||||
I2C_SENDING
|
||||
};
|
||||
|
||||
extern uint8_t pxa260I2cBus;
|
||||
extern uint8_t pxa260I2cBuffer;
|
||||
extern uint16_t pxa260I2cIcr;
|
||||
extern uint16_t pxa260I2cIsr;
|
||||
extern uint8_t pxa260I2cIsar;
|
||||
|
||||
void pxa260I2cReset(void);
|
||||
|
||||
uint32_t pxa260I2cReadWord(uint32_t address);
|
||||
void pxa260I2cWriteWord(uint32_t address, uint32_t value);
|
||||
|
||||
void pxa260I2cTransmitEmpty(void);
|
||||
void pxa260I2cReceiveFull(void);
|
||||
|
||||
#endif
|
||||
16
include/pxa260/pxa260Memctrl.h
Normal file
16
include/pxa260/pxa260Memctrl.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef PXA260_MEMCTRL_H
|
||||
#define PXA260_MEMCTRL_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define PXA260_MEMCTRL_BASE 0x48000000
|
||||
#define PXA260_MEMCTRL_SIZE 0x00010000
|
||||
|
||||
extern uint32_t pxa260MemctrlRegisters[];
|
||||
|
||||
void pxa260MemctrlReset(void);
|
||||
|
||||
uint32_t pxa260MemctrlReadWord(uint32_t address);
|
||||
void pxa260MemctrlWriteWord(uint32_t address, uint32_t value);
|
||||
|
||||
#endif
|
||||
28
include/pxa260/pxa260Ssp.h
Normal file
28
include/pxa260/pxa260Ssp.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef PXA260_SSP_H
|
||||
#define PXA260_SSP_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#define PXA260_SSP_BASE 0x41000000
|
||||
#define PXA260_SSP_SIZE 0x00010000
|
||||
|
||||
extern uint32_t pxa260SspSscr0;
|
||||
extern uint32_t pxa260SspSscr1;
|
||||
extern uint16_t pxa260SspRxFifo[];
|
||||
extern uint16_t pxa260SspTxFifo[];
|
||||
extern uint8_t pxa260SspRxReadPosition;
|
||||
extern uint8_t pxa260SspRxWritePosition;
|
||||
extern bool pxa260SspRxOverflowed;
|
||||
extern uint8_t pxa260SspTxReadPosition;
|
||||
extern uint8_t pxa260SspTxWritePosition;
|
||||
extern bool pxa260SspTransfering;
|
||||
|
||||
void pxa260SspReset(void);
|
||||
|
||||
uint32_t pxa260SspReadWord(uint32_t address);
|
||||
void pxa260SspWriteWord(uint32_t address, uint32_t value);
|
||||
|
||||
void pxa260SspTransferComplete(void);
|
||||
|
||||
#endif
|
||||
28
include/pxa260/pxa260Timing.h
Normal file
28
include/pxa260/pxa260Timing.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef PXA260_TIMING_H
|
||||
#define PXA260_TIMING_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
enum{
|
||||
PXA260_TIMING_CALLBACK_TICK_CPU_TIMER = 0,
|
||||
PXA260_TIMING_CALLBACK_I2C_TRANSMIT_EMPTY,
|
||||
PXA260_TIMING_CALLBACK_I2C_RECEIVE_FULL,
|
||||
PXA260_TIMING_CALLBACK_SSP_TRANSFER_COMPLETE,
|
||||
PXA260_TIMING_CALLBACK_UDC_DEVICE_RESUME_COMPLETE,
|
||||
PXA260_TIMING_CALLBACK_TSC2101_SCAN,
|
||||
PXA260_TIMING_TOTAL_CALLBACKS
|
||||
};
|
||||
|
||||
extern void (*pxa260TimingCallbacks[])(void);//saving a function pointer in a state is not portable and will crash even on the same system between program loads with ASLR
|
||||
extern int32_t pxa260TimingQueuedEvents[];
|
||||
|
||||
void pxa260TimingInit(void);
|
||||
void pxa260TimingReset(void);
|
||||
|
||||
void pxa260TimingTriggerEvent(uint8_t callbackId, int32_t wait);
|
||||
void pxa260TimingCancelEvent(uint8_t callbackId);
|
||||
void pxa260TimingRun(int32_t cycles);//this runs the CPU
|
||||
|
||||
void pxa260TimingTickCpuTimer(void);
|
||||
|
||||
#endif
|
||||
19
include/pxa260/pxa260Udc.h
Normal file
19
include/pxa260/pxa260Udc.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef PXA260_UDC_H
|
||||
#define PXA260_UDC_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define PXA260_UDC_BASE 0x40600000
|
||||
#define PXA260_UDC_SIZE 0x00010000
|
||||
|
||||
extern uint8_t pxa260UdcUdccr;
|
||||
extern uint8_t pxa260UdcUicr0;
|
||||
|
||||
void pxa260UdcReset(void);
|
||||
|
||||
uint32_t pxa260UdcReadWord(uint32_t address);
|
||||
void pxa260UdcWriteWord(uint32_t address, uint32_t value);
|
||||
|
||||
void pxa260UdcDeviceResumeComplete(void);
|
||||
|
||||
#endif
|
||||
19
include/pxa260/pxa260_CPU.h
Normal file
19
include/pxa260/pxa260_CPU.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef PXA260_CPU_H
|
||||
#define PXA260_CPU_H
|
||||
|
||||
#include "pxa260_types.h"
|
||||
|
||||
#if defined(EMU_NO_SAFETY)
|
||||
#include "../armv5te/emu.h"
|
||||
#include "../armv5te/cpu.h"
|
||||
|
||||
#define cpuGetRegExternal(x, regNum) reg_pc(regNum)
|
||||
#define cpuSetReg(x, regNum, value) set_reg(regNum, value)
|
||||
|
||||
#define cpuIrq(x, fiq, raise) (raise ? (cpu_events |= (fiq ? EVENT_FIQ : EVENT_IRQ)) : (cpu_events &= (fiq ? ~EVENT_FIQ : ~EVENT_IRQ)))
|
||||
#else
|
||||
#include "../armv5te/uArm/CPU_2.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
38
include/pxa260/pxa260_DMA.h
Normal file
38
include/pxa260/pxa260_DMA.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef PXA260_DMA_H
|
||||
#define PXA260_DMA_H
|
||||
|
||||
#include "pxa260_CPU.h"
|
||||
#include "pxa260_IC.h"
|
||||
|
||||
/*
|
||||
PXA260 OS DMA controller
|
||||
|
||||
*/
|
||||
|
||||
#define PXA260_DMA_BASE 0x40000000UL
|
||||
#define PXA260_DMA_SIZE 0x00001000UL
|
||||
|
||||
typedef struct{
|
||||
|
||||
UInt32 DAR; //descriptor address register
|
||||
UInt32 SAR; //source address register
|
||||
UInt32 TAR; //target address register
|
||||
UInt32 CR; //command register
|
||||
UInt32 CSR; //control and status register
|
||||
|
||||
}Pxa260dmaChannel;
|
||||
|
||||
typedef struct{
|
||||
|
||||
Pxa260ic* ic;
|
||||
|
||||
UInt16 DINT;
|
||||
Pxa260dmaChannel channels[16];
|
||||
UInt8 CMR[40]; //channel map registers [ we store lower 8 bits only :-) ]
|
||||
|
||||
}Pxa260dma;
|
||||
|
||||
void pxa260dmaInit(Pxa260dma* gpio, Pxa260ic* ic);
|
||||
|
||||
#endif
|
||||
|
||||
13
include/pxa260/pxa260_DSP.h
Normal file
13
include/pxa260/pxa260_DSP.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef PXA260_DSP_H
|
||||
#define PXA260_DSP_H
|
||||
|
||||
#include "pxa260_types.h"
|
||||
|
||||
typedef struct{
|
||||
UInt64 acc0;
|
||||
}Pxa260dsp;
|
||||
|
||||
Boolean pxa260dspAccess(void* userData, Boolean MRRC, UInt8 op, UInt8 RdLo, UInt8 RdHi, UInt8 acc);
|
||||
void pxa260dspInit(Pxa260dsp* dsp);
|
||||
|
||||
#endif
|
||||
48
include/pxa260/pxa260_GPIO.h
Normal file
48
include/pxa260/pxa260_GPIO.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#ifndef PXA260_GPIO_H
|
||||
#define PXA260_GPIO_H
|
||||
|
||||
#include "pxa260_CPU.h"
|
||||
#include "pxa260_IC.h"
|
||||
|
||||
/*
|
||||
PXA260 OS GPIO controller
|
||||
|
||||
*/
|
||||
|
||||
#define PXA260_GPIO_BASE 0x40E00000UL
|
||||
#define PXA260_GPIO_SIZE 0x00001000UL
|
||||
|
||||
|
||||
typedef struct{
|
||||
|
||||
Pxa260ic* ic;
|
||||
|
||||
UInt32 latches[3]; //what pxa wants to be outputting
|
||||
UInt32 inputs[3]; //what pxa is receiving [only set by the pxa260gpioSetState() API]
|
||||
UInt32 levels[3]; //what pxa sees (it differs from above for IN pins)
|
||||
UInt32 dirs[3]; //1 = output
|
||||
UInt32 riseDet[3]; //1 = rise detect
|
||||
UInt32 fallDet[3]; //1 = fall detect
|
||||
UInt32 detStatus[3]; //1 = detect happened
|
||||
UInt32 AFRs[6]; //1, 2, 3 = alt funcs
|
||||
|
||||
}Pxa260gpio;
|
||||
|
||||
#define PXA260_GPIO_LOW 0 //these values make it look like all HiZ, AFR, and nonexistent pins have pullups to those who dumbly assume gpioGEt returns a boolean
|
||||
#define PXA260_GPIO_HIGH 1
|
||||
#define PXA260_GPIO_HiZ 2
|
||||
#define PXA260_GPIO_AFR1 3
|
||||
#define PXA260_GPIO_AFR2 4
|
||||
#define PXA260_GPIO_AFR3 5
|
||||
#define PXA260_GPIO_NOT_PRESENT 6
|
||||
|
||||
Boolean pxa260gpioPrvMemAccessF(void* userData, UInt32 pa, UInt8 size, Boolean write, void* buf);
|
||||
void pxa260gpioInit(Pxa260gpio* gpio, Pxa260ic* ic);
|
||||
|
||||
//for external use :)
|
||||
UInt8 pxa260gpioGetState(Pxa260gpio* gpio, UInt8 gpioNum);
|
||||
void pxa260gpioSetState(Pxa260gpio* gpio, UInt8 gpioNum, Boolean on); //we can only set value (and only of input pins), not direction
|
||||
void pxa260gpioUpdateKeyMatrix(Pxa260gpio* gpio);
|
||||
|
||||
#endif
|
||||
|
||||
61
include/pxa260/pxa260_IC.h
Normal file
61
include/pxa260/pxa260_IC.h
Normal file
@@ -0,0 +1,61 @@
|
||||
#ifndef PXA260_IC_H
|
||||
#define PXA260_IC_H
|
||||
|
||||
#include "pxa260_CPU.h"
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
PXA260 interrupt controller
|
||||
|
||||
PURRPOSE: raises IRQ, FIQ as needed
|
||||
|
||||
*/
|
||||
|
||||
#define PXA260_IC_BASE 0x40D00000UL
|
||||
#define PXA260_IC_SIZE 0x00010000UL
|
||||
|
||||
|
||||
#define PXA260_I_RTC_ALM 31
|
||||
#define PXA260_I_RTC_HZ 30
|
||||
#define PXA260_I_TIMR3 29
|
||||
#define PXA260_I_TIMR2 28
|
||||
#define PXA260_I_TIMR1 27
|
||||
#define PXA260_I_TIMR0 26
|
||||
#define PXA260_I_DMA 25
|
||||
#define PXA260_I_SSP 24
|
||||
#define PXA260_I_MMC 23
|
||||
#define PXA260_I_FFUART 22
|
||||
#define PXA260_I_BTUART 21
|
||||
#define PXA260_I_STUART 20
|
||||
#define PXA260_I_ICP 19
|
||||
#define PXA260_I_I2C 18
|
||||
#define PXA260_I_LCD 17
|
||||
#define PXA260_I_NET_SSP 16
|
||||
#define PXA260_I_AC97 14
|
||||
#define PXA260_I_I2S 13
|
||||
#define PXA260_I_PMU 12
|
||||
#define PXA260_I_USB 11
|
||||
#define PXA260_I_GPIO_all 10
|
||||
#define PXA260_I_GPIO_1 9
|
||||
#define PXA260_I_GPIO_0 8
|
||||
#define PXA260_I_HWUART 7
|
||||
|
||||
|
||||
typedef struct{
|
||||
|
||||
UInt32 ICMR; //Mask Register
|
||||
UInt32 ICLR; //Level Register
|
||||
UInt32 ICCR; //Control Register
|
||||
UInt32 ICPR; //Pending register
|
||||
|
||||
Boolean wasIrq, wasFiq;
|
||||
|
||||
}Pxa260ic;
|
||||
|
||||
Boolean pxa260icPrvMemAccessF(void* userData, UInt32 pa, UInt8 size, Boolean write, void* buf);
|
||||
void pxa260icInit(Pxa260ic* ic);
|
||||
void pxa260icInt(Pxa260ic* ic, UInt8 intNum, Boolean raise); //interrupt caused by emulated hardware/ interrupt handled by guest
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
#ifndef _PXA255_LCD_H_
|
||||
#define _PXA255_LCD_H_
|
||||
#ifndef PXA260_LCD_H
|
||||
#define PXA260_LCD_H
|
||||
|
||||
#include "pxa255_mem.h"
|
||||
#include "pxa255_CPU.h"
|
||||
#include "pxa255_IC.h"
|
||||
#include "pxa260_CPU.h"
|
||||
#include "pxa260_IC.h"
|
||||
|
||||
uint16_t* pxa255Framebuffer;
|
||||
extern uint16_t* pxa260Framebuffer;
|
||||
|
||||
/*
|
||||
PXA255 OS LCD controller
|
||||
PXA260 OS LCD controller
|
||||
|
||||
PURRPOSE: it's nice to have a framebuffer
|
||||
|
||||
*/
|
||||
|
||||
#define PXA255_LCD_BASE 0x44000000UL
|
||||
#define PXA255_LCD_SIZE 0x00001000UL
|
||||
#define PXA260_LCD_BASE 0x44000000UL
|
||||
#define PXA260_LCD_SIZE 0x00001000UL
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +25,7 @@ uint16_t* pxa255Framebuffer;
|
||||
|
||||
typedef struct{
|
||||
|
||||
Pxa255ic* ic;
|
||||
Pxa260ic* ic;
|
||||
|
||||
//registers
|
||||
UInt32 lccr0, lccr1, lccr2, lccr3, fbr0, fbr1, liicr, trgbr, tcr;
|
||||
@@ -45,11 +44,11 @@ typedef struct{
|
||||
|
||||
UInt32 frameNum;
|
||||
|
||||
}Pxa255lcd;
|
||||
}Pxa260lcd;
|
||||
|
||||
Boolean pxa255lcdPrvMemAccessF(void* userData, UInt32 pa, UInt8 size, Boolean write, void* buf);
|
||||
void pxa255lcdInit(Pxa255lcd* lcd, Pxa255ic* ic);
|
||||
void pxa255lcdFrame(Pxa255lcd* lcd);
|
||||
Boolean pxa260lcdPrvMemAccessF(void* userData, UInt32 pa, UInt8 size, Boolean write, void* buf);
|
||||
void pxa260lcdInit(Pxa260lcd* lcd, Pxa260ic* ic);
|
||||
void pxa260lcdFrame(Pxa260lcd* lcd);
|
||||
|
||||
#endif
|
||||
|
||||
24
include/pxa260/pxa260_PwrClk.h
Normal file
24
include/pxa260/pxa260_PwrClk.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef PXA260_PWR_CLK_H
|
||||
#define PXA260_PWR_CLK_H
|
||||
|
||||
#include "pxa260_CPU.h"
|
||||
|
||||
typedef struct{
|
||||
UInt32 CCCR, CKEN, OSCR; //clocks manager regs
|
||||
UInt32 pwrRegs[13]; //we care so little about these, we don't even name them
|
||||
Boolean turbo;
|
||||
}Pxa260pwrClk;
|
||||
|
||||
|
||||
#define PXA260_CLOCK_MANAGER_BASE 0x41300000UL
|
||||
#define PXA260_CLOCK_MANAGER_SIZE 0x00001000UL
|
||||
|
||||
#define PXA260_POWER_MANAGER_BASE 0x40F00000UL
|
||||
#define PXA260_POWER_MANAGER_SIZE 0x00001000UL
|
||||
|
||||
Boolean pxa260pwrClkPrvCoprocRegXferFunc(void* userData, Boolean two, Boolean read, UInt8 op1, UInt8 Rx, UInt8 CRn, UInt8 CRm, UInt8 op2);
|
||||
Boolean pxa260pwrClkPrvClockMgrMemAccessF(void* userData, UInt32 pa, UInt8 size, Boolean write, void* buf);
|
||||
Boolean pxa260pwrClkPrvPowerMgrMemAccessF(void* userData, UInt32 pa, UInt8 size, Boolean write, void* buf);
|
||||
void pxa260pwrClkInit(Pxa260pwrClk* pc);
|
||||
|
||||
#endif
|
||||
36
include/pxa260/pxa260_RTC.h
Normal file
36
include/pxa260/pxa260_RTC.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef PXA260_RTC_H
|
||||
#define PXA260_RTC_H
|
||||
|
||||
#include "pxa260_CPU.h"
|
||||
#include "pxa260_IC.h"
|
||||
|
||||
|
||||
/*
|
||||
PXA260 OS RTC controller
|
||||
|
||||
PURRPOSE: it's nice to know what time it is
|
||||
|
||||
*/
|
||||
|
||||
#define PXA260_RTC_BASE 0x40900000UL
|
||||
#define PXA260_RTC_SIZE 0x00001000UL
|
||||
|
||||
|
||||
typedef struct{
|
||||
|
||||
Pxa260ic* ic;
|
||||
|
||||
UInt32 RCNR_offset; //RTC counter offset from our local time
|
||||
UInt32 RTAR; //RTC alarm
|
||||
UInt32 RTSR; //RTC status
|
||||
UInt32 RTTR; //RTC trim - we ignore this alltogether
|
||||
UInt32 lastSeenTime; //for HZ interrupt
|
||||
|
||||
}Pxa260rtc;
|
||||
|
||||
void pxa260rtcInit(Pxa260rtc* rtc, Pxa260ic* ic);
|
||||
void pxa260rtcUpdate(Pxa260rtc* rtc);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
37
include/pxa260/pxa260_TIMR.h
Normal file
37
include/pxa260/pxa260_TIMR.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef PXA260_TIMR_H
|
||||
#define PXA260_TIMR_H
|
||||
|
||||
#include "pxa260_CPU.h"
|
||||
#include "pxa260_IC.h"
|
||||
|
||||
|
||||
/*
|
||||
PXA260 OS timers controller
|
||||
|
||||
PURRPOSE: timers are useful for stuff :)
|
||||
|
||||
*/
|
||||
|
||||
#define PXA260_TIMR_BASE 0x40A00000UL
|
||||
#define PXA260_TIMR_SIZE 0x00010000UL
|
||||
|
||||
|
||||
typedef struct{
|
||||
|
||||
Pxa260ic* ic;
|
||||
|
||||
UInt32 OSMR[4]; //Match Register 0-3
|
||||
UInt32 OIER; //Interrupt Enable
|
||||
UInt32 OWER; //Watchdog enable
|
||||
UInt32 OSCR; //Counter Register
|
||||
UInt32 OSSR; //Status Register
|
||||
|
||||
}Pxa260timr;
|
||||
|
||||
Boolean pxa260timrPrvMemAccessF(void* userData, UInt32 pa, UInt8 size, Boolean write, void* buf);
|
||||
void pxa260timrInit(Pxa260timr* timr, Pxa260ic* ic);
|
||||
void pxa260timrTick(Pxa260timr* timr);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
#ifndef _PXA255_UART_H_
|
||||
#define _PXA255_UART_H_
|
||||
#ifndef PXA260_UART_H
|
||||
#define PXA260_UART_H
|
||||
|
||||
#include "pxa255_mem.h"
|
||||
#include "pxa255_CPU.h"
|
||||
#include "pxa255_IC.h"
|
||||
#include "pxa260_CPU.h"
|
||||
#include "pxa260_IC.h"
|
||||
|
||||
|
||||
/*
|
||||
PXA255 UARTs
|
||||
PXA260 UARTs
|
||||
|
||||
PXA255 has three. they are identical, but at diff base addresses. this implements one. instanciate more than one of this struct to make all 3 work if needed.
|
||||
PXA260 has three. they are identical, but at diff base addresses. this implements one. instanciate more than one of this struct to make all 3 work if needed.
|
||||
PURRPOSE: this is how linux talks to us :)
|
||||
|
||||
|
||||
@@ -18,10 +17,10 @@
|
||||
|
||||
*/
|
||||
|
||||
#define PXA255_FFUART_BASE 0x40100000UL
|
||||
#define PXA255_BTUART_BASE 0x40200000UL
|
||||
#define PXA255_STUART_BASE 0x40700000UL
|
||||
#define PXA255_UART_SIZE 0x00010000UL
|
||||
#define PXA260_FFUART_BASE 0x40100000UL
|
||||
#define PXA260_BTUART_BASE 0x40200000UL
|
||||
#define PXA260_STUART_BASE 0x40700000UL
|
||||
#define PXA260_UART_SIZE 0x00010000UL
|
||||
|
||||
#define UART_FIFO_DEPTH 64
|
||||
|
||||
@@ -31,8 +30,8 @@
|
||||
#define UART_CHAR_PAR_ERR 0x200
|
||||
#define UART_CHAR_NONE 0x100
|
||||
|
||||
typedef UInt16 (*Pxa255UartReadF)(void* userData);
|
||||
typedef void (*Pxa255UartWriteF)(UInt16 chr, void* userData);
|
||||
typedef UInt16 (*Pxa260UartReadF)(void* userData);
|
||||
typedef void (*Pxa260UartWriteF)(UInt16 chr, void* userData);
|
||||
|
||||
#define UART_FIFO_EMPTY 0xFF
|
||||
|
||||
@@ -46,11 +45,11 @@ typedef struct{
|
||||
|
||||
typedef struct{
|
||||
|
||||
Pxa255ic* ic;
|
||||
Pxa260ic* ic;
|
||||
UInt32 baseAddr;
|
||||
|
||||
Pxa255UartReadF readF;
|
||||
Pxa255UartWriteF writeF;
|
||||
Pxa260UartReadF readF;
|
||||
Pxa260UartWriteF writeF;
|
||||
void* accessFuncsData;
|
||||
|
||||
UartFifo TX, RX;
|
||||
@@ -77,12 +76,12 @@ typedef struct{
|
||||
|
||||
|
||||
|
||||
}Pxa255uart;
|
||||
}Pxa260uart;
|
||||
|
||||
Boolean pxa255uartInit(Pxa255uart* uart, ArmMem* physMem, Pxa255ic* ic, UInt32 baseAddr, UInt8 irq);
|
||||
void pxa255uartProcess(Pxa255uart* uart); //write out data in TX fifo and read data into RX fifo
|
||||
void pxa260uartInit(Pxa260uart* uart, Pxa260ic* ic, UInt32 baseAddr, UInt8 irq);
|
||||
void pxa260uartProcess(Pxa260uart* uart); //write out data in TX fifo and read data into RX fifo
|
||||
|
||||
void pxa255uartSetFuncs(Pxa255uart* uart, Pxa255UartReadF readF, Pxa255UartWriteF writeF, void* userData);
|
||||
void pxa260uartSetFuncs(Pxa260uart* uart, Pxa260UartReadF readF, Pxa260UartWriteF writeF, void* userData);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef UARM_MATH_64_H
|
||||
#define UARM_MATH_64_H
|
||||
|
||||
#include "pxa255_types.h"
|
||||
#include "pxa260_types.h"
|
||||
|
||||
static inline UInt64 u64_from_halves(UInt32 hi, UInt32 lo) { return (((UInt64)hi) << 32ULL) | ((UInt64)lo); }
|
||||
static inline UInt64 u64_32_to_64(UInt32 v) { return (UInt64)v; }
|
||||
@@ -22,6 +22,11 @@ typedef uint8_t Boolean;//must use uint8_t, some functions store extra info in t
|
||||
#define _INLINE_ inline
|
||||
#define _UNUSED_
|
||||
|
||||
#define TYPE_CHECK ((sizeof(UInt32) == 4) && (sizeof(UInt16) == 2) && (sizeof(UInt8) == 1))
|
||||
|
||||
#define errNone 0x00
|
||||
#define errInternal 0x01
|
||||
|
||||
/* runtime stuffs */
|
||||
#define err_str(str) debugLog(str)
|
||||
#define err_hex(num) debugLog("0x%X", num)
|
||||
@@ -1,5 +1,3 @@
|
||||
#ifndef SD_CARD_COMMAND_SPEC_HEADER
|
||||
#define SD_CARD_COMMAND_SPEC_HEADER
|
||||
/*SD Card Commands*/
|
||||
/*Command Format:01IIIIIIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCCCCC1*/
|
||||
/*48 bits, I = index, A = argument, C = CRC*/
|
||||
@@ -63,5 +61,3 @@
|
||||
#define DR_ACCEPTED 0x05
|
||||
#define DR_CRC_ERROR 0x0B
|
||||
#define DR_WRITE_ERROR 0x0D
|
||||
|
||||
#endif
|
||||
@@ -4,8 +4,10 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
uint16_t* sed1376Framebuffer;
|
||||
extern uint8_t sed1376Ram[];
|
||||
extern uint16_t* sed1376Framebuffer;
|
||||
extern uint16_t sed1376FramebufferWidth;
|
||||
extern uint16_t sed1376FramebufferHeight;
|
||||
extern uint8_t sed1376Ram[];
|
||||
|
||||
void sed1376Reset(void);
|
||||
uint32_t sed1376StateSize(void);
|
||||
@@ -17,5 +19,6 @@ uint8_t sed1376GetRegister(uint8_t address);
|
||||
void sed1376SetRegister(uint8_t address, uint8_t value);
|
||||
|
||||
void sed1376Render(void);
|
||||
void sed1376UpdateLcdStatus(void);
|
||||
|
||||
#endif
|
||||
123
include/sed1376Accessors.c.h
Normal file
123
include/sed1376Accessors.c.h
Normal file
@@ -0,0 +1,123 @@
|
||||
//data access
|
||||
static uint32_t handlePanelDataSwaps(uint32_t address){
|
||||
#if !defined(EMU_NO_SAFETY)
|
||||
//word swap
|
||||
if(sed1376Registers[SPECIAL_EFFECT] & 0x80)
|
||||
address ^= 0x00000002;
|
||||
#endif
|
||||
//byte swap, used in 16 bpp mode
|
||||
if(sed1376Registers[SPECIAL_EFFECT] & 0x40)
|
||||
address ^= 0x00000001;
|
||||
return address;
|
||||
}
|
||||
|
||||
//color conversion
|
||||
static uint16_t makeRgb16FromSed666(uint8_t r, uint8_t g, uint8_t b){
|
||||
uint16_t color = r >> 2 << 10 & 0xF800;
|
||||
color |= g >> 2 << 5 & 0x07E0;
|
||||
color |= b >> 2 >> 1 & 0x001F;
|
||||
return color;
|
||||
}
|
||||
static uint16_t makeRgb16FromGreenComponent(uint16_t g){
|
||||
uint16_t color = g;
|
||||
color |= g >> 6;
|
||||
color |= g << 5 & 0xF1;
|
||||
return color;
|
||||
}
|
||||
static uint16_t lutMonochromeValue(uint8_t lutIndex){
|
||||
return makeRgb16FromSed666(sed1376GLut[lutIndex], sed1376GLut[lutIndex], sed1376GLut[lutIndex]);
|
||||
}
|
||||
|
||||
//monochrome
|
||||
static uint16_t get1BppMonochrome(uint16_t x, uint16_t y){
|
||||
return lutMonochromeValue(sed1376Ram[handlePanelDataSwaps(sed1376ScreenStartAddress + y * sed1376LineSize + x / 8)] >> (7 - x % 8) & 0x01);
|
||||
}
|
||||
static uint16_t get2BppMonochrome(uint16_t x, uint16_t y){
|
||||
return lutMonochromeValue(sed1376Ram[handlePanelDataSwaps(sed1376ScreenStartAddress + y * sed1376LineSize + x / 4)] >> (6 - x % 4 * 2) & 0x03);
|
||||
}
|
||||
static uint16_t get4BppMonochrome(uint16_t x, uint16_t y){
|
||||
return lutMonochromeValue(sed1376Ram[handlePanelDataSwaps(sed1376ScreenStartAddress + y * sed1376LineSize + x / 2)] >> (4 - x % 2 * 4) & 0x0F);
|
||||
}
|
||||
static uint16_t get8BppMonochrome(uint16_t x, uint16_t y){
|
||||
return lutMonochromeValue(sed1376Ram[handlePanelDataSwaps(sed1376ScreenStartAddress + y * sed1376LineSize + x)]);
|
||||
}
|
||||
static uint16_t get16BppMonochrome(uint16_t x, uint16_t y){
|
||||
uint16_t pixelValue = sed1376Ram[handlePanelDataSwaps(sed1376ScreenStartAddress + (y * sed1376LineSize + x) * 2)] << 8 | sed1376Ram[handlePanelDataSwaps(sed1376ScreenStartAddress + (y * sed1376LineSize + x) * 2 + 1)];
|
||||
return makeRgb16FromGreenComponent(pixelValue);
|
||||
}
|
||||
|
||||
//color
|
||||
static uint16_t get1BppColor(uint16_t x, uint16_t y){
|
||||
return sed1376OutputLut[sed1376Ram[handlePanelDataSwaps(sed1376ScreenStartAddress + y * sed1376LineSize + x / 8)] >> (7 - x % 8) & 0x01];
|
||||
}
|
||||
static uint16_t get2BppColor(uint16_t x, uint16_t y){
|
||||
return sed1376OutputLut[sed1376Ram[handlePanelDataSwaps(sed1376ScreenStartAddress + y * sed1376LineSize + x / 4)] >> (6 - x % 4 * 2) & 0x03];
|
||||
}
|
||||
static uint16_t get4BppColor(uint16_t x, uint16_t y){
|
||||
return sed1376OutputLut[sed1376Ram[handlePanelDataSwaps(sed1376ScreenStartAddress + y * sed1376LineSize + x / 2)] >> (4 - x % 2 * 4) & 0x0F];
|
||||
}
|
||||
static uint16_t get8BppColor(uint16_t x, uint16_t y){
|
||||
return sed1376OutputLut[sed1376Ram[handlePanelDataSwaps(sed1376ScreenStartAddress + y * sed1376LineSize + x)]];
|
||||
}
|
||||
static uint16_t get16BppColor(uint16_t x, uint16_t y){
|
||||
//this format is little endian, to use big endian data sed1376Registers[SPECIAL_EFFECT] & 0x40 must be set
|
||||
return sed1376Ram[handlePanelDataSwaps(sed1376ScreenStartAddress + (y * sed1376LineSize + x * 2) + 1)] << 8 | sed1376Ram[handlePanelDataSwaps(sed1376ScreenStartAddress + (y * sed1376LineSize + x * 2))];
|
||||
}
|
||||
|
||||
static void selectRenderer(bool color, uint8_t bpp){
|
||||
sed1376RenderPixel = NULL;
|
||||
if(color){
|
||||
switch(bpp){
|
||||
case 1:
|
||||
sed1376RenderPixel = get1BppColor;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
sed1376RenderPixel = get2BppColor;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
sed1376RenderPixel = get4BppColor;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
sed1376RenderPixel = get8BppColor;
|
||||
break;
|
||||
|
||||
case 16:
|
||||
sed1376RenderPixel = get16BppColor;
|
||||
break;
|
||||
|
||||
default:
|
||||
debugLog("SED1376 invalid color bpp:%d\n", bpp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else{
|
||||
switch(bpp){
|
||||
case 1:
|
||||
sed1376RenderPixel = get1BppMonochrome;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
sed1376RenderPixel = get2BppMonochrome;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
sed1376RenderPixel = get4BppMonochrome;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
sed1376RenderPixel = get8BppMonochrome;
|
||||
break;
|
||||
|
||||
case 16:
|
||||
sed1376RenderPixel = get16BppMonochrome;
|
||||
break;
|
||||
|
||||
default:
|
||||
debugLog("SED1376 invalid grayscale bpp:%d\n", bpp);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
#ifndef SED1376_REGISTER_NAMES_H
|
||||
#define SED1376_REGISTER_NAMES_H
|
||||
/*SED1376 Register Definitions*/
|
||||
|
||||
/*Read-Only Configuration Registers*/
|
||||
@@ -83,5 +81,3 @@
|
||||
#define PWM_CONFIG 0xB1
|
||||
#define PWM_LENGTH 0xB2
|
||||
#define PWM_DUTY_CYCLE 0xB3
|
||||
|
||||
#endif
|
||||
14
include/tps65010.h
Normal file
14
include/tps65010.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef TPS65010_H
|
||||
#define TPS65010_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
void tps65010Reset(void);
|
||||
uint32_t tps65010StateSize(void);
|
||||
void tps65010SaveState(uint8_t* data);
|
||||
void tps65010LoadState(uint8_t* data);
|
||||
|
||||
uint8_t tps65010I2cExchange(uint8_t i2cBus);
|
||||
void tps65010UpdateInterrupt(void);//called when buttons are refreshed or an SD card is inserted
|
||||
|
||||
#endif
|
||||
20
include/tsc2101.h
Normal file
20
include/tsc2101.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef TSC2101_H
|
||||
#define TSC2101_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
void tsc2101Reset(bool isBoot);
|
||||
uint32_t tsc2101StateSize(void);
|
||||
void tsc2101SaveState(uint8_t* data);
|
||||
void tsc2101LoadState(uint8_t* data);
|
||||
|
||||
void tsc2101SetPwrDn(bool value);
|
||||
void tsc2101SetChipSelect(bool value);
|
||||
bool tsc2101ExchangeBit(bool bit);
|
||||
void tsc2101UpdateInterrupt(void);//called after touchscreen update to flush the values
|
||||
//TODO: this chip seems to do audio output, need to add a 16bit optimized transfer function
|
||||
|
||||
void tsc2101Scan(void);
|
||||
|
||||
#endif
|
||||
23
include/tungstenT3Bus.h
Normal file
23
include/tungstenT3Bus.h
Normal file
@@ -0,0 +1,23 @@
|
||||
#ifndef TUNGSTEN_T3_BUS_H
|
||||
#define TUNGSTEN_T3_BUS_H
|
||||
|
||||
#define PXA260_BANK_SCOOT 26
|
||||
#define PXA260_NUM_BANKS(areaSize) (((areaSize) >> PXA260_BANK_SCOOT) + ((areaSize) & ((1 << PXA260_BANK_SCOOT) - 1) ? 1 : 0))
|
||||
#define PXA260_START_BANK(address) ((address) >> PXA260_BANK_SCOOT)
|
||||
#define PXA260_END_BANK(address, size) (PXA260_START_BANK(address) + PXA260_NUM_BANKS(size) - 1)
|
||||
#define PXA260_BANK_IN_RANGE(bank, address, size) ((bank) >= PXA260_START_BANK(address) && (bank) <= PXA260_END_BANK(address, size))
|
||||
#define PXA260_BANK_ADDRESS(bank) ((bank) << PXA260_BANK_SCOOT)
|
||||
#define PXA260_TOTAL_MEMORY_BANKS (1 << (32 - PXA260_BANK_SCOOT))//64 banks for *_BANK_SCOOT = 26
|
||||
|
||||
#define PXA260_ROM_START_ADDRESS 0x00000000
|
||||
#define PXA260_RAM_START_ADDRESS 0xA0000000
|
||||
#define TUNGSTEN_T3_W86L488_START_ADDRESS 0x08000000
|
||||
#define PXA260_PCMCIA0_START_ADDRESS 0x20000000
|
||||
#define PXA260_PCMCIA1_START_ADDRESS 0x30000000
|
||||
#define TUNGSTEN_T3_ROM_SIZE (16 * 0x100000)//16mb ROM
|
||||
#define TUNGSTEN_T3_RAM_SIZE (64 * 0x100000)//64mb RAM
|
||||
#define TUNGSTEN_T3_W86L488_SIZE 0x04000000
|
||||
#define PXA260_PCMCIA0_SIZE 0x10000000
|
||||
#define PXA260_PCMCIA1_SIZE 0x10000000
|
||||
|
||||
#endif
|
||||
14
include/w86l488.h
Normal file
14
include/w86l488.h
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef W86L488_H
|
||||
#define W86L488_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
void w86l488Reset(void);
|
||||
uint32_t w86l488StateSize(void);
|
||||
void w86l488SaveState(uint8_t* data);
|
||||
void w86l488LoadState(uint8_t* data);
|
||||
|
||||
uint16_t w86l488Read16(uint8_t address);
|
||||
void w86l488Write16(uint8_t address, uint16_t value);
|
||||
|
||||
#endif
|
||||
45
libretroBuildSystem/CMakeLists.txt
Normal file
45
libretroBuildSystem/CMakeLists.txt
Normal file
@@ -0,0 +1,45 @@
|
||||
add_library(mu_libretro SHARED
|
||||
libretro.c
|
||||
cursors.c
|
||||
miniz.c
|
||||
libretro-common/compat/compat_strl.c
|
||||
libretro-common/compat/compat_posix_string.c
|
||||
libretro-common/compat/fopen_utf8.c
|
||||
libretro-common/encodings/encoding_utf.c
|
||||
libretro-common/memmap/memmap.c
|
||||
libretro-common/streams/file_stream.c
|
||||
libretro-common/string/stdstring.c
|
||||
libretro-common/vfs/vfs_implementation.c)
|
||||
|
||||
# Remove the "lib" prefix always, RetroArch does not name in this way
|
||||
set_target_properties(mu_libretro PROPERTIES PREFIX "")
|
||||
|
||||
# Bring all the sub-modules as needed
|
||||
target_link_libraries(mu_libretro
|
||||
MuCore)
|
||||
|
||||
# Include the required includes
|
||||
target_include_directories(mu_libretro PUBLIC
|
||||
"${PROJECT_SOURCE_DIR}/include"
|
||||
"libretro-common/include")
|
||||
|
||||
# Custom launching the core, tries to find RetroArch on the system
|
||||
## Determine RetroArch directory
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
|
||||
set(MU_LIBRETRO_EXTENSION ".exe")
|
||||
|
||||
if (EXISTS "$ENV{APPDATA}/RetroArch")
|
||||
set(MU_LIBRETRO_DIR "$ENV{APPDATA}/RetroArch")
|
||||
endif()
|
||||
else()
|
||||
set(MU_LIBRETRO_EXTENSION "")
|
||||
endif()
|
||||
|
||||
## Target to run RetroArch with the Mu Core
|
||||
if(DEFINED MU_LIBRETRO_DIR)
|
||||
add_custom_target(RetroArch
|
||||
DEPENDS mu_libretro
|
||||
COMMAND "${MU_LIBRETRO_DIR}/retroarch${MU_LIBRETRO_EXTENSION}" "-v" "-L" "$<TARGET_FILE:mu_libretro>"
|
||||
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
||||
COMMENT "Starting RetroArch with Mu")
|
||||
endif()
|
||||
@@ -35,6 +35,8 @@ else ifeq ($(platform),windows_msvc2003_x86)
|
||||
include $(BUILD_DIR)/Makefile.windows_msvc2003_x86
|
||||
else ifeq ($(platform),windows_msvc2005_x86)
|
||||
include $(BUILD_DIR)/Makefile.windows_msvc2005_x86
|
||||
else ifeq ($(platform),windows_msvc2008_x86)
|
||||
include $(BUILD_DIR)/Makefile.windows_msvc2008_x86
|
||||
else ifeq ($(platform),windows_msvc2010_x86)
|
||||
include $(BUILD_DIR)/Makefile.windows_msvc2010_x86
|
||||
else ifeq ($(platform),windows_msvc2010_x64)
|
||||
@@ -125,13 +127,28 @@ ifeq ($(arch),ppc)
|
||||
CFLAGS += -D__ppc__ -DMSB_FIRST -DWORDS_BIGENDIAN=1
|
||||
endif
|
||||
OSXVER = $(shell sw_vers -productVersion | cut -d. -f 2)
|
||||
OSX_LT_MAVERICKS = $(shell (( $(OSXVER) <= 9)) && echo "YES")
|
||||
OSX_GT_MOJAVE = $(shell (( $(OSXVER) >= 14)) && echo "YES")
|
||||
ifneq ($(OSX_GT_MOJAVE),YES)
|
||||
#this breaks compiling on Mac OS Mojave
|
||||
fpic += -mmacosx-version-min=10.1
|
||||
endif
|
||||
|
||||
ifeq ($(OSX_LT_MAVERICKS),"YES")
|
||||
fpic += -mmacosx-version-min=10.5
|
||||
else
|
||||
ifneq ($(OSX_GT_MOJAVE),YES)
|
||||
#this breaks compiling on Mac OS Mojave
|
||||
fpic += -mmacosx-version-min=10.1
|
||||
endif
|
||||
endif
|
||||
|
||||
SHARED := -dynamiclib
|
||||
|
||||
ifeq ($(CROSS_COMPILE),1)
|
||||
TARGET_RULE = -target $(LIBRETRO_APPLE_PLATFORM) -isysroot $(LIBRETRO_APPLE_ISYSROOT)
|
||||
CFLAGS += $(TARGET_RULE)
|
||||
CPPFLAGS += $(TARGET_RULE)
|
||||
CXXFLAGS += $(TARGET_RULE)
|
||||
LDFLAGS += $(TARGET_RULE)
|
||||
endif
|
||||
|
||||
# iOS
|
||||
else ifneq (,$(findstring ios,$(platform)))
|
||||
EXT ?= dylib
|
||||
@@ -159,6 +176,17 @@ CC += -miphoneos-version-min=5.0
|
||||
CFLAGS += -miphoneos-version-min=5.0
|
||||
endif
|
||||
|
||||
# tvOS
|
||||
else ifeq ($(platform), tvos-arm64)
|
||||
TARGET := $(TARGET_NAME)_libretro_tvos.dylib
|
||||
fpic := -fPIC
|
||||
SHARED := -dynamiclib
|
||||
CFLAGS := -DIOS
|
||||
|
||||
ifeq ($(IOSSDK),)
|
||||
IOSSDK := $(shell xcodebuild -version -sdk appletvos Path)
|
||||
endif
|
||||
|
||||
# Theos iOS
|
||||
else ifeq ($(platform), theos_ios)
|
||||
DEPLOYMENT_IOSVERSION = 5.0
|
||||
@@ -180,33 +208,15 @@ else ifeq ($(platform), qnx)
|
||||
AR = qcc -Vgcc_ntoarmv7le
|
||||
CFLAGS += -D__BLACKBERRY_QNX__
|
||||
|
||||
# PS3
|
||||
else ifeq ($(platform), ps3)
|
||||
EXT = a
|
||||
TARGET := $(TARGET_NAME)_libretro_ps3.$(EXT)
|
||||
CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
|
||||
AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
|
||||
CFLAGS += -D__ppc__ -DMSB_FIRST -DWORDS_BIGENDIAN=1
|
||||
STATIC_LINKING = 1
|
||||
STATIC_LINKING_LINK = 1
|
||||
|
||||
# PS3 (SNC)
|
||||
else ifeq ($(platform), sncps3)
|
||||
EXT = a
|
||||
TARGET := $(TARGET_NAME)_libretro_ps3.$(EXT)
|
||||
CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
|
||||
AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
|
||||
CFLAGS += -D__ppc__ -DMSB_FIRST -DWORDS_BIGENDIAN=1
|
||||
STATIC_LINKING = 1
|
||||
STATIC_LINKING_LINK = 1
|
||||
|
||||
# Lightweight PS3 Homebrew SDK
|
||||
else ifeq ($(platform), psl1ght)
|
||||
EXT = a
|
||||
TARGET := $(TARGET_NAME)_libretro_$(platform).$(EXT)
|
||||
CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT)
|
||||
AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT)
|
||||
CFLAGS += -D__ppc__ -DMSB_FIRST -DWORDS_BIGENDIAN=1
|
||||
else ifneq (,$(filter $(platform), ps3 psl1ght))
|
||||
TARGET := $(TARGET_NAME)_libretro_$(platform).a
|
||||
CC = $(PS3DEV)/ppu/bin/ppu-$(COMMONLV)gcc$(EXE_EXT)
|
||||
AR = $(PS3DEV)/ppu/bin/ppu-$(COMMONLV)ar$(EXE_EXT)
|
||||
ifeq ($(platform), psl1ght)
|
||||
CFLAGS += -D__PSL1GHT__
|
||||
endif
|
||||
CFLAGS += -D__ppc__ -DMSB_FIRST -DWORDS_BIGENDIAN=1 -D__PS3__
|
||||
STATIC_LINKING = 1
|
||||
STATIC_LINKING_LINK = 1
|
||||
|
||||
@@ -438,11 +448,21 @@ else ifeq ($(platform), xbox1_msvc2003)
|
||||
STATIC_LINKING = 1
|
||||
STATIC_LINKING_LINK = 1
|
||||
|
||||
# PlayStation 2
|
||||
else ifeq ($(platform), ps2)
|
||||
TARGET := $(TARGET_NAME)_libretro_$(platform).a
|
||||
CC = mips64r5900el-ps2-elf-gcc$(EXE_EXT)
|
||||
CXX = mips64r5900el-ps2-elf-g++$(EXE_EXT)
|
||||
AR = mips64r5900el-ps2-elf-ar$(EXE_EXT)
|
||||
CFLAGS += -Wall -DPS2 -DABGR1555
|
||||
STATIC_LINKING = 1
|
||||
STATIC_LINKING_LINK = 1
|
||||
|
||||
# Windows
|
||||
else
|
||||
EXT ?= dll
|
||||
TARGET := $(TARGET_NAME)_libretro.$(EXT)
|
||||
CC = gcc
|
||||
CC ?= gcc
|
||||
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=$(BUILD_DIR)/link.T
|
||||
CFLAGS += -D__WIN32__ -D__WIN32_LIBRETRO__
|
||||
endif
|
||||
@@ -465,7 +485,7 @@ include $(BUILD_DIR)/Makefile.common
|
||||
|
||||
OBJECTS := $(SOURCES_C:.c=.o) $(SOURCES_CXX:.cpp=.o) $(SOURCES_ASM:.S=.o)
|
||||
|
||||
DEFINES = $(COREDEFINES)
|
||||
DEFINES += $(COREDEFINES)
|
||||
|
||||
ifeq ($(STATIC_LINKING), 1)
|
||||
DEFINES += -DSTATIC_LINKING
|
||||
@@ -488,6 +508,7 @@ endif
|
||||
COMMON_DEFINES += $(CODE_DEFINES) $(WARNINGS_DEFINES) $(fpic)
|
||||
|
||||
CFLAGS += $(DEFINES) $(COMMON_DEFINES)
|
||||
CXXFLAGS += $(DEFINES) $(COMMON_DEFINES)
|
||||
|
||||
ifneq (,$(findstring msvc,$(platform)))
|
||||
OBJOUT = -Fo
|
||||
@@ -526,8 +547,6 @@ else
|
||||
$(CC) $(fpic) $(SHARED) $(INCFLAGS) $(LDFLAGS) $(OBJOUT)$@ $(OBJECTS) $(LIBM)
|
||||
endif
|
||||
|
||||
@echo "** BUILD SUCCESSFUL! GG NO RE **"
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(INCFLAGS) $(CFLAGS) -c $(OBJOUT)$@ $<
|
||||
|
||||
|
||||
@@ -2,42 +2,66 @@ EMU_PATH := $(CORE_DIR)/../src
|
||||
LIBRETRO_COMM_DIR := $(CORE_DIR)/libretro-common
|
||||
COREDEFINES :=
|
||||
|
||||
INCFLAGS := -I$(LIBRETRO_COMM_DIR)/include
|
||||
# my first make function!!!
|
||||
CHECK_ALL = $(strip $(foreach v,$(2),$(if $(findstring $(v),$(1)),$(v),)))
|
||||
|
||||
INCFLAGS := -I$(CORE_DIR)/../include -I$(LIBRETRO_COMM_DIR)/include
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
COREDEFINES += -DEMU_DEBUG -DEMU_SANDBOX
|
||||
COREDEFINES += -DEMU_DEBUG
|
||||
else
|
||||
COREDEFINES += -DEMU_NO_SAFETY
|
||||
EMU_NO_SAFETY := 1
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring msvc200,$(platform)))
|
||||
# "unix" or "win" is not specific enough, need to know the CPU arch too
|
||||
this_system := $(platform)
|
||||
ifneq (,$(filter unix win,$(this_system)))
|
||||
this_system := $(shell $(CC) -dumpmachine)
|
||||
endif
|
||||
|
||||
|
||||
ifneq (,$(findstring msvc200,$(this_system)))
|
||||
INCFLAGS += -I$(LIBRETRO_COMM_DIR)/include/compat/msvc
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring msvc20,$(platform)))
|
||||
ifneq (,$(findstring msvc20,$(this_system)))
|
||||
# Mu is dependent on stdbool.h and the standard inline directive existing
|
||||
INCFLAGS += -I$(CORE_DIR)/fixIncludes/stdbool
|
||||
COREDEFINES += -Dinline=_inline -DINLINE=_inline
|
||||
endif
|
||||
|
||||
ifneq (,$(findstring windows,$(platform)))
|
||||
# Windows
|
||||
EMU_SUPPORT_PALM_OS5 = 1
|
||||
EMU_OS := windows
|
||||
ifneq (,$(findstring x64,$(platform)))
|
||||
EMU_ARCH := x86_64
|
||||
ifneq (,$(call CHECK_ALL,$(this_system),windows mingw))
|
||||
# Windows
|
||||
ifeq (,$(findstring msvc,$(this_system)))
|
||||
EMU_SUPPORT_PALM_OS5 := 1
|
||||
EMU_OS := windows
|
||||
ifneq (,$(call CHECK_ALL,$(this_system),x86_64 x64))
|
||||
EMU_ARCH := x86_64
|
||||
else
|
||||
EMU_ARCH := x86_32
|
||||
endif
|
||||
else
|
||||
EMU_ARCH := x86_32
|
||||
# MSVC uses its own(incompatible) ASM syntax
|
||||
EMU_SUPPORT_PALM_OS5 := 0
|
||||
endif
|
||||
else ifneq (,$(findstring armv,$(platform)))
|
||||
# ARM Linux
|
||||
EMU_SUPPORT_PALM_OS5 = 1
|
||||
else ifneq (,$(call CHECK_ALL,$(this_system),armv8 aarch64))
|
||||
# ARM Linux 64
|
||||
EMU_SUPPORT_PALM_OS5 := 1
|
||||
EMU_ARCH := armv8
|
||||
EMU_OS := linux
|
||||
else ifneq (,$(call CHECK_ALL,$(this_system),armv rpi2 rpi3))
|
||||
# ARM Linux(rpi3 is aarch64 but its almost always used in 32bit mode)
|
||||
EMU_SUPPORT_PALM_OS5 := 1
|
||||
EMU_ARCH := armv7
|
||||
EMU_OS := linux
|
||||
else ifneq (,$(filter unix osx osx_x86 osx_x86_64 linux_x86 linux_x86_64 linux-portable_x86 linux-portable_x86_64,$(platform)))
|
||||
else ifneq (,$(findstring armhf,$(this_system)))
|
||||
# ARM Linux ARMv5
|
||||
# this needs to be before "linux" because it will trigger the linux case
|
||||
EMU_SUPPORT_PALM_OS5 := 0
|
||||
else ifneq (,$(call CHECK_ALL,$(this_system),osx linux))
|
||||
# x86_* Linux
|
||||
EMU_SUPPORT_PALM_OS5 = 1
|
||||
ifneq (,$(filter osx osx_x86_64 linux_x86_64 linux-portable_x86_64,$(platform)))
|
||||
EMU_SUPPORT_PALM_OS5 := 1
|
||||
ifneq (,$(call CHECK_ALL,$(this_system),osx x86_64 x64))
|
||||
EMU_ARCH := x86_64
|
||||
else
|
||||
EMU_ARCH := x86_32
|
||||
@@ -45,26 +69,47 @@ else ifneq (,$(filter unix osx osx_x86 osx_x86_64 linux_x86 linux_x86_64 linux-p
|
||||
EMU_OS := linux
|
||||
endif
|
||||
|
||||
ifneq (,$(filter ps3 sncps3 psl1ght ngc wii wiiu,$(platform)))
|
||||
# OS 5 isnt even booting yet, just turn the dynarec off to make it compile easier
|
||||
EMU_ARCH := unknown
|
||||
|
||||
ifneq (,$(filter ps3 sncps3 psl1ght ngc wii wiiu,$(this_system)))
|
||||
COREDEFINES += -DEMU_BIG_ENDIAN
|
||||
else ifeq ($(platform), osx)
|
||||
else ifeq ($(this_system), osx)
|
||||
ifeq ($(arch), ppc)
|
||||
COREDEFINES += -DEMU_BIG_ENDIAN
|
||||
endif
|
||||
endif
|
||||
|
||||
# use all CPUs and optimize for the most likely outcome, Android is handled separately
|
||||
# Apple broke OpenMP in there port of Clang so no Mac OS or iOS
|
||||
# ifneq (,$(call CHECK_ALL,$(this_system),windows mingw linux))
|
||||
# # none of libretros MSVC compilers work with these optimizations for multiple different reasons
|
||||
# # they dont have the library "VCOMP.lib"
|
||||
# # they are too old for the extension to exist
|
||||
# # MSVC never has or will support __builtin_expect
|
||||
# ifeq (,$(findstring msvc,$(this_system)))
|
||||
# COREDEFINES += -fopenmp -DEMU_MULTITHREADED -DEMU_MANAGE_HOST_CPU_PIPELINE
|
||||
# LDFLAGS += -fopenmp
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# use C++11
|
||||
ifeq ($(EMU_SUPPORT_PALM_OS5), 1)
|
||||
ifneq ($(platform), android_jni)
|
||||
ifneq ($(this_system), android_jni)
|
||||
CXXFLAGS += -std=c++11
|
||||
endif
|
||||
endif
|
||||
|
||||
# RetroArch needs to be able to launch files directly
|
||||
EMU_HAVE_FILE_LAUNCHER := 1
|
||||
|
||||
include $(EMU_PATH)/makefile.all
|
||||
|
||||
COREDEFINES += $(EMU_DEFINES)
|
||||
|
||||
SOURCES_C := $(CORE_DIR)/libretro.c \
|
||||
$(CORE_DIR)/cursors.c \
|
||||
$(CORE_DIR)/miniz.c \
|
||||
$(EMU_SOURCES_C)
|
||||
SOURCES_CXX := $(EMU_SOURCES_CXX)
|
||||
SOURCES_ASM := $(EMU_SOURCES_ASM)
|
||||
@@ -79,3 +124,6 @@ ifneq ($(STATIC_LINKING), 1)
|
||||
$(LIBRETRO_COMM_DIR)/string/stdstring.c \
|
||||
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.c
|
||||
endif
|
||||
|
||||
# Make sure C++ shares our include flags!
|
||||
CXXFLAGS += $(INCFLAGS)
|
||||
|
||||
@@ -59,7 +59,7 @@ RETROLDXFLAGS =
|
||||
#################
|
||||
# Final variables
|
||||
|
||||
DEFINES = $(PLATDEFS) $(RETRODEFS)
|
||||
DEFINES = $(PLATDEFS) $(COREDEFINES) $(RETRODEFS)
|
||||
CFLAGS = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
|
||||
CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
|
||||
LDFLAGS = $(PLATLDFLAGS) $(RETROLDFLAGS)
|
||||
|
||||
@@ -59,7 +59,7 @@ RETROLDXFLAGS =
|
||||
#################
|
||||
# Final variables
|
||||
|
||||
DEFINES = $(PLATDEFS) $(RETRODEFS)
|
||||
DEFINES = $(PLATDEFS) $(COREDEFINES) $(RETRODEFS)
|
||||
CFLAGS = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
|
||||
CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
|
||||
LDFLAGS = $(PLATLDFLAGS) $(RETROLDFLAGS)
|
||||
|
||||
@@ -59,7 +59,7 @@ RETROLDXFLAGS =
|
||||
#################
|
||||
# Final variables
|
||||
|
||||
DEFINES = $(PLATDEFS) $(RETRODEFS)
|
||||
DEFINES = $(PLATDEFS) $(COREDEFINES) $(RETRODEFS)
|
||||
CFLAGS = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
|
||||
CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
|
||||
LDFLAGS = $(PLATLDFLAGS) $(RETROLDFLAGS)
|
||||
|
||||
@@ -59,7 +59,7 @@ RETROLDXFLAGS =
|
||||
#################
|
||||
# Final variables
|
||||
|
||||
DEFINES = $(PLATDEFS) $(RETRODEFS)
|
||||
DEFINES = $(PLATDEFS) $(COREDEFINES) $(RETRODEFS)
|
||||
CFLAGS = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
|
||||
CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
|
||||
LDFLAGS = $(PLATLDFLAGS) $(RETROLDFLAGS)
|
||||
|
||||
@@ -59,7 +59,7 @@ RETROLDXFLAGS =
|
||||
#################
|
||||
# Final variables
|
||||
|
||||
DEFINES = $(PLATDEFS) $(RETRODEFS)
|
||||
DEFINES = $(PLATDEFS) $(COREDEFINES) $(RETRODEFS)
|
||||
CFLAGS = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
|
||||
CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
|
||||
LDFLAGS = $(PLATLDFLAGS) $(RETROLDFLAGS)
|
||||
|
||||
@@ -59,7 +59,7 @@ RETROLDXFLAGS =
|
||||
#################
|
||||
# Final variables
|
||||
|
||||
DEFINES = $(PLATDEFS) $(RETRODEFS)
|
||||
DEFINES = $(PLATDEFS) $(COREDEFINES) $(RETRODEFS)
|
||||
CFLAGS = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
|
||||
CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
|
||||
LDFLAGS = $(PLATLDFLAGS) $(RETROLDFLAGS)
|
||||
|
||||
@@ -59,7 +59,7 @@ RETROLDXFLAGS =
|
||||
#################
|
||||
# Final variables
|
||||
|
||||
DEFINES = $(PLATDEFS) $(RETRODEFS)
|
||||
DEFINES = $(PLATDEFS) $(COREDEFINES) $(RETRODEFS)
|
||||
CFLAGS = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
|
||||
CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
|
||||
LDFLAGS = $(PLATLDFLAGS) $(RETROLDFLAGS)
|
||||
|
||||
@@ -59,7 +59,7 @@ RETROLDXFLAGS =
|
||||
#################
|
||||
# Final variables
|
||||
|
||||
DEFINES = $(PLATDEFS) $(RETRODEFS)
|
||||
DEFINES = $(PLATDEFS) $(COREDEFINES) $(RETRODEFS)
|
||||
CFLAGS = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
|
||||
CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
|
||||
LDFLAGS = $(PLATLDFLAGS) $(RETROLDFLAGS)
|
||||
|
||||
@@ -59,7 +59,7 @@ RETROLDXFLAGS =
|
||||
#################
|
||||
# Final variables
|
||||
|
||||
DEFINES = $(PLATDEFS) $(RETRODEFS)
|
||||
DEFINES = $(PLATDEFS) $(COREDEFINES) $(RETRODEFS)
|
||||
CFLAGS = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
|
||||
CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
|
||||
LDFLAGS = $(PLATLDFLAGS) $(RETROLDFLAGS)
|
||||
|
||||
@@ -59,7 +59,7 @@ RETROLDXFLAGS =
|
||||
#################
|
||||
# Final variables
|
||||
|
||||
DEFINES = $(PLATDEFS) $(RETRODEFS)
|
||||
DEFINES = $(PLATDEFS) $(COREDEFINES) $(RETRODEFS)
|
||||
CFLAGS = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
|
||||
CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
|
||||
LDFLAGS = $(PLATLDFLAGS) $(RETROLDFLAGS)
|
||||
|
||||
@@ -59,7 +59,7 @@ RETROLDXFLAGS =
|
||||
#################
|
||||
# Final variables
|
||||
|
||||
DEFINES = $(PLATDEFS) $(RETRODEFS)
|
||||
DEFINES = $(PLATDEFS) $(COREDEFINES) $(RETRODEFS)
|
||||
CFLAGS = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
|
||||
CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
|
||||
LDFLAGS = $(PLATLDFLAGS) $(RETROLDFLAGS)
|
||||
|
||||
@@ -53,9 +53,8 @@ SOEXT = .dll
|
||||
# Platform setup
|
||||
|
||||
STATIC_LINKING = 0
|
||||
platform = win
|
||||
PLATDEFS =
|
||||
PLATCFLAGS = -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 -DWIN32 -DCORRECT_VRAM_READS -D_WINDOWS -D_USRDLL -D_CRT_SECURE_NO_WARNINGS -DMSVC2010_EXPORTS -DFRONTEND_SUPPORTS_RGB565 -DGIT_VERSION=\"$(GIT_VERSION)\"
|
||||
PLATCFLAGS = -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 -DWIN32 -D_WINDOWS -D_USRDLL -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -DFRONTEND_SUPPORTS_RGB565 -DGIT_VERSION=\"$(GIT_VERSION)\"
|
||||
PLATCXXFLAGS = $(PLATCFLAGS)
|
||||
#PLATLDFLAGS = -shared -lm
|
||||
#PLATLDXFLAGS = -shared -lm
|
||||
@@ -82,13 +81,17 @@ LDXFLAGS = $(PLATLDXFLAGS) $(RETROLDXFLAGS)
|
||||
# Tuning
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
CFLAGS += -Od -Zi -D_DEBUG
|
||||
CXXFLAGS += -Od -Zi -D_DEBUG
|
||||
LDFLAGS += -DEBUG -DLL
|
||||
CFLAGS += -Od -Zi -D_DEBUG
|
||||
CXXFLAGS += -Od -Zi -D_DEBUG
|
||||
CFLAGS += -MTd
|
||||
CXXFLAGS += -MTd
|
||||
LDFLAGS += -DEBUG -DLL
|
||||
else
|
||||
CFLAGS += -O2 -DNDEBUG
|
||||
CXXFLAGS += -O2 -DNDEBUG
|
||||
LDFLAGS += -DLL
|
||||
CFLAGS += -O2 -DNDEBUG
|
||||
CXXFLAGS += -O2 -DNDEBUG
|
||||
CFLAGS += -MT
|
||||
CXXFLAGS += -MT
|
||||
LDFLAGS += -DLL
|
||||
endif
|
||||
|
||||
ifneq ($(LOG_PERFORMANCE),)
|
||||
|
||||
@@ -37,10 +37,17 @@ PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../IDE")
|
||||
INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS80COMNTOOLS)../../VC/include")
|
||||
LIB := $(shell IFS=$$'\n'; cygpath -w "$(VS80COMNTOOLS)../../VC/lib")
|
||||
|
||||
WindowsSdkDir := $(INETSDK)
|
||||
WindowsSdkDir := $(shell reg query "HKLM\SOFTWARE\Microsoft\MicrosoftSDK\InstalledSDKs\8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3" -v "Install Dir" | grep -o '[A-Z]:\\.*')
|
||||
|
||||
export INCLUDE := $(INCLUDE);$(WindowsSdkDir)/Include;libretro/msvc/msvc-2005
|
||||
export LIB := $(LIB);$(WindowsSdkDir);$(INETSDK)/Lib
|
||||
WindowsSDKIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include")
|
||||
WindowsSDKAtlIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\atl")
|
||||
WindowsSDKCrtIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\crt")
|
||||
WindowsSDKGlIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\gl")
|
||||
WindowsSDKMfcIncludeDir := $(shell cygpath -w "$(WindowsSdkDir)\Include\mfc")
|
||||
WindowsSDKLibDir := $(shell cygpath -w "$(WindowsSdkDir)\Lib")
|
||||
|
||||
export INCLUDE := $(INCLUDE);$(WindowsSDKIncludeDir);$(WindowsSDKAtlIncludeDir);$(WindowsSDKCrtIncludeDir);$(WindowsSDKGlIncludeDir);$(WindowsSDKMfcIncludeDir);libretro-common/include/compat/msvc
|
||||
export LIB := $(LIB);$(WindowsSDKLibDir)
|
||||
|
||||
############
|
||||
# Extensions
|
||||
@@ -52,9 +59,8 @@ SOEXT = .dll
|
||||
# Platform setup
|
||||
|
||||
STATIC_LINKING = 0
|
||||
platform = win
|
||||
PLATDEFS =
|
||||
PLATCFLAGS = -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 -DWIN32 -DCORRECT_VRAM_READS -D_WINDOWS -D_USRDLL -D_CRT_SECURE_NO_WARNINGS -DMSVC2010_EXPORTS -DFRONTEND_SUPPORTS_RGB565 -DGIT_VERSION=\"$(GIT_VERSION)\"
|
||||
PLATCFLAGS = -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 -DWIN32 -D_WINDOWS -D_USRDLL -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -DFRONTEND_SUPPORTS_RGB565 -DGIT_VERSION=\"$(GIT_VERSION)\"
|
||||
PLATCXXFLAGS = $(PLATCFLAGS)
|
||||
#PLATLDFLAGS = -shared -lm
|
||||
#PLATLDXFLAGS = -shared -lm
|
||||
@@ -81,13 +87,17 @@ LDXFLAGS = $(PLATLDXFLAGS) $(RETROLDXFLAGS)
|
||||
# Tuning
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
CFLAGS += -Od -Zi -D_DEBUG
|
||||
CXXFLAGS += -Od -Zi -D_DEBUG
|
||||
LDFLAGS += -DEBUG -DLL
|
||||
CFLAGS += -Od -Zi -D_DEBUG
|
||||
CXXFLAGS += -Od -Zi -D_DEBUG
|
||||
CFLAGS += -MTd
|
||||
CXXFLAGS += -MTd
|
||||
LDFLAGS += -DEBUG -DLL
|
||||
else
|
||||
CFLAGS += -O2 -DNDEBUG
|
||||
CXXFLAGS += -O2 -DNDEBUG
|
||||
LDFLAGS += -DLL
|
||||
CFLAGS += -O2 -DNDEBUG
|
||||
CXXFLAGS += -O2 -DNDEBUG
|
||||
CFLAGS += -MT
|
||||
CXXFLAGS += -MT
|
||||
LDFLAGS += -DLL
|
||||
endif
|
||||
|
||||
ifneq ($(LOG_PERFORMANCE),)
|
||||
|
||||
104
libretroBuildSystem/build/Makefile.windows_msvc2008_x86
Normal file
104
libretroBuildSystem/build/Makefile.windows_msvc2008_x86
Normal file
@@ -0,0 +1,104 @@
|
||||
##############
|
||||
# Works on hosts Linux
|
||||
# apt-get install mingw-w64
|
||||
|
||||
##########################
|
||||
# Checks the host platform
|
||||
|
||||
HOST_PLATFORM = linux
|
||||
ifeq ($(shell uname -a),)
|
||||
HOST_PLATFORM = windows
|
||||
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
||||
HOST_PLATFORM = windows
|
||||
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
||||
HOST_PLATFORM = darwin
|
||||
else ifneq ($(findstring win,$(shell uname -a)),)
|
||||
HOST_PLATFORM = windows
|
||||
endif
|
||||
|
||||
|
||||
####################################
|
||||
# Variable setup for Makefile.common
|
||||
|
||||
CORE_DIR ?= ..
|
||||
BUILD_DIR ?= .
|
||||
INCLUDES =
|
||||
|
||||
include $(BUILD_DIR)/Makefile.common
|
||||
|
||||
#################
|
||||
# Toolchain setup
|
||||
|
||||
CC = cl.exe
|
||||
CXX = cl.exe
|
||||
|
||||
PATH := $(shell IFS=$$'\n'; cygpath "$(VS90COMNTOOLS)../../VC/bin"):$(PATH)
|
||||
PATH := $(PATH):$(shell IFS=$$'\n'; cygpath "$(VS90COMNTOOLS)../IDE")
|
||||
INCLUDE := $(shell IFS=$$'\n'; cygpath "$(VS90COMNTOOLS)../../VC/include")
|
||||
LIB := $(shell IFS=$$'\n'; cygpath -w "$(VS90COMNTOOLS)../../VC/lib")
|
||||
|
||||
WindowsSdkDir := $(INETSDK)
|
||||
|
||||
export INCLUDE := $(INCLUDE);$(WindowsSdkDir)/Include
|
||||
export LIB := $(LIB);$(WindowsSdkDir);$(INETSDK)/Lib
|
||||
|
||||
############
|
||||
# Extensions
|
||||
|
||||
OBJEXT = .obj
|
||||
SOEXT = .dll
|
||||
|
||||
################
|
||||
# Platform setup
|
||||
|
||||
STATIC_LINKING = 0
|
||||
PLATDEFS =
|
||||
PLATCFLAGS = -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 -DWIN32 -D_WINDOWS -D_USRDLL -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -DFRONTEND_SUPPORTS_RGB565 -DGIT_VERSION=\"$(GIT_VERSION)\"
|
||||
PLATCXXFLAGS = $(PLATCFLAGS)
|
||||
#PLATLDFLAGS = -shared -lm
|
||||
#PLATLDXFLAGS = -shared -lm
|
||||
|
||||
################
|
||||
# libretro setup
|
||||
|
||||
RETRODEFS = -D__LIBRETRO__ -wd4710 -wd4711 -wd4127 -wd4204 -wd4242 -wd4244 -wd4820 -wd4214 -wd4100 -wd4738 -wd4706 -wd4668 -wd4245 -wd4255 -wd4389 -wd4305 -wd4113
|
||||
RETROCFLAGS =
|
||||
RETROCXXFLAGS =
|
||||
RETROLDFLAGS =
|
||||
RETROLDXFLAGS =
|
||||
|
||||
#################
|
||||
# Final variables
|
||||
|
||||
DEFINES = $(PLATDEFS) $(COREDEFINES) $(RETRODEFS)
|
||||
CFLAGS = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
|
||||
CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
|
||||
LDFLAGS = $(PLATLDFLAGS) $(RETROLDFLAGS)
|
||||
LDXFLAGS = $(PLATLDXFLAGS) $(RETROLDXFLAGS)
|
||||
|
||||
########
|
||||
# Tuning
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
CFLAGS += -Od -Zi -D_DEBUG
|
||||
CXXFLAGS += -Od -Zi -D_DEBUG
|
||||
CFLAGS += -MTd
|
||||
CXXFLAGS += -MTd
|
||||
LDFLAGS += -DEBUG -DLL
|
||||
else
|
||||
CFLAGS += -O2 -DNDEBUG
|
||||
CXXFLAGS += -O2 -DNDEBUG
|
||||
CFLAGS += -MT
|
||||
CXXFLAGS += -MT
|
||||
LDFLAGS += -DLL
|
||||
endif
|
||||
|
||||
ifneq ($(LOG_PERFORMANCE),)
|
||||
CFLAGS += -DLOG_PERFORMANCE
|
||||
CXXFLAGS += -DLOG_PERFORMANCE
|
||||
endif
|
||||
|
||||
###############
|
||||
# Include rules
|
||||
|
||||
include $(BUILD_DIR)/Makefile.rules
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user