Compare commits

..

45 commits

Author SHA1 Message Date
Richard Goedeken
47f8e92e9a
Merge pull request #91 from orbea/strict-aliasing
build: remove -fno-strict-aliasing
2024-11-03 17:44:22 -08:00
orbea
1b7c25cdaa build: remove -fno-strict-aliasing
It compiles with -Werror=strict-aliasing so this is not required.
2024-11-03 12:34:08 -08:00
orbea
5532574896 Remove executable permissions from the Makefile
mode change 100755 => 100644 projects/unix/Makefile
2024-11-03 12:32:20 -08:00
Richard Goedeken
2798e65d6f update version and release info for v2.6.0 release 2024-07-14 17:36:33 -07:00
Richard Goedeken
d972dc5ea1 update minimum macos SDK in makefile 2024-07-14 12:01:02 -07:00
Richard Goedeken
9d13986f76
Merge pull request #90 from Jj0YzL5nvJ/up2024
CI/CD: Update to generic scripts, independent schedule, etc
2024-05-26 19:56:29 -07:00
Jj0YzL5nvJ
1d690fd8a6 CI/CD: Update to generic scripts, independent schedule, etc 2024-05-24 11:17:26 -06:00
Richard Goedeken
f01be76948
Merge pull request #89 from Clownacy/patch-1
Fix check for M64P_BIG_ENDIAN
2024-01-12 20:21:12 -08:00
Clownacy
47f8cee6ce
Fix check for M64P_BIG_ENDIAN
Every check for M64P_BIG_ENDIAN in the emulator core only checks for its definition, not for its value being non-zero.
2024-01-10 17:33:07 +00:00
Richard Goedeken
f22dc14377
Merge pull request #88 from Jj0YzL5nvJ/up2023
CI/CD: Add BLAKE2 hashfile
2023-06-11 12:18:52 -07:00
Jj0YzL5nvJ
6b53db06de CI/CD: Add BLAKE2 hashfile 2023-05-22 00:24:57 -06:00
Richard Goedeken
bbfba920fc
Merge pull request #87 from Jj0YzL5nvJ/ci-schedule
CI/CD: Integrate scheduled builds and other...
2023-03-02 21:59:57 -08:00
Jj0YzL5nvJ
4ff2fe6a19 CI/CD: Integrate scheduled builds and other necessary updates 2023-02-14 23:49:33 -06:00
Richard Goedeken
ca917cec14
Merge pull request #86 from Jj0YzL5nvJ/up2022
CI/CD: Update MSVC
2022-09-30 16:59:21 -07:00
Jj0YzL5nvJ
fdebc89484 CI/CD: Update MSVC 2022-09-27 23:36:03 -06:00
Richard Goedeken
aa0ea78030
Merge pull request #85 from Jj0YzL5nvJ/ci-update
CI/CD: Update
2022-07-13 19:30:22 -07:00
Jj0YzL5nvJ
3cdee61a98 CI/CD: Update 2022-07-10 18:52:10 -06:00
bsmiles32
27580a8c33
Merge pull request #84 from derselbst/cbfd-overload
Added overload distortion effect, used by a few tracks in CBFD
2022-04-24 22:03:47 +02:00
derselbst
21b669e8a3 Add a comment regarding mp3 and cbfd ucode differences 2022-04-24 17:22:50 +02:00
Tom M
9452b4a181 Apply suggestions from code review
Co-authored-by: bsmiles32 <bobby.smiles32@gmail.com>
2022-04-24 17:13:43 +02:00
Richard Goedeken
2ae723c33b
Merge pull request #82 from Jj0YzL5nvJ/ci-github
CI/CD: Implement GitHub Actions and public nightly builds
2022-04-11 20:55:33 -07:00
Josh Ware
37682c2a12 Added overload distortion effect, used by a few tracks in CBFD 2022-02-14 19:46:05 +01:00
bsmiles32
4bac3aeb98
Merge pull request #83 from fzurita/out_of_bounds_access
Fix out of bounds memory access encountered in CBFD
2022-01-16 18:29:31 +01:00
fzurita
53e6c6a143 Fix out of bounds memory access encountered in CBFD 2022-01-16 12:26:06 -05:00
Jj0YzL5nvJ
51345ed0e5 CI/CD: Implement GitHub Actions and public nightly builds 2021-12-05 09:00:32 -07:00
Pierce Andjelkovic
88093cb434 RISC-V Support 2021-09-15 00:02:11 +02:00
Richard Goedeken
88766c6e2d bump up minimum version number so that we can still build this on modern macos 2021-02-10 21:14:23 -08:00
orbea
e653930d75 build: Allow out of tree builds.
Also fixes a case of SRCDIR being used before its set.
2020-12-15 10:17:15 +01:00
Gilles Siberlin
bb56985770
Merge pull request #79 from loganmc10/ub
Fix undefined behavior
2020-10-21 15:49:47 +02:00
Logan McNaughton
2f42716781 Fix undefined behavior 2020-10-19 10:46:51 -07:00
Richard Goedeken
b4155b7004 Revert "Allow non-default compilers without resorting to symbolic links"
This reverts commit 0ff1d46edf, as it conflicts with GNU make which always defines default values for certain variables
2020-09-16 22:31:15 -07:00
Richard Goedeken
72a1deca7d
Merge pull request #77 from Jj0YzL5nvJ/alter_cc_cxx
Allow non-default compilers without resorting to symbolic links
2020-08-31 21:19:30 -07:00
Jj0YzL5nvJ
0ff1d46edf Allow non-default compilers without resorting to symbolic links 2020-08-30 03:46:09 -06:00
Richard Goedeken
4e61df6a25
Merge pull request #76 from Jj0YzL5nvJ/alter
Allow to set custom platform toolset from commands
2020-08-19 23:36:36 -07:00
Jj0YzL5nvJ
d12cd46872 Allow to set custom platform toolset from commands 2020-08-13 11:58:07 -06:00
Jj0YzL5nvJ
2df8038d5f AppVeyor with artifact packaging 2020-03-02 09:38:16 +01:00
Jj0YzL5nvJ
7d9293ad91 Changes to have more generic project files 2020-02-26 12:39:06 +01:00
Gillou68310
f295d34727 Fix HVQM Implementation 2020-02-21 09:14:06 +01:00
Gillou68310
25b83af2f4 Rework task dispatching implementation 2020-02-20 15:49:07 +01:00
Gillou68310
fa00bf82fd Implement HVQM ucode 2020-02-03 20:50:27 +01:00
Gillou68310
c05c5e0fab Preliminary implementation for Yakouchuu II ucode 2020-02-02 12:11:05 +01:00
Gillou68310
7ea802e76e Migrate to VS2017 2019-11-13 17:15:02 +01:00
Richard Goedeken
f01fed082a add function attributes so GCC can find bugs in calls to string formatting functions with variadic arguments 2019-03-03 09:30:19 -08:00
Richard Goedeken
16c31f09c0
Merge pull request #68 from djames1/master
Added ppc64le support
2019-02-21 21:43:52 -08:00
Daniel James
42ffe474b2 Added ppc64le support 2019-02-20 11:29:49 -05:00
15 changed files with 1066 additions and 206 deletions

