mirror of
https://github.com/ares-emulator/ares.git
synced 2026-11-13 20:05:46 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9285b5289 | ||
|
|
4fc09438d2 | ||
|
|
a0a7a53b32 | ||
|
|
90f1425b8e | ||
|
|
9f4446061d | ||
|
|
32e58943f0 | ||
|
|
bc116e70e1 | ||
|
|
992e1c08cb | ||
|
|
9dcc1a39d3 | ||
|
|
9bbcf638dd | ||
|
|
d6c8d36770 | ||
|
|
c19cf47803 | ||
|
|
1d5a5aef83 | ||
|
|
64ec01bd57 | ||
|
|
82b1e88ec1 | ||
|
|
a592dc24d2 | ||
|
|
976b9828b6 | ||
|
|
7f625b6348 | ||
|
|
23a9d66924 | ||
|
|
e4e9044097 | ||
|
|
04a51df859 | ||
|
|
0c80c1e56b | ||
|
|
6f7618dc81 | ||
|
|
fdd7acb76b | ||
|
|
7ce2ffd010 | ||
|
|
bb22386f5f | ||
|
|
b372f65691 | ||
|
|
048d0e331d | ||
|
|
1323a627b3 | ||
|
|
b4ef96e4d6 | ||
|
|
8d2f88b745 | ||
|
|
ca7eee17a9 | ||
|
|
9ef81df3cf | ||
|
|
68af829f8e | ||
|
|
56862e0026 | ||
|
|
09d8af1c18 | ||
|
|
d20bc3c1b0 | ||
|
|
97c82119b5 | ||
|
|
b78228c5c0 | ||
|
|
5107ed00cb | ||
|
|
aeff8ec8f9 | ||
|
|
7640e1598c |
No files matched your search
@@ -10,6 +10,7 @@ pushd build
|
||||
# build; pipe output to render warnings neatly
|
||||
xcodebuild -configuration RelWithDebInfo \
|
||||
DEBUG_INFORMATION_FORMAT="dwarf-with-dsym" \
|
||||
-parallelizeTargets \
|
||||
2>&1 | xcbeautify --renderer github-actions
|
||||
|
||||
popd
|
||||
|
||||
+89
-252
@@ -1,10 +1,12 @@
|
||||
name: Build
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
tags: [ 'v*' ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
workflow_call:
|
||||
inputs:
|
||||
codesign:
|
||||
description: Enable codesigning
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
@@ -12,53 +14,57 @@ jobs:
|
||||
matrix:
|
||||
program:
|
||||
- ares
|
||||
config:
|
||||
- RelWithDebInfo
|
||||
platform:
|
||||
- name: windows
|
||||
- name: windows-x64
|
||||
os: windows-latest
|
||||
compiler: clang++
|
||||
windres: windres
|
||||
shell: 'msys2 {0}'
|
||||
msystem: clang64
|
||||
install: mingw-w64-clang-x86_64-clang mingw-w64-clang-x86_64-pkgconf mingw-w64-clang-x86_64-SDL2
|
||||
- name: windows-arm64
|
||||
install: mingw-w64-clang-x86_64-clang
|
||||
target-cmake-preset: windows-ci-mingw-native
|
||||
- name: windows-x64-gcc
|
||||
os: windows-latest
|
||||
compiler: clang++ --target=aarch64-w64-windows-gnu --sysroot=/clangarm64 -resource-dir=/clangarm64/lib/clang/$(basename "$(clang++ -print-resource-dir)")
|
||||
windres: windres --target=aarch64-w64-windows-gnu
|
||||
compiler: g++
|
||||
shell: 'msys2 {0}'
|
||||
msystem: clang64
|
||||
install: mingw-w64-clang-x86_64-clang mingw-w64-clang-aarch64-clang mingw-w64-clang-aarch64-pkgconf mingw-w64-clang-aarch64-SDL2
|
||||
msystem: mingw64
|
||||
install: mingw-w64-x86_64-toolchain
|
||||
target-cmake-preset: windows-ci-mingw-native
|
||||
- name: windows-clang-cl-x64
|
||||
os: windows-latest
|
||||
windres: rc
|
||||
shell: bash
|
||||
target-cmake-preset: windows-ci-cl-native
|
||||
- name: windows-clang-cl-arm64
|
||||
os: windows-latest
|
||||
windres: rc
|
||||
shell: bash
|
||||
target-cmake-preset: windows-ci-cl-cross
|
||||
native-cmake-preset: windows-ci-cl-native
|
||||
- name: windows-msvc-x64
|
||||
os: windows-latest
|
||||
compiler: clang++
|
||||
windres: llvm-rc
|
||||
windres: rc
|
||||
shell: bash
|
||||
msvc-arch: x64
|
||||
target-cmake-preset: windows-ci-msvc-native
|
||||
- name: windows-msvc-arm64
|
||||
os: windows-latest
|
||||
compiler: clang++ --target=aarch64-w64-windows-msvc
|
||||
windres: llvm-rc
|
||||
shell: bash
|
||||
msvc-arch: x64_arm64
|
||||
- name: windows-cl-x64
|
||||
os: windows-latest
|
||||
compiler: cl
|
||||
windres: rc
|
||||
shell: bash
|
||||
msvc-arch: x64
|
||||
- name: windows-cl-arm64
|
||||
os: windows-latest
|
||||
compiler: cl
|
||||
windres: rc
|
||||
shell: bash
|
||||
msvc-arch: x64_arm64
|
||||
target-cmake-preset: windows-ci-msvc-cross
|
||||
native-cmake-preset: windows-ci-msvc-native
|
||||
- name: macos-universal
|
||||
os: macos-15
|
||||
compiler: clang++
|
||||
shell: sh
|
||||
install: cmake ccache xcbeautify
|
||||
target-cmake-preset: macos-ci-universal
|
||||
- name: ubuntu
|
||||
os: ubuntu-latest
|
||||
compiler: g++
|
||||
shell: sh
|
||||
shell: bash
|
||||
install: cmake ccache ninja-build libsdl2-dev libgtk-3-dev libao-dev libopenal-dev
|
||||
target-cmake-preset: ubuntu-ci
|
||||
name: ${{ matrix.program }}-${{ matrix.platform.name }}
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
defaults:
|
||||
@@ -70,247 +76,78 @@ jobs:
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ${{ matrix.platform.msystem }}
|
||||
install: make ${{ matrix.platform.install }}
|
||||
install: make git cmake ccache ninja ${{ matrix.platform.install }}
|
||||
- name: "macOS: Import Certificate"
|
||||
if: runner.os == 'macOS' && inputs.codesign
|
||||
uses: apple-actions/import-codesign-certs@v3
|
||||
continue-on-error: ${{ secrets.MACOS_CERTIFICATE_NAME == '' }}
|
||||
with:
|
||||
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE_DATA }}
|
||||
p12-password: ${{ secrets.MACOS_CERTIFICATE_PASSPHRASE }}
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-tags: true
|
||||
fetch-depth: 0
|
||||
- name: Install Linux Dependencies
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update -y -qq
|
||||
sudo apt-get install libsdl2-dev libgtk-3-dev libao-dev libopenal-dev
|
||||
- name: "macOS: Import Certificate"
|
||||
if: runner.os == 'macOS' && github.event_name != 'pull_request'
|
||||
continue-on-error: ${{ github.repository != 'ares-emulator/ares' }}
|
||||
uses: wpilibsuite/import-signing-certificate@2ac4f44d28045073d23153256efbb4c4b2d8aa22 # Don't use rolling branch for security reasons
|
||||
with:
|
||||
certificate-data: ${{ secrets.MACOS_CERTIFICATE_DATA }}
|
||||
certificate-passphrase: ${{ secrets.MACOS_CERTIFICATE_PASSPHRASE }}
|
||||
keychain-name: ares-macos-keychain
|
||||
keychain-password: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v4
|
||||
- name: Install Windows Dependencies
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
export PATH="/c/Users/runneradmin/.cargo/bin:$PATH" # correct on windows-latest as of 2024-02-19
|
||||
if [[ ${{ matrix.platform.name }} == *-arm64 ]]; then
|
||||
rustup toolchain install nightly
|
||||
rustup default nightly
|
||||
rustup target add aarch64-pc-windows-msvc
|
||||
pushd thirdparty/librashader
|
||||
./build-librashader.sh aarch64-pc-windows-msvc
|
||||
popd
|
||||
else
|
||||
rustup toolchain install nightly
|
||||
rustup default nightly
|
||||
pushd thirdparty/librashader
|
||||
./build-librashader.sh
|
||||
popd
|
||||
fi
|
||||
- name: "macOS: recover MoltenVK cache"
|
||||
if: runner.os == 'macOS'
|
||||
uses: actions/cache@v4
|
||||
env:
|
||||
cache-name: moltenvk
|
||||
with:
|
||||
path: thirdparty/MoltenVK/MoltenVK
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('thirdparty/MoltenVK/HEAD') }}
|
||||
sudo apt-get install ${{ matrix.platform.install }}
|
||||
- name: Install macOS Dependencies
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
sudo xcode-select -s /Applications/Xcode_16.1.0.app/Contents/Developer
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.13
|
||||
brew install ninja cmake
|
||||
pip install --no-input setuptools
|
||||
rustup toolchain install nightly
|
||||
rustup default nightly
|
||||
rustup target add x86_64-apple-darwin
|
||||
rustup target add aarch64-apple-darwin
|
||||
pushd thirdparty/SDL
|
||||
./build-SDL.sh
|
||||
popd
|
||||
pushd thirdparty/MoltenVK
|
||||
./build-moltenvk.sh
|
||||
popd
|
||||
export MACOSX_DEPLOYMENT_TARGET=10.15
|
||||
pushd thirdparty/librashader
|
||||
./build-librashader.sh
|
||||
popd
|
||||
- name: Set up MSVC environment
|
||||
if: matrix.platform.msvc-arch != ''
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
arch: ${{ matrix.platform.msvc-arch }}
|
||||
- name: Make
|
||||
if: runner.os != 'macOS'
|
||||
run: ${MAKE:-make} -j4 -C desktop-ui build=optimized local=false compiler="${{ matrix.platform.compiler }}" windres="${{ matrix.platform.windres }}"
|
||||
- name: "macOS: Make universal app"
|
||||
if: runner.os == 'macOS'
|
||||
run: scripts/macos-make-universal.sh build=optimized local=false
|
||||
brew install ${{ matrix.platform.install }}
|
||||
- name: "Build: Linux"
|
||||
if: runner.os == 'Linux'
|
||||
run: .github/scripts/build_ubuntu.sh
|
||||
env:
|
||||
MAKEFLAGS: -j3
|
||||
MACOS_CERTIFICATE_NAME: ${{ secrets.MACOS_CERTIFICATE_NAME }}
|
||||
MACOS_KEYCHAIN_NAME: ares-macos-keychain
|
||||
MACOS_KEYCHAIN_PASSWORD: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}
|
||||
TARGET_PRESET: ${{ matrix.platform.target-cmake-preset }}
|
||||
- name: "Build: Windows"
|
||||
if: runner.os != 'macOS' && runner.os != 'Linux'
|
||||
run: .github/scripts/build_windows.sh
|
||||
env:
|
||||
CROSS_COMPILE: ${{ matrix.platform.native-cmake-preset != '' }}
|
||||
NATIVE_PRESET: ${{ matrix.platform.native-cmake-preset }}
|
||||
TARGET_PRESET: ${{ matrix.platform.target-cmake-preset }}
|
||||
- name: "Windows: sign"
|
||||
if: runner.os == 'Windows' && github.event_name != 'pull_request'
|
||||
if: runner.os == 'Windows' && inputs.codesign
|
||||
uses: DanaBear/code-sign-action@98c79121b376beab8d6a9484f445089db4461bca
|
||||
with:
|
||||
certificate: '${{ secrets.WIN_CERTIFICATE }}'
|
||||
password: '${{ secrets.WIN_PASSWORD }}'
|
||||
certificatesha1: '${{ secrets.WIN_CERTHASH }}'
|
||||
certificatename: '${{ secrets.WIN_CERTNAME }}'
|
||||
folder: 'desktop-ui/out'
|
||||
folder: 'build/desktop-ui/rundir/'
|
||||
timestampUrl: 'http://timestamp.digicert.com'
|
||||
- name: "macOS: notarize"
|
||||
if: false
|
||||
continue-on-error: ${{ github.repository != 'ares-emulator/ares' }}
|
||||
run: |
|
||||
ditto -c -k --keepParent desktop-ui/out/ares.app /tmp/ares.zip
|
||||
xcrun notarytool submit /tmp/ares.zip --apple-id "$MACOS_NOTARIZATION_USERNAME" --password "$MACOS_NOTARIZATION_PASSWORD" --team-id "$MACOS_NOTARIZATION_TEAMID" --wait
|
||||
xcrun stapler staple desktop-ui/out/ares.app
|
||||
- name: "Build: macOS"
|
||||
if: runner.os == 'macOS'
|
||||
run: .github/scripts/build_macos.sh
|
||||
env:
|
||||
MACOS_NOTARIZATION_USERNAME: ${{ secrets.MACOS_NOTARIZATION_USERNAME }}
|
||||
MACOS_NOTARIZATION_PASSWORD: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}
|
||||
TARGET_PRESET: ${{ matrix.platform.target-cmake-preset }}
|
||||
MACOS_CERTIFICATE_NAME: ${{ secrets.MACOS_CERTIFICATE_NAME }}
|
||||
MACOS_NOTARIZATION_TEAMID: ${{ secrets.MACOS_NOTARIZATION_TEAMID }}
|
||||
- name: Upload
|
||||
- name: Upload Build (Windows)
|
||||
if: runner.os != 'macOS' && runner.os != 'Linux'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.program }}-${{ matrix.platform.name }}
|
||||
path: desktop-ui/out/*
|
||||
|
||||
|
||||
release:
|
||||
if: false
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- build
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
path: build/desktop-ui/rundir/*
|
||||
- name: Upload Build (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: 'src'
|
||||
- name: Download Artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
name: ${{ matrix.program }}-${{ matrix.platform.name }}
|
||||
path: build/desktop-ui/RelWithDebInfo/
|
||||
- name: Upload Debug Symbols (Windows)
|
||||
if: runner.os != 'macOS' && runner.os != 'Linux'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: 'bin'
|
||||
- name: Package Artifacts
|
||||
run: |
|
||||
set -eu
|
||||
case ${GITHUB_REF} in
|
||||
refs/tags/*) suffix="-${GITHUB_REF#refs/tags/}" ;;
|
||||
refs/heads/master) suffix="-nightly" ;;
|
||||
*) suffix="" ;;
|
||||
esac
|
||||
|
||||
srcdir="${GITHUB_WORKSPACE}/src"
|
||||
bindir="${GITHUB_WORKSPACE}/bin"
|
||||
|
||||
# Hack: Workaround for GitHub artifacts losing attributes.
|
||||
chmod +x ${bindir}/ares-macos-universal/ares.app/Contents/MacOS/ares
|
||||
|
||||
for package in windows windows-msvc-arm64 macos-universal
|
||||
do
|
||||
mkdir "${package}"
|
||||
cd "${package}"
|
||||
|
||||
# Package ares.
|
||||
outdir=ares${suffix}
|
||||
mkdir ${outdir}
|
||||
cp -ar ${bindir}/ares-${package}/* ${outdir}
|
||||
zip -r ../ares-${package}.zip ${outdir}
|
||||
|
||||
cd -
|
||||
done
|
||||
- name: Create Release
|
||||
id: release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -eu
|
||||
github_rest()
|
||||
{
|
||||
local method="${1}"
|
||||
local url="https://api.github.com${2}"
|
||||
shift 2
|
||||
>&2 echo "${method} ${url}"
|
||||
curl \
|
||||
--fail \
|
||||
-H "Accept: application/vnd.github.v3+json" \
|
||||
-H "Authorization: token ${GITHUB_TOKEN}" \
|
||||
-X "${method}" \
|
||||
"${url}" \
|
||||
"$@"
|
||||
}
|
||||
github_get_release_id_for_tag()
|
||||
{
|
||||
payload=$(github_rest GET "/repos/${GITHUB_REPOSITORY}/releases/tags/${1}") || return
|
||||
echo "${payload}" | jq .id
|
||||
}
|
||||
github_delete_release_by_id()
|
||||
{
|
||||
github_rest DELETE "/repos/${GITHUB_REPOSITORY}/releases/${1}"
|
||||
}
|
||||
github_create_release()
|
||||
{
|
||||
local payload="{
|
||||
\"tag_name\": \"${1}\",
|
||||
\"target_commitish\": \"${2}\",
|
||||
\"name\": \"${3}\",
|
||||
\"body\": \"${4}\",
|
||||
\"draft\": ${5},
|
||||
\"prerelease\": ${6}
|
||||
}"
|
||||
github_rest POST "/repos/${GITHUB_REPOSITORY}/releases" -d "${payload}"
|
||||
}
|
||||
make_nightly_release()
|
||||
{
|
||||
github_create_release \
|
||||
nightly \
|
||||
"${GITHUB_SHA}" \
|
||||
"ares nightly $(date +"%Y-%m-%d")" \
|
||||
"Auto-generated nightly release on $(date -u +"%Y-%m-%d %T %Z")" \
|
||||
false \
|
||||
true
|
||||
}
|
||||
make_version_release()
|
||||
{
|
||||
github_create_release \
|
||||
"${1}" \
|
||||
"${GITHUB_SHA}" \
|
||||
"ares ${1}" \
|
||||
"This is ares ${1}, released on $(date +"%Y-%m-%d")." \
|
||||
false \
|
||||
false
|
||||
}
|
||||
case ${GITHUB_REF} in
|
||||
refs/tags/*)
|
||||
# Create a new version release using the current revision.
|
||||
echo "UPLOAD_URL=$(make_version_release ${GITHUB_REF#refs/tags/} | jq -r .upload_url)" >> $GITHUB_ENV
|
||||
;;
|
||||
refs/heads/master)
|
||||
# Check for an existing nightly release.
|
||||
{ release_id=$(github_get_release_id_for_tag nightly); status=$?; } || true
|
||||
# Delete existing nightly release if it exists.
|
||||
case ${status} in
|
||||
0) github_delete_release_by_id "${release_id}" ;;
|
||||
22) >&2 echo "No current nightly release; skipping tag deletion." ;;
|
||||
*) >&2 echo "API call failed unexpectedly." && exit 1 ;;
|
||||
esac
|
||||
# Create a new nightly release using the current revision.
|
||||
echo "UPLOAD_URL=$(make_nightly_release | jq -r .upload_url)" >> $GITHUB_ENV
|
||||
;;
|
||||
esac
|
||||
- name: Upload ares-windows
|
||||
uses: actions/upload-release-asset@v1
|
||||
env: { GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' }
|
||||
with: { upload_url: '${{ env.UPLOAD_URL }}', asset_path: 'ares-windows.zip', asset_name: 'ares-windows.zip', asset_content_type: 'application/zip' }
|
||||
- name: Upload ares-windows-msvc-arm64
|
||||
uses: actions/upload-release-asset@v1
|
||||
env: { GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' }
|
||||
with: { upload_url: '${{ env.UPLOAD_URL }}', asset_path: 'ares-windows-msvc-arm64.zip', asset_name: 'ares-windows-msvc-arm64.zip', asset_content_type: 'application/zip' }
|
||||
- name: Upload ares-macos-universal
|
||||
uses: actions/upload-release-asset@v1
|
||||
env: { GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' }
|
||||
with: { upload_url: '${{ env.UPLOAD_URL }}', asset_path: 'ares-macos-universal.zip', asset_name: 'ares-macos-universal.zip', asset_content_type: 'application/zip' }
|
||||
# - name: Upload ares-ubuntu
|
||||
# uses: actions/upload-release-asset@v1
|
||||
# env: { GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' }
|
||||
# with: { upload_url: '${{ env.UPLOAD_URL }}', asset_path: 'ares-ubuntu.zip', asset_name: 'ares-ubuntu.zip', asset_content_type: 'application/zip' }
|
||||
name: ${{ matrix.program }}-${{ matrix.platform.name }}-PDBs
|
||||
path: build/PDBs/*
|
||||
- name: Upload Debug Symbols (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.program }}-${{ matrix.platform.name }}-dSYMs
|
||||
path: build/dSYMs/*
|
||||
@@ -1,153 +0,0 @@
|
||||
name: Build (New)
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
codesign:
|
||||
description: Enable codesigning
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
program:
|
||||
- ares
|
||||
config:
|
||||
- RelWithDebInfo
|
||||
platform:
|
||||
- name: windows-x64
|
||||
os: windows-latest
|
||||
compiler: clang++
|
||||
shell: 'msys2 {0}'
|
||||
msystem: clang64
|
||||
install: mingw-w64-clang-x86_64-clang
|
||||
target-cmake-preset: windows-ci-mingw-native
|
||||
- name: windows-x64-gcc
|
||||
os: windows-latest
|
||||
compiler: g++
|
||||
shell: 'msys2 {0}'
|
||||
msystem: mingw64
|
||||
install: mingw-w64-x86_64-toolchain
|
||||
target-cmake-preset: windows-ci-mingw-native
|
||||
- name: windows-clang-cl-x64
|
||||
os: windows-latest
|
||||
windres: rc
|
||||
shell: bash
|
||||
target-cmake-preset: windows-ci-cl-native
|
||||
- name: windows-clang-cl-arm64
|
||||
os: windows-latest
|
||||
windres: rc
|
||||
shell: bash
|
||||
target-cmake-preset: windows-ci-cl-cross
|
||||
native-cmake-preset: windows-ci-cl-native
|
||||
- name: windows-msvc-x64
|
||||
os: windows-latest
|
||||
windres: rc
|
||||
shell: bash
|
||||
target-cmake-preset: windows-ci-msvc-native
|
||||
- name: windows-msvc-arm64
|
||||
os: windows-latest
|
||||
windres: rc
|
||||
shell: bash
|
||||
target-cmake-preset: windows-ci-msvc-cross
|
||||
native-cmake-preset: windows-ci-msvc-native
|
||||
- name: macos-universal
|
||||
os: macos-15
|
||||
compiler: clang++
|
||||
shell: sh
|
||||
install: cmake ccache xcbeautify
|
||||
target-cmake-preset: macos-ci-universal
|
||||
- name: ubuntu
|
||||
os: ubuntu-latest
|
||||
compiler: g++
|
||||
shell: bash
|
||||
install: cmake ccache ninja-build libsdl2-dev libgtk-3-dev libao-dev libopenal-dev
|
||||
target-cmake-preset: ubuntu-ci
|
||||
name: ${{ matrix.program }}-${{ matrix.platform.name }}
|
||||
runs-on: ${{ matrix.platform.os }}
|
||||
defaults:
|
||||
run:
|
||||
shell: ${{ matrix.platform.shell }}
|
||||
steps:
|
||||
- name: Install MSYS2 Dependencies
|
||||
if: matrix.platform.shell == 'msys2 {0}'
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ${{ matrix.platform.msystem }}
|
||||
install: make git cmake ccache ninja ${{ matrix.platform.install }}
|
||||
- name: "macOS: Import Certificate"
|
||||
if: runner.os == 'macOS' && inputs.codesign
|
||||
uses: apple-actions/import-codesign-certs@v3
|
||||
continue-on-error: ${{ !inputs.codesign }}
|
||||
with:
|
||||
p12-file-base64: ${{ secrets.MACOS_CERTIFICATE_DATA }}
|
||||
p12-password: ${{ secrets.MACOS_CERTIFICATE_PASSPHRASE }}
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-tags: true
|
||||
fetch-depth: 0
|
||||
- name: Install Linux Dependencies
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update -y -qq
|
||||
sudo apt-get install ${{ matrix.platform.install }}
|
||||
- name: Install macOS Dependencies
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
brew install ${{ matrix.platform.install }}
|
||||
- name: "Build: Linux"
|
||||
if: runner.os == 'Linux'
|
||||
run: .github/scripts/build_ubuntu.sh
|
||||
env:
|
||||
TARGET_PRESET: ${{ matrix.platform.target-cmake-preset }}
|
||||
- name: "Build: Windows"
|
||||
if: runner.os != 'macOS' && runner.os != 'Linux'
|
||||
run: .github/scripts/build_windows.sh
|
||||
env:
|
||||
CROSS_COMPILE: ${{ matrix.platform.native-cmake-preset != '' }}
|
||||
NATIVE_PRESET: ${{ matrix.platform.native-cmake-preset }}
|
||||
TARGET_PRESET: ${{ matrix.platform.target-cmake-preset }}
|
||||
- name: "Windows: sign"
|
||||
if: runner.os == 'Windows' && inputs.codesign
|
||||
uses: DanaBear/code-sign-action@98c79121b376beab8d6a9484f445089db4461bca
|
||||
with:
|
||||
certificate: '${{ secrets.WIN_CERTIFICATE }}'
|
||||
password: '${{ secrets.WIN_PASSWORD }}'
|
||||
certificatesha1: '${{ secrets.WIN_CERTHASH }}'
|
||||
certificatename: '${{ secrets.WIN_CERTNAME }}'
|
||||
folder: 'build/desktop-ui/rundir/'
|
||||
timestampUrl: 'http://timestamp.digicert.com'
|
||||
- name: "Build: macOS"
|
||||
if: runner.os == 'macOS'
|
||||
run: .github/scripts/build_macos.sh
|
||||
env:
|
||||
TARGET_PRESET: ${{ matrix.platform.target-cmake-preset }}
|
||||
MACOS_CERTIFICATE_NAME: ${{ secrets.MACOS_CERTIFICATE_NAME }}
|
||||
MACOS_NOTARIZATION_TEAMID: ${{ secrets.MACOS_NOTARIZATION_TEAMID }}
|
||||
- name: Upload Build (Windows)
|
||||
if: runner.os != 'macOS' && runner.os != 'Linux'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.program }}-${{ matrix.platform.name }}
|
||||
path: build/desktop-ui/rundir/*
|
||||
- name: Upload Build (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.program }}-${{ matrix.platform.name }}
|
||||
path: build/desktop-ui/RelWithDebInfo/
|
||||
- name: Upload Debug Symbols (Windows)
|
||||
if: runner.os != 'macOS' && runner.os != 'Linux'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.program }}-${{ matrix.platform.name }}-PDBs
|
||||
path: build/PDBs/*
|
||||
- name: Upload Debug Symbols (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.program }}-${{ matrix.platform.name }}-dSYMs
|
||||
path: build/dSYMs/*
|
||||
@@ -12,6 +12,6 @@ concurrency:
|
||||
jobs:
|
||||
build-project:
|
||||
name: Build
|
||||
uses: ./.github/workflows/build_new.yml
|
||||
uses: ./.github/workflows/build.yml
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -1,8 +1,6 @@
|
||||
name: Push
|
||||
on:
|
||||
push:
|
||||
branches: [ '*' ]
|
||||
tags: [ 'v*' ]
|
||||
push
|
||||
concurrency:
|
||||
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
|
||||
cancel-in-progress: true
|
||||
@@ -11,7 +9,7 @@ permissions:
|
||||
jobs:
|
||||
build:
|
||||
name: Build ares
|
||||
uses: ./.github/workflows/build_new.yml
|
||||
uses: ./.github/workflows/build.yml
|
||||
secrets: inherit
|
||||
with:
|
||||
codesign: true
|
||||
|
||||
@@ -48,12 +48,19 @@ jobs:
|
||||
description="This is ares ${GITHUB_REF_NAME}, released on ${now}."
|
||||
echo "description=${description}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Update Git Tag
|
||||
if: steps.check.outputs.tag == 'nightly'
|
||||
id: update-tag
|
||||
run: |
|
||||
git -C src tag -f ${{ steps.check.outputs.tag }}
|
||||
git -C src push -f origin ${{ steps.check.outputs.tag }}
|
||||
|
||||
- name: Create Release 🛫
|
||||
id: create_release
|
||||
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
|
||||
with:
|
||||
draft: ${{ github.ref != 'refs/heads/master' }}
|
||||
prerelease: ${{ steps.check.outputs.tag == 'nightly' }}
|
||||
tag_name: ${{ steps.check.outputs.tag }}
|
||||
name: ares ${{ steps.check.outputs.versionName }}
|
||||
body: ${{ steps.check.outputs.description }}
|
||||
|
||||
+4
-4
@@ -26,10 +26,6 @@
|
||||
!CMakeLists.txt
|
||||
!CMakePresets.json
|
||||
|
||||
thirdparty/SDL/SDL
|
||||
thirdparty/SDL/libSDL2-2.0.0.dylib
|
||||
desktop-ui/out
|
||||
desktop-ui/obj
|
||||
ruby/video/metal/shaders.metallib
|
||||
ruby/video/metal/shaders.ir
|
||||
ares/ares/resource/resource.cpp
|
||||
@@ -38,5 +34,9 @@ hiro/resource/resource.cpp
|
||||
hiro/resource/resource.hpp
|
||||
desktop-ui/resource/resource.cpp
|
||||
desktop-ui/resource/resource.hpp
|
||||
mia/resource/resource.cpp
|
||||
mia/resource/resource.hpp
|
||||
tests/arm7tdmi/tests
|
||||
tests/m68000/tests
|
||||
thirdparty/libchdr/deps/zlib-*/zconf.h
|
||||
thirdparty/libchdr/deps/zlib-*/zconf.h.included
|
||||
+1
-1
@@ -81,7 +81,7 @@
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"cacheVariables": {
|
||||
"CMAKE_OSX_ARCHITECTURES": {"type": "STRING", "value": "x86_64;arm64"},
|
||||
"CMAKE_OSX_DEPLOYMENT_TARGET": {"type": "STRING", "value": "10.13"},
|
||||
"CMAKE_OSX_DEPLOYMENT_TARGET": {"type": "STRING", "value": "10.15"},
|
||||
"ARES_CODESIGN_IDENTITY": {"type": "STRING", "value": "$penv{MACOS_CERTIFICATE_NAME}"},
|
||||
"ARES_CODESIGN_TEAM": {"type": "STRING", "value": "$penv{MACOS_NOTARIZATION_TEAMID}"},
|
||||
"ENABLE_CCACHE": true,
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
targets = all clean install uninstall verbose
|
||||
|
||||
$(targets):
|
||||
@$(MAKE) -C desktop-ui $@
|
||||
|
||||
.PHONY: $(targets)
|
||||
@@ -1,7 +1,7 @@
|
||||
----------------------------------------------------------------------
|
||||
ares
|
||||
|
||||
Copyright (c) 2004-2024 ares team, Near et al
|
||||
Copyright (c) 2004-2025 ares team, Near et al
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
|
||||
@@ -14,21 +14,19 @@ Official releases are available from
|
||||
Nightly Builds
|
||||
--------------
|
||||
|
||||
Automated, untested builds of ares are available for Windows and macOS as a [pre-release](https://github.com/higan-emu/ares/releases/tag/nightly).
|
||||
Automated, untested builds of ares are available for Windows and macOS as a [pre-release](https://github.com/ares-emulator/ares/releases/tag/nightly).
|
||||
Only the latest nightly build is kept.
|
||||
|
||||
Building ares
|
||||
-------------
|
||||
|
||||
Build instructions are available on the ares wiki. See build instructions for:
|
||||
ares supports building on Windows, macOS, and various Linux/BSD distributions. See build instructions for:
|
||||
|
||||
* [Windows](https://github.com/ares-emulator/ares/wiki/Build-Instructions-For-Windows)
|
||||
* [macOS](https://github.com/ares-emulator/ares/wiki/Build-Instructions-For-macOS)
|
||||
* [Linux](https://github.com/ares-emulator/ares/wiki/Build-Instructions-For-Linux)
|
||||
* [BSD](https://github.com/ares-emulator/ares/wiki/Build-Instructions-For-BSD)
|
||||
|
||||
For legacy Makefile build instructions, see [here](https://github.com/ares-emulator/ares/wiki/Legacy-Build-Instructions).
|
||||
|
||||
Command-line options
|
||||
--------------------
|
||||
|
||||
@@ -40,7 +38,7 @@ Usage: ./ares [options] game(s)
|
||||
--help Displays available options and exit
|
||||
--fullscreen Start in full screen mode
|
||||
--system system Specify the system name
|
||||
--shader shader Specify GLSL shader name to load (requires OpenGL driver)
|
||||
--shader shader Specify a slang shader to load (requires OpenGL or Metal)
|
||||
--setting name=value Specify a value for a setting
|
||||
--dump-all-settings Show a list of all existing settings and exit
|
||||
--no-file-prompt Do not prompt to load (optional) additional roms (eg: 64DD)
|
||||
|
||||
+3
-1
@@ -1,5 +1,7 @@
|
||||
add_library(ares STATIC ares/ares.cpp ares/memory/fixed-allocator.cpp)
|
||||
|
||||
configure_file(ares/ares.cpp.in ares/ares.cpp @ONLY)
|
||||
|
||||
add_library(ares::ares ALIAS ares)
|
||||
|
||||
option(ARES_PROFILE_ACCURACY "Build to prefer emulation accuracy over performance in certain specific areas" OFF)
|
||||
@@ -29,7 +31,7 @@ endif()
|
||||
|
||||
target_sources(
|
||||
ares
|
||||
PRIVATE ares/ares.cpp ares/ares.hpp ares/inline.hpp ares/platform.hpp ares/random.hpp ares/types.hpp
|
||||
PRIVATE ares/ares.cpp ares/ares.cpp.in ares/ares.hpp ares/inline.hpp ares/platform.hpp ares/random.hpp ares/types.hpp
|
||||
)
|
||||
|
||||
target_sources(
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
ifeq ($(platform),windows)
|
||||
options += $(call lib,uuid kernel32 user32 gdi32 comctl32 comdlg32 shell32)
|
||||
else ifeq ($(platform),macos)
|
||||
else ifneq ($(filter $(platform),linux bsd),)
|
||||
options += -Wl,-export-dynamic
|
||||
options += -lX11 -lXext
|
||||
else
|
||||
$(error "ares is a library and cannot be built directly.")
|
||||
endif
|
||||
|
||||
ares.objects := ares ares-fixed-allocator
|
||||
|
||||
$(object.path)/ares.o: $(ares.path)/ares/ares.cpp
|
||||
$(object.path)/ares-fixed-allocator.o: $(ares.path)/ares/memory/fixed-allocator.cpp
|
||||
|
||||
ifeq ($(vulkan),true)
|
||||
flags += -DVULKAN
|
||||
endif
|
||||
|
||||
ifeq ($(profile),accuracy)
|
||||
flags += -DPROFILE_ACCURACY
|
||||
endif
|
||||
|
||||
ifeq ($(profile),performance)
|
||||
flags += -DPROFILE_PERFORMANCE
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),a26),)
|
||||
include $(ares.path)/a26/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),fc),)
|
||||
include $(ares.path)/fc/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),sfc),)
|
||||
include $(ares.path)/sfc/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),n64),)
|
||||
include $(ares.path)/n64/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),sg),)
|
||||
include $(ares.path)/sg/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),ms),)
|
||||
include $(ares.path)/ms/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),md),)
|
||||
include $(ares.path)/md/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),saturn),)
|
||||
include $(ares.path)/saturn/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),ps1),)
|
||||
include $(ares.path)/ps1/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),pce),)
|
||||
include $(ares.path)/pce/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),msx),)
|
||||
include $(ares.path)/msx/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),cv),)
|
||||
include $(ares.path)/cv/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),myvision),)
|
||||
include $(ares.path)/myvision/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),gb),)
|
||||
include $(ares.path)/gb/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),gba),)
|
||||
include $(ares.path)/gba/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),ws),)
|
||||
include $(ares.path)/ws/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),ng),)
|
||||
include $(ares.path)/ng/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),ngp),)
|
||||
include $(ares.path)/ngp/GNUmakefile
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(cores),spec),)
|
||||
include $(ares.path)/spec/GNUmakefile
|
||||
endif
|
||||
|
||||
include $(ares.path)/component/GNUmakefile
|
||||
|
||||
flags += $(foreach c,$(call strupper,$(cores)),-DCORE_$c)
|
||||
|
||||
ares.objects := $(ares.objects:%=$(object.path)/%.o)
|
||||
@@ -1,15 +0,0 @@
|
||||
ares.components += mos6502
|
||||
|
||||
ares.objects += ares-a26-system
|
||||
ares.objects += ares-a26-controller
|
||||
ares.objects += ares-a26-cartridge
|
||||
ares.objects += ares-a26-cpu
|
||||
ares.objects += ares-a26-tia
|
||||
ares.objects += ares-a26-riot
|
||||
|
||||
$(object.path)/ares-a26-system.o: $(ares.path)/a26/system/system.cpp
|
||||
$(object.path)/ares-a26-controller.o: $(ares.path)/a26/controller/controller.cpp
|
||||
$(object.path)/ares-a26-cartridge.o: $(ares.path)/a26/cartridge/cartridge.cpp
|
||||
$(object.path)/ares-a26-cpu.o: $(ares.path)/a26/cpu/cpu.cpp
|
||||
$(object.path)/ares-a26-tia.o: $(ares.path)/a26/tia/tia.cpp
|
||||
$(object.path)/ares-a26-riot.o: $(ares.path)/a26/riot/riot.cpp
|
||||
@@ -9,13 +9,13 @@ namespace ares {
|
||||
Platform* platform = nullptr;
|
||||
bool _runAhead = false;
|
||||
|
||||
const string Name = "ares";
|
||||
const string Version = "142";
|
||||
const string Copyright = "ares team, Near";
|
||||
const string Name = "@ARES_NAME@";
|
||||
const string Version = "@ARES_VERSION@";
|
||||
const string Copyright = "@ARES_LEGAL_COPYRIGHT_SHORT@";
|
||||
const string License = "ISC";
|
||||
const string LicenseURI = "https://opensource.org/licenses/ISC";
|
||||
const string Website = "ares-emu.net";
|
||||
const string WebsiteURI = "https://ares-emu.net/";
|
||||
const string Website = "@ARES_WEBSITE@";
|
||||
const string WebsiteURI = "https://@ARES_WEBSITE@/";
|
||||
const u32 SerializerSignature = 0x31545342; //"BST1" (little-endian)
|
||||
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
build := stable
|
||||
nall.path := ../../../nall
|
||||
include $(nall.path)/GNUmakefile
|
||||
|
||||
all:
|
||||
sourcery resource.bml resource.cpp resource.hpp
|
||||
|
||||
clean:
|
||||
$(call delete,resource.cpp)
|
||||
$(call delete,resource.hpp)
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,34 +0,0 @@
|
||||
namespace Resource {
|
||||
namespace Ares {
|
||||
extern const unsigned char Icon1x[6562];
|
||||
extern const unsigned char Icon2x[9662];
|
||||
extern const unsigned char Logo1x[11533];
|
||||
extern const unsigned char Logo2x[18991];
|
||||
}
|
||||
namespace Sprite {
|
||||
namespace SuperFamicom {
|
||||
extern const unsigned char CrosshairBlue[332];
|
||||
extern const unsigned char CrosshairGreen[329];
|
||||
extern const unsigned char CrosshairRed[342];
|
||||
}
|
||||
namespace WonderSwan {
|
||||
extern const unsigned char Auxiliary0[117];
|
||||
extern const unsigned char Auxiliary1[134];
|
||||
extern const unsigned char Auxiliary2[136];
|
||||
extern const unsigned char Headphones[167];
|
||||
extern const unsigned char Initialized[136];
|
||||
extern const unsigned char LowBattery[144];
|
||||
extern const unsigned char Orientation0[148];
|
||||
extern const unsigned char Orientation1[150];
|
||||
extern const unsigned char PoweredOn[155];
|
||||
extern const unsigned char Sleeping[154];
|
||||
extern const unsigned char VolumeA0[129];
|
||||
extern const unsigned char VolumeA1[142];
|
||||
extern const unsigned char VolumeA2[146];
|
||||
extern const unsigned char VolumeB0[125];
|
||||
extern const unsigned char VolumeB1[137];
|
||||
extern const unsigned char VolumeB2[148];
|
||||
extern const unsigned char VolumeB3[153];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
ares.components := $(call unique,$(ares.components))
|
||||
|
||||
ares.objects += $(if $(findstring ay38910,$(ares.components)),ares-audio-ay38910)
|
||||
ares.objects += $(if $(findstring msm5205,$(ares.components)),ares-audio-msm5205)
|
||||
ares.objects += $(if $(findstring sn76489,$(ares.components)),ares-audio-sn76489)
|
||||
ares.objects += $(if $(findstring t6w28,$(ares.components)),ares-audio-t6w28)
|
||||
ares.objects += $(if $(findstring ym2149,$(ares.components)),ares-audio-ym2149)
|
||||
ares.objects += $(if $(findstring ym2413,$(ares.components)),ares-audio-ym2413)
|
||||
ares.objects += $(if $(findstring ym2610,$(ares.components)),ares-audio-ym2610)
|
||||
ares.objects += $(if $(findstring ym2612,$(ares.components)),ares-audio-ym2612)
|
||||
|
||||
ares.objects += $(if $(findstring m24c,$(ares.components)),ares-eeprom-m24c)
|
||||
ares.objects += $(if $(findstring m93lcx6,$(ares.components)),ares-eeprom-m93lcx6)
|
||||
|
||||
ares.objects += $(if $(findstring i8255,$(ares.components)),ares-io-i8255)
|
||||
|
||||
ares.objects += $(if $(findstring arm7tdmi,$(ares.components)),ares-processor-arm7tdmi)
|
||||
ares.objects += $(if $(findstring gsu,$(ares.components)),ares-processor-gsu)
|
||||
ares.objects += $(if $(findstring hg51b,$(ares.components)),ares-processor-hg51b)
|
||||
ares.objects += $(if $(findstring huc6280,$(ares.components)),ares-processor-huc6280)
|
||||
ares.objects += $(if $(findstring i8080,$(ares.components)),ares-processor-i8080)
|
||||
ares.objects += $(if $(findstring m68hc05,$(ares.components)),ares-processor-m68hc05)
|
||||
ares.objects += $(if $(findstring m68000,$(ares.components)),ares-processor-m68000)
|
||||
ares.objects += $(if $(findstring mos6502,$(ares.components)),ares-processor-mos6502)
|
||||
ares.objects += $(if $(findstring sh2,$(ares.components)),ares-processor-sh2)
|
||||
ares.objects += $(if $(findstring sm5k,$(ares.components)),ares-processor-sm5k)
|
||||
ares.objects += $(if $(findstring sm83,$(ares.components)),ares-processor-sm83)
|
||||
ares.objects += $(if $(findstring spc700,$(ares.components)),ares-processor-spc700)
|
||||
ares.objects += $(if $(findstring ssp1601,$(ares.components)),ares-processor-ssp1601)
|
||||
ares.objects += $(if $(findstring tlcs900h,$(ares.components)),ares-processor-tlcs900h)
|
||||
ares.objects += $(if $(findstring upd96050,$(ares.components)),ares-processor-upd96050)
|
||||
ares.objects += $(if $(findstring v30mz,$(ares.components)),ares-processor-v30mz)
|
||||
ares.objects += $(if $(findstring wdc65816,$(ares.components)),ares-processor-wdc65816)
|
||||
ares.objects += $(if $(findstring z80,$(ares.components)),ares-processor-z80)
|
||||
|
||||
ares.objects += $(if $(findstring sst39sf0x0,$(ares.components)),ares-flash-sst39sf0x0)
|
||||
|
||||
ares.objects += $(if $(findstring tms9918,$(ares.components)),ares-video-tms9918)
|
||||
ares.objects += $(if $(findstring v9938,$(ares.components)),ares-video-v9938)
|
||||
|
||||
$(object.path)/ares-audio-ay38910.o: $(ares.path)/component/audio/ay38910/ay38910.cpp
|
||||
$(object.path)/ares-audio-msm5205.o: $(ares.path)/component/audio/msm5205/msm5205.cpp
|
||||
$(object.path)/ares-audio-sn76489.o: $(ares.path)/component/audio/sn76489/sn76489.cpp
|
||||
$(object.path)/ares-audio-t6w28.o: $(ares.path)/component/audio/t6w28/t6w28.cpp
|
||||
$(object.path)/ares-audio-ym2149.o: $(ares.path)/component/audio/ym2149/ym2149.cpp
|
||||
$(object.path)/ares-audio-ym2413.o: $(ares.path)/component/audio/ym2413/ym2413.cpp
|
||||
$(object.path)/ares-audio-ym2612.o: $(ares.path)/component/audio/ym2612/ym2612.cpp
|
||||
|
||||
$(object.path)/ares-eeprom-m24c.o: $(ares.path)/component/eeprom/m24c/m24c.cpp
|
||||
$(object.path)/ares-eeprom-m93lcx6.o: $(ares.path)/component/eeprom/m93lcx6/m93lcx6.cpp
|
||||
|
||||
$(object.path)/ares-io-i8255.o: $(ares.path)/component/io/i8255/i8255.cpp
|
||||
|
||||
$(object.path)/ares-processor-arm7tdmi.o: $(ares.path)/component/processor/arm7tdmi/arm7tdmi.cpp
|
||||
$(object.path)/ares-processor-gsu.o: $(ares.path)/component/processor/gsu/gsu.cpp
|
||||
$(object.path)/ares-processor-hg51b.o: $(ares.path)/component/processor/hg51b/hg51b.cpp
|
||||
$(object.path)/ares-processor-huc6280.o: $(ares.path)/component/processor/huc6280/huc6280.cpp
|
||||
$(object.path)/ares-processor-i8080.o: $(ares.path)/component/processor/i8080/i8080.cpp
|
||||
$(object.path)/ares-processor-m68hc05.o: $(ares.path)/component/processor/m68hc05/m68hc05.cpp
|
||||
$(object.path)/ares-processor-m68000.o: $(ares.path)/component/processor/m68000/m68000.cpp
|
||||
$(object.path)/ares-processor-mos6502.o: $(ares.path)/component/processor/mos6502/mos6502.cpp
|
||||
$(object.path)/ares-processor-sh2.o: $(ares.path)/component/processor/sh2/sh2.cpp
|
||||
$(object.path)/ares-processor-sm5k.o: $(ares.path)/component/processor/sm5k/sm5k.cpp
|
||||
$(object.path)/ares-processor-sm83.o: $(ares.path)/component/processor/sm83/sm83.cpp
|
||||
$(object.path)/ares-processor-spc700.o: $(ares.path)/component/processor/spc700/spc700.cpp
|
||||
$(object.path)/ares-processor-ssp1601.o: $(ares.path)/component/processor/ssp1601/ssp1601.cpp
|
||||
$(object.path)/ares-processor-tlcs900h.o: $(ares.path)/component/processor/tlcs900h/tlcs900h.cpp
|
||||
$(object.path)/ares-processor-upd96050.o: $(ares.path)/component/processor/upd96050/upd96050.cpp
|
||||
$(object.path)/ares-processor-v30mz.o: $(ares.path)/component/processor/v30mz/v30mz.cpp
|
||||
$(object.path)/ares-processor-wdc65816.o: $(ares.path)/component/processor/wdc65816/wdc65816.cpp
|
||||
$(object.path)/ares-processor-z80.o: $(ares.path)/component/processor/z80/z80.cpp
|
||||
|
||||
$(object.path)/ares-flash-sst39sf0x0.o: $(ares.path)/component/flash/sst39sf0x0/sst39sf0x0.cpp
|
||||
|
||||
$(object.path)/ares-video-tms9918.o: $(ares.path)/component/video/tms9918/tms9918.cpp
|
||||
$(object.path)/ares-video-v9938.o: $(ares.path)/component/video/v9938/v9938.cpp
|
||||
@@ -150,6 +150,7 @@ auto SH2::internalReadByte(u32 address, n8 data) -> n8 {
|
||||
data.bit(5) = wdt.wtcsr.tme;
|
||||
data.bit(6) = wdt.wtcsr.wtit;
|
||||
data.bit(7) = wdt.wtcsr.ovf;
|
||||
if(wdt.wtcsr.wtit) debug(unimplemented, "SH2: wdt.wtit = 1");
|
||||
return data;
|
||||
|
||||
//WTCNT: watchdog timer counter
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
ares.components += z80
|
||||
ares.components += tms9918
|
||||
ares.components += sn76489
|
||||
|
||||
ares.objects += ares-cv-cpu
|
||||
ares.objects += ares-cv-vdp
|
||||
ares.objects += ares-cv-psg
|
||||
ares.objects += ares-cv-system
|
||||
ares.objects += ares-cv-cartridge
|
||||
ares.objects += ares-cv-controller
|
||||
|
||||
$(object.path)/ares-cv-cpu.o: $(ares.path)/cv/cpu/cpu.cpp
|
||||
$(object.path)/ares-cv-vdp.o: $(ares.path)/cv/vdp/vdp.cpp
|
||||
$(object.path)/ares-cv-psg.o: $(ares.path)/cv/psg/psg.cpp
|
||||
$(object.path)/ares-cv-system.o: $(ares.path)/cv/system/system.cpp
|
||||
$(object.path)/ares-cv-cartridge.o: $(ares.path)/cv/cartridge/cartridge.cpp
|
||||
$(object.path)/ares-cv-controller.o: $(ares.path)/cv/controller/controller.cpp
|
||||
@@ -1,23 +0,0 @@
|
||||
ares.components += mos6502
|
||||
ares.components += ym2149
|
||||
ares.components += ym2413
|
||||
ares.components += m24c
|
||||
ares.components += sst39sf0x0
|
||||
|
||||
ares.objects += ares-fc-system
|
||||
ares.objects += ares-fc-controller
|
||||
ares.objects += ares-fc-expansion
|
||||
ares.objects += ares-fc-cartridge
|
||||
ares.objects += ares-fc-cpu
|
||||
ares.objects += ares-fc-apu
|
||||
ares.objects += ares-fc-ppu
|
||||
ares.objects += ares-fc-fds
|
||||
|
||||
$(object.path)/ares-fc-system.o: $(ares.path)/fc/system/system.cpp
|
||||
$(object.path)/ares-fc-controller.o: $(ares.path)/fc/controller/controller.cpp
|
||||
$(object.path)/ares-fc-expansion.o: $(ares.path)/fc/expansion/expansion.cpp
|
||||
$(object.path)/ares-fc-cartridge.o: $(ares.path)/fc/cartridge/cartridge.cpp
|
||||
$(object.path)/ares-fc-cpu.o: $(ares.path)/fc/cpu/cpu.cpp
|
||||
$(object.path)/ares-fc-apu.o: $(ares.path)/fc/apu/apu.cpp
|
||||
$(object.path)/ares-fc-ppu.o: $(ares.path)/fc/ppu/ppu.cpp
|
||||
$(object.path)/ares-fc-fds.o: $(ares.path)/fc/fds/fds.cpp
|
||||
@@ -1,16 +0,0 @@
|
||||
ares.components += sm83
|
||||
ares.components += m93lcx6
|
||||
|
||||
ares.objects += ares-gb-system
|
||||
ares.objects += ares-gb-bus
|
||||
ares.objects += ares-gb-cartridge
|
||||
ares.objects += ares-gb-cpu
|
||||
ares.objects += ares-gb-ppu
|
||||
ares.objects += ares-gb-apu
|
||||
|
||||
$(object.path)/ares-gb-system.o: $(ares.path)/gb/system/system.cpp
|
||||
$(object.path)/ares-gb-cartridge.o: $(ares.path)/gb/cartridge/cartridge.cpp
|
||||
$(object.path)/ares-gb-bus.o: $(ares.path)/gb/bus/bus.cpp
|
||||
$(object.path)/ares-gb-cpu.o: $(ares.path)/gb/cpu/cpu.cpp
|
||||
$(object.path)/ares-gb-ppu.o: $(ares.path)/gb/ppu/ppu.cpp
|
||||
$(object.path)/ares-gb-apu.o: $(ares.path)/gb/apu/apu.cpp
|
||||
@@ -1,19 +0,0 @@
|
||||
ares.components += arm7tdmi
|
||||
|
||||
ares.objects += ares-gba-memory
|
||||
ares.objects += ares-gba-system
|
||||
ares.objects += ares-gba-cartridge
|
||||
ares.objects += ares-gba-player
|
||||
ares.objects += ares-gba-cpu
|
||||
ares.objects += ares-gba-ppu
|
||||
ares.objects += ares-gba-apu
|
||||
ares.objects += ares-gba-display
|
||||
|
||||
$(object.path)/ares-gba-memory.o: $(ares.path)/gba/memory/memory.cpp
|
||||
$(object.path)/ares-gba-system.o: $(ares.path)/gba/system/system.cpp
|
||||
$(object.path)/ares-gba-cartridge.o: $(ares.path)/gba/cartridge/cartridge.cpp
|
||||
$(object.path)/ares-gba-player.o: $(ares.path)/gba/player/player.cpp
|
||||
$(object.path)/ares-gba-cpu.o: $(ares.path)/gba/cpu/cpu.cpp
|
||||
$(object.path)/ares-gba-ppu.o: $(ares.path)/gba/ppu/ppu.cpp
|
||||
$(object.path)/ares-gba-apu.o: $(ares.path)/gba/apu/apu.cpp
|
||||
$(object.path)/ares-gba-display.o: $(ares.path)/gba/display/display.cpp
|
||||
@@ -113,30 +113,36 @@ auto Cartridge::power() -> void {
|
||||
|
||||
#define RAM_ANALYZE
|
||||
|
||||
auto Cartridge::read(u32 mode, n32 address) -> n32 {
|
||||
if(address < 0x0e00'0000) {
|
||||
if(has.eeprom && (address & eeprom.mask) == eeprom.test) return eeprom.read();
|
||||
return mrom.read(mode, address);
|
||||
} else {
|
||||
n32 word = 0xff;
|
||||
if(has.sram) word = sram.read(address);
|
||||
if(has.flash) word = flash.read(address);
|
||||
word |= word << 8;
|
||||
word |= word << 16;
|
||||
auto Cartridge::readRom(u32 mode, n32 address) -> n32 {
|
||||
if(mode & Word) {
|
||||
n32 word = 0;
|
||||
word |= readRom(mode & ~Word | Half, (address & ~3) + 0) << 0;
|
||||
word |= readRom(mode & ~Word | Half, (address & ~3) + 2) << 16;
|
||||
return word;
|
||||
}
|
||||
|
||||
if(has.eeprom && (address & eeprom.mask) == eeprom.test) return eeprom.read();
|
||||
return mrom.read(mode, address);
|
||||
}
|
||||
|
||||
auto Cartridge::write(u32 mode, n32 address, n32 word) -> void {
|
||||
if(address < 0x0e00'0000) {
|
||||
if(has.eeprom && (address & eeprom.mask) == eeprom.test) return eeprom.write(word & 1);
|
||||
return mrom.write(mode, address, word);
|
||||
} else {
|
||||
if(mode & Word) word = word >> (8 * (address & 3));
|
||||
if(mode & Half) word = word >> (8 * (address & 1));
|
||||
if(has.sram) return sram.write(address, word);
|
||||
if(has.flash) return flash.write(address, word);
|
||||
}
|
||||
auto Cartridge::readBackup(u32 mode, n32 address) -> n32 {
|
||||
n32 word = 0xff;
|
||||
if(has.sram) word = sram.read(address);
|
||||
if(has.flash) word = flash.read(address);
|
||||
word *= 0x01010101;
|
||||
return word;
|
||||
}
|
||||
|
||||
auto Cartridge::writeRom(u32 mode, n32 address, n32 word) -> void {
|
||||
if(has.eeprom && (address & eeprom.mask) == eeprom.test) return eeprom.write(word & 1);
|
||||
return mrom.write(mode, address, word);
|
||||
}
|
||||
|
||||
auto Cartridge::writeBackup(u32 mode, n32 address, n32 word) -> void {
|
||||
if(mode & Word) word = word >> (8 * (address & 3));
|
||||
if(mode & Half) word = word >> (8 * (address & 1));
|
||||
if(has.sram) return sram.write(address, word);
|
||||
if(has.flash) return flash.write(address, word);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,8 +17,10 @@ struct Cartridge {
|
||||
auto save() -> void;
|
||||
auto power() -> void;
|
||||
|
||||
auto read(u32 mode, n32 address) -> n32;
|
||||
auto write(u32 mode, n32 address, n32 word) -> void;
|
||||
auto readRom(u32 mode, n32 address) -> n32;
|
||||
auto readBackup(u32 mode, n32 address) -> n32;
|
||||
auto writeRom(u32 mode, n32 address, n32 word) -> void;
|
||||
auto writeBackup(u32 mode, n32 address, n32 word) -> void;
|
||||
|
||||
auto serialize(serializer&) -> void;
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
struct MROM {
|
||||
//mrom.cpp
|
||||
auto read(u32 mode, n32 address) -> n32;
|
||||
auto readBus(u32 mode, n32 address) -> n16;
|
||||
auto read(u32 mode, n32 address) -> n16;
|
||||
auto write(u32 mode, n32 address, n32 word) -> void;
|
||||
|
||||
//serialization.cpp
|
||||
|
||||
@@ -1,15 +1,4 @@
|
||||
auto Cartridge::MROM::read(u32 mode, n32 address) -> n32 {
|
||||
if(mode & Word) {
|
||||
n32 word = 0;
|
||||
word |= readBus(mode & ~Word | Half, (address & ~3) + 0) << 0;
|
||||
word |= readBus(mode & ~Word | Half, (address & ~3) + 2) << 16;
|
||||
return word;
|
||||
}
|
||||
|
||||
return readBus(mode, address);
|
||||
}
|
||||
|
||||
auto Cartridge::MROM::readBus(u32 mode, n32 address) -> n16 {
|
||||
auto Cartridge::MROM::read(u32 mode, n32 address) -> n16 {
|
||||
address &= 0x01ff'ffff;
|
||||
|
||||
if(address >= size) {
|
||||
@@ -20,8 +9,7 @@ auto Cartridge::MROM::readBus(u32 mode, n32 address) -> n16 {
|
||||
if(mode & Half) address &= ~1;
|
||||
auto p = data + address;
|
||||
if(mode & Half) return p[0] << 0 | p[1] << 8;
|
||||
if(mode & Byte) return p[0] << 0;
|
||||
return 0; //should never occur
|
||||
return p[0] << 0;
|
||||
}
|
||||
|
||||
auto Cartridge::MROM::write(u32 mode, n32 address, n32 word) -> void {
|
||||
|
||||
+18
-4
@@ -43,19 +43,26 @@ inline auto CPU::getBus(u32 mode, n32 address) -> n32 {
|
||||
word = ppu.readOAM(mode, address);
|
||||
break;
|
||||
|
||||
case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f:
|
||||
case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d:
|
||||
if(mode & Prefetch && wait.prefetch) {
|
||||
prefetchSync(address);
|
||||
prefetchStep(1);
|
||||
word = prefetchRead();
|
||||
if(mode & Word) word |= prefetchRead() << 16;
|
||||
} else {
|
||||
if(context.dmaActive) context.dmaRomAccess = true;
|
||||
if constexpr(!UseDebugger) prefetchReset();
|
||||
if constexpr(!UseDebugger) step(waitCartridge(mode, address));
|
||||
word = cartridge.read(mode, address);
|
||||
word = cartridge.readRom(mode, address);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x0e: case 0x0f:
|
||||
if constexpr(!UseDebugger) prefetchReset();
|
||||
if constexpr(!UseDebugger) step(waitCartridge(mode, address));
|
||||
word = cartridge.readBackup(mode, address);
|
||||
break;
|
||||
|
||||
default:
|
||||
if constexpr(!UseDebugger) prefetchStep(1);
|
||||
return openBus.get(mode, address);
|
||||
@@ -117,10 +124,17 @@ auto CPU::set(u32 mode, n32 address, n32 word) -> void {
|
||||
ppu.writeOAM(mode, address, word);
|
||||
break;
|
||||
|
||||
case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d: case 0x0e: case 0x0f:
|
||||
case 0x08: case 0x09: case 0x0a: case 0x0b: case 0x0c: case 0x0d:
|
||||
if(context.dmaActive) context.dmaRomAccess = true;
|
||||
prefetchReset();
|
||||
step(waitCartridge(mode, address));
|
||||
cartridge.write(mode, address, word);
|
||||
cartridge.writeRom(mode, address, word);
|
||||
break;
|
||||
|
||||
case 0x0e: case 0x0f:
|
||||
prefetchReset();
|
||||
step(waitCartridge(mode, address));
|
||||
cartridge.writeBackup(mode, address, word);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -58,11 +58,18 @@ auto CPU::main() -> void {
|
||||
auto CPU::dmaRun() -> void {
|
||||
if(!context.dmaActive && !context.busLocked) {
|
||||
context.dmaActive = true;
|
||||
while(dma[0].run() | dma[1].run() | dma[2].run() | dma[3].run());
|
||||
while(true) {
|
||||
if(dma[0].run()) continue;
|
||||
if(dma[1].run()) continue;
|
||||
if(dma[2].run()) continue;
|
||||
if(dma[3].run()) continue;
|
||||
break;
|
||||
}
|
||||
if(context.dmaRan) {
|
||||
idle();
|
||||
context.dmaRan = false;
|
||||
context.dmaRomAccess = false;
|
||||
context.dmaActiveChannel = 0; //assign burst to a channel that cannot access ROM
|
||||
}
|
||||
context.dmaActive = false;
|
||||
}
|
||||
|
||||
@@ -263,6 +263,7 @@ struct CPU : ARM7TDMI, Thread, IO {
|
||||
n1 dmaRan;
|
||||
n1 dmaRomAccess;
|
||||
n1 dmaActive;
|
||||
n2 dmaActiveChannel;
|
||||
n1 timerLatched;
|
||||
n1 busLocked;
|
||||
} context;
|
||||
|
||||
+12
-13
@@ -10,40 +10,39 @@ inline auto CPU::DMA::run() -> bool {
|
||||
auto CPU::DMA::transfer() -> void {
|
||||
u32 seek = size ? 4 : 2;
|
||||
u32 mode = size ? Word : Half;
|
||||
mode |= latch.length() == length() ? Nonsequential : Sequential;
|
||||
|
||||
if(!cpu.context.dmaRan) {
|
||||
cpu.context.dmaRan = true;
|
||||
cpu.idle();
|
||||
}
|
||||
|
||||
if(cpu.context.dmaActiveChannel != id) {
|
||||
//channel has switched - new burst transfer must be started
|
||||
cpu.context.dmaRomAccess = 0;
|
||||
cpu.context.dmaActiveChannel = id;
|
||||
}
|
||||
|
||||
if(latch.source() < 0x0200'0000) {
|
||||
cpu.idle(); //cannot access BIOS
|
||||
} else {
|
||||
n32 addr = latch.source();
|
||||
if(mode & Word) addr &= ~3;
|
||||
if(mode & Half) addr &= ~1;
|
||||
if(addr & 0x0800'0000) cpu.context.dmaRomAccess = true;
|
||||
latch.data = cpu.get(mode, addr);
|
||||
u32 sequential = Nonsequential;
|
||||
if(cpu.context.dmaRomAccess) sequential = Sequential;
|
||||
latch.data = cpu.get(mode | sequential, addr);
|
||||
if(mode & Half) latch.data |= latch.data << 16;
|
||||
}
|
||||
|
||||
if(mode & Nonsequential) {
|
||||
if((source() & 0x0800'0000) && (target() & 0x0800'0000)) {
|
||||
//ROM -> ROM transfer
|
||||
mode |= Sequential;
|
||||
mode ^= Nonsequential;
|
||||
}
|
||||
}
|
||||
|
||||
if(latch.target() < 0x0200'0000) {
|
||||
cpu.idle(); //cannot access BIOS
|
||||
} else {
|
||||
n32 addr = latch.target();
|
||||
if(mode & Word) addr &= ~3;
|
||||
if(mode & Half) addr &= ~1;
|
||||
if(addr & 0x0800'0000) cpu.context.dmaRomAccess = true;
|
||||
cpu.set(mode, addr, latch.data >> (addr & 2) * 8);
|
||||
u32 sequential = Nonsequential;
|
||||
if(cpu.context.dmaRomAccess) sequential = Sequential;
|
||||
cpu.set(mode | sequential, addr, latch.data >> (addr & 2) * 8);
|
||||
}
|
||||
|
||||
switch(sourceMode) {
|
||||
|
||||
@@ -11,11 +11,11 @@ auto CPU::prefetchSync(n32 address) -> void {
|
||||
|
||||
auto CPU::prefetchStep(u32 clocks) -> void {
|
||||
step(clocks);
|
||||
if(!wait.prefetch || context.dmaRomAccess || prefetch.stopped) return;
|
||||
if(!wait.prefetch || prefetch.stopped) return;
|
||||
|
||||
while(!prefetch.full() && clocks--) {
|
||||
if(--prefetch.wait) continue;
|
||||
prefetch.slot[prefetch.load >> 1 & 7] = cartridge.read(Half, prefetch.load);
|
||||
prefetch.slot[prefetch.load >> 1 & 7] = cartridge.readRom(Half, prefetch.load);
|
||||
prefetch.load += 2;
|
||||
prefetch.wait = waitCartridge(Half | Sequential, prefetch.load);
|
||||
}
|
||||
|
||||
@@ -116,6 +116,7 @@ auto CPU::serialize(serializer& s) -> void {
|
||||
s(context.dmaRan);
|
||||
s(context.dmaRomAccess);
|
||||
s(context.dmaActive);
|
||||
s(context.dmaActiveChannel);
|
||||
s(context.timerLatched);
|
||||
s(context.busLocked);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
static const string SerializerVersion = "v141.6";
|
||||
static const string SerializerVersion = "v142";
|
||||
|
||||
auto System::serialize(bool synchronize) -> serializer {
|
||||
if(synchronize) scheduler.enter(Scheduler::Mode::Synchronize);
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
ares.components += m68000
|
||||
ares.components += z80
|
||||
ares.components += sh2
|
||||
ares.components += ssp1601
|
||||
ares.components += sn76489
|
||||
ares.components += ym2612
|
||||
ares.components += m24c
|
||||
|
||||
ares.objects += ares-md-bus
|
||||
ares.objects += ares-md-cpu
|
||||
ares.objects += ares-md-apu
|
||||
ares.objects += ares-md-vdp
|
||||
ares.objects += ares-md-opn2
|
||||
ares.objects += ares-md-m32x
|
||||
ares.objects += ares-md-mcd
|
||||
ares.objects += ares-md-system
|
||||
ares.objects += ares-md-cartridge
|
||||
ares.objects += ares-md-controller
|
||||
|
||||
$(object.path)/ares-md-bus.o: $(ares.path)/md/bus/bus.cpp
|
||||
$(object.path)/ares-md-cpu.o: $(ares.path)/md/cpu/cpu.cpp
|
||||
$(object.path)/ares-md-apu.o: $(ares.path)/md/apu/apu.cpp
|
||||
$(object.path)/ares-md-vdp.o: $(ares.path)/md/vdp/vdp.cpp
|
||||
$(object.path)/ares-md-opn2.o: $(ares.path)/md/opn2/opn2.cpp
|
||||
$(object.path)/ares-md-m32x.o: $(ares.path)/md/m32x/m32x.cpp
|
||||
$(object.path)/ares-md-mcd.o: $(ares.path)/md/mcd/mcd.cpp
|
||||
$(object.path)/ares-md-system.o: $(ares.path)/md/system/system.cpp
|
||||
$(object.path)/ares-md-cartridge.o: $(ares.path)/md/cartridge/cartridge.cpp
|
||||
$(object.path)/ares-md-controller.o: $(ares.path)/md/controller/controller.cpp
|
||||
@@ -8,6 +8,8 @@ auto M32X::readExternal(n1 upper, n1 lower, n24 address, n16 data) -> n16 {
|
||||
}
|
||||
|
||||
if(address >= 0x840000 && address <= 0x87ffff) {
|
||||
if(vdp.framebufferAccess) return data;
|
||||
if(vdp.framebufferEngaged()) { debug(unusual, "[32X FB] 68k read while FEN==1"); return data; } // wait instead?
|
||||
return vdp.bbram[address >> 1 & 0xffff];
|
||||
}
|
||||
|
||||
@@ -40,7 +42,8 @@ auto M32X::writeExternal(n1 upper, n1 lower, n24 address, n16 data) -> void {
|
||||
}
|
||||
|
||||
if(address >= 0x840000 && address <= 0x85ffff) {
|
||||
if (vdp.framebufferAccess) return;
|
||||
if(vdp.framebufferAccess) return;
|
||||
if(vdp.framebufferEngaged()) { debug(unusual, "[32X FB] 68k write while FEN==1"); return; } // wait instead?
|
||||
if(!data && (!upper || !lower)) return; //8-bit 0x00 writes do not go through
|
||||
shm.debugger.tracer.instruction->invalidate(0x0400'0000 | address & 0x1fffe);
|
||||
shs.debugger.tracer.instruction->invalidate(0x0400'0000 | address & 0x1fffe);
|
||||
@@ -50,7 +53,8 @@ auto M32X::writeExternal(n1 upper, n1 lower, n24 address, n16 data) -> void {
|
||||
}
|
||||
|
||||
if(address >= 0x860000 && address <= 0x87ffff) {
|
||||
if (vdp.framebufferAccess) return;
|
||||
if(vdp.framebufferAccess) return;
|
||||
if(vdp.framebufferEngaged()) { debug(unusual, "[32X FB] 68k overwrite while FEN==1"); return; } // wait instead?
|
||||
shm.debugger.tracer.instruction->invalidate(0x0402'0000 | address & 0x1fffe);
|
||||
shs.debugger.tracer.instruction->invalidate(0x0402'0000 | address & 0x1fffe);
|
||||
if(upper && data.byte(1)) vdp.bbram[address >> 1 & 0xffff].byte(1) = data.byte(1);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
auto M32X::readInternal(n1 upper, n1 lower, n32 address, n16 data) -> n16 {
|
||||
if(address >= 0x0000'0000 && address <= 0x0000'3fff) {
|
||||
if(shm.active()) shm.step(1); if(shs.active()) shs.step(1);
|
||||
if(shm.active()) shm.internalStep(1); if(shs.active()) shs.internalStep(1);
|
||||
if(shm.active()) return shm.bootROM[address >> 1];
|
||||
if(shs.active()) return shs.bootROM[address >> 1];
|
||||
}
|
||||
@@ -9,20 +9,22 @@ auto M32X::readInternal(n1 upper, n1 lower, n32 address, n16 data) -> n16 {
|
||||
return readInternalIO(upper, lower, address, data);
|
||||
}
|
||||
|
||||
if(address >= 0x0200'0000 && address <= 0x023f'ffff) {
|
||||
if(address >= 0x0200'0000 && address <= 0x03ff'ffff) {
|
||||
while(dreq.vram) {
|
||||
// SH2 ROM accesses stall while RV is set
|
||||
if(shm.active()) shm.step(1);
|
||||
if(shs.active()) shs.step(1);
|
||||
//SH2 ROM accesses stall while RV is set
|
||||
if(shm.active()) { shm.internalStep(1); shm.syncM68k(true); }
|
||||
if(shs.active()) { shs.internalStep(1); shs.syncM68k(true); }
|
||||
}
|
||||
|
||||
// TODO: SH2 ROM accesses need to stall while the m68k is on the bus
|
||||
if(shm.active()) shm.step(6); if(shs.active()) shs.step(6);
|
||||
//TODO: SH2 ROM accesses need to stall while the m68k is on the bus
|
||||
if(shm.active()) shm.internalStep(6); if(shs.active()) shs.internalStep(6);
|
||||
return cartridge.child->read(upper, lower, address, data);
|
||||
}
|
||||
|
||||
if(address >= 0x0400'0000 && address <= 0x0405'ffff) {
|
||||
if(shm.active()) shm.step(5); if(shs.active()) shs.step(5);
|
||||
if(address >= 0x0400'0000 && address <= 0x05ff'ffff) {
|
||||
if(!vdp.framebufferAccess) return data;
|
||||
if(vdp.framebufferEngaged()) { debug(unusual, "[32X FB] SH2 read while FEN==1"); return data; } // wait instead?
|
||||
if(shm.active()) shm.internalStep(5); if(shs.active()) shs.internalStep(5);
|
||||
return vdp.bbram[address >> 1 & 0xffff];
|
||||
}
|
||||
|
||||
@@ -38,30 +40,27 @@ auto M32X::writeInternal(n1 upper, n1 lower, n32 address, n16 data) -> void {
|
||||
return writeInternalIO(upper, lower, address, data);
|
||||
}
|
||||
|
||||
if(address >= 0x0400'0000 && address <= 0x0401'ffff) {
|
||||
if (!vdp.framebufferAccess) return;
|
||||
if(!data && (!upper || !lower)) return; //8-bit 0x00 writes do not go through
|
||||
if(shm.active()) shm.step(4); if(shs.active()) shs.step(4);
|
||||
if(upper) vdp.bbram[address >> 1 & 0xffff].byte(1) = data.byte(1);
|
||||
if(lower) vdp.bbram[address >> 1 & 0xffff].byte(0) = data.byte(0);
|
||||
return;
|
||||
}
|
||||
if(address >= 0x0400'0000 && address <= 0x05ff'ffff) {
|
||||
address &= 0x0403'ffff;
|
||||
|
||||
if(address >= 0x0402'0000 && address <= 0x0403'ffff) {
|
||||
if (!vdp.framebufferAccess) return;
|
||||
if(shm.active()) shm.step(4); if(shs.active()) shs.step(4);
|
||||
if(upper && data.byte(1)) vdp.bbram[address >> 1 & 0xffff].byte(1) = data.byte(1);
|
||||
if(lower && data.byte(0)) vdp.bbram[address >> 1 & 0xffff].byte(0) = data.byte(0);
|
||||
return;
|
||||
}
|
||||
if(address >= 0x0400'0000 && address <= 0x0401'ffff) {
|
||||
if(!vdp.framebufferAccess) return;
|
||||
if(vdp.framebufferEngaged()) { debug(unusual, "[32X FB] SH2 write while FEN==1"); return; } // wait instead?
|
||||
if(!data && (!upper || !lower)) return; //8-bit 0x00 writes do not go through
|
||||
if(shm.active()) shm.internalStep(4); if(shs.active()) shs.internalStep(4);
|
||||
if(upper) vdp.bbram[address >> 1 & 0xffff].byte(1) = data.byte(1);
|
||||
if(lower) vdp.bbram[address >> 1 & 0xffff].byte(0) = data.byte(0);
|
||||
return;
|
||||
}
|
||||
|
||||
if(address >= 0x0404'0000 && address <= 0x0405'ffff) {
|
||||
if (!vdp.framebufferAccess) return;
|
||||
if(!data && (!upper || !lower)) return; //8-bit 0x00 writes do not go through
|
||||
if(shm.active()) shm.step(4); if(shs.active()) shs.step(4);
|
||||
if(upper) vdp.bbram[address >> 1 & 0xffff].byte(1) = data.byte(1);
|
||||
if(lower) vdp.bbram[address >> 1 & 0xffff].byte(0) = data.byte(0);
|
||||
return;
|
||||
if(address >= 0x0402'0000 && address <= 0x0403'ffff) {
|
||||
if(!vdp.framebufferAccess) return;
|
||||
if(vdp.framebufferEngaged()) { debug(unusual, "[32X FB] SH2 overwrite while FEN==1"); return; } // wait instead?
|
||||
if(shm.active()) shm.internalStep(4); if(shs.active()) shs.internalStep(4);
|
||||
if(upper && data.byte(1)) vdp.bbram[address >> 1 & 0xffff].byte(1) = data.byte(1);
|
||||
if(lower && data.byte(0)) vdp.bbram[address >> 1 & 0xffff].byte(0) = data.byte(0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(address >= 0x0600'0000 && address <= 0x0603'ffff) {
|
||||
|
||||
@@ -139,15 +139,20 @@ auto M32X::readExternalIO(n1 upper, n1 lower, n24 address, n16 data) -> n16 {
|
||||
//frame buffer control
|
||||
if(address == 0xa1518a) {
|
||||
data.bit( 0) = vdp.framebufferActive;
|
||||
data.bit( 1) = MegaDrive::vdp.refreshing(); //framebuffer access
|
||||
data.bit( 1) = MegaDrive::vdp.refreshing()
|
||||
|| vdp.framebufferEngaged(); // FEN: frame buffer engaged
|
||||
data.bit( 2, 12) = 0;
|
||||
data.bit(13) = vdp.vblank || vdp.hblank; //palette access
|
||||
data.bit(13) = !vdp.paletteEngaged(); // PEN: can access palette
|
||||
data.bit(14) = vdp.hblank;
|
||||
data.bit(15) = vdp.vblank;
|
||||
}
|
||||
|
||||
//palette
|
||||
if(address >= 0xa15200 && address <= 0xa153ff) {
|
||||
if(vdp.framebufferAccess) return data;
|
||||
while(vdp.paletteEngaged()) {
|
||||
if(cpu.active()) cpu.wait(1);
|
||||
}
|
||||
data = vdp.cram[address >> 1 & 0xff];
|
||||
}
|
||||
|
||||
@@ -357,7 +362,10 @@ auto M32X::writeExternalIO(n1 upper, n1 lower, n24 address, n16 data) -> void {
|
||||
|
||||
//palette
|
||||
if(address >= 0xa15200 && address <= 0xa153ff) {
|
||||
if (vdp.framebufferAccess) return;
|
||||
if(vdp.framebufferAccess) return;
|
||||
while(vdp.paletteEngaged()) {
|
||||
if(cpu.active()) cpu.wait(1);;
|
||||
}
|
||||
if(upper) vdp.cram[address >> 1 & 0xff].byte(1) = data.byte(1);
|
||||
if(lower) vdp.cram[address >> 1 & 0xff].byte(0) = data.byte(0);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
auto M32X::readInternalIO(n1 upper, n1 lower, n29 address, n16 data) -> n16 {
|
||||
if(shm.active()) shm.step(1); if(shs.active()) shs.step(1);
|
||||
if(shm.active()) shm.internalStep(1); if(shs.active()) shs.internalStep(1);
|
||||
|
||||
//interrupt mask
|
||||
if(address == 0x4000) {
|
||||
@@ -63,6 +63,8 @@ auto M32X::readInternalIO(n1 upper, n1 lower, n29 address, n16 data) -> n16 {
|
||||
|
||||
//FIFO
|
||||
if(address == 0x4012) {
|
||||
if(shm.active()) { shm.syncM68k(); }
|
||||
if(shs.active()) { shs.syncM68k(); }
|
||||
data = dreq.fifo.read(data);
|
||||
shm.dmac.dreq[0] = !dreq.fifo.empty();
|
||||
shs.dmac.dreq[0] = !dreq.fifo.empty();
|
||||
@@ -71,8 +73,8 @@ auto M32X::readInternalIO(n1 upper, n1 lower, n29 address, n16 data) -> n16 {
|
||||
//communication
|
||||
if(address >= 0x4020 && address <= 0x402f) {
|
||||
data = communication[address >> 1 & 7];
|
||||
if(shm.active()) { shm.syncOtherSh2(); shm.syncM68k(); }
|
||||
if(shs.active()) { shs.syncOtherSh2(); shs.syncM68k(); }
|
||||
if(shm.active()) { shm.syncAll(); }
|
||||
if(shs.active()) { shs.syncAll(); }
|
||||
}
|
||||
|
||||
//PWM control
|
||||
@@ -144,15 +146,21 @@ auto M32X::readInternalIO(n1 upper, n1 lower, n29 address, n16 data) -> n16 {
|
||||
if(shm.active()) shm.syncM68k();
|
||||
if(shs.active()) shs.syncM68k();
|
||||
data.bit( 0) = vdp.framebufferActive;
|
||||
data.bit( 1) = MegaDrive::vdp.refreshing(); //framebuffer access
|
||||
data.bit(13) = vdp.vblank || vdp.hblank; //palette access
|
||||
data.bit( 1) = MegaDrive::vdp.refreshing()
|
||||
|| vdp.framebufferEngaged(); // FEN: frame buffer engaged
|
||||
data.bit(13) = !vdp.paletteEngaged(); // PEN: can access palette
|
||||
data.bit(14) = vdp.hblank;
|
||||
data.bit(15) = vdp.vblank;
|
||||
}
|
||||
|
||||
//palette
|
||||
if(address >= 0x4200 && address <= 0x43ff) {
|
||||
if(shm.active()) shm.step(4); if(shs.active()) shs.step(4);
|
||||
if(!vdp.framebufferAccess) return data;
|
||||
while(vdp.paletteEngaged()) {
|
||||
if(shm.active()) { shm.internalStep(1); shm.syncAll(true); }
|
||||
if(shs.active()) { shs.internalStep(1); shs.syncAll(true); }
|
||||
}
|
||||
if(shm.active()) shm.internalStep(4); if(shs.active()) shs.internalStep(4);
|
||||
data = vdp.cram[address >> 1 & 0xff];
|
||||
}
|
||||
|
||||
@@ -160,7 +168,7 @@ auto M32X::readInternalIO(n1 upper, n1 lower, n29 address, n16 data) -> n16 {
|
||||
}
|
||||
|
||||
auto M32X::writeInternalIO(n1 upper, n1 lower, n29 address, n16 data) -> void {
|
||||
if(shm.active()) shm.step(1); if(shs.active()) shs.step(1);
|
||||
if(shm.active()) shm.internalStep(1); if(shs.active()) shs.internalStep(1);
|
||||
|
||||
//interrupt mask
|
||||
if(address == 0x4000) {
|
||||
@@ -228,8 +236,8 @@ auto M32X::writeInternalIO(n1 upper, n1 lower, n29 address, n16 data) -> void {
|
||||
|
||||
//communication
|
||||
if(address >= 0x4020 && address <= 0x402f) {
|
||||
if(shm.active()) { shm.syncOtherSh2(); shm.syncM68k(); }
|
||||
if(shs.active()) { shs.syncOtherSh2(); shs.syncM68k(); }
|
||||
if(shm.active()) { shm.syncAll(); }
|
||||
if(shs.active()) { shs.syncAll(); }
|
||||
if(upper) communication[address >> 1 & 7].byte(1) = data.byte(1);
|
||||
if(lower) communication[address >> 1 & 7].byte(0) = data.byte(0);
|
||||
}
|
||||
@@ -337,8 +345,12 @@ auto M32X::writeInternalIO(n1 upper, n1 lower, n29 address, n16 data) -> void {
|
||||
|
||||
//palette
|
||||
if(address >= 0x4200 && address <= 0x43ff) {
|
||||
if (!vdp.framebufferAccess) return;
|
||||
if(shm.active()) shm.step(4); if(shs.active()) shs.step(4);
|
||||
if(!vdp.framebufferAccess) return;
|
||||
while(vdp.paletteEngaged()) {
|
||||
if(shm.active()) { shm.internalStep(1); shm.syncAll(true); }
|
||||
if(shs.active()) { shs.internalStep(1); shs.syncAll(true); }
|
||||
}
|
||||
if(shm.active()) shm.internalStep(4); if(shs.active()) shs.internalStep(4);
|
||||
if(upper) vdp.cram[address >> 1 & 0xff].byte(1) = data.byte(1);
|
||||
if(lower) vdp.cram[address >> 1 & 0xff].byte(0) = data.byte(0);
|
||||
}
|
||||
|
||||
@@ -76,6 +76,13 @@ auto M32X::vblank(bool line) -> void {
|
||||
}
|
||||
|
||||
auto M32X::hblank(bool line) -> void {
|
||||
if(vdp.hblank > line) {
|
||||
// TODO: VDP regs should be latched 192 MClks (~82 cycles) before end of hblank (according to official docs)
|
||||
vdp.latch.mode = vdp.mode;
|
||||
vdp.latch.lines = vdp.lines;
|
||||
vdp.latch.priority = vdp.priority;
|
||||
vdp.latch.dotshift = vdp.dotshift;
|
||||
}
|
||||
vdp.hblank = line;
|
||||
shm.irq.hint.active = 0;
|
||||
shs.irq.hint.active = 0;
|
||||
|
||||
+14
-4
@@ -40,10 +40,12 @@ struct M32X {
|
||||
auto main() -> void;
|
||||
auto instructionPrologue(u16 instruction) -> void override;
|
||||
auto step(u32 clocks) -> void override;
|
||||
auto internalStep(u32 clocks) -> void;
|
||||
auto power(bool reset) -> void;
|
||||
auto restart() -> void;
|
||||
auto syncOtherSh2() -> void;
|
||||
auto syncM68k() -> void;
|
||||
auto syncAll(bool force = false) -> void;
|
||||
auto syncOtherSh2(bool force = false) -> void;
|
||||
auto syncM68k(bool force = false) -> void;
|
||||
|
||||
auto busReadByte(u32 address) -> u32 override;
|
||||
auto busReadWord(u32 address) -> u32 override;
|
||||
@@ -69,10 +71,8 @@ struct M32X {
|
||||
|
||||
s32 cyclesUntilSh2Sync = 0;
|
||||
s32 cyclesUntilM68kSync = 0;
|
||||
s32 cyclesUntilFullSync = 0;
|
||||
s32 minCyclesBetweenSh2Syncs = 0;
|
||||
s32 minCyclesBetweenM68kSyncs = 0;
|
||||
s32 minCyclesBetweenFullSyncs = 0;
|
||||
};
|
||||
|
||||
struct VDP {
|
||||
@@ -104,6 +104,8 @@ struct M32X {
|
||||
auto plot(u32* output, u16 color) -> void;
|
||||
auto fill() -> void;
|
||||
auto selectFramebuffer(n1 active) -> void;
|
||||
auto framebufferEngaged() -> bool;
|
||||
auto paletteEngaged() -> bool;
|
||||
|
||||
//serialization.cpp
|
||||
auto serialize(serializer&) -> void;
|
||||
@@ -118,8 +120,16 @@ struct M32X {
|
||||
n1 framebufferAccess;
|
||||
n1 framebufferActive;
|
||||
n1 framebufferSelect;
|
||||
int framebufferWait;
|
||||
n1 hblank;
|
||||
n1 vblank;
|
||||
|
||||
struct Latch {
|
||||
n2 mode;
|
||||
n1 lines;
|
||||
n1 priority;
|
||||
n1 dotshift;
|
||||
} latch;
|
||||
};
|
||||
|
||||
struct PWM : Thread {
|
||||
|
||||
@@ -46,12 +46,17 @@ auto M32X::VDP::serialize(serializer& s) -> void {
|
||||
s(lines);
|
||||
s(priority);
|
||||
s(dotshift);
|
||||
s(latch.mode);
|
||||
s(latch.lines);
|
||||
s(latch.priority);
|
||||
s(latch.dotshift);
|
||||
s(autofillLength);
|
||||
s(autofillAddress);
|
||||
s(autofillData);
|
||||
s(framebufferAccess);
|
||||
s(framebufferActive);
|
||||
s(framebufferSelect);
|
||||
s(framebufferWait);
|
||||
s(hblank);
|
||||
s(vblank);
|
||||
selectFramebuffer(framebufferSelect);
|
||||
@@ -76,4 +81,5 @@ auto M32X::PWM::serialize(serializer& s) -> void {
|
||||
s(lfifoLatch);
|
||||
s(rfifoLatch);
|
||||
s(mfifoLatch);
|
||||
updateFrequency();
|
||||
}
|
||||
+56
-21
@@ -49,28 +49,47 @@ auto M32X::SH7604::instructionPrologue(u16 instruction) -> void {
|
||||
debugger.instruction(instruction);
|
||||
}
|
||||
|
||||
auto M32X::SH7604::internalStep(u32 clocks) -> void {
|
||||
if(SH2::Accuracy::Recompiler && m32x.shm.recompiler.enabled) {
|
||||
regs.CCR += clocks;
|
||||
return;
|
||||
}
|
||||
|
||||
step(clocks);
|
||||
}
|
||||
|
||||
auto M32X::SH7604::step(u32 clocks) -> void {
|
||||
SH2::frt.run(clocks);
|
||||
SH2::wdt.run(clocks);
|
||||
|
||||
Thread::step(clocks);
|
||||
|
||||
cyclesUntilSh2Sync -= clocks;
|
||||
cyclesUntilM68kSync -= clocks;
|
||||
cyclesUntilFullSync -= clocks;
|
||||
|
||||
if(cyclesUntilFullSync <= 0) {
|
||||
cyclesUntilFullSync = minCyclesBetweenFullSyncs;
|
||||
if(m32x.shm.active()) Thread::synchronize(m32x.shs, cpu);
|
||||
if(m32x.shs.active()) Thread::synchronize(m32x.shm, cpu);
|
||||
m32x.vdp.framebufferWait -= min(clocks, m32x.vdp.framebufferWait);
|
||||
|
||||
if(cyclesUntilSh2Sync <= 0) {
|
||||
cyclesUntilSh2Sync = minCyclesBetweenSh2Syncs;
|
||||
if (m32x.shm.active()) Thread::synchronize(m32x.shs);
|
||||
if (m32x.shs.active()) Thread::synchronize(m32x.shm);
|
||||
}
|
||||
|
||||
if(cyclesUntilM68kSync <= 0) {
|
||||
cyclesUntilM68kSync = minCyclesBetweenM68kSyncs;
|
||||
Thread::synchronize(cpu);
|
||||
}
|
||||
}
|
||||
|
||||
auto M32X::SH7604::power(bool reset) -> void {
|
||||
Thread::create((system.frequency() / 7.0) * 3.0, {&M32X::SH7604::main, this});
|
||||
SH2::recompilerStepCycles = 20; // Minimum cycles for recompiler to run for each batch of instructions
|
||||
minCyclesBetweenFullSyncs = 50; // Minimum cycles between full sync with the M68K/MD side
|
||||
minCyclesBetweenSh2Syncs = 5; // Minimum Cycles between sync with the other SH2 (syncOtherSh2)
|
||||
minCyclesBetweenM68kSyncs = 10; // Minimum Cycles between sync with the M68K (syncM68k)
|
||||
|
||||
//When tweaking these values, make sure to test the following problematic games:
|
||||
// Brutal - Check for hang in attract mode
|
||||
// Chaotix - Check for hang on intro screen or level loading transitions
|
||||
|
||||
SH2::recompilerStepCycles = 200; //Recompiler will force an exit after at least N cycles have passed
|
||||
minCyclesBetweenSh2Syncs = 10; //Do not sync SH2s more than once every N cycles
|
||||
minCyclesBetweenM68kSyncs = 50; //Do not sync M68K more than once every N cycles
|
||||
SH2::power(reset);
|
||||
irq = {};
|
||||
irq.vres.enable = 1;
|
||||
@@ -83,19 +102,35 @@ auto M32X::SH7604::restart() -> void {
|
||||
Thread::restart({&M32X::SH7604::main, this});
|
||||
}
|
||||
|
||||
auto M32X::SH7604::syncOtherSh2() -> void {
|
||||
// avoid synchronizing if we recently have
|
||||
if(cyclesUntilSh2Sync > 0) return;
|
||||
if(m32x.shm.active()) Thread::synchronize(m32x.shs);
|
||||
if(m32x.shs.active()) Thread::synchronize(m32x.shm);
|
||||
cyclesUntilSh2Sync = minCyclesBetweenSh2Syncs;
|
||||
auto M32X::SH7604::syncAll(bool force) -> void {
|
||||
SH2::cyclesUntilRecompilerExit = 0;
|
||||
|
||||
if(SH2::Accuracy::Recompiler && m32x.shm.recompiler.enabled && force) {
|
||||
cyclesUntilSh2Sync = 0;
|
||||
cyclesUntilM68kSync = 0;
|
||||
step(regs.CCR);
|
||||
regs.CCR = 0;
|
||||
}
|
||||
}
|
||||
|
||||
auto M32X::SH7604::syncM68k() -> void {
|
||||
// avoid synchronizing if we recently have
|
||||
if(cyclesUntilM68kSync > 0) return;
|
||||
Thread::synchronize(cpu);
|
||||
cyclesUntilM68kSync = minCyclesBetweenM68kSyncs;
|
||||
auto M32X::SH7604::syncOtherSh2(bool force) -> void {
|
||||
SH2::cyclesUntilRecompilerExit = 0;
|
||||
|
||||
if(SH2::Accuracy::Recompiler && m32x.shm.recompiler.enabled && force) {
|
||||
cyclesUntilSh2Sync = 0;
|
||||
step(regs.CCR);
|
||||
regs.CCR = 0;
|
||||
}
|
||||
}
|
||||
|
||||
auto M32X::SH7604::syncM68k(bool force) -> void {
|
||||
SH2::cyclesUntilRecompilerExit = 0;
|
||||
|
||||
if(SH2::Accuracy::Recompiler && m32x.shm.recompiler.enabled && force) {
|
||||
cyclesUntilM68kSync = 0;
|
||||
step(regs.CCR);
|
||||
regs.CCR = 0;
|
||||
}
|
||||
}
|
||||
|
||||
auto M32X::SH7604::busReadByte(u32 address) -> u32 {
|
||||
|
||||
+30
-23
@@ -17,28 +17,30 @@ auto M32X::VDP::power(bool reset) -> void {
|
||||
lines = 0;
|
||||
priority = 0;
|
||||
dotshift = 0;
|
||||
latch = {};
|
||||
autofillLength = 0;
|
||||
autofillAddress = 0;
|
||||
autofillData = 0;
|
||||
framebufferAccess = 0;
|
||||
framebufferActive = 0;
|
||||
framebufferSelect = 0;
|
||||
framebufferWait = 0;
|
||||
hblank = 0;
|
||||
vblank = 1;
|
||||
selectFramebuffer(framebufferSelect);
|
||||
}
|
||||
|
||||
auto M32X::VDP::scanline(u32 pixels[1280], u32 y) -> void {
|
||||
if(!Mega32X() || !pixels || y >= (lines ? 240 : 224)) return;
|
||||
if(mode == 1) return scanlineMode1(pixels, y);
|
||||
if(mode == 2) return scanlineMode2(pixels, y);
|
||||
if(mode == 3) return scanlineMode3(pixels, y);
|
||||
if(!Mega32X() || !pixels || y >= (latch.lines ? 240 : 224)) return;
|
||||
if(latch.mode == 1) return scanlineMode1(pixels, y);
|
||||
if(latch.mode == 2) return scanlineMode2(pixels, y);
|
||||
if(latch.mode == 3) return scanlineMode3(pixels, y);
|
||||
}
|
||||
|
||||
auto M32X::VDP::scanlineMode1(u32 pixels[1280], u32 y) -> void {
|
||||
u16 address = fbram[y];
|
||||
for(u32 x : range(320)) {
|
||||
u8 color = fbram[address + (x + dotshift >> 1) & 0xffff].byte(!(x + dotshift & 1));
|
||||
u8 color = fbram[address + (x + latch.dotshift >> 1) & 0xffff].byte(!(x + latch.dotshift & 1));
|
||||
plot(&pixels[x * 4], cram[color]);
|
||||
}
|
||||
}
|
||||
@@ -66,30 +68,24 @@ auto M32X::VDP::scanlineMode3(u32 pixels[1280], u32 y) -> void {
|
||||
}
|
||||
|
||||
auto M32X::VDP::plot(u32* output, u16 color) -> void {
|
||||
n1 backdrop = output[0] >> 11;
|
||||
n1 throughbit = color >> 15;
|
||||
b1 opaque = color & 0x7fff;
|
||||
|
||||
if(priority == 0) {
|
||||
//Mega Drive has priority
|
||||
if(throughbit || backdrop) {
|
||||
output[0] = color | 1 << 15;
|
||||
output[1] = color | 1 << 15;
|
||||
output[2] = color | 1 << 15;
|
||||
output[3] = color | 1 << 15;
|
||||
}
|
||||
} else {
|
||||
//Mega 32X has priority
|
||||
if(!throughbit || backdrop) {
|
||||
output[0] = color | 1 << 15;
|
||||
output[1] = color | 1 << 15;
|
||||
output[2] = color | 1 << 15;
|
||||
output[3] = color | 1 << 15;
|
||||
for(int i = 0; i < 4; i++) {
|
||||
n1 backdrop = output[i] >> 11;
|
||||
|
||||
if(latch.priority == 0) {
|
||||
//Mega Drive has priority
|
||||
if(throughbit || backdrop) output[i] = color | 1 << 15;
|
||||
} else {
|
||||
//Mega 32X has priority
|
||||
if(!throughbit || backdrop) output[i] = color | 1 << 15;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto M32X::VDP::fill() -> void {
|
||||
if(framebufferWait > 0) { debug(unusual, "[32X FILL] triggered before last fill finished"); return; }
|
||||
framebufferWait = 7+3*(autofillLength+1); // according to official docs
|
||||
for(u32 repeat : range(1 + autofillLength)) {
|
||||
bbram[autofillAddress] = autofillData;
|
||||
autofillAddress.byte(0)++;
|
||||
@@ -98,9 +94,20 @@ auto M32X::VDP::fill() -> void {
|
||||
|
||||
auto M32X::VDP::selectFramebuffer(n1 select) -> void {
|
||||
framebufferSelect = select;
|
||||
if(!vblank && mode) return;
|
||||
if(!vblank && latch.mode) return;
|
||||
|
||||
framebufferActive = select;
|
||||
fbram = {dram.data() + 0x10000 * (select == 0), 0x10000};
|
||||
bbram = {dram.data() + 0x10000 * (select == 1), 0x10000};
|
||||
}
|
||||
|
||||
// back buffer access
|
||||
auto M32X::VDP::framebufferEngaged() -> bool {
|
||||
// TODO: 40 cycle wait at start of hblank (according to official docs)
|
||||
return (latch.mode != 0 && framebufferSelect != framebufferActive) || framebufferWait > 0;
|
||||
}
|
||||
|
||||
auto M32X::VDP::paletteEngaged() -> bool {
|
||||
// TODO: not available for 24 MClks (~10 cycles) at start of hblank (according to official docs)
|
||||
return !vblank && !hblank && latch.mode.bit(0);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
static const string SerializerVersion = "v141.1";
|
||||
static const string SerializerVersion = "v142";
|
||||
|
||||
auto System::serialize(bool synchronize) -> serializer {
|
||||
if(synchronize) scheduler.enter(Scheduler::Mode::Synchronize);
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
ares.components += z80
|
||||
ares.components += sn76489
|
||||
ares.components += ym2413
|
||||
|
||||
ares.objects += ares-ms-cpu
|
||||
ares.objects += ares-ms-vdp
|
||||
ares.objects += ares-ms-psg
|
||||
ares.objects += ares-ms-opll
|
||||
ares.objects += ares-ms-system
|
||||
ares.objects += ares-ms-cartridge
|
||||
ares.objects += ares-ms-controller
|
||||
ares.objects += ares-ms-expansion
|
||||
|
||||
$(object.path)/ares-ms-cpu.o: $(ares.path)/ms/cpu/cpu.cpp
|
||||
$(object.path)/ares-ms-vdp.o: $(ares.path)/ms/vdp/vdp.cpp
|
||||
$(object.path)/ares-ms-psg.o: $(ares.path)/ms/psg/psg.cpp
|
||||
$(object.path)/ares-ms-opll.o: $(ares.path)/ms/opll/opll.cpp
|
||||
$(object.path)/ares-ms-system.o: $(ares.path)/ms/system/system.cpp
|
||||
$(object.path)/ares-ms-cartridge.o: $(ares.path)/ms/cartridge/cartridge.cpp
|
||||
$(object.path)/ares-ms-controller.o: $(ares.path)/ms/controller/controller.cpp
|
||||
$(object.path)/ares-ms-expansion.o: $(ares.path)/ms/expansion/expansion.cpp
|
||||
@@ -1,25 +0,0 @@
|
||||
ares.components += z80
|
||||
ares.components += tms9918
|
||||
ares.components += v9938
|
||||
ares.components += ay38910
|
||||
ares.components += ym2413
|
||||
|
||||
ares.objects += ares-msx-system
|
||||
ares.objects += ares-msx-keyboard
|
||||
ares.objects += ares-msx-cartridge
|
||||
ares.objects += ares-msx-controller
|
||||
ares.objects += ares-msx-cpu
|
||||
ares.objects += ares-msx-vdp
|
||||
ares.objects += ares-msx-psg
|
||||
ares.objects += ares-msx-tape
|
||||
ares.objects += ares-msx-rtc
|
||||
|
||||
$(object.path)/ares-msx-system.o: $(ares.path)/msx/system/system.cpp
|
||||
$(object.path)/ares-msx-keyboard.o: $(ares.path)/msx/keyboard/keyboard.cpp
|
||||
$(object.path)/ares-msx-cartridge.o: $(ares.path)/msx/cartridge/cartridge.cpp
|
||||
$(object.path)/ares-msx-controller.o: $(ares.path)/msx/controller/controller.cpp
|
||||
$(object.path)/ares-msx-cpu.o: $(ares.path)/msx/cpu/cpu.cpp
|
||||
$(object.path)/ares-msx-vdp.o: $(ares.path)/msx/vdp/vdp.cpp
|
||||
$(object.path)/ares-msx-psg.o: $(ares.path)/msx/psg/psg.cpp
|
||||
$(object.path)/ares-msx-tape.o: $(ares.path)/msx/tape/tape.cpp
|
||||
$(object.path)/ares-msx-rtc.o: $(ares.path)/msx/rtc/rtc.cpp
|
||||
@@ -1,15 +0,0 @@
|
||||
ares.components += z80
|
||||
ares.components += tms9918
|
||||
ares.components += ay38910
|
||||
|
||||
ares.objects += ares-myvision-cpu
|
||||
ares.objects += ares-myvision-vdp
|
||||
ares.objects += ares-myvision-psg
|
||||
ares.objects += ares-myvision-system
|
||||
ares.objects += ares-myvision-cartridge
|
||||
|
||||
$(object.path)/ares-myvision-cpu.o: $(ares.path)/myvision/cpu/cpu.cpp
|
||||
$(object.path)/ares-myvision-vdp.o: $(ares.path)/myvision/vdp/vdp.cpp
|
||||
$(object.path)/ares-myvision-psg.o: $(ares.path)/myvision/psg/psg.cpp
|
||||
$(object.path)/ares-myvision-system.o: $(ares.path)/myvision/system/system.cpp
|
||||
$(object.path)/ares-myvision-cartridge.o: $(ares.path)/myvision/cartridge/cartridge.cpp
|
||||
@@ -1,99 +0,0 @@
|
||||
ares.components += sm5k
|
||||
|
||||
ares.objects += ares-n64-memory
|
||||
ares.objects += ares-n64-system
|
||||
ares.objects += ares-n64-cartridge
|
||||
ares.objects += ares-n64-cic
|
||||
ares.objects += ares-n64-controller
|
||||
ares.objects += ares-n64-dd
|
||||
ares.objects += ares-n64-mi
|
||||
ares.objects += ares-n64-vi
|
||||
ares.objects += ares-n64-ai
|
||||
ares.objects += ares-n64-pi
|
||||
ares.objects += ares-n64-pif
|
||||
ares.objects += ares-n64-ri
|
||||
ares.objects += ares-n64-si
|
||||
ares.objects += ares-n64-rdram
|
||||
ares.objects += ares-n64-cpu
|
||||
ares.objects += ares-n64-rsp
|
||||
ares.objects += ares-n64-rdp
|
||||
ares.objects += ares-n64-aleck64
|
||||
|
||||
$(object.path)/ares-n64-memory.o: $(ares.path)/n64/memory/memory.cpp
|
||||
$(object.path)/ares-n64-system.o: $(ares.path)/n64/system/system.cpp
|
||||
$(object.path)/ares-n64-cartridge.o: $(ares.path)/n64/cartridge/cartridge.cpp
|
||||
$(object.path)/ares-n64-cic.o: $(ares.path)/n64/cic/cic.cpp
|
||||
$(object.path)/ares-n64-controller.o: $(ares.path)/n64/controller/controller.cpp
|
||||
$(object.path)/ares-n64-dd.o: $(ares.path)/n64/dd/dd.cpp
|
||||
$(object.path)/ares-n64-sp.o: $(ares.path)/n64/sp/sp.cpp
|
||||
$(object.path)/ares-n64-dp.o: $(ares.path)/n64/dp/dp.cpp
|
||||
$(object.path)/ares-n64-mi.o: $(ares.path)/n64/mi/mi.cpp
|
||||
$(object.path)/ares-n64-vi.o: $(ares.path)/n64/vi/vi.cpp
|
||||
$(object.path)/ares-n64-ai.o: $(ares.path)/n64/ai/ai.cpp
|
||||
$(object.path)/ares-n64-pi.o: $(ares.path)/n64/pi/pi.cpp
|
||||
$(object.path)/ares-n64-pif.o: $(ares.path)/n64/pif/pif.cpp
|
||||
$(object.path)/ares-n64-ri.o: $(ares.path)/n64/ri/ri.cpp
|
||||
$(object.path)/ares-n64-si.o: $(ares.path)/n64/si/si.cpp
|
||||
$(object.path)/ares-n64-rdram.o: $(ares.path)/n64/rdram/rdram.cpp
|
||||
$(object.path)/ares-n64-cpu.o: $(ares.path)/n64/cpu/cpu.cpp
|
||||
$(object.path)/ares-n64-rsp.o: $(ares.path)/n64/rsp/rsp.cpp
|
||||
$(object.path)/ares-n64-rdp.o: $(ares.path)/n64/rdp/rdp.cpp
|
||||
$(object.path)/ares-n64-aleck64.o: $(ares.path)/n64/aleck64/aleck64.cpp
|
||||
|
||||
ifeq ($(vulkan),true)
|
||||
ifeq ($(platform),macos)
|
||||
molten = $(ares.path)/../thirdparty/MoltenVK/libMoltenVK.dylib
|
||||
ifeq ($(wildcard $(molten)),)
|
||||
molten = $(shell brew --prefix molten-vk)/lib/libMoltenVK.dylib
|
||||
ifeq ($(wildcard $(molten)),)
|
||||
$(error Compiling Ares N64 Vulkan backend requires MoltenVK. Install it via Homebrew, compile it using thirdparty/MoltenVK/build-moltenvk.sh, or disable with vulkan=false")
|
||||
endif
|
||||
endif
|
||||
ares.dylibs += $(molten)
|
||||
endif
|
||||
ares.objects += ares-n64-vulkan
|
||||
$(object.path)/ares-n64-vulkan.o: $(ares.path)/n64/vulkan/vulkan.cpp
|
||||
PARALLEL_RDP_IMPLEMENTATION := $(ares.path)/n64/vulkan/parallel-rdp
|
||||
include $(PARALLEL_RDP_IMPLEMENTATION)/config.mk
|
||||
ares.objects += $(PARALLEL_RDP_SOURCES_CXX:$(PARALLEL_RDP_IMPLEMENTATION)/%.cpp=ares-n64-parallel-rdp/%)
|
||||
ares.objects += $(PARALLEL_RDP_SOURCES_C:$(PARALLEL_RDP_IMPLEMENTATION)/%.c=ares-n64-parallel-rdp/%)
|
||||
flags += $(PARALLEL_RDP_INCLUDE_DIRS) $(PARALLEL_RDP_CXXFLAGS) $(PARALLEL_RDP_CFLAGS)
|
||||
$(object.path)/ares-n64-parallel-rdp/volk/volk.o: $(PARALLEL_RDP_IMPLEMENTATION)/volk/volk.c
|
||||
$(object.path)/ares-n64-parallel-rdp/parallel-rdp/video_interface.o: $(PARALLEL_RDP_IMPLEMENTATION)/parallel-rdp/video_interface.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/parallel-rdp/command_ring.o: $(PARALLEL_RDP_IMPLEMENTATION)/parallel-rdp/command_ring.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/parallel-rdp/rdp_device.o: $(PARALLEL_RDP_IMPLEMENTATION)/parallel-rdp/rdp_device.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/parallel-rdp/rdp_dump_write.o: $(PARALLEL_RDP_IMPLEMENTATION)/parallel-rdp/rdp_dump_write.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/parallel-rdp/rdp_renderer.o: $(PARALLEL_RDP_IMPLEMENTATION)/parallel-rdp/rdp_renderer.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/buffer.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/buffer.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/buffer_pool.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/buffer_pool.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/command_buffer.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/command_buffer.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/command_pool.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/command_pool.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/context.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/context.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/cookie.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/cookie.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/descriptor_set.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/descriptor_set.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/device.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/device.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/event_manager.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/event_manager.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/fence.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/fence.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/fence_manager.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/fence_manager.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/image.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/image.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/indirect_layout.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/indirect_layout.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/memory_allocator.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/memory_allocator.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/pipeline_event.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/pipeline_event.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/query_pool.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/query_pool.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/render_pass.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/render_pass.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/sampler.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/sampler.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/semaphore.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/semaphore.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/semaphore_manager.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/semaphore_manager.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/shader.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/shader.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/vulkan/texture/texture_format.o: $(PARALLEL_RDP_IMPLEMENTATION)/vulkan/texture/texture_format.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/util/arena_allocator.o: $(PARALLEL_RDP_IMPLEMENTATION)/util/arena_allocator.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/util/logging.o: $(PARALLEL_RDP_IMPLEMENTATION)/util/logging.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/util/thread_id.o: $(PARALLEL_RDP_IMPLEMENTATION)/util/thread_id.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/util/aligned_alloc.o: $(PARALLEL_RDP_IMPLEMENTATION)/util/aligned_alloc.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/util/timer.o: $(PARALLEL_RDP_IMPLEMENTATION)/util/timer.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/util/timeline_trace_file.o: $(PARALLEL_RDP_IMPLEMENTATION)/util/timeline_trace_file.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/util/environment.o: $(PARALLEL_RDP_IMPLEMENTATION)/util/environment.cpp
|
||||
$(object.path)/ares-n64-parallel-rdp/util/thread_name.o: $(PARALLEL_RDP_IMPLEMENTATION)/util/thread_name.cpp
|
||||
else
|
||||
$(warning Ares n64 core requires Vulkan for RDP emulation, only titles using Software Rendering will function)
|
||||
endif
|
||||
@@ -54,7 +54,7 @@ auto Cartridge::joybusComm(n8 send, n8 recv, n8 input[], n8 output[]) -> n2 {
|
||||
if(input[0] == 0x07 && send >= 2 && recv >= 9) {
|
||||
if(cartridge.rtc.present) {
|
||||
rtc.read(input[1], &output[0]);
|
||||
output[8] = 0x00;
|
||||
output[8] = rtc.status;
|
||||
valid = 1;
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@ auto Cartridge::joybusComm(n8 send, n8 recv, n8 input[], n8 output[]) -> n2 {
|
||||
if(input[0] == 0x08 && send >= 10 && recv >= 1) {
|
||||
if(cartridge.rtc.present) {
|
||||
rtc.write(input[1], &input[2]);
|
||||
output[0] = 0x00;
|
||||
output[0] = rtc.status;
|
||||
valid = 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
auto CPU::Exception::trigger(u32 code, u32 coprocessor, bool tlbMiss) -> void {
|
||||
self.debugger.exception(code);
|
||||
reportGDBException(code, self.ipu.pc);
|
||||
if (code != 0) { //ignore interrupt exceptions
|
||||
reportGDBException(code, self.ipu.pc);
|
||||
}
|
||||
|
||||
u64 vectorBase = !self.scc.status.vectorLocation ? (s32)0x8000'0000 : (s32)0xbfc0'0200;
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
ares.components += m68000
|
||||
ares.components += z80
|
||||
|
||||
ares.objects += ares-ng-system
|
||||
ares.objects += ares-ng-cpu
|
||||
ares.objects += ares-ng-apu
|
||||
ares.objects += ares-ng-lspc
|
||||
ares.objects += ares-ng-opnb
|
||||
ares.objects += ares-ng-cartridge
|
||||
ares.objects += ares-ng-controller
|
||||
ares.objects += ares-ng-card
|
||||
|
||||
$(object.path)/ares-ng-system.o: $(ares.path)/ng/system/system.cpp
|
||||
$(object.path)/ares-ng-cpu.o: $(ares.path)/ng/cpu/cpu.cpp
|
||||
$(object.path)/ares-ng-apu.o: $(ares.path)/ng/apu/apu.cpp
|
||||
$(object.path)/ares-ng-lspc.o: $(ares.path)/ng/lspc/lspc.cpp
|
||||
$(object.path)/ares-ng-opnb.o: $(ares.path)/ng/opnb/opnb.cpp
|
||||
$(object.path)/ares-ng-cartridge.o: $(ares.path)/ng/cartridge/cartridge.cpp
|
||||
$(object.path)/ares-ng-controller.o: $(ares.path)/ng/controller/controller.cpp
|
||||
$(object.path)/ares-ng-card.o: $(ares.path)/ng/card/card.cpp
|
||||
@@ -1,17 +0,0 @@
|
||||
ares.components += tlcs900h
|
||||
ares.components += z80
|
||||
ares.components += t6w28
|
||||
|
||||
ares.objects += ares-ngp-system
|
||||
ares.objects += ares-ngp-cartridge
|
||||
ares.objects += ares-ngp-cpu
|
||||
ares.objects += ares-ngp-apu
|
||||
ares.objects += ares-ngp-kge
|
||||
ares.objects += ares-ngp-psg
|
||||
|
||||
$(object.path)/ares-ngp-system.o: $(ares.path)/ngp/system/system.cpp
|
||||
$(object.path)/ares-ngp-cartridge.o: $(ares.path)/ngp/cartridge/cartridge.cpp
|
||||
$(object.path)/ares-ngp-cpu.o: $(ares.path)/ngp/cpu/cpu.cpp
|
||||
$(object.path)/ares-ngp-apu.o: $(ares.path)/ngp/apu/apu.cpp
|
||||
$(object.path)/ares-ngp-kge.o: $(ares.path)/ngp/kge/kge.cpp
|
||||
$(object.path)/ares-ngp-psg.o: $(ares.path)/ngp/psg/psg.cpp
|
||||
@@ -1,20 +0,0 @@
|
||||
ares.components += huc6280
|
||||
ares.components += msm5205
|
||||
|
||||
ares.objects += ares-pce-cpu
|
||||
ares.objects += ares-pce-vdp
|
||||
ares.objects += ares-pce-vdp-performance
|
||||
ares.objects += ares-pce-psg
|
||||
ares.objects += ares-pce-pcd
|
||||
ares.objects += ares-pce-system
|
||||
ares.objects += ares-pce-cartridge
|
||||
ares.objects += ares-pce-controller
|
||||
|
||||
$(object.path)/ares-pce-cpu.o: $(ares.path)/pce/cpu/cpu.cpp
|
||||
$(object.path)/ares-pce-vdp.o: $(ares.path)/pce/vdp/vdp.cpp
|
||||
$(object.path)/ares-pce-vdp-performance.o: $(ares.path)/pce/vdp-performance/vdp.cpp
|
||||
$(object.path)/ares-pce-psg.o: $(ares.path)/pce/psg/psg.cpp
|
||||
$(object.path)/ares-pce-pcd.o: $(ares.path)/pce/pcd/pcd.cpp
|
||||
$(object.path)/ares-pce-system.o: $(ares.path)/pce/system/system.cpp
|
||||
$(object.path)/ares-pce-cartridge.o: $(ares.path)/pce/cartridge/cartridge.cpp
|
||||
$(object.path)/ares-pce-controller.o: $(ares.path)/pce/controller/controller.cpp
|
||||
@@ -1,25 +0,0 @@
|
||||
ares.components += m68hc05
|
||||
|
||||
ares.objects += ares-ps1-memory
|
||||
ares.objects += ares-ps1-system
|
||||
ares.objects += ares-ps1-disc
|
||||
ares.objects += ares-ps1-cpu
|
||||
ares.objects += ares-ps1-gpu
|
||||
ares.objects += ares-ps1-spu
|
||||
ares.objects += ares-ps1-mdec
|
||||
ares.objects += ares-ps1-interrupt
|
||||
ares.objects += ares-ps1-peripheral
|
||||
ares.objects += ares-ps1-dma
|
||||
ares.objects += ares-ps1-timer
|
||||
|
||||
$(object.path)/ares-ps1-memory.o: $(ares.path)/ps1/memory/memory.cpp
|
||||
$(object.path)/ares-ps1-system.o: $(ares.path)/ps1/system/system.cpp
|
||||
$(object.path)/ares-ps1-disc.o: $(ares.path)/ps1/disc/disc.cpp
|
||||
$(object.path)/ares-ps1-cpu.o: $(ares.path)/ps1/cpu/cpu.cpp
|
||||
$(object.path)/ares-ps1-gpu.o: $(ares.path)/ps1/gpu/gpu.cpp
|
||||
$(object.path)/ares-ps1-spu.o: $(ares.path)/ps1/spu/spu.cpp
|
||||
$(object.path)/ares-ps1-mdec.o: $(ares.path)/ps1/mdec/mdec.cpp
|
||||
$(object.path)/ares-ps1-interrupt.o: $(ares.path)/ps1/interrupt/interrupt.cpp
|
||||
$(object.path)/ares-ps1-peripheral.o: $(ares.path)/ps1/peripheral/peripheral.cpp
|
||||
$(object.path)/ares-ps1-dma.o: $(ares.path)/ps1/dma/dma.cpp
|
||||
$(object.path)/ares-ps1-timer.o: $(ares.path)/ps1/timer/timer.cpp
|
||||
@@ -1,6 +0,0 @@
|
||||
ares.components += sh2
|
||||
ares.components += m68k
|
||||
|
||||
ares.objects += ares-saturn-system
|
||||
|
||||
$(object.path)/ares-saturn-system.o: $(ares.path)/saturn/system/system.cpp
|
||||
@@ -1,34 +0,0 @@
|
||||
ares.components += wdc65816
|
||||
ares.components += spc700
|
||||
ares.components += arm7tdmi
|
||||
ares.components += gsu
|
||||
ares.components += hg51b
|
||||
ares.components += upd96050
|
||||
|
||||
ares.objects += ares-sfc-system
|
||||
ares.objects += ares-sfc-controller
|
||||
ares.objects += ares-sfc-cartridge
|
||||
ares.objects += ares-sfc-memory
|
||||
ares.objects += ares-sfc-cpu
|
||||
ares.objects += ares-sfc-smp
|
||||
ares.objects += ares-sfc-dsp
|
||||
ares.objects += ares-sfc-ppu
|
||||
ares.objects += ares-sfc-ppu-performance
|
||||
ares.objects += ares-sfc-coprocessor
|
||||
ares.objects += ares-sfc-expansion
|
||||
ares.objects += ares-sfc-slot
|
||||
|
||||
$(object.path)/ares-sfc-system.o: $(ares.path)/sfc/system/system.cpp
|
||||
$(object.path)/ares-sfc-controller.o: $(ares.path)/sfc/controller/controller.cpp
|
||||
$(object.path)/ares-sfc-cartridge.o: $(ares.path)/sfc/cartridge/cartridge.cpp
|
||||
$(object.path)/ares-sfc-memory.o: $(ares.path)/sfc/memory/memory.cpp
|
||||
|
||||
$(object.path)/ares-sfc-cpu.o: $(ares.path)/sfc/cpu/cpu.cpp
|
||||
$(object.path)/ares-sfc-smp.o: $(ares.path)/sfc/smp/smp.cpp
|
||||
$(object.path)/ares-sfc-dsp.o: $(ares.path)/sfc/dsp/dsp.cpp
|
||||
$(object.path)/ares-sfc-ppu.o: $(ares.path)/sfc/ppu/ppu.cpp
|
||||
$(object.path)/ares-sfc-ppu-performance.o: $(ares.path)/sfc/ppu-performance/ppu.cpp
|
||||
|
||||
$(object.path)/ares-sfc-coprocessor.o: $(ares.path)/sfc/coprocessor/coprocessor.cpp
|
||||
$(object.path)/ares-sfc-expansion.o: $(ares.path)/sfc/expansion/expansion.cpp
|
||||
$(object.path)/ares-sfc-slot.o: $(ares.path)/sfc/slot/slot.cpp
|
||||
@@ -1,20 +0,0 @@
|
||||
ares.components += z80
|
||||
ares.components += tms9918
|
||||
ares.components += sn76489
|
||||
ares.components += i8255
|
||||
|
||||
ares.objects += ares-sg-cpu
|
||||
ares.objects += ares-sg-vdp
|
||||
ares.objects += ares-sg-psg
|
||||
ares.objects += ares-sg-ppi
|
||||
ares.objects += ares-sg-system
|
||||
ares.objects += ares-sg-cartridge
|
||||
ares.objects += ares-sg-controller
|
||||
|
||||
$(object.path)/ares-sg-cpu.o: $(ares.path)/sg/cpu/cpu.cpp
|
||||
$(object.path)/ares-sg-vdp.o: $(ares.path)/sg/vdp/vdp.cpp
|
||||
$(object.path)/ares-sg-psg.o: $(ares.path)/sg/psg/psg.cpp
|
||||
$(object.path)/ares-sg-ppi.o: $(ares.path)/sg/ppi/ppi.cpp
|
||||
$(object.path)/ares-sg-system.o: $(ares.path)/sg/system/system.cpp
|
||||
$(object.path)/ares-sg-cartridge.o: $(ares.path)/sg/cartridge/cartridge.cpp
|
||||
$(object.path)/ares-sg-controller.o: $(ares.path)/sg/controller/controller.cpp
|
||||
@@ -1,14 +0,0 @@
|
||||
ares.components += z80
|
||||
ares.components += ay38910
|
||||
|
||||
ares.objects += ares-spec-keyboard ares-spec-expansion ares-spec-system
|
||||
ares.objects += ares-spec-cpu ares-spec-ula ares-spec-psg
|
||||
ares.objects += ares-spec-tape
|
||||
|
||||
$(object.path)/ares-spec-keyboard.o: $(ares.path)/spec/keyboard/keyboard.cpp
|
||||
$(object.path)/ares-spec-expansion.o: $(ares.path)/spec/expansion/expansion.cpp
|
||||
$(object.path)/ares-spec-system.o: $(ares.path)/spec/system/system.cpp
|
||||
$(object.path)/ares-spec-cpu.o: $(ares.path)/spec/cpu/cpu.cpp
|
||||
$(object.path)/ares-spec-ula.o: $(ares.path)/spec/ula/ula.cpp
|
||||
$(object.path)/ares-spec-psg.o: $(ares.path)/spec/psg/psg.cpp
|
||||
$(object.path)/ares-spec-tape.o: $(ares.path)/spec/tape/tape.cpp
|
||||
@@ -1,20 +0,0 @@
|
||||
ares.components += v30mz
|
||||
ares.components += m93lcx6
|
||||
|
||||
ares.objects += ares-ws-system
|
||||
ares.objects += ares-ws-memory
|
||||
ares.objects += ares-ws-eeprom
|
||||
ares.objects += ares-ws-cartridge
|
||||
ares.objects += ares-ws-cpu
|
||||
ares.objects += ares-ws-ppu
|
||||
ares.objects += ares-ws-apu
|
||||
ares.objects += ares-ws-serial
|
||||
|
||||
$(object.path)/ares-ws-system.o: $(ares.path)/ws/system/system.cpp
|
||||
$(object.path)/ares-ws-memory.o: $(ares.path)/ws/memory/memory.cpp
|
||||
$(object.path)/ares-ws-eeprom.o: $(ares.path)/ws/eeprom/eeprom.cpp
|
||||
$(object.path)/ares-ws-cartridge.o: $(ares.path)/ws/cartridge/cartridge.cpp
|
||||
$(object.path)/ares-ws-cpu.o: $(ares.path)/ws/cpu/cpu.cpp
|
||||
$(object.path)/ares-ws-ppu.o: $(ares.path)/ws/ppu/ppu.cpp
|
||||
$(object.path)/ares-ws-apu.o: $(ares.path)/ws/apu/apu.cpp
|
||||
$(object.path)/ares-ws-serial.o: $(ares.path)/ws/serial/serial.cpp
|
||||
@@ -18,12 +18,14 @@ endif()
|
||||
|
||||
# Set default global project variables
|
||||
set(ARES_NAME "ares")
|
||||
set(ARES_WEBSITE "https://ares-emu.net")
|
||||
set(ARES_WEBSITE "ares-emu.net")
|
||||
set(
|
||||
ARES_COMMENTS
|
||||
"ares is a cross-platform, open source, multi-system emulator, focusing on accuracy and preservation."
|
||||
)
|
||||
string(TIMESTAMP CURRENT_YEAR "%Y")
|
||||
set(ARES_LEGAL_COPYRIGHT "Copyright (c) 2004-${CURRENT_YEAR} ares team, Near et. al.")
|
||||
set(ARES_LEGAL_COPYRIGHT_SHORT "2004-${CURRENT_YEAR} ares team, Near")
|
||||
|
||||
# Add common module directories to default search path
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/common" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/finders")
|
||||
|
||||
@@ -11,7 +11,9 @@ elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
|
||||
set(CMAKE_CXX_EXTENSIONS FALSE)
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos")
|
||||
if(NOT DEFINED ENV{MACOSX_DEPLOYMENT_TARGET})
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
|
||||
if(NOT DEFINED CMAKE_OSX_DEPLOYMENT_TARGET OR ("${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL ""))
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
|
||||
endif()
|
||||
endif()
|
||||
set(OS_MACOS TRUE)
|
||||
elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|FreeBSD|OpenBSD")
|
||||
|
||||
@@ -4,7 +4,7 @@ set(_ares_version 0)
|
||||
|
||||
if(NOT DEFINED ARES_VERSION_OVERRIDE AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
|
||||
execute_process(
|
||||
COMMAND git describe --always --tags --dirty=-modified
|
||||
COMMAND git describe --always --tags --exclude=nightly --dirty=-modified
|
||||
OUTPUT_VARIABLE ARES_VERSION
|
||||
ERROR_VARIABLE _git_describe_err
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
|
||||
@@ -87,7 +87,10 @@ if(MoltenVK_FOUND)
|
||||
endif()
|
||||
set_target_properties(
|
||||
MoltenVK::MoltenVK
|
||||
PROPERTIES INTERFACE_COMPILE_OPTIONS "${PC_MoltenVK_CFLAGS_OTHER}" VERSION ${MoltenVK_VERSION}
|
||||
PROPERTIES
|
||||
INTERFACE_COMPILE_OPTIONS "${PC_MoltenVK_CFLAGS_OTHER}"
|
||||
VERSION ${MoltenVK_VERSION}
|
||||
MACOS_VERSION_REQUIRED 10.15
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -108,6 +108,8 @@ if(librashader_FOUND AND ARES_ENABLE_LIBRASHADER)
|
||||
if(NOT TARGET librashader::librashader)
|
||||
add_library(librashader::librashader UNKNOWN IMPORTED)
|
||||
set_property(TARGET librashader::librashader PROPERTY IMPORTED_LOCATION "${librashader_LIBRARY}")
|
||||
# cargo does not set the minimum version correctly in the dylib, so manually define librashader's actual system requirement
|
||||
set_property(TARGET librashader::librashader PROPERTY MACOS_VERSION_REQUIRED 10.15)
|
||||
|
||||
librashader_set_soname()
|
||||
set_target_properties(
|
||||
|
||||
@@ -57,7 +57,7 @@ mark_as_advanced(slang_shaders_LOCATION)
|
||||
if(NOT TARGET libretro::slang_shaders)
|
||||
if(slang_shaders_LOCATION)
|
||||
add_library(slang_shaders INTERFACE)
|
||||
set_target_properties(slang_shaders PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${slang_shaders_LOCATION}")
|
||||
set_target_properties(slang_shaders PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${slang_shaders_LOCATION}" MACOS_VERSION_REQUIRED 10.15)
|
||||
add_library(libretro::slang_shaders ALIAS slang_shaders)
|
||||
endif()
|
||||
endif()
|
||||
+15
-10
@@ -22,17 +22,17 @@ function(ares_configure_executable target)
|
||||
get_target_property(target_type ${target} TYPE)
|
||||
|
||||
if(target_type STREQUAL EXECUTABLE)
|
||||
if(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_STYLE STREQUAL Automatic)
|
||||
get_target_property(is_bundle ${target} MACOSX_BUNDLE)
|
||||
get_target_property(target_output_name ${target} OUTPUT_NAME)
|
||||
if(is_bundle)
|
||||
set(plist_file "resource/${target_output_name}.plist.in")
|
||||
configure_file(${plist_file} "${target_output_name}.plist" @ONLY)
|
||||
set(entitlements_file "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/entitlements.plist")
|
||||
else()
|
||||
set(entitlements_file "${CMAKE_CURRENT_SOURCE_DIR}/cmake/macos/entitlements.plist")
|
||||
# configure_file(cmake/macos/exportOptions.plist.in ${CMAKE_BINARY_DIR}/exportOptions.plist)
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${entitlements_file}")
|
||||
message(AUTHOR_WARNING "Target ${target} is missing an entitlements file in its cmake directory.")
|
||||
else()
|
||||
set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${entitlements_file}")
|
||||
if(NOT EXISTS "${entitlements_file}")
|
||||
message(AUTHOR_WARNING "Target ${target} is missing an entitlements file in its cmake directory.")
|
||||
else()
|
||||
set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${entitlements_file}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
_bundle_dependencies(${target})
|
||||
@@ -108,10 +108,15 @@ function(_bundle_dependencies target)
|
||||
endforeach()
|
||||
cmake_path(IS_PREFIX system_library_path "${imported_location}" is_system_framework)
|
||||
|
||||
unset(_required_macos)
|
||||
get_target_property(_required_macos ${library} MACOS_VERSION_REQUIRED)
|
||||
|
||||
if(is_system_framework OR is_xcode_framework)
|
||||
continue()
|
||||
elseif(is_framework)
|
||||
file(REAL_PATH "../../.." library_location BASE_DIRECTORY "${imported_location}")
|
||||
elseif(_required_macos VERSION_GREATER CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||
continue()
|
||||
elseif(NOT library_type STREQUAL "STATIC_LIBRARY")
|
||||
if(NOT imported_location MATCHES ".+\\.a")
|
||||
set(library_location "${imported_location}")
|
||||
|
||||
@@ -147,6 +147,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
add_link_options("$<$<CONFIG:Debug,RelWithDebInfo>:${_ares_mingw_gcc_debug_link_options}>")
|
||||
|
||||
add_compile_options(${_ares_gcc_common_options})
|
||||
add_link_options(-static-libstdc++)
|
||||
endif()
|
||||
|
||||
# arch/machine-specific optimizations
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
name := ares
|
||||
build := optimized
|
||||
threaded := true
|
||||
openmp := false
|
||||
vulkan := true
|
||||
sdl2 := true
|
||||
local := true
|
||||
lto := true
|
||||
librashader := true
|
||||
flags += -I. -I.. -I../ares -I../thirdparty -I../thirdparty/librashader/include -DMIA_LIBRARY
|
||||
|
||||
nall.path := ../nall
|
||||
include $(nall.path)/GNUmakefile
|
||||
|
||||
ifneq ($(filter $(arch),x86 amd64),)
|
||||
ifeq ($(filter cl,$(compiler)),)
|
||||
ifeq ($(local),true)
|
||||
flags += -march=native
|
||||
else
|
||||
# For official builds, default to x86-64-v2 (Intel Nehalem, AMD Bulldozer) which supports up to SSE 4.2.
|
||||
flags += -march=x86-64-v2
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(platform),macos)
|
||||
ares.dylibs :=
|
||||
endif
|
||||
|
||||
libco.path := ../libco
|
||||
include $(libco.path)/GNUmakefile
|
||||
|
||||
thirdparty.path := ../thirdparty
|
||||
sljit.path := $(thirdparty.path)/sljit/sljit_src
|
||||
libchdr.path := $(thirdparty.path)/libchdr
|
||||
tzxfile.path := $(thirdparty.path)/TZXFile
|
||||
ymfm.path := $(thirdparty.path)/ymfm
|
||||
include $(thirdparty.path)/GNUmakefile
|
||||
|
||||
ifeq ($(platform),macos)
|
||||
librashader.path := $(thirdparty.path)/librashader/target/optimized/librashader.dylib
|
||||
else ifeq ($(platform), windows)
|
||||
ifneq ($(wildcard $(thirdparty.path)/librashader/target/aarch64-pc-windows-msvc/optimized/librashader.dll),)
|
||||
librashader.path := $(thirdparty.path)/librashader/target/aarch64-pc-windows-msvc/optimized/librashader.dll
|
||||
else
|
||||
librashader.path := $(thirdparty.path)/librashader/target/optimized/librashader.dll
|
||||
endif
|
||||
endif
|
||||
|
||||
ruby.path := ../ruby
|
||||
include $(ruby.path)/GNUmakefile
|
||||
|
||||
hiro.path := ../hiro
|
||||
hiro.resource := resource/ares.rc
|
||||
include $(hiro.path)/GNUmakefile
|
||||
|
||||
profile := performance
|
||||
cores := a26 fc sfc n64 sg ms md ps1 pce ng msx cv myvision gb gba ws ngp spec
|
||||
#cores += saturn
|
||||
|
||||
ares.path := ../ares
|
||||
include $(ares.path)/GNUmakefile
|
||||
|
||||
mia.path := ../mia
|
||||
|
||||
mia.objects := mia mia-resource
|
||||
mia.objects := $(mia.objects:%=$(object.path)/%.o)
|
||||
|
||||
$(object.path)/mia.o: $(mia.path)/mia.cpp
|
||||
$(object.path)/mia-resource.o: $(mia.path)/resource/resource.cpp
|
||||
|
||||
desktop-ui.path = ../desktop-ui
|
||||
|
||||
desktop-ui.objects += desktop-ui desktop-ui-resource desktop-ui-input desktop-ui-game-browser desktop-ui-emulator
|
||||
desktop-ui.objects += desktop-ui-program desktop-ui-presentation desktop-ui-settings desktop-ui-tools
|
||||
desktop-ui.objects := $(desktop-ui.objects:%=$(object.path)/%.o)
|
||||
|
||||
$(object.path)/desktop-ui.o: $(desktop-ui.path)/desktop-ui.cpp
|
||||
$(object.path)/desktop-ui-resource.o: $(desktop-ui.path)/resource/resource.cpp
|
||||
$(object.path)/desktop-ui-input.o: $(desktop-ui.path)/input/input.cpp
|
||||
$(object.path)/desktop-ui-emulator.o: $(desktop-ui.path)/emulator/emulator.cpp
|
||||
$(object.path)/desktop-ui-game-browser.o: $(desktop-ui.path)/game-browser/game-browser.cpp
|
||||
$(object.path)/desktop-ui-program.o: $(desktop-ui.path)/program/program.cpp
|
||||
$(object.path)/desktop-ui-presentation.o: $(desktop-ui.path)/presentation/presentation.cpp
|
||||
$(object.path)/desktop-ui-settings.o: $(desktop-ui.path)/settings/settings.cpp
|
||||
$(object.path)/desktop-ui-tools.o: $(desktop-ui.path)/tools/tools.cpp
|
||||
|
||||
all.objects := $(libco.objects) $(sljit.objects) $(libchdr.objects) $(tzxfile.objects) $(ymfm.objects) $(nall.objects) $(ruby.objects) $(hiro.objects) $(ares.objects) $(mia.objects) $(desktop-ui.objects)
|
||||
all.options := $(options) $(libco.options) $(sljit.options) $(libchdr.options) $(tzxfile.options) $(ymfm.options) $(nall.options) $(ruby.options) $(hiro.options) $(ares.options) $(mia.options) $(desktop-ui.options)
|
||||
|
||||
$(all.objects): | $(object.path)
|
||||
|
||||
all: output
|
||||
ifneq ($(MAKECMDGOALS),clean)
|
||||
ifeq ($(platform),macos)
|
||||
ifeq ($(librashader), true)
|
||||
ifeq ($(wildcard $(librashader.path)),)
|
||||
$(error Tried to compile ares for macOS with librashader enabled, but no librashader library was found. Compile it with thirdparty/librashader/build-librashader.sh, or disable librashader by compiling ares with librashader=false)
|
||||
endif
|
||||
ares.dylibs += $(librashader.path)
|
||||
endif
|
||||
else ifeq ($(platform), windows)
|
||||
ifeq ($(librashader), true)
|
||||
ifeq ($(wildcard $(librashader.path)),)
|
||||
$(error Tried to compile ares for Windows with librashader enabled, but no librashader library was found. Compile it with thirdparty/librashader/build-librashader.sh, or disable librashader by compiling ares with librashader=false)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
output: $(all.objects) | $(output.path)
|
||||
$(info Linking $(output.path)/$(name)$(extension) ...)
|
||||
+@$(compiler) $(call exe,$(output.path)/$(name)$(extension)) $(all.objects) $(all.options)
|
||||
$(call copy,../LICENSE,$(output.path)/LICENSE.txt)
|
||||
ifeq ($(platform),macos)
|
||||
# Apply workaround for buggy linker in Xcode < 11.4.1
|
||||
@$(compiler) -o $(output.path)/macos-fix-jit macos-fix-jit.cpp
|
||||
$(output.path)/macos-fix-jit $(output.path)/$(name)
|
||||
rm -f $(output.path)/macos-fix-jit
|
||||
rm -rf $(output.path)/$(name).app
|
||||
install_name_tool -add_rpath @executable_path/../Frameworks $(output.path)/$(name)
|
||||
mkdir -p $(output.path)/$(name).app/Contents/MacOS/
|
||||
mkdir -p $(output.path)/$(name).app/Contents/Resources/
|
||||
mkdir -p $(output.path)/$(name).app/Contents/Frameworks/
|
||||
ifneq ($(ares.dylibs),)
|
||||
cp $(ares.dylibs) $(output.path)/$(name).app/Contents/Frameworks/
|
||||
endif
|
||||
mv $(output.path)/$(name) $(output.path)/$(name).app/Contents/MacOS/$(name)
|
||||
cp resource/$(name).plist $(output.path)/$(name).app/Contents/Info.plist
|
||||
$(call mkdir,$(output.path)/$(name).app/Contents/Resources/Shaders/)
|
||||
$(call mkdir,$(output.path)/$(name).app/Contents/Resources/Database/)
|
||||
ifeq ($(build),debug)
|
||||
# Try to copy the debug .metallib into the .app bundle; if we don't succeed, user will see runtime log message
|
||||
-cp ../ruby/video/metal/shaders.metallib $(output.path)/$(name).app/Contents/Resources/Shaders/shaders.metallib
|
||||
endif
|
||||
cp ../ruby/video/metal/Shaders.metal $(output.path)/$(name).app/Contents/Resources/Shaders/Shaders.metal
|
||||
$(call rcopy,$(thirdparty.path)/slang-shaders/*,$(output.path)/$(name).app/Contents/Resources/Shaders/)
|
||||
$(call rcopy,$(mia.path)/Database/*,$(output.path)/$(name).app/Contents/Resources/Database/)
|
||||
sips -s format icns resource/$(name).png --out $(output.path)/$(name).app/Contents/Resources/$(name).icns
|
||||
codesign --force --deep --options runtime --entitlements resource/$(name).selfsigned.entitlements --sign - $(output.path)/$(name).app
|
||||
else ifneq ($(filter $(platform),windows linux bsd),)
|
||||
$(call mkdir,$(output.path)/Shaders/)
|
||||
$(call mkdir,$(output.path)/Database/)
|
||||
$(call rcopy,$(thirdparty.path)/slang-shaders/*,$(output.path)/Shaders/)
|
||||
$(call rcopy,$(mia.path)/Database/*,$(output.path)/Database/)
|
||||
ifeq ($(librashader), true)
|
||||
ifdef librashader.path
|
||||
$(call copy,$(librashader.path),$(output.path)/)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
verbose: nall.verbose ruby.verbose hiro.verbose all;
|
||||
|
||||
clean:
|
||||
ifeq ($(platform),macos)
|
||||
rm -rf $(output.path)/$(name).app
|
||||
endif
|
||||
$(call rdelete,$(object.path))
|
||||
$(call rdelete,$(output.path))
|
||||
|
||||
install: all
|
||||
ifeq ($(platform),windows)
|
||||
$(call mkdir,$(prefix)/$(name)/)
|
||||
else ifeq ($(shell id -un),root)
|
||||
$(error "make install should not be run as root")
|
||||
else ifeq ($(platform),macos)
|
||||
mkdir -p ~/Library/Application\ Support/$(name)/
|
||||
cp -R $(output.path)/$(name).app /Applications/$(name).app
|
||||
else ifneq ($(filter $(platform),linux bsd),)
|
||||
mkdir -p $(prefix)/bin/
|
||||
mkdir -p $(prefix)/share/applications/
|
||||
mkdir -p $(prefix)/share/icons/hicolor/256x256/apps/
|
||||
mkdir -p $(prefix)/share/$(name)/Shaders/
|
||||
mkdir -p $(prefix)/share/$(name)/Database/
|
||||
cp $(output.path)/$(name) $(prefix)/bin/$(name)
|
||||
cp -R $(thirdparty.path)/slang-shaders/* $(prefix)/share/$(name)/Shaders/
|
||||
cp -R $(mia.path)/Database/* $(prefix)/share/$(name)/Database/
|
||||
cp resource/$(name).desktop $(prefix)/share/applications/$(name).desktop
|
||||
cp resource/$(name).png $(prefix)/share/icons/hicolor/256x256/apps/$(name).png
|
||||
endif
|
||||
|
||||
uninstall:
|
||||
ifeq ($(platform),windows)
|
||||
else ifeq ($(shell id -un),root)
|
||||
$(error "make uninstall should not be run as root")
|
||||
else ifeq ($(platform),macos)
|
||||
rm -rf /Applications/$(name).app
|
||||
else ifneq ($(filter $(platform),linux bsd),)
|
||||
rm -f $(prefix)/bin/$(name)
|
||||
rm -f $(prefix)/share/applications/$(name).desktop
|
||||
rm -f $(prefix)/share/icons/hicolor/256x256/apps/$(name).png
|
||||
endif
|
||||
|
||||
-include $(object.path)/*.d
|
||||
@@ -12,8 +12,6 @@ set_target_xcode_properties(
|
||||
CLANG_ENABLE_OBJC_ARC YES
|
||||
SKIP_INSTALL NO
|
||||
INSTALL_PATH "$(LOCAL_APPS_DIR)"
|
||||
INFOPLIST_KEY_CFBundleDisplayName "ares"
|
||||
INFOPLIST_KEY_NSHumanReadableCopyright "(c) 2004-${CURRENT_YEAR} ares team, Near et. al."
|
||||
)
|
||||
|
||||
set_target_properties(
|
||||
@@ -21,7 +19,7 @@ set_target_properties(
|
||||
PROPERTIES
|
||||
OUTPUT_NAME ares
|
||||
MACOSX_BUNDLE TRUE
|
||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/resource/ares.plist"
|
||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/ares.plist"
|
||||
XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY YES
|
||||
XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY YES
|
||||
XCODE_EMBED_PLUGINS_REMOVE_HEADERS_ON_COPY YES
|
||||
@@ -67,20 +65,24 @@ endfunction()
|
||||
# Add slang-shaders as a post-build script so we don't have an exceedingly long "Copy Files" phase
|
||||
if(ARES_ENABLE_LIBRASHADER)
|
||||
if(TARGET libretro::slang_shaders)
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${XCODE}>,$<CONFIG>,>/ares.app/Contents/Resources/Shaders/bilinear.slangp"
|
||||
POST_BUILD
|
||||
COMMAND ditto "${slang_shaders_LOCATION}" "$<TARGET_BUNDLE_CONTENT_DIR:desktop-ui>/Resources/Shaders/"
|
||||
WORKING_DIRECTORY "$<TARGET_BUNDLE_CONTENT_DIR:desktop-ui>"
|
||||
COMMENT "Copying slang shaders to app bundle"
|
||||
)
|
||||
add_custom_target(
|
||||
bundled_shaders
|
||||
DEPENDS
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${XCODE}>,$<CONFIG>,>/ares.app/Contents/Resources/Shaders/bilinear.slangp"
|
||||
)
|
||||
add_dependencies(desktop-ui bundled_shaders)
|
||||
get_target_property(_required_macos libretro::slang_shaders MACOS_VERSION_REQUIRED)
|
||||
if(_required_macos VERSION_LESS_EQUAL CMAKE_OSX_DEPLOYMENT_TARGET)
|
||||
add_custom_command(
|
||||
OUTPUT
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${XCODE}>,$<CONFIG>,>/ares.app/Contents/Resources/Shaders/bilinear.slangp"
|
||||
POST_BUILD
|
||||
COMMAND ditto "${slang_shaders_LOCATION}" "$<TARGET_BUNDLE_CONTENT_DIR:desktop-ui>/Resources/Shaders/"
|
||||
WORKING_DIRECTORY "$<TARGET_BUNDLE_CONTENT_DIR:desktop-ui>"
|
||||
COMMENT "Copying slang shaders to app bundle"
|
||||
)
|
||||
add_custom_target(
|
||||
bundled_shaders
|
||||
DEPENDS
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/$<IF:$<BOOL:${XCODE}>,$<CONFIG>,>/ares.app/Contents/Resources/Shaders/bilinear.slangp"
|
||||
)
|
||||
add_dependencies(desktop-ui bundled_shaders)
|
||||
endif()
|
||||
unset(_required_macos)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ auto SuperFamicom::load() -> LoadResult {
|
||||
|
||||
if(auto slot = cartridge->find<ares::Node::Port>("Super Game Boy/Cartridge Slot")) {
|
||||
gb = mia::Medium::create("Game Boy");
|
||||
if(gb->load(Emulator::load(gb, settings.paths.superFamicom.gameBoy)) != successful) {
|
||||
if(gb->load(Emulator::load(gb, settings.paths.superFamicom.gameBoy)) == successful) {
|
||||
slot->allocate();
|
||||
slot->connect();
|
||||
} else {
|
||||
@@ -125,7 +125,7 @@ auto SuperFamicom::load() -> LoadResult {
|
||||
|
||||
if(auto slot = cartridge->find<ares::Node::Port>("BS Memory Slot")) {
|
||||
bs = mia::Medium::create("BS Memory");
|
||||
if(bs->load(Emulator::load(bs, settings.paths.superFamicom.bsMemory)) != successful) {
|
||||
if(bs->load(Emulator::load(bs, settings.paths.superFamicom.bsMemory)) == successful) {
|
||||
slot->allocate();
|
||||
slot->connect();
|
||||
} else {
|
||||
@@ -135,7 +135,7 @@ auto SuperFamicom::load() -> LoadResult {
|
||||
|
||||
if(auto slot = cartridge->find<ares::Node::Port>("Sufami Turbo Slot A")) {
|
||||
stA = mia::Medium::create("Sufami Turbo");
|
||||
if(stA->load(Emulator::load(stA, settings.paths.superFamicom.sufamiTurbo)) != successful) {
|
||||
if(stA->load(Emulator::load(stA, settings.paths.superFamicom.sufamiTurbo)) == successful) {
|
||||
slot->allocate();
|
||||
slot->connect();
|
||||
} else {
|
||||
@@ -145,7 +145,7 @@ auto SuperFamicom::load() -> LoadResult {
|
||||
|
||||
if(auto slot = cartridge->find<ares::Node::Port>("Sufami Turbo Slot B")) {
|
||||
stB = mia::Medium::create("Sufami Turbo");
|
||||
if(stB->load(Emulator::load(stB, settings.paths.superFamicom.sufamiTurbo)) != successful) {
|
||||
if(stB->load(Emulator::load(stB, settings.paths.superFamicom.sufamiTurbo)) == successful) {
|
||||
slot->allocate();
|
||||
slot->connect();
|
||||
} else {
|
||||
|
||||
@@ -260,7 +260,7 @@ Presentation::Presentation() {
|
||||
loadEmulators();
|
||||
|
||||
resizeWindow();
|
||||
setTitle({ares::Name, " v", ares::Version});
|
||||
setTitle({ares::Name, " ", ares::Version});
|
||||
setAssociatedFile();
|
||||
setBackgroundColor({0, 0, 0});
|
||||
setAlignment(Alignment::Center);
|
||||
@@ -589,7 +589,7 @@ auto Presentation::refreshSystemMenu() -> void {
|
||||
}
|
||||
|
||||
auto Presentation::unloadEmulator(bool reloading) -> void {
|
||||
setTitle({ares::Name, " v", ares::Version});
|
||||
setTitle({ares::Name, " ", ares::Version});
|
||||
setAssociatedFile();
|
||||
systemMenu.setVisible(false);
|
||||
systemMenu.reset();
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
build := stable
|
||||
nall.path := ../../nall
|
||||
include $(nall.path)/GNUmakefile
|
||||
|
||||
all:
|
||||
sourcery resource.bml resource.cpp resource.hpp
|
||||
|
||||
clean:
|
||||
$(call delete,resource.cpp)
|
||||
$(call delete,resource.hpp)
|
||||
@@ -19,9 +19,9 @@
|
||||
<key>NSSupportsAutomaticGraphicsSwitching</key>
|
||||
<true/>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.13</string>
|
||||
<string>@CMAKE_OSX_DEPLOYMENT_TARGET@</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © ares Team and Contributors.</string>
|
||||
<string>@ARES_LEGAL_COPYRIGHT@</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-library-validation</key>
|
||||
<true/>
|
||||
<key>com.apple.security.get-task-allow</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,4 +0,0 @@
|
||||
#include "resource.hpp"
|
||||
|
||||
namespace Resource {
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
namespace Resource {
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
ifeq ($(platform),windows)
|
||||
ifeq ($(hiro),)
|
||||
hiro := windows
|
||||
endif
|
||||
|
||||
ifeq ($(hiro),windows)
|
||||
hiro.flags = $(flags.cpp) -DHIRO_WINDOWS
|
||||
hiro.options = $(call lib,kernel32 user32 gdi32 advapi32 ole32 comctl32 comdlg32 uxtheme msimg32 dwmapi)
|
||||
else
|
||||
# require dynamic linking for all other backends
|
||||
static ?= false
|
||||
ifeq ($(static),true)
|
||||
$(error hiro does not support static linking against $(hiro) on Windows)
|
||||
endif
|
||||
|
||||
hiro.flags = $(flags.cpp) $(if $(findstring g++,$(compiler)),-Wno-deprecated-declarations)
|
||||
|
||||
ifeq ($(hiro),gtk2)
|
||||
hiro.flags += -DHIRO_GTK=2 $(shell $(pkg_config) --cflags gtk+-2.0)
|
||||
hiro.options = $(shell $(pkg_config) --libs gtk+-2.0)
|
||||
else ifeq ($(hiro),gtk3)
|
||||
hiro.flags += -DHIRO_GTK=3 $(shell $(pkg_config) --cflags gtk+-3.0)
|
||||
hiro.options = $(shell $(pkg_config) --libs gtk+-3.0)
|
||||
else ifeq ($(hiro),qt5)
|
||||
moc = $(shell $(pkg_config) --variable=host_bins Qt5Core)/moc
|
||||
hiro.flags += -DHIRO_QT=5 $(shell $(pkg_config) --cflags Qt5Core Qt5Gui Qt5Widgets)
|
||||
hiro.options = $(shell $(pkg_config) --libs Qt5Core Qt5Gui Qt5Widgets)
|
||||
else
|
||||
$(error unrecognized hiro backend $(hiro))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(platform),macos)
|
||||
ifeq ($(hiro),)
|
||||
hiro := cocoa
|
||||
endif
|
||||
|
||||
ifeq ($(hiro),cocoa)
|
||||
hiro.flags = $(flags.objcpp) -w -DHIRO_COCOA
|
||||
hiro.options = -framework Cocoa -framework Carbon -framework IOKit -framework Security
|
||||
else
|
||||
$(error unrecognized hiro backend $(hiro))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(filter $(platform),linux bsd),)
|
||||
ifeq ($(hiro),)
|
||||
hiro := gtk3
|
||||
endif
|
||||
|
||||
ifeq ($(hiro),gtk2)
|
||||
hiro.flags = $(flags.cpp) -DHIRO_GTK=2 $(shell $(pkg_config) --cflags gtk+-2.0) -Wno-deprecated-declarations
|
||||
hiro.options = -L/usr/local/lib -lX11 $(shell $(pkg_config) --libs gtk+-2.0)
|
||||
else ifeq ($(hiro),gtk2-se)
|
||||
flags += -DHiro_SourceEdit
|
||||
hiro.flags = $(flags.cpp) -DHIRO_GTK=2 $(shell $(pkg_config) --cflags gtk+-2.0 gtksourceview-2.0) -Wno-deprecated-declarations
|
||||
hiro.options = -L/usr/local/lib -lX11 $(shell $(pkg_config) --libs gtk+-2.0 gtksourceview-2.0)
|
||||
else ifeq ($(hiro),gtk3)
|
||||
hiro.flags = $(flags.cpp) -DHIRO_GTK=3 $(shell $(pkg_config) --cflags gtk+-3.0) -Wno-deprecated-declarations
|
||||
hiro.options = -L/usr/local/lib -lX11 $(shell $(pkg_config) --libs gtk+-3.0)
|
||||
else ifeq ($(hiro),gtk3-se)
|
||||
flags += -DHiro_SourceEdit
|
||||
hiro.flags = $(flags.cpp) -DHIRO_GTK=3 $(shell $(pkg_config) --cflags gtk+-3.0 gtksourceview-3.0) -Wno-deprecated-declarations
|
||||
hiro.options = -L/usr/local/lib -lX11 $(shell $(pkg_config) --libs gtk+-3.0 gtksourceview-3.0)
|
||||
else ifeq ($(hiro),qt4)
|
||||
moc = /usr/local/lib/qt4/bin/moc
|
||||
hiro.flags = $(flags.cpp) -DHIRO_QT=4 $(shell $(pkg_config) --cflags QtCore QtGui)
|
||||
hiro.options = -L/usr/local/lib -lX11 $(shell $(pkg_config) --libs QtCore QtGui)
|
||||
else ifeq ($(hiro),qt5)
|
||||
moc = $(shell $(pkg_config) --variable=host_bins Qt5Core)/moc
|
||||
hiro.flags = $(flags.cpp) -DHIRO_QT=5 -fPIC $(shell $(pkg_config) --cflags Qt5Core Qt5Gui Qt5Widgets)
|
||||
hiro.options = -L/usr/local/lib -lX11 $(shell $(pkg_config) --libs Qt5Core Qt5Gui Qt5Widgets)
|
||||
else
|
||||
$(error unrecognized hiro backend $(hiro))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(hiro.resource),)
|
||||
hiro.resource := $(hiro.path)/windows/hiro.rc
|
||||
endif
|
||||
|
||||
ifneq ($(findstring windres,$(windres)),)
|
||||
# windres
|
||||
hiro.resource.extension := .o
|
||||
hiro.resource.command = $1 $2
|
||||
else
|
||||
# rc
|
||||
hiro.resource.extension := .res
|
||||
hiro.resource.command = /nologo /fo $2 $1
|
||||
endif
|
||||
|
||||
hiro.objects := \
|
||||
$(object.path)/hiro-$(hiro).o \
|
||||
$(if $(filter windows,$(hiro)),$(object.path)/hiro-resource$(hiro.resource.extension))
|
||||
|
||||
$(object.path)/hiro-$(hiro).o: $(hiro.path)/hiro.cpp
|
||||
$(if $(filter qt%,$(hiro)),$(info Compiling $(hiro.path)/qt/qt.moc ...))
|
||||
$(if $(filter qt%,$(hiro)),@$(moc) -i -o $(hiro.path)/qt/qt.moc $(hiro.path)/qt/qt.hpp)
|
||||
$(info Compiling $(subst ../,,$<) ...)
|
||||
@$(compiler) $(hiro.flags) $(flags) $(flags.deps) -c $< $(call obj,$@)
|
||||
|
||||
$(object.path)/hiro-resource$(hiro.resource.extension): $(hiro.resource)
|
||||
$(info Compiling $(subst ../,,$<) ...)
|
||||
@$(windres) $(call hiro.resource.command,$<,$@)
|
||||
|
||||
hiro.verbose:
|
||||
$(info hiro Target:)
|
||||
$(info $([space]) $(hiro))
|
||||
@@ -2,8 +2,6 @@ target_sources(hiro PRIVATE cmake/os-macos.cmake hiro.mm hiro.cpp)
|
||||
|
||||
target_enable_feature(hiro "Cocoa UI backend" HIRO_COCOA)
|
||||
|
||||
target_compile_definitions(hiro PRIVATE PLATFORM_MACOS)
|
||||
|
||||
target_link_libraries(
|
||||
hiro
|
||||
PRIVATE
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
-(void) activate {
|
||||
menuCheckItem->state.checked = !menuCheckItem->state.checked;
|
||||
auto state = menuCheckItem->state.checked ? NSOnState : NSOffState;
|
||||
auto state = menuCheckItem->state.checked ? NSControlStateValueOn : NSControlStateValueOff;
|
||||
[self setState:state];
|
||||
menuCheckItem->doToggle();
|
||||
}
|
||||
@@ -34,7 +34,7 @@ auto pMenuCheckItem::destruct() -> void {
|
||||
}
|
||||
|
||||
auto pMenuCheckItem::setChecked(bool checked) -> void {
|
||||
auto state = checked ? NSOnState : NSOffState;
|
||||
auto state = checked ? NSControlStateValueOn : NSControlStateValueOff;
|
||||
[cocoaAction setState:state];
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ auto pMenuRadioItem::setChecked() -> void {
|
||||
if(auto object = weak.acquire()) {
|
||||
if(auto self = object->self()) {
|
||||
if(auto p = dynamic_cast<pMenuRadioItem*>(self)) {
|
||||
auto state = this == p ? NSOnState : NSOffState;
|
||||
auto state = this == p ? NSControlStateValueOn : NSControlStateValueOff;
|
||||
[p->cocoaAction setState:state];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,11 +10,14 @@ auto pBrowserWindow::directory(BrowserWindow::State& state) -> string {
|
||||
if(state.title) [panel setTitle:[NSString stringWithUTF8String:state.title]];
|
||||
panel.canChooseDirectories = YES;
|
||||
panel.canChooseFiles = NO;
|
||||
panel.canCreateDirectories = YES;
|
||||
panel.directoryURL = [NSURL fileURLWithPath:[NSString stringWithUTF8String:state.path]];
|
||||
if([panel runModal] == NSModalResponseOK) {
|
||||
NSArray* files = [panel URLs];
|
||||
const char* path = [[[files objectAtIndex:0] path] UTF8String];
|
||||
if(path) result = path;
|
||||
NSString* path = panel.URLs.firstObject.path;
|
||||
if(path) {
|
||||
path = [path stringByAppendingString:@"/"];
|
||||
result = path.UTF8String;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ auto NSMakeImage(image icon, u32 scaleWidth = 0, u32 scaleHeight = 0) -> NSImage
|
||||
pixelsWide:icon.width() pixelsHigh:icon.height()
|
||||
bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES
|
||||
isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace
|
||||
bitmapFormat:NSAlphaNonpremultipliedBitmapFormat
|
||||
bitmapFormat:NSBitmapFormatAlphaNonpremultiplied
|
||||
bytesPerRow:(4 * icon.width()) bitsPerPixel:32
|
||||
];
|
||||
memory::copy<u32>([bitmap bitmapData], icon.data(), icon.width() * icon.height());
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
[self setTarget:self];
|
||||
[self setAction:@selector(activate:)];
|
||||
//NSRoundedBezelStyle has a fixed height; which breaks both icons and larger/smaller text
|
||||
[self setBezelStyle:NSRegularSquareBezelStyle];
|
||||
[self setBezelStyle:NSBezelStyleFlexiblePush];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
|
||||
[self setTarget:self];
|
||||
[self setAction:@selector(activate:)];
|
||||
[self setBezelStyle:NSRegularSquareBezelStyle];
|
||||
[self setButtonType:NSOnOffButton];
|
||||
[self setBezelStyle:NSBezelStyleFlexiblePush];
|
||||
[self setButtonType:NSButtonTypeOnOff];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(IBAction) activate:(id)sender {
|
||||
checkButton->state.checked = [self state] != NSOffState;
|
||||
checkButton->state.checked = [self state] != NSControlStateValueOff;
|
||||
checkButton->doToggle();
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ auto pCheckButton::setBordered(bool bordered) -> void {
|
||||
}
|
||||
|
||||
auto pCheckButton::setChecked(bool checked) -> void {
|
||||
[(CocoaCheckButton*)cocoaView setState:checked ? NSOnState : NSOffState];
|
||||
[(CocoaCheckButton*)cocoaView setState:checked ? NSControlStateValueOn : NSControlStateValueOff];
|
||||
}
|
||||
|
||||
auto pCheckButton::setGeometry(Geometry geometry) -> void {
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
|
||||
[self setTarget:self];
|
||||
[self setAction:@selector(activate:)];
|
||||
[self setButtonType:NSSwitchButton];
|
||||
[self setButtonType:NSButtonTypeSwitch];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(IBAction) activate:(id)sender {
|
||||
checkLabel->state.checked = [self state] != NSOffState;
|
||||
checkLabel->state.checked = [self state] != NSControlStateValueOff;
|
||||
checkLabel->doToggle();
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ auto pCheckLabel::minimumSize() const -> Size {
|
||||
}
|
||||
|
||||
auto pCheckLabel::setChecked(bool checked) -> void {
|
||||
[(CocoaCheckLabel*)cocoaView setState:checked ? NSOnState : NSOffState];
|
||||
[(CocoaCheckLabel*)cocoaView setState:checked ? NSControlStateValueOn : NSControlStateValueOff];
|
||||
}
|
||||
|
||||
auto pCheckLabel::setGeometry(Geometry geometry) -> void {
|
||||
|
||||
@@ -30,13 +30,11 @@
|
||||
auto& state = horizontalScrollBar->state;
|
||||
|
||||
switch([self hitPart]) {
|
||||
case NSScrollerIncrementLine:
|
||||
case NSScrollerIncrementPage:
|
||||
if(state.position < state.length - 1) state.position++;
|
||||
[self update];
|
||||
break;
|
||||
|
||||
case NSScrollerDecrementLine:
|
||||
case NSScrollerDecrementPage:
|
||||
if(state.position) state.position--;
|
||||
[self update];
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
[self setTarget:self];
|
||||
[self setAction:@selector(activate:)];
|
||||
[self setBezelStyle:NSRegularSquareBezelStyle];
|
||||
[self setButtonType:NSOnOffButton];
|
||||
[self setBezelStyle:NSBezelStyleFlexiblePush];
|
||||
[self setButtonType:NSButtonTypeOnOff];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -64,7 +64,7 @@ auto pRadioButton::setChecked() -> void {
|
||||
if(auto object = weak.acquire()) {
|
||||
if(auto self = object->self()) {
|
||||
if(auto p = dynamic_cast<pRadioButton*>(self)) {
|
||||
auto state = this == p ? NSOnState : NSOffState;
|
||||
auto state = this == p ? NSControlStateValueOn : NSControlStateValueOff;
|
||||
[(CocoaRadioButton*)p->cocoaView setState:state];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
[self setTarget:self];
|
||||
[self setAction:@selector(activate:)];
|
||||
[self setButtonType:NSRadioButton];
|
||||
[self setButtonType:NSButtonTypeRadio];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -60,7 +60,7 @@ auto pRadioLabel::setGroup(sGroup group) -> void {
|
||||
if(auto object = weak.acquire()) {
|
||||
if(auto self = object->self()) {
|
||||
if(auto p = dynamic_cast<pRadioLabel*>(self)) {
|
||||
auto state = p->state().checked ? NSOnState : NSOffState;
|
||||
auto state = p->state().checked ? NSControlStateValueOn : NSControlStateValueOff;
|
||||
[(CocoaRadioLabel*)p->cocoaView setState:state];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
if(self = [super initTextCell:@""]) {
|
||||
tableView = &tableViewReference;
|
||||
buttonCell = [[NSButtonCell alloc] initTextCell:@""];
|
||||
[buttonCell setButtonType:NSSwitchButton];
|
||||
[buttonCell setButtonType:NSButtonTypeSwitch];
|
||||
[buttonCell setControlSize:NSControlSizeSmall];
|
||||
[buttonCell setRefusesFirstResponder:YES];
|
||||
[buttonCell setTarget:self];
|
||||
@@ -222,7 +222,7 @@
|
||||
if(auto tableViewCell = tableViewItem->cell([view columnAtPoint:frame.origin])) {
|
||||
if(tableViewCell->state.checkable) {
|
||||
[buttonCell setHighlighted:YES];
|
||||
[buttonCell setState:(tableViewCell->state.checked ? NSOnState : NSOffState)];
|
||||
[buttonCell setState:(tableViewCell->state.checked ? NSControlStateValueOn : NSControlStateValueOff)];
|
||||
[buttonCell drawWithFrame:frame inView:view];
|
||||
frame.origin.x += frame.size.height + 2;
|
||||
frame.size.width -= frame.size.height + 2;
|
||||
|
||||
@@ -30,13 +30,11 @@
|
||||
auto& state = verticalScrollBar->state;
|
||||
|
||||
switch([self hitPart]) {
|
||||
case NSScrollerIncrementLine:
|
||||
case NSScrollerIncrementPage:
|
||||
if(state.position < state.length - 1) state.position++;
|
||||
[self update];
|
||||
break;
|
||||
|
||||
case NSScrollerDecrementLine:
|
||||
case NSScrollerDecrementPage:
|
||||
if(state.position) state.position--;
|
||||
[self update];
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
all:
|
||||
sourcery resource.bml resource.cpp resource.hpp
|
||||
|
||||
permissions:
|
||||
chmod +w icon/action/*.png
|
||||
chmod +w icon/application/*.png
|
||||
chmod +w icon/device/*.png
|
||||
chmod +w icon/edit/*.png
|
||||
chmod +w icon/emblem/*.png
|
||||
chmod +w icon/go/*.png
|
||||
chmod +w icon/media/*.png
|
||||
chmod +w icon/place/*.png
|
||||
chmod +w icon/prompt/*.png
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,194 +0,0 @@
|
||||
namespace Icon {
|
||||
namespace Action {
|
||||
extern const unsigned char Add1x[323];
|
||||
extern const unsigned char Add2x[601];
|
||||
extern const unsigned char Attach1x[649];
|
||||
extern const unsigned char Attach2x[1747];
|
||||
extern const unsigned char Bookmark1x[686];
|
||||
extern const unsigned char Bookmark2x[1532];
|
||||
extern const unsigned char Close1x[586];
|
||||
extern const unsigned char Close2x[2045];
|
||||
extern const unsigned char FullScreen1x[650];
|
||||
extern const unsigned char FullScreen2x[1256];
|
||||
extern const unsigned char Mute1x[632];
|
||||
extern const unsigned char Mute2x[1789];
|
||||
extern const unsigned char NewFile1x[477];
|
||||
extern const unsigned char NewFile2x[1008];
|
||||
extern const unsigned char NewFolder1x[635];
|
||||
extern const unsigned char NewFolder2x[1399];
|
||||
extern const unsigned char Open1x[672];
|
||||
extern const unsigned char Open2x[1550];
|
||||
extern const unsigned char Properties1x[464];
|
||||
extern const unsigned char Properties2x[1115];
|
||||
extern const unsigned char Quit1x[799];
|
||||
extern const unsigned char Quit2x[1725];
|
||||
extern const unsigned char Refresh1x[912];
|
||||
extern const unsigned char Refresh2x[2024];
|
||||
extern const unsigned char Remove1x[247];
|
||||
extern const unsigned char Remove2x[317];
|
||||
extern const unsigned char Save1x[911];
|
||||
extern const unsigned char Save2x[1971];
|
||||
extern const unsigned char Search1x[935];
|
||||
extern const unsigned char Search2x[2215];
|
||||
extern const unsigned char Settings1x[611];
|
||||
extern const unsigned char Settings2x[2129];
|
||||
extern const unsigned char Stop1x[820];
|
||||
extern const unsigned char Stop2x[1927];
|
||||
}
|
||||
namespace Application {
|
||||
extern const unsigned char Browser1x[928];
|
||||
extern const unsigned char Browser2x[2251];
|
||||
extern const unsigned char Calculator1x[686];
|
||||
extern const unsigned char Calculator2x[1382];
|
||||
extern const unsigned char Calendar1x[603];
|
||||
extern const unsigned char Calendar2x[1298];
|
||||
extern const unsigned char Chat1x[422];
|
||||
extern const unsigned char Chat2x[783];
|
||||
extern const unsigned char FileManager1x[378];
|
||||
extern const unsigned char FileManager2x[667];
|
||||
extern const unsigned char Mail1x[550];
|
||||
extern const unsigned char Mail2x[1426];
|
||||
extern const unsigned char Monitor1x[611];
|
||||
extern const unsigned char Monitor2x[1886];
|
||||
extern const unsigned char Terminal1x[668];
|
||||
extern const unsigned char Terminal2x[1488];
|
||||
extern const unsigned char TextEditor1x[574];
|
||||
extern const unsigned char TextEditor2x[1523];
|
||||
}
|
||||
namespace Device {
|
||||
extern const unsigned char Clock1x[897];
|
||||
extern const unsigned char Clock2x[2399];
|
||||
extern const unsigned char Display1x[662];
|
||||
extern const unsigned char Display2x[1596];
|
||||
extern const unsigned char Joypad1x[812];
|
||||
extern const unsigned char Joypad2x[1470];
|
||||
extern const unsigned char Keyboard1x[587];
|
||||
extern const unsigned char Keyboard2x[1110];
|
||||
extern const unsigned char Microphone1x[703];
|
||||
extern const unsigned char Microphone2x[2105];
|
||||
extern const unsigned char Mouse1x[720];
|
||||
extern const unsigned char Mouse2x[1695];
|
||||
extern const unsigned char Network1x[408];
|
||||
extern const unsigned char Network2x[1293];
|
||||
extern const unsigned char Optical1x[720];
|
||||
extern const unsigned char Optical2x[1338];
|
||||
extern const unsigned char Printer1x[481];
|
||||
extern const unsigned char Printer2x[917];
|
||||
extern const unsigned char Speaker1x[592];
|
||||
extern const unsigned char Speaker2x[1854];
|
||||
extern const unsigned char Storage1x[603];
|
||||
extern const unsigned char Storage2x[1155];
|
||||
}
|
||||
namespace Edit {
|
||||
extern const unsigned char Clear1x[773];
|
||||
extern const unsigned char Clear2x[1682];
|
||||
extern const unsigned char Copy1x[498];
|
||||
extern const unsigned char Copy2x[723];
|
||||
extern const unsigned char Cut1x[807];
|
||||
extern const unsigned char Cut2x[2087];
|
||||
extern const unsigned char Delete1x[680];
|
||||
extern const unsigned char Delete2x[2049];
|
||||
extern const unsigned char Find1x[617];
|
||||
extern const unsigned char Find2x[1636];
|
||||
extern const unsigned char Paste1x[561];
|
||||
extern const unsigned char Paste2x[1027];
|
||||
extern const unsigned char Redo1x[591];
|
||||
extern const unsigned char Redo2x[1502];
|
||||
extern const unsigned char Replace1x[776];
|
||||
extern const unsigned char Replace2x[2104];
|
||||
extern const unsigned char Undo1x[650];
|
||||
extern const unsigned char Undo2x[1601];
|
||||
}
|
||||
namespace Emblem {
|
||||
extern const unsigned char Archive1x[540];
|
||||
extern const unsigned char Archive2x[1067];
|
||||
extern const unsigned char Audio1x[688];
|
||||
extern const unsigned char Audio2x[1486];
|
||||
extern const unsigned char Binary1x[560];
|
||||
extern const unsigned char Binary2x[1675];
|
||||
extern const unsigned char File1x[741];
|
||||
extern const unsigned char File2x[1342];
|
||||
extern const unsigned char Folder1x[581];
|
||||
extern const unsigned char Folder2x[1176];
|
||||
extern const unsigned char FolderOpen1x[625];
|
||||
extern const unsigned char FolderOpen2x[1184];
|
||||
extern const unsigned char FolderTemplate1x[429];
|
||||
extern const unsigned char FolderTemplate2x[772];
|
||||
extern const unsigned char Font1x[627];
|
||||
extern const unsigned char Font2x[1121];
|
||||
extern const unsigned char Image1x[558];
|
||||
extern const unsigned char Image2x[1163];
|
||||
extern const unsigned char Markup1x[709];
|
||||
extern const unsigned char Markup2x[1759];
|
||||
extern const unsigned char Program1x[609];
|
||||
extern const unsigned char Program2x[1490];
|
||||
extern const unsigned char Script1x[516];
|
||||
extern const unsigned char Script2x[1416];
|
||||
extern const unsigned char Text1x[333];
|
||||
extern const unsigned char Text2x[744];
|
||||
extern const unsigned char Video1x[592];
|
||||
extern const unsigned char Video2x[1797];
|
||||
}
|
||||
namespace Go {
|
||||
extern const unsigned char Down1x[683];
|
||||
extern const unsigned char Down2x[1187];
|
||||
extern const unsigned char Home1x[606];
|
||||
extern const unsigned char Home2x[1774];
|
||||
extern const unsigned char Left1x[655];
|
||||
extern const unsigned char Left2x[1200];
|
||||
extern const unsigned char Right1x[676];
|
||||
extern const unsigned char Right2x[1219];
|
||||
extern const unsigned char Up1x[652];
|
||||
extern const unsigned char Up2x[1193];
|
||||
}
|
||||
namespace Media {
|
||||
extern const unsigned char Back1x[770];
|
||||
extern const unsigned char Back2x[1236];
|
||||
extern const unsigned char Eject1x[628];
|
||||
extern const unsigned char Eject2x[987];
|
||||
extern const unsigned char Flash1x[607];
|
||||
extern const unsigned char Flash2x[1323];
|
||||
extern const unsigned char Floppy1x[561];
|
||||
extern const unsigned char Floppy2x[890];
|
||||
extern const unsigned char Next1x[771];
|
||||
extern const unsigned char Next2x[1225];
|
||||
extern const unsigned char Optical1x[931];
|
||||
extern const unsigned char Optical2x[2288];
|
||||
extern const unsigned char Pause1x[464];
|
||||
extern const unsigned char Pause2x[481];
|
||||
extern const unsigned char Play1x[660];
|
||||
extern const unsigned char Play2x[1028];
|
||||
extern const unsigned char Record1x[653];
|
||||
extern const unsigned char Record2x[1266];
|
||||
extern const unsigned char Rewind1x[764];
|
||||
extern const unsigned char Rewind2x[1074];
|
||||
extern const unsigned char Skip1x[782];
|
||||
extern const unsigned char Skip2x[1205];
|
||||
extern const unsigned char Stop1x[429];
|
||||
extern const unsigned char Stop2x[571];
|
||||
}
|
||||
namespace Place {
|
||||
extern const unsigned char Bookmarks1x[753];
|
||||
extern const unsigned char Bookmarks2x[1738];
|
||||
extern const unsigned char Desktop1x[722];
|
||||
extern const unsigned char Desktop2x[910];
|
||||
extern const unsigned char Home1x[679];
|
||||
extern const unsigned char Home2x[1416];
|
||||
extern const unsigned char Server1x[642];
|
||||
extern const unsigned char Server2x[847];
|
||||
extern const unsigned char Settings1x[629];
|
||||
extern const unsigned char Settings2x[2240];
|
||||
extern const unsigned char Share1x[697];
|
||||
extern const unsigned char Share2x[1446];
|
||||
}
|
||||
namespace Prompt {
|
||||
extern const unsigned char Error1x[653];
|
||||
extern const unsigned char Error2x[1645];
|
||||
extern const unsigned char Information1x[863];
|
||||
extern const unsigned char Information2x[1910];
|
||||
extern const unsigned char Question1x[932];
|
||||
extern const unsigned char Question2x[2231];
|
||||
extern const unsigned char Warning1x[603];
|
||||
extern const unsigned char Warning2x[1391];
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
libco.objects := libco
|
||||
libco.objects := $(libco.objects:%=$(object.path)/%.o)
|
||||
|
||||
$(object.path)/libco.o: $(libco.path)/libco.c
|
||||
+4
-1
@@ -1,6 +1,8 @@
|
||||
add_library(mia STATIC mia.cpp mia.hpp resource/resource.cpp)
|
||||
add_library(ares::mia ALIAS mia)
|
||||
|
||||
add_sourcery_command(mia resource)
|
||||
|
||||
target_sources(
|
||||
mia
|
||||
PRIVATE
|
||||
@@ -121,6 +123,7 @@ if(ARES_BUILD_OPTIONAL_TARGETS)
|
||||
"$<$<PLATFORM_ID:Darwin>:$<LINK_LIBRARY:FRAMEWORK,Carbon.framework>>"
|
||||
"$<$<PLATFORM_ID:Darwin>:$<LINK_LIBRARY:FRAMEWORK,IOKit.framework>>"
|
||||
"$<$<PLATFORM_ID:Darwin>:$<LINK_LIBRARY:FRAMEWORK,Security.framework>>"
|
||||
"$<$<PLATFORM_ID:Darwin>:mia>"
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
@@ -138,7 +141,7 @@ if(ARES_BUILD_OPTIONAL_TARGETS)
|
||||
PROPERTIES
|
||||
OUTPUT_NAME mia
|
||||
MACOSX_BUNDLE TRUE
|
||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/resource/mia.plist"
|
||||
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/mia.plist"
|
||||
XCODE_EMBED_FRAMEWORKS_REMOVE_HEADERS_ON_COPY YES
|
||||
XCODE_EMBED_FRAMEWORKS_CODE_SIGN_ON_COPY YES
|
||||
XCODE_EMBED_PLUGINS_REMOVE_HEADERS_ON_COPY YES
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
name := mia
|
||||
build := optimized
|
||||
threaded := true
|
||||
local := true
|
||||
flags += -I. -I.. -I../ares -I../thirdparty
|
||||
|
||||
nall.path := ../nall
|
||||
include $(nall.path)/GNUmakefile
|
||||
|
||||
thirdparty.path := ../thirdparty
|
||||
libchdr.path := $(thirdparty.path)/libchdr
|
||||
tzxfile.path := $(thirdparty.path)/TZXFile
|
||||
include $(thirdparty.path)/GNUmakefile
|
||||
|
||||
hiro.path := ../hiro
|
||||
hiro.resource := resource/$(name).rc
|
||||
include $(hiro.path)/GNUmakefile
|
||||
|
||||
ares.path := ../ares
|
||||
mia.path := ../mia
|
||||
|
||||
objects := ares mia resource
|
||||
objects := $(objects:%=$(object.path)/%.o)
|
||||
|
||||
$(object.path)/ares.o: $(ares.path)/ares/ares.cpp
|
||||
$(object.path)/mia.o: $(mia.path)/mia.cpp
|
||||
$(object.path)/resource.o: $(mia.path)/resource/resource.cpp
|
||||
|
||||
all.objects := $(libchdr.objects) $(tzxfile.objects) $(nall.objects) $(hiro.objects) $(objects)
|
||||
all.options := $(libchdr.options) $(tzxfile.options) $(nall.options) $(hiro.options) $(options)
|
||||
|
||||
$(all.objects): | $(object.path)
|
||||
|
||||
all: $(all.objects) | $(output.path)
|
||||
$(info Linking $(output.path)/$(name)$(extension) ...)
|
||||
+@$(compiler) -o $(output.path)/$(name)$(extension) $(all.objects) $(all.options)
|
||||
ifeq ($(platform),macos)
|
||||
rm -rf $(output.path)/$(name).app
|
||||
mkdir -p $(output.path)/$(name).app/Contents/MacOS/
|
||||
mkdir -p $(output.path)/$(name).app/Contents/Resources/
|
||||
mv $(output.path)/$(name) $(output.path)/$(name).app/Contents/MacOS/$(name)
|
||||
cp resource/$(name).plist $(output.path)/$(name).app/Contents/Info.plist
|
||||
sips -s format icns resource/$(name).png --out $(output.path)/$(name).app/Contents/Resources/$(name).icns
|
||||
endif
|
||||
|
||||
verbose: hiro.verbose nall.verbose all;
|
||||
|
||||
clean:
|
||||
ifeq ($(platform),macos)
|
||||
rm -rf $(output.path)/$(name).app
|
||||
endif
|
||||
$(call delete,$(object.path)/*)
|
||||
$(call delete,$(output.path)/*)
|
||||
|
||||
install: all
|
||||
ifeq ($(platform),windows)
|
||||
$(call mkdir,$(prefix)/$(name)/)
|
||||
$(call mkdir,$(prefix)/$(name)/Database/)
|
||||
$(call mkdir,$(prefix)/$(name)/Firmware/)
|
||||
$(call rcopy,Database/*,$(prefix)/$(name)/Database/)
|
||||
$(call rcopy,Firmware/*,$(prefix)/$(name)/Firmware/)
|
||||
else ifeq ($(shell id -un),root)
|
||||
$(error "make install should not be run as root")
|
||||
else ifeq ($(platform),macos)
|
||||
cp -R $(output.path)/$(name).app /Applications/$(name).app
|
||||
else ifneq ($(filter $(platform),linux bsd),)
|
||||
mkdir -p $(prefix)/bin/
|
||||
mkdir -p $(prefix)/share/applications/
|
||||
mkdir -p $(prefix)/share/icons/
|
||||
mkdir -p $(prefix)/share/$(name)/
|
||||
mkdir -p $(prefix)/share/$(name)/Database/
|
||||
mkdir -p $(prefix)/share/$(name)/Firmware/
|
||||
cp $(output.path)/$(name) $(prefix)/bin/$(name)
|
||||
cp resource/$(name).desktop $(prefix)/share/applications/$(name).desktop
|
||||
cp resource/$(name).png $(prefix)/share/icons/$(name).png
|
||||
cp -R Database/* $(prefix)/share/$(name)/Database/
|
||||
cp -R Firmware/* $(prefix)/share/$(name)/Firmware/
|
||||
endif
|
||||
|
||||
uninstall:
|
||||
ifeq ($(platform),windows)
|
||||
else ifeq ($(shell id -un),root)
|
||||
$(error "make uninstall should not be run as root")
|
||||
else ifeq ($(platform),macos)
|
||||
rm -rf /Applications/$(name).app
|
||||
else ifneq ($(filter $(platform),linux bsd),)
|
||||
rm -f $(prefix)/bin/$(name)
|
||||
rm -f $(prefix)/share/applications/$(name).desktop
|
||||
rm -f $(prefix)/share/icons/$(name).png
|
||||
endif
|
||||
|
||||
-include $(object.path)/*.d
|
||||
@@ -1,4 +1,5 @@
|
||||
struct GameBoyColor : GameBoy {
|
||||
auto name() -> string override { return "Game Boy Color"; }
|
||||
auto saveName() -> string override { return "Game Boy"; }
|
||||
auto extensions() -> vector<string> override { return {"gb", "gbc"}; }
|
||||
};
|
||||
+6
-14
@@ -120,9 +120,12 @@ auto Mega32X::analyze(vector<u8>& rom) -> string {
|
||||
|
||||
vector<string> regions;
|
||||
string region = slice((const char*)&rom[0x01f0], 0, 16).trimRight(" ");
|
||||
if(!regions) {
|
||||
if(region == "JAPAN" ) regions.append("NTSC-J");
|
||||
if(region == "EUROPE") regions.append("PAL");
|
||||
|
||||
//Stellar Assault (U,E) is the one game using the single-byte region coding which
|
||||
//uses an 'E' value for both PAL and NTSC-U region. (NTSC-J cartridge uses '1')
|
||||
//https://segaretro.org/ROM_header#Regional_compatiblity
|
||||
if(region(0) == 'E' && hash == "2f9b6017258fbb1c37d81df07c68d5255495d3bf76d9c7b680ff66bccf665750") {
|
||||
regions.append("NTSC-U", "PAL");
|
||||
}
|
||||
if(!regions) {
|
||||
if(region.find("J")) regions.append("NTSC-J");
|
||||
@@ -143,17 +146,6 @@ auto Mega32X::analyze(vector<u8>& rom) -> string {
|
||||
regions.append("NTSC-J", "NTSC-U", "PAL");
|
||||
}
|
||||
|
||||
// FIFA Soccer 96 and Mortal Kombat II have an incorrect header, so force PAL based on name
|
||||
if(location.ifind("(Europe)") || location.ifind("(PAL)")) {
|
||||
regions.reset();
|
||||
regions.append("PAL");
|
||||
}
|
||||
|
||||
//Shadow Squadron - Stellar Assault is missing NTSC-U region in header
|
||||
if(hash == "2f9b6017258fbb1c37d81df07c68d5255495d3bf76d9c7b680ff66bccf665750") {
|
||||
regions.append("NTSC-U");
|
||||
}
|
||||
|
||||
string domesticName;
|
||||
domesticName.resize(48);
|
||||
memory::copy(domesticName.get(), &rom[0x0120], domesticName.size());
|
||||
|
||||
Loaded 100 of 4025 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user