152
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,152 @@
name: HLE RSP
on:
push:
paths-ignore:
- '.{gitattributes,gitignore,travis.yml}'
- '*.md,appveyor.yml,README'
pull_request:
paths-ignore:
- '.{gitattributes,gitignore,travis.yml}'
- '*.md,appveyor.yml,README'
workflow_dispatch:
jobs:
Linux:
strategy:
fail-fast: false
matrix:
include:
- cc: GCC
arch: x64
- cc: GCC
arch: x86
- cc: Clang
arch: x64
- cc: Clang
arch: x86
name: Linux / ${{ matrix.cc }} / ${{ matrix.arch }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Get build dependencies and arrange the environment
run: |
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
export C_CLANG_SUFFIX="-15" C_GCC_SUFFIX="-12"
./../mupen64plus-core/.github/workflows/scripts/ci_install_ubuntu_deps.sh ${{ matrix.arch }} ${{ matrix.cc }}
- name: Build and related stuff, backup binaries
run: |
export C_CLANG_SUFFIX="-15" C_GCC_SUFFIX="-12"
./../mupen64plus-core/.github/workflows/scripts/ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} makepkg
- name: Upload artifact
if: matrix.cc == 'GCC'
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}
path: pkg/*.tar.gz
MSYS2:
strategy:
fail-fast: false
matrix:
include:
- cc: GCC
arch: x64
cross: x86_64
env: MINGW64
- cc: GCC
arch: x86
cross: i686
env: MINGW32
name: Windows / MSYS2 ${{ matrix.cc }} / ${{ matrix.arch }}
runs-on: windows-2022
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.env }}
update: true
install: >-
git
libtool
make
mingw-w64-${{ matrix.cross }}-gcc
mingw-w64-${{ matrix.cross }}-toolchain
mingw-w64-${{ matrix.cross }}-ntldd
- name: Build and related stuff, backup binaries
run: |
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
./../mupen64plus-core/.github/workflows/scripts/ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }}
- name: Backup dependencies, etc...
run: |
./../mupen64plus-core/.github/workflows/scripts/ci_backup_mingw_deps.sh ${{ matrix.env }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}
path: pkg/*
MSVC:
strategy:
fail-fast: false
matrix:
include:
- toolset: v143
arch: x64
vs: 2022
- toolset: v141_xp
arch: x86
vs: 2019
name: Windows / MSVC with ${{ matrix.toolset }} / ${{ matrix.arch }}
runs-on: windows-${{ matrix.vs }}
defaults:
run:
shell: cmd
steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v2
- name: Build and related stuff, backup binaries
run: |
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ..\mupen64plus-core
set TOOLSET=${{ matrix.toolset }}
.\..\mupen64plus-core\.github\workflows\scripts\ci_msvc_build.cmd ${{ matrix.arch }}
- name: Backup dependencies, etc...
run: |
.\..\mupen64plus-core\.github\workflows\scripts\ci_backup_msvc_deps.cmd ${{ matrix.arch }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}
path: pkg/*
Nightly-build:
runs-on: ubuntu-latest
if: github.ref_name == 'master'
needs: [Linux, MSYS2, MSVC]
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: binaries
- name: Get some tools
run: |
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
sudo apt-get update
sudo apt-get -y install hashdeep
- name: Creating new artifacts and update nightly-build
run: |
./../mupen64plus-core/.github/workflows/scripts/ci_nightly_artifacts.sh
- name: Nightly-build
uses: ncipollo/release-action@v1
with:
prerelease: true
allowUpdates: true
removeArtifacts: true
replacesArtifacts: false
tag: nightly-build
artifacts: pkg/*

148
.github/workflows/schedule.yml vendored Normal file
View file

@ -0,0 +1,148 @@
name: HLE RSP - Scheduled
on:
schedule:
- cron: '30 14 21 * *'
jobs:
Linux:
strategy:
fail-fast: false
matrix:
include:
- cc: GCC
arch: x64
- cc: GCC
arch: x86
- cc: Clang
arch: x64
- cc: Clang
arch: x86
name: Linux / ${{ matrix.cc }} / ${{ matrix.arch }}
runs-on: ubuntu-22.04
if: github.repository == 'mupen64plus/mupen64plus-rsp-hle'
steps:
- uses: actions/checkout@v4
- name: Get build dependencies and arrange the environment
run: |
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
export C_CLANG_SUFFIX="-15" C_GCC_SUFFIX="-12"
./../mupen64plus-core/.github/workflows/scripts/ci_install_ubuntu_deps.sh ${{ matrix.arch }} ${{ matrix.cc }}
- name: Build and related stuff, backup binaries
run: |
export C_CLANG_SUFFIX="-15" C_GCC_SUFFIX="-12"
./../mupen64plus-core/.github/workflows/scripts/ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }} makepkg
- name: Upload artifact
if: matrix.cc == 'GCC'
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}
path: pkg/*.tar.gz
MSYS2:
strategy:
fail-fast: false
matrix:
include:
- cc: GCC
arch: x64
cross: x86_64
env: MINGW64
- cc: GCC
arch: x86
cross: i686
env: MINGW32
name: Windows / MSYS2 ${{ matrix.cc }} / ${{ matrix.arch }}
runs-on: windows-2022
if: github.repository == 'mupen64plus/mupen64plus-rsp-hle'
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.env }}
update: true
install: >-
git
libtool
make
mingw-w64-${{ matrix.cross }}-gcc
mingw-w64-${{ matrix.cross }}-toolchain
mingw-w64-${{ matrix.cross }}-ntldd
- name: Build and related stuff, backup binaries
run: |
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
./../mupen64plus-core/.github/workflows/scripts/ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }}
- name: Backup dependencies, etc...
run: |
./../mupen64plus-core/.github/workflows/scripts/ci_backup_mingw_deps.sh ${{ matrix.env }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}
path: pkg/*
MSVC:
strategy:
fail-fast: false
matrix:
include:
- toolset: v143
arch: x64
vs: 2022
- toolset: v141_xp
arch: x86
vs: 2019
name: Windows / MSVC with ${{ matrix.toolset }} / ${{ matrix.arch }}
runs-on: windows-${{ matrix.vs }}
if: github.repository == 'mupen64plus/mupen64plus-rsp-hle'
defaults:
run:
shell: cmd
steps:
- uses: actions/checkout@v4
- uses: microsoft/setup-msbuild@v2
- name: Build and related stuff, backup binaries
run: |
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ..\mupen64plus-core
set TOOLSET=${{ matrix.toolset }}
.\..\mupen64plus-core\.github\workflows\scripts\ci_msvc_build.cmd ${{ matrix.arch }}
- name: Backup dependencies, etc...
run: |
.\..\mupen64plus-core\.github\workflows\scripts\ci_backup_msvc_deps.cmd ${{ matrix.arch }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PKG_NAME }}
path: pkg/*
Nightly-build:
runs-on: ubuntu-latest
if: github.ref_name == 'master'
needs: [Linux, MSYS2, MSVC]
steps:
- uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: binaries
- name: Get some tools
run: |
git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ../mupen64plus-core
sudo apt-get update
sudo apt-get -y install hashdeep
- name: Creating new artifacts and update nightly-build
run: |
./../mupen64plus-core/.github/workflows/scripts/ci_nightly_artifacts.sh
- name: Nightly-build
uses: ncipollo/release-action@v1
with:
prerelease: true
allowUpdates: true
removeArtifacts: true
replacesArtifacts: false
tag: nightly-build
artifacts: pkg/*

67
RELEASE
View file

@ -1,9 +1,70 @@
RSP High-Level Emulation plugin for Mupen64Plus
-----------------------------------------------
Mupen64Plus-rsp-hle v2.5.9 - February 10, 2019
----------------------------------------------
- *** BETA RELEASE *** For Testing Only ***
--------------------------------------------
# Mupen64Plus-rsp-hle v2.6.0 - July 14, 2024
## Merged PRs
* [90](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/90): CI/CD: Update to generic scripts, independent schedule, etc
* [89](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/89): Fix check for M64P_BIG_ENDIAN
* [88](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/88): CI/CD: Add BLAKE2 hashfile
* [87](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/87): CI/CD: Integrate scheduled builds and other...
* [86](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/86): CI/CD: Update MSVC
* [85](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/85): CI/CD: Update
* [84](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/84): Added overload distortion effect, used by a few tracks in CBFD
* [83](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/83): Fix out of bounds memory access encountered in CBFD
* [82](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/82): CI/CD: Implement GitHub Actions and public nightly builds
* [81](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/81): Add RISC-V Support
* [80](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/80): build: Allow out of tree builds.
* [79](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/79): Fix undefined behavior
* [77](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/77): Allow non-default compilers without resorting to symbolic links
* [76](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/76): Allow to set custom platform toolset from commands
* [75](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/75): AppVeyor with artifact packaging
* [74](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/74): Fix HQVM implementation
* [73](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/73): Rework task dispatching implementation
* [72](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/72): Changes to have more generic project files
* [70](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/70): Implement HVQM ucode
* [69](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/69): Integrate Hvqm preliminary work (not fully functional yet)
* [68](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/68): Added ppc64le support
## Top Contributors (2 or more commits)
1. Jj0YzL5nvJ
2. richard42
3. Gillou68310
4. derselbst
------------------------------------------------
# Mupen64Plus-rsp-hle v2.5.9 - February 10, 2019
## Merged PRs
* [67](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/67): Remove use of ConfigSaveSection
* [66](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/66): Makefile aarch64
* [65](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/65): Indi and Naboo now have an HLE implementation
* [64](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/64): Remove WDC and Stunt Racer from LLE list
* [63](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/63): Update homepage links
* [62](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/62): Don't set MI_INTR_SP if task is not finished yet
* [61](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/61): Implement RE2 fill video double buffer ucode
* [60](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/60): Update jpeg.c
* [59](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/59): If DEBUG not set, set NDEBUG
* [58](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/58): Build MXE targets as additional tests in travis build matrix
* [54](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/54): Implement RSP fallback.
* [53](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/53): Implement RE2 video frame decoding ucode
* [52](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/52): specify audio ucode flags explicitly
* [51](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/51): Let each ucode specify how sp status should be modified.
* [47](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/47): Prevent yet one more illegal access to alist_buffer
* [46](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/46): Add support for Re2 bilinear resizing
* [45](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/45): Prevent more illegal accesses of alist_buffer
* [44](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/44): Prevent CLEARBUFF for naudio and nead from deriving a count too big for alist_buffer
* [43](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/43): Backport fixes from Project64
* [42](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/42): Use faster container based Travis CI
* [41](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/41): Use Ubuntu Trusty as base system for Travis CI
* [40](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/40): Backports from project64
* [38](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/38): Added x64 configuration to VisualStudio2013 project file
* [37](https://github.com/mupen64plus/mupen64plus-rsp-hle/pull/37): Remove unnecessary OpenBSD warning.
Mupen64Plus-rsp-hle v2.5 - April 26, 2015
-------------------------------------------------

40
appveyor.yml Normal file
View file

@ -0,0 +1,40 @@
version: 1.0.{build}
image: Visual Studio 2022
skip_tags: true
skip_commits:
files:
- '**/*.md'
- .github/
- data/*
- .gitattributes
- .gitignore
- .travis.yml
- README
configuration:
- Release
platform:
- Win32
- x64
before_build:
- git tag --delete nightly-build
- git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ..\mupen64plus-core
build_script:
- msbuild projects\msvc\mupen64plus-rsp-hle.vcxproj /p:Configuration=%configuration%;Platform=%platform%
after_build:
- ps: $env:rev1 = git describe --tags
- set rev2=%platform%
- if "%rev2%"=="Win32" set rev2=x86
- set filepkg=mupen64plus-rsp-hle_v%rev1%_%rev2%
- cd projects\msvc\%platform%\%configuration%
- 7z a -t7z ..\..\..\..\build\%filepkg%.7z *.dll
artifacts:
- path: build\$(filepkg).7z
name: $(filepkg)

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -21,30 +21,41 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}</ProjectGuid>
<RootNamespace>mupen64plusrsphle</RootNamespace>
<Keyword>Win32Proj</Keyword>
</PropertyGroup>
<PropertyGroup Condition="'$(WindowsTargetPlatformVersion)'=='' and '$(VisualStudioVersion)' != '14.0'">
<LatestTargetPlatformVersion>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0'))</LatestTargetPlatformVersion>
<WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
<TargetPlatformVersion>$(WindowsTargetPlatformVersion)</TargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(PlatformToolset)'=='' or '$(PlatformToolset)'=='v100'" Label="Configuration">
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120_xp</PlatformToolset>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v120</PlatformToolset>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@ -62,47 +73,18 @@
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@ -112,11 +94,7 @@
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -128,18 +106,16 @@
<AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@ -147,11 +123,10 @@
<AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>Default</CompileAs>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -168,6 +143,7 @@
<ClCompile Include="..\..\src\audio.c" />
<ClCompile Include="..\..\src\cicx105.c" />
<ClCompile Include="..\..\src\hle.c" />
<ClCompile Include="..\..\src\hvqm.c" />
<ClCompile Include="..\..\src\jpeg.c" />
<ClCompile Include="..\..\src\memory.c" />
<ClCompile Include="..\..\src\mp3.c" />
@ -191,4 +167,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

44
projects/unix/Makefile Executable file → Normal file
View file

@ -102,6 +102,13 @@ ifneq ("$(filter ppc64 powerpc64,$(HOST_CPU))","")
PIC ?= 1
$(warning Architecture "$(HOST_CPU)" not officially supported.')
endif
ifneq ("$(filter ppc64le powerpc64le,$(HOST_CPU))","")
CPU := PPC
ARCH_DETECTED := 64BITS
BIG_ENDIAN := 0
PIC ?= 1
$(warning Architecture "$(HOST_CPU)" not officially supported.')
endif
ifneq ("$(filter arm%,$(HOST_CPU))","")
ifeq ("$(filter arm%b,$(HOST_CPU))","")
CPU := ARM
@ -123,14 +130,24 @@ ifneq ("$(filter aarch64,$(HOST_CPU))","")
NEW_DYNAREC := 1
NO_ASM := 1
endif
ifneq ("$(filter riscv64,$(HOST_CPU))","")
CPU := RISCV64
ARCH_DETECTED := 64BITS
PIC ?= 1
NO_ASM := 1
$(warning Architecture "$(HOST_CPU)" not officially supported.)
endif
ifeq ("$(CPU)","NONE")
$(error CPU type "$(HOST_CPU)" not supported. Please file bug report at 'https://github.com/mupen64plus/mupen64plus-core/issues')
endif
SRCDIR = ../../src
OBJDIR = _obj$(POSTFIX)
# base CFLAGS, LDLIBS, and LDFLAGS
OPTFLAGS ?= -O3 -flto
WARNFLAGS ?= -Wall
CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fno-strict-aliasing -fvisibility=hidden -I../../src
CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -fvisibility=hidden -I$(SRCDIR)
LDFLAGS += $(SHARED)
# Since we are building a shared library, we must compile with -fPIC on some architectures
@ -150,8 +167,20 @@ ifeq ($(ARCH_DETECTED), 64BITS_32)
ifeq ($(OS), FREEBSD)
$(error Do not use the BITS=32 option with FreeBSD, use -m32 and -m elf_i386)
endif
CFLAGS += -m32
LDFLAGS += -Wl,-m,elf_i386
ifneq ($(OS), OSX)
ifeq ($(OS), MINGW)
LDFLAGS += -Wl,-m,i386pe
else
CFLAGS += -m32
LDFLAGS += -Wl,-m,elf_i386
endif
endif
endif
ifeq ($(ARCH_DETECTED), 64BITS)
ifeq ($(OS), MINGW)
LDFLAGS += -Wl,-m,i386pep
endif
endif
# set special flags per-system
@ -165,9 +194,9 @@ ifeq ($(OS), OSX)
ifeq ($(CPU), X86)
ifeq ($(ARCH_DETECTED), 64BITS)
CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH)
CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=10.9 -isysroot $(OSX_SDK_PATH)
else
CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=10.5 -isysroot $(OSX_SDK_PATH)
CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=10.9 -isysroot $(OSX_SDK_PATH)
LDFLAGS += -read_only_relocs suppress
endif
endif
@ -238,10 +267,6 @@ ifeq ($(DUMP), 1)
CFLAGS += -DENABLE_TASK_DUMP
endif
SRCDIR = ../../src
OBJDIR = _obj$(POSTFIX)
# list of source files to compile
SOURCE = \
$(SRCDIR)/alist.c \
@ -251,6 +276,7 @@ SOURCE = \
$(SRCDIR)/audio.c \
$(SRCDIR)/cicx105.c \
$(SRCDIR)/hle.c \
$(SRCDIR)/hvqm.c \
$(SRCDIR)/jpeg.c \
$(SRCDIR)/memory.c \
$(SRCDIR)/mp3.c \

View file

@ -237,7 +237,7 @@ void alist_interleave(struct hle_t* hle, uint16_t dmemo, uint16_t left, uint16_t
uint16_t r1 = *(srcR++);
uint16_t r2 = *(srcR++);
#if M64P_BIG_ENDIAN
#ifdef M64P_BIG_ENDIAN
*(dst++) = l1;
*(dst++) = r1;
*(dst++) = l2;
@ -1017,8 +1017,22 @@ void alist_iirf(
count -= 0x10;
} while (count > 0);
dram_store_u16(hle, (uint16_t*)&frame[6], address + 4, 4);
dram_store_u16(hle, (uint16_t*)&ibuf[(index-2)&3], address+8, 2);
dram_store_u16(hle, (uint16_t*)&ibuf[(index-1)&3], address+10, 2);
dram_store_u16(hle, (uint16_t*)&frame[6], address + 4, 2);
dram_store_u16(hle, (uint16_t*)&ibuf[(index-2)&3], address+8, 1);
dram_store_u16(hle, (uint16_t*)&ibuf[(index-1)&3], address+10, 1);
}
/* Perform a clamped gain, then attenuate it back by an amount */
void alist_overload(struct hle_t* hle, uint16_t dmem, int16_t count, int16_t gain, uint16_t attenuation)
{
int16_t accu;
int16_t * sample = (int16_t*)(hle->alist_buffer + dmem);
while (count != 0)
{
accu = clamp_s16(*sample * gain);
*sample = (accu * attenuation) >> 16;
sample++;
count --;
}
}

View file

@ -150,6 +150,13 @@ void alist_iirf(
int16_t* table,
uint32_t address);
void alist_overload(
struct hle_t* hle,
uint16_t dmem,
int16_t count,
int16_t gain,
uint16_t attenuation);
/*
* Audio flags
*/

View file

@ -263,6 +263,16 @@ static void MP3(struct hle_t* hle, uint32_t w1, uint32_t w2)
mp3_task(hle, index, address);
}
static void OVERLOAD(struct hle_t* hle, uint32_t w1, uint32_t w2)
{
/* Overload distortion effect for Conker's Bad Fur Day */
uint16_t dmem = (w1 & 0xfff) + NAUDIO_MAIN;
int16_t gain = (int16_t)(uint16_t)w2;
uint16_t attenuation = w2 >> 16;
alist_overload(hle, dmem, NAUDIO_COUNT, gain, attenuation);
}
/* global functions */
void alist_process_naudio(struct hle_t* hle)
{
@ -308,7 +318,7 @@ void alist_process_naudio_dk(struct hle_t* hle)
void alist_process_naudio_mp3(struct hle_t* hle)
{
static const acmd_callback_t ABI[0x10] = {
UNKNOWN, ADPCM, CLEARBUFF, ENVMIXER,
OVERLOAD, ADPCM, CLEARBUFF, ENVMIXER,
LOADBUFF, RESAMPLE, SAVEBUFF, MP3,
MP3ADDY, SETVOL, DMEMMOVE, LOADADPCM,
MIXER, INTERLEAVE, NAUDIO_14, SETLOOP
@ -320,9 +330,20 @@ void alist_process_naudio_mp3(struct hle_t* hle)
void alist_process_naudio_cbfd(struct hle_t* hle)
{
/* TODO: see what differs from alist_process_naudio_mp3 */
/* What differs from alist_process_naudio_mp3?
*
* JoshW: It appears that despite being a newer game, CBFD appears to have a slightly older ucode version
* compared to JFG, B.T. et al.
* For naudio_mp3, the functions DMEM parameters have an additional protective AND on them
* (basically dmem & 0xffff).
* But there are minor differences are in the RESAMPLE and ENVMIXER functions.
* I don't think it is making any noticeable difference, as it could be just a simplification of the logic.
*
* bsmiles32: The only difference I could remember between mp3 and cbfd variants is in the MP3ADDY command.
* And the MP3 overlay is also different.
*/
static const acmd_callback_t ABI[0x10] = {
UNKNOWN, ADPCM, CLEARBUFF, ENVMIXER,
OVERLOAD, ADPCM, CLEARBUFF, ENVMIXER,
LOADBUFF, RESAMPLE, SAVEBUFF, MP3,
MP3ADDY, SETVOL, DMEMMOVE, LOADADPCM,
MIXER, INTERLEAVE, NAUDIO_14, SETLOOP

295
src/hle.c
View file

@ -44,18 +44,17 @@
static unsigned int sum_bytes(const unsigned char *bytes, unsigned int size);
static bool is_task(struct hle_t* hle);
static void send_dlist_to_gfx_plugin(struct hle_t* hle);
static bool try_fast_audio_dispatching(struct hle_t* hle);
static bool try_fast_task_dispatching(struct hle_t* hle);
static void normal_task_dispatching(struct hle_t* hle);
static void non_task_dispatching(struct hle_t* hle);
static bool try_re2_task_dispatching(struct hle_t* hle);
static ucode_func_t try_audio_task_detection(struct hle_t* hle);
static ucode_func_t try_normal_task_detection(struct hle_t* hle);
static ucode_func_t non_task_detection(struct hle_t* hle);
static ucode_func_t task_detection(struct hle_t* hle);
#ifdef ENABLE_TASK_DUMP
static void dump_binary(struct hle_t* hle, const char *const filename,
const unsigned char *const bytes, unsigned int size);
static void dump_task(struct hle_t* hle, const char *const filename);
static void dump_unknown_task(struct hle_t* hle, unsigned int sum);
static void dump_unknown_non_task(struct hle_t* hle, unsigned int sum);
static void dump_unknown_task(struct hle_t* hle, unsigned int uc_start);
static void dump_unknown_non_task(struct hle_t* hle, unsigned int uc_start);
#endif
/* Global functions */
@ -109,12 +108,38 @@ void hle_init(struct hle_t* hle,
void hle_execute(struct hle_t* hle)
{
if (is_task(hle)) {
if (!try_fast_task_dispatching(hle))
normal_task_dispatching(hle);
} else {
non_task_dispatching(hle);
uint32_t uc_start = *dmem_u32(hle, TASK_UCODE);
uint32_t uc_dstart = *dmem_u32(hle, TASK_UCODE_DATA);
uint32_t uc_dsize = *dmem_u32(hle, TASK_UCODE_DATA_SIZE);
bool match = false;
struct cached_ucodes_t * cached_ucodes = &hle->cached_ucodes;
struct ucode_info_t *info = NULL;
if (cached_ucodes->count > 0)
info = &cached_ucodes->infos[cached_ucodes->count-1];
for (int i = 0; i < cached_ucodes->count; i++)
{
if (info->uc_start == uc_start && info->uc_dstart == uc_dstart && info->uc_dsize == uc_dsize)
{
match = true;
break;
}
info--;
}
if (!match)
{
info = &cached_ucodes->infos[cached_ucodes->count];
info->uc_start = uc_start;
info->uc_dstart = uc_dstart;
info->uc_dsize = uc_dsize;
info->uc_pfunc = task_detection(hle);
cached_ucodes->count++;
assert(cached_ucodes->count <= CACHED_UCODES_MAX_SIZE);
assert(info->uc_pfunc != NULL);
}
info->uc_pfunc(hle);
}
/* local functions */
@ -177,7 +202,43 @@ static void send_dlist_to_gfx_plugin(struct hle_t* hle)
}
}
static bool try_fast_audio_dispatching(struct hle_t* hle)
static void task_done(struct hle_t* hle)
{
rsp_break(hle, SP_STATUS_TASKDONE);
}
static void unknown_ucode(struct hle_t* hle)
{
/* Forward task to RSP Fallback.
* If task is not forwarded, use the regular "unknown ucode" path */
if (HleForwardTask(hle->user_defined) != 0) {
uint32_t uc_start = *dmem_u32(hle, TASK_UCODE);
HleWarnMessage(hle->user_defined, "unknown RSP code: uc_start: %x PC:%x", uc_start, *hle->sp_pc);
#ifdef ENABLE_TASK_DUMP
dump_unknown_non_task(hle, uc_start);
#endif
}
}
static void unknown_task(struct hle_t* hle)
{
/* Forward task to RSP Fallback.
* If task is not forwarded, use the regular "unknown task" path */
if (HleForwardTask(hle->user_defined) != 0) {
/* Send task_done signal for unknown ucodes to allow further processings */
rsp_break(hle, SP_STATUS_TASKDONE);
uint32_t uc_start = *dmem_u32(hle, TASK_UCODE);
HleWarnMessage(hle->user_defined, "unknown OSTask: uc_start: %x PC:%x", uc_start, *hle->sp_pc);
#ifdef ENABLE_TASK_DUMP
dump_unknown_task(hle, uc_start);
#endif
}
}
static ucode_func_t try_audio_task_detection(struct hle_t* hle)
{
/* identify audio ucode by using the content of ucode_data */
uint32_t ucode_data = *dmem_u32(hle, TASK_UCODE_DATA);
@ -189,11 +250,11 @@ static bool try_fast_audio_dispatching(struct hle_t* hle)
switch(v)
{
case 0x1e24138c: /* audio ABI (most common) */
alist_process_audio(hle); return true;
return &alist_process_audio;
case 0x1dc8138c: /* GoldenEye */
alist_process_audio_ge(hle); return true;
return &alist_process_audio_ge;
case 0x1e3c1390: /* BlastCorp, DiddyKongRacing */
alist_process_audio_bc(hle); return true;
return &alist_process_audio_bc;
default:
HleWarnMessage(hle->user_defined, "ABI1 identification regression: v=%08x", v);
}
@ -202,33 +263,33 @@ static bool try_fast_audio_dispatching(struct hle_t* hle)
switch(v)
{
case 0x11181350: /* MarioKart, WaveRace (E) */
alist_process_nead_mk(hle); return true;
return &alist_process_nead_mk;
case 0x111812e0: /* StarFox (J) */
alist_process_nead_sfj(hle); return true;
return &alist_process_nead_sfj;
case 0x110412ac: /* WaveRace (J RevB) */
alist_process_nead_wrjb(hle); return true;
return &alist_process_nead_wrjb;
case 0x110412cc: /* StarFox/LylatWars (except J) */
alist_process_nead_sf(hle); return true;
return &alist_process_nead_sf;
case 0x1cd01250: /* FZeroX */
alist_process_nead_fz(hle); return true;
return &alist_process_nead_fz;
case 0x1f08122c: /* YoshisStory */
alist_process_nead_ys(hle); return true;
return &alist_process_nead_ys;
case 0x1f38122c: /* 1080° Snowboarding */
alist_process_nead_1080(hle); return true;
return &alist_process_nead_1080;
case 0x1f681230: /* Zelda OoT / Zelda MM (J, J RevA) */
alist_process_nead_oot(hle); return true;
return &alist_process_nead_oot;
case 0x1f801250: /* Zelda MM (except J, J RevA, E Beta), PokemonStadium 2 */
alist_process_nead_mm(hle); return true;
return &alist_process_nead_mm;
case 0x109411f8: /* Zelda MM (E Beta) */
alist_process_nead_mmb(hle); return true;
return &alist_process_nead_mmb;
case 0x1eac11b8: /* AnimalCrossing */
alist_process_nead_ac(hle); return true;
return &alist_process_nead_ac;
case 0x00010010: /* MusyX v2 (IndianaJones, BattleForNaboo) */
musyx_v2_task(hle); return true;
return &musyx_v2_task;
case 0x1f701238: /* Mario Artist Talent Studio */
alist_process_nead_mats(hle); return true;
return &alist_process_nead_mats;
case 0x1f4c1230: /* FZeroX Expansion */
alist_process_nead_efz(hle); return true;
return &alist_process_nead_efz;
default:
HleWarnMessage(hle->user_defined, "ABI2 identification regression: v=%08x", v);
}
@ -241,198 +302,172 @@ static bool try_fast_audio_dispatching(struct hle_t* hle)
RogueSquadron, ResidentEvil2, PolarisSnoCross,
TheWorldIsNotEnough, RugratsInParis, NBAShowTime,
HydroThunder, Tarzan, GauntletLegend, Rush2049 */
musyx_v1_task(hle); return true;
return &musyx_v1_task;
case 0x0000127c: /* naudio (many games) */
alist_process_naudio(hle); return true;
return &alist_process_naudio;
case 0x00001280: /* BanjoKazooie */
alist_process_naudio_bk(hle); return true;
return &alist_process_naudio_bk;
case 0x1c58126c: /* DonkeyKong */
alist_process_naudio_dk(hle); return true;
return &alist_process_naudio_dk;
case 0x1ae8143c: /* BanjoTooie, JetForceGemini, MickeySpeedWayUSA, PerfectDark */
alist_process_naudio_mp3(hle); return true;
return &alist_process_naudio_mp3;
case 0x1ab0140c: /* ConkerBadFurDay */
alist_process_naudio_cbfd(hle); return true;
return &alist_process_naudio_cbfd;
default:
HleWarnMessage(hle->user_defined, "ABI3 identification regression: v=%08x", v);
}
}
return false;
return NULL;
}
static bool try_fast_task_dispatching(struct hle_t* hle)
static ucode_func_t try_normal_task_detection(struct hle_t* hle)
{
/* identify task ucode by its type */
switch (*dmem_u32(hle, TASK_TYPE)) {
case 1:
/* Resident evil 2 */
if (*dmem_u32(hle, TASK_DATA_PTR) == 0) {
return try_re2_task_dispatching(hle);
}
if (hle->hle_gfx) {
send_dlist_to_gfx_plugin(hle);
return true;
}
break;
case 2:
if (hle->hle_aud) {
send_alist_to_audio_plugin(hle);
return true;
} else if (try_fast_audio_dispatching(hle))
return true;
break;
case 7:
HleShowCFB(hle->user_defined);
break;
}
return false;
}
static void normal_task_dispatching(struct hle_t* hle)
{
const unsigned int sum =
unsigned int sum =
sum_bytes((void*)dram_u32(hle, *dmem_u32(hle, TASK_UCODE)), min(*dmem_u32(hle, TASK_UCODE_SIZE), 0xf80) >> 1);
switch (sum) {
/* StoreVe12: found in Zelda Ocarina of Time [misleading task->type == 4] */
case 0x278:
/* Nothing to emulate */
rsp_break(hle, SP_STATUS_TASKDONE);
return;
return &task_done;
/* GFX: Twintris [misleading task->type == 0] */
case 0x212ee:
if (hle->hle_gfx) {
send_dlist_to_gfx_plugin(hle);
return;
return &send_dlist_to_gfx_plugin;
}
break;
return NULL;
/* JPEG: found in Pokemon Stadium J */
case 0x2c85a:
jpeg_decode_PS0(hle);
return;
return &jpeg_decode_PS0;
/* JPEG: found in Zelda Ocarina of Time, Pokemon Stadium 1, Pokemon Stadium 2 */
case 0x2caa6:
jpeg_decode_PS(hle);
return;
return &jpeg_decode_PS;
/* JPEG: found in Ogre Battle, Bottom of the 9th */
case 0x130de:
case 0x278b0:
jpeg_decode_OB(hle);
return;
return &jpeg_decode_OB;
}
/* Forward task to RSP Fallback.
* If task is not forwarded, use the regular "unknown task" path */
if (HleForwardTask(hle->user_defined) != 0) {
/* Resident Evil 2 */
sum = sum_bytes((void*)dram_u32(hle, *dmem_u32(hle, TASK_UCODE)), 256);
switch (sum) {
/* Send task_done signal for unknown ucodes to allow further processings */
rsp_break(hle, SP_STATUS_TASKDONE);
case 0x450f:
return &resize_bilinear_task;
HleWarnMessage(hle->user_defined, "unknown OSTask: sum: %x PC:%x", sum, *hle->sp_pc);
#ifdef ENABLE_TASK_DUMP
dump_unknown_task(hle, sum);
#endif
case 0x3b44:
return &decode_video_frame_task;
case 0x3d84:
return &fill_video_double_buffer_task;
}
/* HVQM */
sum = sum_bytes((void*)dram_u32(hle, *dmem_u32(hle, TASK_UCODE)), 1488);
switch (sum) {
case 0x19495:
return &hvqm2_decode_sp1_task;
case 0x19728:
return &hvqm2_decode_sp2_task;
}
return NULL;
}
static void non_task_dispatching(struct hle_t* hle)
static ucode_func_t non_task_detection(struct hle_t* hle)
{
const unsigned int sum = sum_bytes(hle->imem, 44);
if (sum == 0x9e2)
{
/* CIC x105 ucode (used during boot of CIC x105 games) */
cicx105_ucode(hle);
return;
}
/* Forward task to RSP Fallback.
* If task is not forwarded, use the regular "unknown ucode" path */
if (HleForwardTask(hle->user_defined) != 0) {
HleWarnMessage(hle->user_defined, "unknown RSP code: sum: %x PC:%x", sum, *hle->sp_pc);
#ifdef ENABLE_TASK_DUMP
dump_unknown_non_task(hle, sum);
#endif
return &cicx105_ucode;
}
return &unknown_ucode;
}
/* Resident evil 2 */
static bool try_re2_task_dispatching(struct hle_t* hle)
static ucode_func_t task_detection(struct hle_t* hle)
{
const unsigned int sum =
sum_bytes((void*)dram_u32(hle, *dmem_u32(hle, TASK_UCODE)), 256);
if (is_task(hle)) {
ucode_func_t uc_pfunc;
uint32_t type = *dmem_u32(hle, TASK_TYPE);
switch (sum) {
if (type == 2) {
if (hle->hle_aud) {
return &send_alist_to_audio_plugin;
}
uc_pfunc = try_audio_task_detection(hle);
if (uc_pfunc)
return uc_pfunc;
}
case 0x450f:
resize_bilinear_task(hle);
return true;
uc_pfunc = try_normal_task_detection(hle);
if (uc_pfunc)
return uc_pfunc;
if (type == 1) {
if (hle->hle_gfx) {
return &send_dlist_to_gfx_plugin;
}
}
case 0x3b44:
decode_video_frame_task(hle);
return true;
case 0x3d84:
fill_video_double_buffer_task(hle);
return true;
return &unknown_task;
}
else {
return non_task_detection(hle);
}
return false;
}
#ifdef ENABLE_TASK_DUMP
static void dump_unknown_task(struct hle_t* hle, unsigned int sum)
static void dump_unknown_task(struct hle_t* hle, unsigned int uc_start)
{
char filename[256];
uint32_t ucode = *dmem_u32(hle, TASK_UCODE);
uint32_t ucode_data = *dmem_u32(hle, TASK_UCODE_DATA);
uint32_t data_ptr = *dmem_u32(hle, TASK_DATA_PTR);
sprintf(&filename[0], "task_%x.log", sum);
sprintf(&filename[0], "task_%x.log", uc_start);
dump_task(hle, filename);
/* dump ucode_boot */
sprintf(&filename[0], "ucode_boot_%x.bin", sum);
sprintf(&filename[0], "ucode_boot_%x.bin", uc_start);
dump_binary(hle, filename, (void*)dram_u32(hle, *dmem_u32(hle, TASK_UCODE_BOOT)), *dmem_u32(hle, TASK_UCODE_BOOT_SIZE));
/* dump ucode */
if (ucode != 0) {
sprintf(&filename[0], "ucode_%x.bin", sum);
sprintf(&filename[0], "ucode_%x.bin", uc_start);
dump_binary(hle, filename, (void*)dram_u32(hle, ucode), 0xf80);
}
/* dump ucode_data */
if (ucode_data != 0) {
sprintf(&filename[0], "ucode_data_%x.bin", sum);
sprintf(&filename[0], "ucode_data_%x.bin", uc_start);
dump_binary(hle, filename, (void*)dram_u32(hle, ucode_data), *dmem_u32(hle, TASK_UCODE_DATA_SIZE));
}
/* dump data */
if (data_ptr != 0) {
sprintf(&filename[0], "data_%x.bin", sum);
sprintf(&filename[0], "data_%x.bin", uc_start);
dump_binary(hle, filename, (void*)dram_u32(hle, data_ptr), *dmem_u32(hle, TASK_DATA_SIZE));
}
}
static void dump_unknown_non_task(struct hle_t* hle, unsigned int sum)
static void dump_unknown_non_task(struct hle_t* hle, unsigned int uc_start)
{
char filename[256];
/* dump IMEM & DMEM for further analysis */
sprintf(&filename[0], "imem_%x.bin", sum);
sprintf(&filename[0], "imem_%x.bin", uc_start);
dump_binary(hle, filename, hle->imem, 0x1000);
sprintf(&filename[0], "dmem_%x.bin", sum);
sprintf(&filename[0], "dmem_%x.bin", uc_start);
dump_binary(hle, filename, hle->dmem, 0x1000);
}

View file

@ -22,12 +22,18 @@
#ifndef HLE_EXTERNAL_H
#define HLE_EXTERNAL_H
#if defined(__GNUC__)
#define ATTR_FMT(fmtpos, attrpos) __attribute__ ((format (printf, fmtpos, attrpos)))
#else
#define ATTR_FMT(fmtpos, attrpos)
#endif
/* users of the hle core are expected to define these functions */
void HleVerboseMessage(void* user_defined, const char *message, ...);
void HleInfoMessage(void* user_defined, const char *message, ...);
void HleErrorMessage(void* user_defined, const char *message, ...);
void HleWarnMessage(void* user_defined, const char *message, ...);
void HleVerboseMessage(void* user_defined, const char *message, ...) ATTR_FMT(2, 3);
void HleInfoMessage(void* user_defined, const char *message, ...) ATTR_FMT(2, 3);
void HleErrorMessage(void* user_defined, const char *message, ...) ATTR_FMT(2, 3);
void HleWarnMessage(void* user_defined, const char *message, ...) ATTR_FMT(2, 3);
void HleCheckInterrupts(void* user_defined);
void HleProcessDlistList(void* user_defined);

View file

@ -74,6 +74,8 @@ struct hle_t
/* mp3.c */
uint8_t mp3_buffer[0x1000];
struct cached_ucodes_t cached_ucodes;
};
/* some mips interface interrupt flags */

354
src/hvqm.c Normal file
View file

@ -0,0 +1,354 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus-rsp-hle - hvqm.c *
* Mupen64Plus homepage: https://mupen64plus.org/ *
* Copyright (C) 2020 Gilles Siberlin *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include <assert.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "hle_external.h"
#include "hle_internal.h"
#include "memory.h"
/* Nest size */
#define HVQM2_NESTSIZE_L 70 /* Number of elements on long side */
#define HVQM2_NESTSIZE_S 38 /* Number of elements on short side */
#define HVQM2_NESTSIZE (HVQM2_NESTSIZE_L * HVQM2_NESTSIZE_S)
struct HVQM2Block {
uint8_t nbase;
uint8_t dc;
uint8_t dc_l;
uint8_t dc_r;
uint8_t dc_u;
uint8_t dc_d;
};
struct HVQM2Basis {
uint8_t sx;
uint8_t sy;
int16_t scale;
uint16_t offset;
uint16_t lineskip;
};
struct HVQM2Arg {
uint32_t info;
uint32_t buf;
uint16_t buf_width;
uint8_t chroma_step_h;
uint8_t chroma_step_v;
uint16_t hmcus;
uint16_t vmcus;
uint8_t alpha;
uint32_t nest;
};
struct RGBA {
uint8_t r;
uint8_t g;
uint8_t b;
uint8_t a;
};
static struct HVQM2Arg arg;
static const int16_t constant[5][16] = {
{0x0006,0x0008,0x0008,0x0006,0x0008,0x000A,0x000A,0x0008,0x0008,0x000A,0x000A,0x0008,0x0006,0x0008,0x0008,0x0006},
{0x0002,0x0000,0xFFFF,0xFFFF,0x0002,0x0000,0xFFFF,0xFFFF,0x0002,0x0000,0xFFFF,0xFFFF,0x0002,0x0000,0xFFFF,0xFFFF},
{0xFFFF,0xFFFF,0x0000,0x0002,0xFFFF,0xFFFF,0x0000,0x0002,0xFFFF,0xFFFF,0x0000,0x0002,0xFFFF,0xFFFF,0x0000,0x0002},
{0x0002,0x0002,0x0002,0x0002,0x0000,0x0000,0x0000,0x0000,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF},
{0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x0000,0x0000,0x0000,0x0000,0x0002,0x0002,0x0002,0x0002}
};
static int process_info(struct hle_t* hle, uint8_t* base, int16_t* out)
{
struct HVQM2Block block;
uint8_t nbase = *base;
dram_load_u8(hle, (uint8_t*)&block, arg.info, sizeof(struct HVQM2Block));
arg.info += 8;
*base = block.nbase & 0x7;
if ((block.nbase & nbase) != 0)
return 0;
if (block.nbase == 0)
{
//LABEL8
for (int i = 0; i < 16; i++)
{
out[i] = constant[0][i] * block.dc;
out[i] += constant[1][i] * block.dc_l;
out[i] += constant[2][i] * block.dc_r;
out[i] += constant[3][i] * block.dc_u;
out[i] += constant[4][i] * block.dc_d;
out[i] += 4;
out[i] >>= 3;
}
}
else if ((block.nbase & 0xf) == 0)
{
//LABEL7
for (int i = 0; i < 16; i++)
{
out[i] = *dram_u8(hle, arg.info);
arg.info++;
}
}
else if (*base == 0)
{
//LABEL6
for (int i = 0; i < 16; i++)
{
out[i] = *(int8_t*)dram_u8(hle, arg.info) + block.dc;
arg.info++;
}
}
else
{
//LABEL5
struct HVQM2Basis basis;
for (int i = 0; i < 16; i++)
out[i] = block.dc;
for (; *base != 0; (*base)--)
{
basis.sx = *dram_u8(hle, arg.info);
arg.info++;
basis.sy = *dram_u8(hle, arg.info);
arg.info++;
basis.scale = *dram_u16(hle, arg.info);
arg.info += 2;
basis.offset = *dram_u16(hle, arg.info);
arg.info += 2;
basis.lineskip = *dram_u16(hle, arg.info);
arg.info += 2;
int16_t vec[16];
uint32_t addr = arg.nest + basis.offset;
int shift = (basis.sx != 0) ? 1 : 0;
//LABEL9
//LABEL10
for (int i = 0; i < 16; i += 4)
{
vec[i] = *dram_u8(hle, addr);
vec[i + 1] = *dram_u8(hle, addr + (1 << shift));
vec[i + 2] = *dram_u8(hle, addr + (2 << shift));
vec[i + 3] = *dram_u8(hle, addr + (3 << shift));
addr += basis.lineskip;
}
//LABEL11
int16_t sum = 0x8;
for (int i = 0; i < 16; i++)
sum += vec[i];
sum >>= 4;
int16_t max = 0;
for (int i = 0; i < 16; i++)
{
vec[i] -= sum;
max = (abs(vec[i]) > max) ? abs(vec[i]) : max;
}
double dmax = 0.0;
if (max > 0)
dmax = (double)(basis.scale << 2) / (double)max;
for (int i = 0; i < 16; i++)
out[i] += (vec[i] < 0) ? (int16_t)((double)vec[i] * dmax - 0.5) : (int16_t)((double)vec[i] * dmax + 0.5);
block.nbase &= 8;
}
assert(block.nbase == 0);
//if(block.nbase != 0)
// LABEL6
}
return 1;
}
#define SATURATE8(x) ((unsigned int) x <= 255 ? x : (x < 0 ? 0: 255))
static struct RGBA YCbCr_to_RGBA(int16_t Y, int16_t Cb, int16_t Cr, uint8_t alpha)
{
struct RGBA color;
//Format S10.6
int r = (int)(((double)Y + 0.5) + (1.765625 * (double)(Cr - 128)));
int g = (int)(((double)Y + 0.5) - (0.34375 * (double)(Cr - 128)) - (0.71875 * (double)(Cb - 128)));
int b = (int)(((double)Y + 0.5) + (1.40625 * (double)(Cb - 128)));
color.r = SATURATE8(r);
color.g = SATURATE8(g);
color.b = SATURATE8(b);
color.a = alpha;
return color;
}
void store_rgba5551(struct hle_t* hle, struct RGBA color, uint32_t * addr)
{
uint16_t pixel = ((color.b >> 3) << 11) | ((color.g >> 3) << 6) | ((color.r >> 3) << 1) | (color.a & 1);
dram_store_u16(hle, &pixel, *addr, 1);
*addr += 2;
}
void store_rgba8888(struct hle_t* hle, struct RGBA color, uint32_t * addr)
{
uint32_t pixel = (color.b << 24) | (color.g << 16) | (color.r << 8) | color.a;
dram_store_u32(hle, &pixel, *addr, 1);
*addr += 4;
}
typedef void(*store_pixel_t)(struct hle_t* hle, struct RGBA color, uint32_t * addr);
static void hvqm2_decode(struct hle_t* hle, int is32)
{
//uint32_t uc_data_ptr = *dmem_u32(hle, TASK_UCODE_DATA);
uint32_t data_ptr = *dmem_u32(hle, TASK_DATA_PTR);
assert((*dmem_u32(hle, TASK_FLAGS) & 0x1) == 0);
/* Fill HVQM2Arg struct */
arg.info = *dram_u32(hle, data_ptr);
data_ptr += 4;
arg.buf = *dram_u32(hle, data_ptr);
data_ptr += 4;
arg.buf_width = *dram_u16(hle, data_ptr);
data_ptr += 2;
arg.chroma_step_h = *dram_u8(hle, data_ptr);
data_ptr++;
arg.chroma_step_v = *dram_u8(hle, data_ptr);
data_ptr++;
arg.hmcus = *dram_u16(hle, data_ptr);
data_ptr += 2;
arg.vmcus = *dram_u16(hle, data_ptr);
data_ptr += 2;
arg.alpha = *dram_u8(hle, data_ptr);
arg.nest = data_ptr + 1;
assert(arg.chroma_step_h == 2);
assert((arg.chroma_step_v == 1) || (arg.chroma_step_v == 2));
assert((*hle->sp_status & 0x80) == 0); //SP_STATUS_YIELD
int length, skip;
store_pixel_t store_pixel;
if (is32)
{
length = 0x20;
skip = arg.buf_width << 2;
arg.buf_width <<= 4;
store_pixel = &store_rgba8888;
}
else
{
length = 0x10;
skip = arg.buf_width << 1;
arg.buf_width <<= 3;
store_pixel = &store_rgba5551;
}
if (arg.chroma_step_v == 2)
arg.buf_width += arg.buf_width;
for (int i = arg.vmcus; i != 0; i--)
{
uint32_t out;
int j;
for (j = arg.hmcus, out = arg.buf; j != 0; j--, out += length)
{
uint8_t base = 0x80;
int16_t Cb[16], Cr[16], Y1[32], Y2[32];
int16_t* pCb = Cb;
int16_t* pCr = Cr;
int16_t* pY1 = Y1;
int16_t* pY2 = Y2;
if (arg.chroma_step_v == 2)
{
if (process_info(hle, &base, pY1) == 0)
continue;
if (process_info(hle, &base, pY2) == 0)
continue;
pY1 = &Y1[16];
pY2 = &Y2[16];
}
if (process_info(hle, &base, pY1) == 0)
continue;
if (process_info(hle, &base, pY2) == 0)
continue;
if (process_info(hle, &base, Cr) == 0)
continue;
if (process_info(hle, &base, Cb) == 0)
continue;
pY1 = Y1;
pY2 = Y2;
uint32_t out_buf = out;
for (int k = 0; k < 4; k++)
{
for (int m = 0; m < arg.chroma_step_v; m++)
{
uint32_t addr = out_buf;
for (int l = 0; l < 4; l++)
{
struct RGBA color = YCbCr_to_RGBA(pY1[l], pCb[l >> 1], pCr[l >> 1], arg.alpha);
store_pixel(hle, color, &addr);
}
for (int l = 0; l < 4; l++)
{
struct RGBA color = YCbCr_to_RGBA(pY2[l], pCb[(l + 4) >> 1], pCr[(l + 4) >> 1], arg.alpha);
store_pixel(hle, color, &addr);
}
out_buf += skip;
pY1 += 4;
pY2 += 4;
}
pCr += 4;
pCb += 4;
}
}
arg.buf += arg.buf_width;
}
rsp_break(hle, SP_STATUS_TASKDONE);
}
void hvqm2_decode_sp1_task(struct hle_t* hle)
{
hvqm2_decode(hle, 0);
}
void hvqm2_decode_sp2_task(struct hle_t* hle)
{
hvqm2_decode(hle, 1);
}

View file

@ -43,7 +43,7 @@
#define CONFIG_PARAM_VERSION 1.00
#define RSP_API_VERSION 0x20000
#define RSP_HLE_VERSION 0x020509
#define RSP_HLE_VERSION 0x020600
#define RSP_PLUGIN_API_VERSION 0x020000
#define RSP_HLE_CONFIG_SECTION "Rsp-HLE"
@ -461,9 +461,6 @@ EXPORT void CALL InitiateRSP(RSP_INFO Rsp_Info, unsigned int* CycleCount)
setup_rsp_fallback(ConfigGetParamString(l_ConfigRspHle, RSP_HLE_CONFIG_FALLBACK));
m64p_rom_header rom_header;
CoreDoCommand(M64CMD_ROM_GET_HEADER, sizeof(rom_header), &rom_header);
g_hle.hle_gfx = ConfigGetParamBool(l_ConfigRspHle, RSP_HLE_CONFIG_HLE_GFX);
g_hle.hle_aud = ConfigGetParamBool(l_ConfigRspHle, RSP_HLE_CONFIG_HLE_AUD);
@ -475,6 +472,8 @@ EXPORT void CALL InitiateRSP(RSP_INFO Rsp_Info, unsigned int* CycleCount)
EXPORT void CALL RomClosed(void)
{
g_hle.cached_ucodes.count = 0;
/* notify fallback plugin */
if (l_RomClosed) {
l_RomClosed();

View file

@ -24,8 +24,23 @@
#include <stdint.h>
#define CACHED_UCODES_MAX_SIZE 16
struct hle_t;
typedef void(*ucode_func_t)(struct hle_t* hle);
struct ucode_info_t {
uint32_t uc_start;
uint32_t uc_dstart;
uint16_t uc_dsize;
ucode_func_t uc_pfunc;
};
struct cached_ucodes_t {
struct ucode_info_t infos[CACHED_UCODES_MAX_SIZE];
int count;
};
/* cic_x105 ucode */
void cicx105_ucode(struct hle_t* hle);
@ -148,5 +163,9 @@ void resize_bilinear_task(struct hle_t* hle);
void decode_video_frame_task(struct hle_t* hle);
void fill_video_double_buffer_task(struct hle_t* hle);
/* hvqm2 ucode */
void hvqm2_decode_sp1_task(struct hle_t* hle);
void hvqm2_decode_sp2_task(struct hle_t* hle);
#endif