mirror of
https://github.com/mupen64plus/mupen64plus-ui-console.git
synced 2025-04-02 10:52:34 -04:00
Compare commits
302 commits
Author | SHA1 | Date | |
---|---|---|---|
|
a3a53cc73a | ||
|
16f138052c | ||
|
198eeaa08c | ||
|
d2309bc9ca | ||
|
12d57e4098 | ||
|
210309c525 | ||
|
94a307628e | ||
|
d431a01581 | ||
|
6c3627866b | ||
|
beddd15785 | ||
|
1cab2e6dfe | ||
|
1a68327fdd | ||
|
c69c0d74de | ||
|
3a5793ebc3 | ||
|
76dad4fb55 | ||
|
335e826aea | ||
|
11720558ab | ||
|
1340c4bdfc | ||
|
674dc3e9ec | ||
|
46225f27df | ||
|
3ad5cbb56f | ||
|
b02f0c3985 | ||
|
42546ab00b | ||
|
6365caa007 | ||
|
cd0c0e6c10 | ||
|
b5f62979ed | ||
|
a056188d84 | ||
|
32e2734421 | ||
|
20cdcb3755 | ||
|
7b23651028 | ||
|
ae2d353cab | ||
|
96834d5a18 | ||
|
42f91fec0d | ||
|
6210d5cce2 | ||
|
e147b94f3c | ||
|
d0fdeafeb2 | ||
|
089be953f2 | ||
|
91a1dcd483 | ||
|
0c32ac42ae | ||
|
96e284b6ec | ||
|
77a2adea93 | ||
|
9f5ab4a8dc | ||
|
5ec0b2a23a | ||
|
117d2e8fa4 | ||
|
b8fa2dea54 | ||
|
8f7b6b07ca | ||
|
8548eb39f1 | ||
|
d940c9323e | ||
|
d4303d96c4 | ||
|
e46434df3a | ||
|
b4db22f1fd | ||
|
5926250b86 | ||
|
7158199d94 | ||
|
9df31d93f9 | ||
|
a0034474ad | ||
|
1ffb52b17a | ||
|
2cdb10de7e | ||
|
3c28ab2d54 | ||
|
c510ac4fc5 | ||
|
39c5800112 | ||
|
cd65527203 | ||
|
838d4d4f2f | ||
|
e502f2b66b | ||
|
859dda24f4 | ||
|
cbbfeaad14 | ||
|
0dc8782b4d | ||
|
d1d184009a | ||
|
b1add1f806 | ||
|
2409aff737 | ||
|
0bb63fe6f5 | ||
|
5c1e2e8f0a | ||
|
678c534d27 | ||
|
5b9eba4cab | ||
|
adfcea709b | ||
|
9125460cd7 | ||
|
5485240100 | ||
|
e90085e34d | ||
|
6f44877ba6 | ||
|
c99996235e | ||
|
b49c7a6275 | ||
|
b7cfc11513 | ||
|
da4df0e27f | ||
|
f641c94b3d | ||
|
8e20ab8f70 | ||
|
a105ae0c6f | ||
|
78d3d6c955 | ||
|
aa292ba32d | ||
|
50a0714ab6 | ||
|
990e24d7bc | ||
|
1cdc745ad2 | ||
|
9f663670bb | ||
|
92514d1ced | ||
|
e54b7c1a24 | ||
|
5e17accad0 | ||
|
36d7cd8eb3 | ||
|
36145e5bdf | ||
|
7daadc8e57 | ||
|
187d3a3bda | ||
|
f5bf3777cb | ||
|
c2331cb564 | ||
|
60b193c95c | ||
|
8e63bfa5f7 | ||
|
dc36c1e7ac | ||
|
f13e35b373 | ||
|
20f18fc435 | ||
|
0abb73fcb7 | ||
|
7aac7adb5f | ||
|
5639129cfc | ||
|
1e9a53456c | ||
|
334db80b55 | ||
|
07dba790c8 | ||
|
fcca5a0813 | ||
|
bdcd13b3ed | ||
|
c52baffa34 | ||
|
6b8aa2e63c | ||
|
1474de74d7 | ||
|
f5db412261 | ||
|
3fc549b5c3 | ||
|
b8dff88aed | ||
|
f89efa27d1 | ||
|
58cf524522 | ||
|
cd103ec918 | ||
|
e1b4a8f1e3 | ||
|
9818963be4 | ||
|
f0b0a1249e | ||
|
398b96c3b2 | ||
|
42747beafd | ||
|
ac12e2cf3a | ||
|
cb4e055c54 | ||
|
48441f5647 | ||
|
44f0f5060d | ||
|
8c56a77f45 | ||
|
b2bbc856ab | ||
|
8edabd0a78 | ||
|
87ef78922a | ||
|
fb5134b37e | ||
|
ce0619035b | ||
|
3ddfb4d973 | ||
|
f3d45ddbbe | ||
|
be26692c40 | ||
|
1b08f8c445 | ||
|
4e145eae6e | ||
|
969970dcde | ||
|
7c140db778 | ||
|
5dcf54f00d | ||
|
175503cde5 | ||
|
8fb22f1096 | ||
|
5ce862533c | ||
|
90fefcab64 | ||
|
c495ff81e6 | ||
|
7d5247b399 | ||
|
36c51b5c8f | ||
|
0bc3036a58 | ||
|
566c9f9903 | ||
|
91f0a28d85 | ||
|
a04f4f2b53 | ||
|
29363909e0 | ||
|
1703b25649 | ||
|
76937ae2e8 | ||
|
7ee1328d4d | ||
|
fe425d1bcf | ||
|
e7e218406c | ||
|
af28634085 | ||
|
fe680206dc | ||
|
fc64df7ae7 | ||
|
c5381217a2 | ||
|
fb21340f22 | ||
|
b393896e1b | ||
|
6f0b800cd1 | ||
|
ad9815f6c4 | ||
|
79022e7499 | ||
|
60d72dc650 | ||
|
8622e12da3 | ||
|
ac8a254ac7 | ||
|
d1bbbcca5f | ||
|
da9e9b4d3b | ||
|
4999d06015 | ||
|
16996c73bd | ||
|
6c4695cae5 | ||
|
9986f7a85d | ||
|
d1408e91c2 | ||
|
69cfb75a50 | ||
|
212be30f54 | ||
|
4cff083518 | ||
|
5d19eca9b5 | ||
|
ccfa8cf3c3 | ||
|
04fe4dad22 | ||
|
61c419cee7 | ||
|
ba2e1d0192 | ||
|
77748f1c00 | ||
|
9a3c294a88 | ||
|
64d7fa307e | ||
|
5bf3cc39f6 | ||
|
d1b19e9893 | ||
|
dccdaa03ee | ||
|
ff73a2f421 | ||
|
ef07d7d1c7 | ||
|
d048eee443 | ||
|
d0cebb5307 | ||
|
340c135b7c | ||
|
e7d1692e44 | ||
|
f34f491110 | ||
|
f7532d62cd | ||
|
aa3e838d0a | ||
|
69e4a968e7 | ||
|
f8827b148a | ||
|
b7ce0a97a4 | ||
|
45346e9ccb | ||
|
ed4f8d906b | ||
|
c17d2bae69 | ||
|
42f26b8a03 | ||
|
14af485493 | ||
|
25217eacdd | ||
|
3b7bee6a33 | ||
|
10b90e4647 | ||
|
08b53f2444 | ||
|
68a5b42c15 | ||
|
bbe021bc01 | ||
|
b65642a899 | ||
|
79e0f12a6a | ||
|
b05ff7522a | ||
|
d8d9f23080 | ||
|
c939b8ca0c | ||
|
46549eea52 | ||
|
56159acc29 | ||
|
d7a60ce545 | ||
|
36a5c35b64 | ||
|
5726cca201 | ||
|
39059928a9 | ||
|
ce7b345509 | ||
|
c77f1134e0 | ||
|
16f9c57b1c | ||
|
e24f33b2c7 | ||
|
042700252e | ||
|
0ad97d0897 | ||
|
01a44c4c53 | ||
|
db675f1052 | ||
|
2894af52e3 | ||
|
9d4018c551 | ||
|
c33e0725b1 | ||
|
d12a172dbd | ||
|
7b7873bcfa | ||
|
a755ced05a | ||
|
71b99273f8 | ||
|
414ba078a3 | ||
|
851ba40977 | ||
|
9772c338a2 | ||
|
2acfd02362 | ||
|
649789679b | ||
|
ccfea343af | ||
|
f9c62d0081 | ||
|
6b5de19fe7 | ||
|
0f679f3a53 | ||
|
a9494e2c02 | ||
|
f4a9e8699f | ||
|
cf11a07c99 | ||
|
082aba7f75 | ||
|
753373768e | ||
|
d5fe6bbbba | ||
|
ec6faeb750 | ||
|
665e817b48 | ||
|
238ff7f8e9 | ||
|
7b2758def8 | ||
|
29e4230313 | ||
|
25f8ade6e4 | ||
|
6b46d19ffd | ||
|
f3db39ea83 | ||
|
ded3973463 | ||
|
f79205201e | ||
|
9e015d30a8 | ||
|
adb7b2e44c | ||
|
b1570a4b2c | ||
|
f7e7785a34 | ||
|
d07cf9f8a2 | ||
|
3a72b1a0e7 | ||
|
94877f6b77 | ||
|
31082b9ed7 | ||
|
e984740635 | ||
|
37550982da | ||
|
81f692eb50 | ||
|
6a68ccbd2b | ||
|
3b0d8c7317 | ||
![]() |
88212f6656 | ||
|
5951bba95e | ||
|
6292682492 | ||
![]() |
38252128b9 | ||
|
3d27c6dbe7 | ||
|
ca159d07f5 | ||
|
38d372f5f9 | ||
|
2174b9096a | ||
|
02596bdf31 | ||
![]() |
1d4c790fc8 | ||
![]() |
f3ba5fe609 | ||
![]() |
1be5a8cf30 | ||
![]() |
17b16b31cc | ||
![]() |
ff34d04fcf | ||
![]() |
f4c547f3c6 | ||
![]() |
098dd7c174 | ||
![]() |
88471f9649 | ||
![]() |
3dafaed16c | ||
|
945aea3c7b | ||
|
6db6563706 |
37 changed files with 5008 additions and 458 deletions
38
.gitattributes
vendored
Normal file
38
.gitattributes
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
* text=auto
|
||||
|
||||
# normal text files
|
||||
*.6 text
|
||||
AUTHORS text
|
||||
*.c text
|
||||
*.cfg text
|
||||
*.cht text
|
||||
*.conf text
|
||||
COPYING text
|
||||
*.cpp text
|
||||
*.def text
|
||||
*-license text
|
||||
*.h text
|
||||
*.html text
|
||||
*.ini text
|
||||
INSTALL text
|
||||
LICENSES text
|
||||
Makefile text
|
||||
*.py text
|
||||
README text
|
||||
RELEASE text
|
||||
*.S text
|
||||
*.sh text
|
||||
*.txt text
|
||||
*.ver text
|
||||
|
||||
# windows specific text files
|
||||
*.sln text eol=crlf
|
||||
*.vcproj text eol=crlf
|
||||
*.vcxproj text eol=crlf
|
||||
*.vcxproj.filters text eol=crlf
|
||||
|
||||
# binary files
|
||||
*.gz binary
|
||||
*.ttf binary
|
||||
cursor.tex binary
|
||||
font.tex binary
|
158
.github/workflows/build.yml
vendored
Normal file
158
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,158 @@
|
|||
name: UI Console
|
||||
|
||||
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"
|
||||
export BUILD_DEPS="libsdl1.2-dev libsdl2-dev"
|
||||
./../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"
|
||||
export PATH="$(pwd)/../mupen64plus-core/.github/workflows/scripts:${PATH}"
|
||||
export CONFIG_OVERRIDE="SDL_CONFIG="sdl-config""
|
||||
ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }}
|
||||
export CONFIG_OVERRIDE="SDL_CONFIG="sdl2-config""
|
||||
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
|
||||
mingw-w64-${{ matrix.cross }}-SDL2
|
||||
- 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 }} SDL2.dll
|
||||
- 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/*
|
154
.github/workflows/schedule.yml
vendored
Normal file
154
.github/workflows/schedule.yml
vendored
Normal file
|
@ -0,0 +1,154 @@
|
|||
name: UI Console - Scheduled
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '50 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-ui-console'
|
||||
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"
|
||||
export BUILD_DEPS="libsdl1.2-dev libsdl2-dev"
|
||||
./../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"
|
||||
export PATH="$(pwd)/../mupen64plus-core/.github/workflows/scripts:${PATH}"
|
||||
export CONFIG_OVERRIDE="SDL_CONFIG="sdl-config""
|
||||
ci_build.sh ${{ matrix.arch }} ${{ matrix.cc }}
|
||||
export CONFIG_OVERRIDE="SDL_CONFIG="sdl2-config""
|
||||
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-ui-console'
|
||||
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
|
||||
mingw-w64-${{ matrix.cross }}-SDL2
|
||||
- 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-ui-console'
|
||||
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 }} SDL2.dll
|
||||
- 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/*
|
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
/projects/unix/_obj*/
|
||||
/projects/unix/mupen64plus
|
48
.travis.yml
Normal file
48
.travis.yml
Normal file
|
@ -0,0 +1,48 @@
|
|||
sudo: required
|
||||
dist: xenial
|
||||
language: cpp
|
||||
compiler:
|
||||
- gcc
|
||||
- clang
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- git
|
||||
- libsdl1.2-dev
|
||||
- libsdl2-dev
|
||||
before_install:
|
||||
- git clone --depth=1 --branch=master git://github.com/mupen64plus/mupen64plus-core.git deps/mupen64plus-core
|
||||
script:
|
||||
- make -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 clean && LDFLAGS="-Wl,--no-add-needed -Wl,--no-undefined" OPTFLAGS="-O2" make SDL_CONFIG=sdl-config CC="${CC}" CXX="${CXX}" -j$(nproc) -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 all
|
||||
- make -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 clean && LDFLAGS="-Wl,--no-add-needed -Wl,--no-undefined" OPTFLAGS="-O2" make SDL_CONFIG=sdl2-config CC="${CC}" CXX="${CXX}" -j$(nproc) -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 all
|
||||
|
||||
# extra mxe build entries
|
||||
matrix:
|
||||
include:
|
||||
- env:
|
||||
- MXE_CPU=i686
|
||||
- PATH="/usr/lib/mxe/usr/bin/:$PATH"
|
||||
before_install:
|
||||
- curl -sSL "https://mirror.mxe.cc/repos/apt/client-conf/mxeapt.gpg" | sudo -E apt-key add -
|
||||
- echo "deb https://mirror.mxe.cc/repos/apt xenial main" | sudo tee -a /etc/apt/sources.list
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get -y --allow-unauthenticated install mxe-i686-w64-mingw32.shared-gcc
|
||||
- sudo apt-get -y --allow-unauthenticated install mxe-i686-w64-mingw32.shared-sdl2
|
||||
- git clone --depth=1 --branch=master git://github.com/mupen64plus/mupen64plus-core.git deps/mupen64plus-core
|
||||
script:
|
||||
- make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" SDL_CONFIG="${MXE_CPU}-w64-mingw32.shared-sdl2-config" -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 clean &&
|
||||
make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" SDL_CONFIG="${MXE_CPU}-w64-mingw32.shared-sdl2-config" -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 -j$(nproc) all
|
||||
|
||||
- env:
|
||||
- MXE_CPU=x86_64
|
||||
- PATH="/usr/lib/mxe/usr/bin/:$PATH"
|
||||
before_install:
|
||||
- curl -sSL "https://mirror.mxe.cc/repos/apt/client-conf/mxeapt.gpg" | sudo -E apt-key add -
|
||||
- echo "deb https://mirror.mxe.cc/repos/apt xenial main" | sudo tee -a /etc/apt/sources.list
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get -y --allow-unauthenticated install mxe-x86-64-w64-mingw32.shared-gcc
|
||||
- sudo apt-get -y --allow-unauthenticated install mxe-x86-64-w64-mingw32.shared-sdl2
|
||||
- git clone --depth=1 --branch=master git://github.com/mupen64plus/mupen64plus-core.git deps/mupen64plus-core
|
||||
script:
|
||||
- make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" SDL_CONFIG="${MXE_CPU}-w64-mingw32.shared-sdl2-config" -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 clean &&
|
||||
make UNAME=MINGW CROSS_COMPILE="${MXE_CPU}-w64-mingw32.shared-" CC="${MXE_CPU}-w64-mingw32.shared-gcc" CXX="${MXE_CPU}-w64-mingw32.shared-g++" HOST_CPU="${MXE_CPU}" SDL_CONFIG="${MXE_CPU}-w64-mingw32.shared-sdl2-config" -C projects/unix APIDIR="$(pwd)/deps/mupen64plus-core/src/api/" V=1 -j$(nproc) all
|
6
LICENSES
6
LICENSES
|
@ -5,6 +5,10 @@ Mupen64Plus-ui-console is licensed under the GNU General Public License version
|
|||
|
||||
The authors of Mupen64Plus-ui-console are:
|
||||
* Richard Goedeken (Richard42)
|
||||
* Anthony Bentley (bentley)
|
||||
* Dorian Fevrier (Narann)
|
||||
* littleguy77
|
||||
* and others.
|
||||
|
||||
Mupen64Plus is based on GPL-licensed source code from Mupen64 v0.5, originally written by:
|
||||
* Hacktarux
|
||||
|
@ -18,7 +22,7 @@ Mupen64Plus is based on GPL-licensed source code from Mupen64 v0.5, originally w
|
|||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
|
264
README
264
README
|
@ -1,48 +1,238 @@
|
|||
Mupen64Plus-UI-Console README
|
||||
-----------------------------
|
||||
|
||||
README Sections
|
||||
1. Command-line options
|
||||
===============================================================================
|
||||
-------------------------------------------------------------------------------
|
||||
Mupen64plus-ui-console README v2.5
|
||||
-------------------------------------------------------------------------------
|
||||
===============================================================================
|
||||
|
||||
1. Command-line options
|
||||
------------------------
|
||||
The latest documentation for this plugin can be found at:
|
||||
|
||||
Run 'mupen64plus --help' for a complete list of command-line options:
|
||||
https://mupen64plus.org/wiki/index.php/UIConsoleUsage
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Console Options
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
At startup, the mupen64plus program will look for a user configuration file
|
||||
called 'mupen64plus.cfg'. If this file does not exist, it will be created and
|
||||
default settings will be written. If desired, an alternate config directory can
|
||||
be specified using the --configdir commandline option.
|
||||
|
||||
Run 'mupen64plus --help' for a complete list of commandline options:
|
||||
|
||||
$ mupen64plus --help
|
||||
Usage: mupen64plus [parameter(s)] [romfile]
|
||||
|
||||
Parameters:
|
||||
--noosd : disable onscreen display.
|
||||
--osd : enable onscreen display.
|
||||
--fullscreen : use fullscreen display mode
|
||||
--windowed : use windowed display mode
|
||||
--resolution (res) : display resolution (640x480, 800x600, 1024x768, etc)
|
||||
--cheats (cheat-spec) : enable or list cheat codes for the given rom file
|
||||
--corelib (filepath) : use core library (filepath) (can be only filename or full path)
|
||||
--configdir (dir) : force configation directory to (dir); should contain mupen64plus.cfg
|
||||
--datadir (dir) : search for shared data files (.ini files, languages, etc) in (dir)
|
||||
--plugindir (dir) : search for plugins in (dir)
|
||||
--sshotdir (dir) : set screenshot directory to (dir)
|
||||
--gfx (plugin-spec) : use gfx plugin given by (plugin-spec)
|
||||
--audio (plugin-spec) : use audio plugin given by (plugin-spec)
|
||||
--input (plugin-spec) : use input plugin given by (plugin-spec)
|
||||
--rsp (plugin-spec) : use rsp plugin given by (plugin-spec)
|
||||
--emumode (mode) : set emu mode to: 0=Pure Interpreter 1=Interpreter 2=DynaRec
|
||||
--testshots (list) : take screenshots at frames given in comma-separated (list), then quit
|
||||
--core-compare-send : use the Core Comparison debugging feature, in data sending mode
|
||||
--core-compare-recv : use the Core Comparison debugging feature, in data receiving mode
|
||||
--saveoptions : save the given command-line options in configuration file for future
|
||||
--verbose : print lots of information
|
||||
--help : see this help message
|
||||
--noosd : disable onscreen display
|
||||
--osd : enable onscreen display
|
||||
--fullscreen : use fullscreen display mode
|
||||
--windowed : use windowed display mode
|
||||
--resolution (res) : display resolution (640x480, 800x600, 1024x768, etc)
|
||||
--nospeedlimit : disable core speed limiter (should be used with dummy audio plugin)
|
||||
--cheats (cheat-spec) : enable or list cheat codes for the given rom file
|
||||
--corelib (filepath) : use core library (filepath) (can be only filename or full path)
|
||||
--configdir (dir) : force configation directory to (dir); should contain mupen64plus.cfg
|
||||
--datadir (dir) : search for shared data files (.ini files, languages, etc) in (dir)
|
||||
--debug : launch console-based debugger (requires core lib built for debugging)
|
||||
--plugindir (dir) : search for plugins in (dir)
|
||||
--sshotdir (dir) : set screenshot directory to (dir)
|
||||
--gfx (plugin-spec) : use gfx plugin given by (plugin-spec)
|
||||
--audio (plugin-spec) : use audio plugin given by (plugin-spec)
|
||||
--input (plugin-spec) : use input plugin given by (plugin-spec)
|
||||
--rsp (plugin-spec) : use rsp plugin given by (plugin-spec)
|
||||
--emumode (mode) : set emu mode to: 0=Pure Interpreter 1=Interpreter 2=DynaRec
|
||||
--savestate (filepath) : savestate loaded at startup
|
||||
--testshots (list) : take screenshots at frames given in comma-separated (list), then quit
|
||||
--set (param-spec) : set a configuration variable, format: ParamSection[ParamName]=Value
|
||||
--gb-rom-{1,2,3,4} : define GB cart rom to load inside transferpak {1,2,3,4}
|
||||
--gb-ram-{1,2,3,4} : define GB cart ram to load inside transferpak {1,2,3,4}
|
||||
--dd-ipl-rom : define 64DD IPL rom
|
||||
--dd-disk : define disk to load into the disk drive
|
||||
--core-compare-send : use the Core Comparison debugging feature, in data sending mode
|
||||
--core-compare-recv : use the Core Comparison debugging feature, in data receiving mode
|
||||
--nosaveoptions : do not save the given command-line options in configuration file
|
||||
--pif (filepath) : use a binary PIF ROM (filepath) instead of HLE PIF
|
||||
--verbose : print lots of information
|
||||
--help : see this help message
|
||||
|
||||
(plugin-spec):
|
||||
(pluginname) : filename (without path) of plugin to find in plugin directory
|
||||
(pluginpath) : full path and filename of plugin
|
||||
'dummy' : use dummy plugin
|
||||
(cheat-spec):
|
||||
'list' : show all of the available cheat codes
|
||||
'all' : enable all of the available cheat codes
|
||||
(codelist) : a comma-separated list of cheat code numbers to enable
|
||||
(plugin-spec):
|
||||
(pluginname) : filename (without path) of plugin to find in plugin directory
|
||||
(pluginpath) : full path and filename of plugin
|
||||
'dummy' : use dummy plugin
|
||||
|
||||
(cheat-spec):
|
||||
'list' : show all of the available cheat codes
|
||||
'all' : enable all of the available cheat codes
|
||||
(codelist) : a comma-separated list of cheat code numbers to enable,
|
||||
with dashes to use code variables (ex 1-2 to use cheat 1 option 2)
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Cheats
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
To list the available cheats in the rom:
|
||||
|
||||
mupen64plus --cheats list "/path/to/my/rom.v64"
|
||||
|
||||
If there are cheats in the rom, you will get (in the output console):
|
||||
|
||||
UI-Console: 3 cheat code(s) found for ROM 'MY ROM'
|
||||
0: [Enable All Levels] (This is needed to be able to Play all Levels of the Game)
|
||||
1: [Enable All Weapons] (This is needed to be able to Play with all Weapons of the Game)
|
||||
2: etc...
|
||||
|
||||
All you have to do to use this cheats is:
|
||||
|
||||
mupen64plus --cheats 0,1,2 "/path/to/my/rom.v64"
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Debugger
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Setup
|
||||
=====
|
||||
|
||||
You must use a mupen64plus core library which was built with the DEBUGGER flag set.
|
||||
|
||||
Running
|
||||
=======
|
||||
|
||||
Use the --debug command-line option to enable the console debugger.
|
||||
|
||||
The emulator mode should be set to "interpreter", as the dynarec seems to cause
|
||||
issues when interacting with the debugging API. This can be done with the R4300Emulator
|
||||
config setting or with the --emumode flag.
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
Once the emulator boots, it will be paused by default. You will be presented
|
||||
with a prompt as follows:
|
||||
|
||||
(dbg)
|
||||
|
||||
The following commands can be entered:
|
||||
|
||||
run
|
||||
Unpauses the game.
|
||||
|
||||
pause
|
||||
Pauses the game.
|
||||
|
||||
step <num-steps>
|
||||
When paused, instructs the emulator to make a single step, or a series of
|
||||
steps if num-steps is provided.
|
||||
|
||||
regs
|
||||
Prints out general purpose register values.
|
||||
|
||||
pc
|
||||
Print current value of Program Counter register
|
||||
|
||||
pc-1
|
||||
Print previous value of Program Counter register
|
||||
|
||||
asm
|
||||
Print assembly language instructions. Several forms are supported:
|
||||
|
||||
asm Print one instruction at the Program Counter register
|
||||
|
||||
asm <addr> Print one instruction at <addr>
|
||||
|
||||
asm <addr> <n> Print <n> instructions starting at <addr>
|
||||
|
||||
asm <addr> <n> <flags> Print <n> instructions starting at <addr> with flags
|
||||
- If flags bit-3 is set (i.e. & 0x04): also print binary instruction data
|
||||
- If flags bit-2 is set: prefix each instruction with its memory address
|
||||
- If flags bit-1 is set: prefix each instruction with a counter from <addr>
|
||||
|
||||
mem
|
||||
Print memory values. Several forms are supported:
|
||||
|
||||
mem <addr> Print one 32-bit word at <addr>
|
||||
|
||||
mem /N <addr> Print <N> 32-bit words at <addr>
|
||||
mem /Nb <addr> Print <N> 8-bit bytes at <addr>
|
||||
mem /Nh <addr> Print <N> 16-bit half-words at <addr>
|
||||
mem /Nw <addr> Print <N> 32-bit words at <addr>
|
||||
mem /Nd <addr> Print <N> 64-bit double-words at <addr>
|
||||
|
||||
mem /NxM <addr> Print <N> rows of <M> 32-bit words at <addr>
|
||||
mem /NxMb <addr> Print <N> rows of <M> 8-bit bytes at <addr>
|
||||
mem /NxMh <addr> Print <N> rows of <M> 16-bit half-words at <addr>
|
||||
mem /NxMw <addr> Print <N> rows of <M> 32-bit words at <addr>
|
||||
mem /NxMd <addr> Print <N> rows of <M> 64-bit double-words at <addr>
|
||||
|
||||
write
|
||||
Write values to memory. Several forms are supported:
|
||||
|
||||
write <addr> <value> Write a (1) byte value to <addr>
|
||||
|
||||
write <addr> b <value> Write a (1) byte value to <addr>
|
||||
write <addr> h <value> Write a half-word value (2 bytes) to <addr>
|
||||
write <addr> w <value> Write a word value (4 bytes) to <addr>
|
||||
write <addr> d <value> Write a double-word value (8 bytes) to <addr>
|
||||
|
||||
dumpmem <addr> <n> <filename>
|
||||
Dump <n> bytes of RDRAM memory starting at <addr> to <filename>.
|
||||
|
||||
translate
|
||||
Translates virtual memory addresses to physical memory addresses. Memory
|
||||
read/write breakpoints must operate on physical addresses, in contrast to the
|
||||
memory read/write commands and execution breakpoints that operate on virtual
|
||||
addresses.
|
||||
|
||||
translate <virtual address> Print the 32-bit physical address for the
|
||||
provided <virtual address> argument.
|
||||
|
||||
bp add
|
||||
Adds a breakpoint at a given address. Several forms are supported:
|
||||
|
||||
bp add pc Add a breakpoint at the Program Counter, triggered
|
||||
on EXEC, READ, and WRITE.
|
||||
|
||||
bp add <addr> Add a breakpoint at <addr>, triggered on EXEC,
|
||||
READ, and WRITE.
|
||||
|
||||
bp add <addr> <n> Add a breakpoint starting at <addr>, extending <n>
|
||||
bytes, triggered on EXEC, READ, and WRITE.
|
||||
|
||||
bp add <addr> <n> <flags> Add a breakpoint starting at <addr>, extending <n>
|
||||
bytes, with specified trigger flags.
|
||||
- M64P_BKP_FLAG_READ = 0x02
|
||||
- M64P_BKP_FLAG_WRITE = 0x04
|
||||
- M64P_BKP_FLAG_EXEC = 0x08
|
||||
|
||||
bp trig
|
||||
Prints the reason for the most recently activated breakpoint trigger. Memory
|
||||
read/write breakpoints will indicate the hit address.
|
||||
|
||||
bp rm <addr|index>
|
||||
Removes a breakpoint by address or number.
|
||||
|
||||
bp list
|
||||
Lists all breakpoints.
|
||||
|
||||
exit|quit
|
||||
Stop emulator and quit debugger
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
64DD Support
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Some compatibility with the 64DD disk drive unit has been implemented, but there
|
||||
are a few small usability issues of which users should be aware.
|
||||
|
||||
When using the 64DD, you need to pass a path to a cartridge rom, even if none is
|
||||
strictly required. The IPL boot rom will execute first and select the disk if
|
||||
you have one inserted, or just show the boot menu otherwise. We can remove this
|
||||
requirement at a later time. For now all we need to remember is to use a Japanese
|
||||
ROM (otherwise some region check will fail) with same features as the 64DD game
|
||||
you want to play (think RumblePak, TransferPak, otherwise, they won't be available).
|
||||
|
||||
There is a sibling issue also with 64DD games in that there are no entries in the
|
||||
game db (mupen64plus.ini) for them, and the core currently only relies on the cart
|
||||
ROM loaded to fetch the ROM infos.
|
||||
|
||||
|
||||
|
|
126
RELEASE
126
RELEASE
|
@ -1,6 +1,132 @@
|
|||
Mupen64Plus-UI-Console RELEASE
|
||||
------------------------------
|
||||
|
||||
---------------------------------------------------------
|
||||
# Mupen64Plus-UI-Console Front-End v2.6.0 - July 14, 2024
|
||||
|
||||
## Merged PRs
|
||||
|
||||
* [83](https://github.com/mupen64plus/mupen64plus-ui-console/pull/83): CI/CD: Update to generic scripts, independent schedule, etc
|
||||
* [82](https://github.com/mupen64plus/mupen64plus-ui-console/pull/82): CI/CD: Fixes Ubuntu i386 builds, among other changes
|
||||
* [81](https://github.com/mupen64plus/mupen64plus-ui-console/pull/81): main.c: Fix 64DD ROM loading
|
||||
* [80](https://github.com/mupen64plus/mupen64plus-ui-console/pull/80): CI/CD: Integrate scheduled builds and other...
|
||||
* [78](https://github.com/mupen64plus/mupen64plus-ui-console/pull/78): CI/CD: Update MSVC
|
||||
* [77](https://github.com/mupen64plus/mupen64plus-ui-console/pull/77): CI/CD: Update
|
||||
* [74](https://github.com/mupen64plus/mupen64plus-ui-console/pull/74): README: Update parameters documentation.
|
||||
Savestate, 64DD and PIF options previously missing.
|
||||
* [72](https://github.com/mupen64plus/mupen64plus-ui-console/pull/72): CI/CD: Implement GitHub Actions and public nightly builds
|
||||
* [70](https://github.com/mupen64plus/mupen64plus-ui-console/pull/70): remove redundant condition about PIE value in Makefile
|
||||
* [69](https://github.com/mupen64plus/mupen64plus-ui-console/pull/69): fix build with mingw64
|
||||
* [66](https://github.com/mupen64plus/mupen64plus-ui-console/pull/66): build: Fix the build with 'cc' on gentoo.
|
||||
* [64](https://github.com/mupen64plus/mupen64plus-ui-console/pull/64): build: Allow out of tree builds.
|
||||
* [61](https://github.com/mupen64plus/mupen64plus-ui-console/pull/61): Allow non-default compilers without resorting to symbolic links
|
||||
* [60](https://github.com/mupen64plus/mupen64plus-ui-console/pull/60): Allow to set custom platform toolset from commands
|
||||
* [59](https://github.com/mupen64plus/mupen64plus-ui-console/pull/59): Add SDL2_net dependency
|
||||
* [58](https://github.com/mupen64plus/mupen64plus-ui-console/pull/58): PIF binary support
|
||||
* [57](https://github.com/mupen64plus/mupen64plus-ui-console/pull/57): AppVeyor with artifact packaging
|
||||
* [56](https://github.com/mupen64plus/mupen64plus-ui-console/pull/56): Changes to have more generic project files + Other things...
|
||||
|
||||
|
||||
## Closed Issues
|
||||
|
||||
* [79](https://github.com/mupen64plus/mupen64plus-ui-console/issues/79): High Dpi awareness
|
||||
* [76](https://github.com/mupen64plus/mupen64plus-ui-console/issues/76): Unrecognized UI-Console commands
|
||||
* [73](https://github.com/mupen64plus/mupen64plus-ui-console/issues/73): How to view osSyncPrints?
|
||||
* [67](https://github.com/mupen64plus/mupen64plus-ui-console/issues/67): Fails to build with mingw64 due to usage of "PIE" option on system without explicit PIE
|
||||
* [65](https://github.com/mupen64plus/mupen64plus-ui-console/issues/65): gcc9 build failure
|
||||
* [62](https://github.com/mupen64plus/mupen64plus-ui-console/issues/62): Build error after #61 merged
|
||||
* [54](https://github.com/mupen64plus/mupen64plus-ui-console/issues/54): 2.5.9: Missing config API change
|
||||
|
||||
|
||||
## Top Contributors (2 or more commits)
|
||||
1. Jj0YzL5nvJ
|
||||
2. richard42
|
||||
3. GhostlyDark
|
||||
4. orbea
|
||||
5. loganmc10
|
||||
6. Narann
|
||||
|
||||
|
||||
-------------------------------------------------------------
|
||||
# Mupen64Plus-UI-Console Front-End v2.5.9 - February 10, 2019
|
||||
|
||||
## Merged PRs
|
||||
|
||||
* [52](https://github.com/mupen64plus/mupen64plus-ui-console/pull/52): Fix setting plugin parameters when configuration file not present.
|
||||
* [51](https://github.com/mupen64plus/mupen64plus-ui-console/pull/51): Enhancements to debugging interface
|
||||
* [48](https://github.com/mupen64plus/mupen64plus-ui-console/pull/48): Fix nosaveoptions
|
||||
* [47](https://github.com/mupen64plus/mupen64plus-ui-console/pull/47): Make --nosaveoptions not ever save options.
|
||||
* [45](https://github.com/mupen64plus/mupen64plus-ui-console/pull/45): Update homepage links
|
||||
* [44](https://github.com/mupen64plus/mupen64plus-ui-console/pull/44): Build MXE targets as additional tests in travis build matrix
|
||||
* [43](https://github.com/mupen64plus/mupen64plus-ui-console/pull/43): Add basic support for 64DD.
|
||||
* [41](https://github.com/mupen64plus/mupen64plus-ui-console/pull/41): Basic support for GB cart loader command.
|
||||
* [40](https://github.com/mupen64plus/mupen64plus-ui-console/pull/40): Fix for #39.
|
||||
This should fix https://github.com/mupen64plus/mupen64plus-ui-console/issues/39
|
||||
* [36](https://github.com/mupen64plus/mupen64plus-ui-console/pull/36): Fix no-pie mode for compilers that default to PIE
|
||||
* [35](https://github.com/mupen64plus/mupen64plus-ui-console/pull/35): Use faster container based Travis CI
|
||||
* [29](https://github.com/mupen64plus/mupen64plus-ui-console/pull/29): Add support for VIDEXT_HEADER
|
||||
* [28](https://github.com/mupen64plus/mupen64plus-ui-console/pull/28): bump macosx-version-min to 10.6 for SDL2.0.5.
|
||||
Allows for compilation on MacOS 10.12 Sierra using packages from Homebrew (samplerate speexdsp nasm and the sdl2 packages).
|
||||
* [27](https://github.com/mupen64plus/mupen64plus-ui-console/pull/27): New implementation of the savestate loaded at startup option.
|
||||
The savestate will be loaded on the first safe state interrupt instead of being loaded on the first frame.
|
||||
* [26](https://github.com/mupen64plus/mupen64plus-ui-console/pull/26): Use Ubuntu Trusty as base system for Travis CI
|
||||
* [22](https://github.com/mupen64plus/mupen64plus-ui-console/pull/22): Added x64 configuration to VisualStudio2013 project file
|
||||
* [21](https://github.com/mupen64plus/mupen64plus-ui-console/pull/21): Remove unnecessary OpenBSD warning.
|
||||
|
||||
|
||||
## Closed Issues
|
||||
|
||||
* [50](https://github.com/mupen64plus/mupen64plus-ui-console/issues/50): COREDIR and PLUGINDIR should default to a value derived from PREFIX
|
||||
* [46](https://github.com/mupen64plus/mupen64plus-ui-console/issues/46): Missing definitions of m64p_media_loader and M64CMD_SET_MEDIA_LOADER
|
||||
* [39](https://github.com/mupen64plus/mupen64plus-ui-console/issues/39): Fails to build under windows
|
||||
* [34](https://github.com/mupen64plus/mupen64plus-ui-console/issues/34): [SOLVED] Bad value during make
|
||||
* [30](https://github.com/mupen64plus/mupen64plus-ui-console/issues/30): Setting position of window (...+%d+%d)
|
||||
* [23](https://github.com/mupen64plus/mupen64plus-ui-console/issues/23): Custom config folder with --configdir doesn't include save folder
|
||||
|
||||
|
||||
Mupen64Plus-UI-Console Front-End v2.5 - April 26, 2015
|
||||
------------------------------------------------------
|
||||
- Update man page document
|
||||
- Add application desktop file and icons
|
||||
- Add support for loading savestate immediately on emulator startup
|
||||
- Compile-time flag to support building ui-console as a library (used by Android frontend)
|
||||
|
||||
Mupen64Plus-UI-Console Front-End v2.0 - July 4, 2013
|
||||
----------------------------------------------------
|
||||
- Project files for Visual Studio 2012
|
||||
- Makefile changes
|
||||
- add support for PowerPC and MinGW32 builds
|
||||
- add cross-compiling support to build Win32 executables (MXE) under Linux
|
||||
|
||||
Mupen64Plus-UI-Console Front-End v1.99.5 - March 10, 2012
|
||||
---------------------------------------------------------
|
||||
- New option to disable internal core speed limiter (for benchmarking)
|
||||
- Updated Console-UI front-end for new Mupen64plus 2.0 API versioning
|
||||
- Added config version number for UI-Console section
|
||||
- makefile fixes and improvements
|
||||
|
||||
Mupen64Plus-UI-Console Front-End v1.99.4 - November 22, 2010
|
||||
------------------------------------------------------------
|
||||
- add some parameter checking for --emumode option
|
||||
- new cheat file format from spinout182
|
||||
- makefile fixes and improvements
|
||||
|
||||
Mupen64Plus-UI-Console Front-End v1.99.3 - February 13, 2010
|
||||
------------------------------------------------------------
|
||||
- New feature: command-line option --set for setting arbitrary configuration variables
|
||||
- updated MAN pgae for all the changes made in the 2.0 re-architecture
|
||||
- Makefile improvements:
|
||||
- added OS type GNU/kFreeBSD
|
||||
- add -lpthread to LIBS so that GDB will run the emulator without throwing a warning right after starting
|
||||
|
||||
Mupen64Plus-UI-Console Front-End v1.99.2 - January 6, 2010
|
||||
------------------------------------------------------------
|
||||
- new feature: added MSVC8 project/solution files, minor refactoring for VC compatibility
|
||||
- Makefile improvements:
|
||||
- throw error if OS/CPU not supported
|
||||
- use DESTDIR in install/uninstall paths
|
||||
- Allow user-specified CC/CXX/LD paths
|
||||
|
||||
Mupen64Plus-UI-Console Front-End v1.99.1 - December 14, 2009
|
||||
------------------------------------------------------------
|
||||
- Brand new Console-based front-end for Mupen64Plus 2.0
|
||||
|
|
49
appveyor.yml
Normal file
49
appveyor.yml
Normal file
|
@ -0,0 +1,49 @@
|
|||
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-win32-deps.git ..\mupen64plus-win32-deps
|
||||
- git clone --depth 1 https://github.com/mupen64plus/mupen64plus-core.git ..\mupen64plus-core
|
||||
|
||||
build_script:
|
||||
- msbuild projects\msvc\mupen64plus-ui-console.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-ui-console_v%rev1%_%rev2%
|
||||
- md tdata
|
||||
- cd tdata
|
||||
- copy ..\projects\msvc\%platform%\%configuration%\*.exe .
|
||||
- copy ..\..\mupen64plus-core\data\* .
|
||||
- copy ..\..\mupen64plus-win32-deps\freetype-2.13.0\lib\%rev2%\*.dll .
|
||||
- copy ..\..\mupen64plus-win32-deps\libpng-1.6.39\lib\%rev2%\*.dll .
|
||||
- copy ..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\%rev2%\*.dll .
|
||||
- copy ..\..\mupen64plus-win32-deps\SDL2_net-2.2.0\lib\%rev2%\*.dll .
|
||||
- copy ..\..\mupen64plus-win32-deps\zlib-1.2.13\lib\%rev2%\*.dll .
|
||||
- 7z a -t7z ..\build\%filepkg%.7z *
|
||||
|
||||
artifacts:
|
||||
- path: build\$(filepkg).7z
|
||||
name: $(filepkg)
|
BIN
data/icons/48x48/apps/mupen64plus.png
Normal file
BIN
data/icons/48x48/apps/mupen64plus.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
1478
data/icons/scalable/apps/mupen64plus.svg
Normal file
1478
data/icons/scalable/apps/mupen64plus.svg
Normal file
File diff suppressed because it is too large
Load diff
After Width: | Height: | Size: 52 KiB |
12
data/mupen64plus.desktop
Normal file
12
data/mupen64plus.desktop
Normal file
|
@ -0,0 +1,12 @@
|
|||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Name=Mupen64Plus
|
||||
GenericName=N64 Emulator
|
||||
Comment=Nintendo 64 emulator and plugins for Linux, Mac OSX, FreeBSD, and Windows
|
||||
Exec=mupen64plus %f
|
||||
Icon=mupen64plus
|
||||
MimeType=application/x-n64-rom;
|
||||
Categories=Game;Emulator;
|
||||
Keywords=Emulator;Nintendo64;Mupen64plus;
|
||||
NoDisplay=true
|
228
doc/mupen64plus.6
Normal file
228
doc/mupen64plus.6
Normal file
|
@ -0,0 +1,228 @@
|
|||
.Dd September 20, 2013
|
||||
.Dt MUPEN64PLUS 6
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm mupen64plus
|
||||
.Nd console front\(hyend for the Mupen64Plus N64 emulator
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op parameters
|
||||
.Ar romfile
|
||||
.Sh DESCRIPTION
|
||||
.Nm
|
||||
is a plugin\(hybased N64 emulator for Linux/Unix, OSX, and Windows which is capable of accurately playing many games.
|
||||
Included are four MIPS R4300 CPU emulators, with dynamic recompilers for 32\(hybit x86 and 64\(hybit amd64 systems, and necessary plugins for audio, graphical rendering (RDP), signal co\(hyprocessor (RSP), and input.
|
||||
There are several OpenGL video plugins available:
|
||||
.Bl -bullet
|
||||
.It
|
||||
Rice, included with the distribution
|
||||
.It
|
||||
Glide64Mk2, included with the distribution
|
||||
.It
|
||||
.Lk https://github.com/mupen64plus/mupen64plus-video-arachnoid Arachnoid
|
||||
.It
|
||||
.Lk https://github.com/mupen64plus/mupen64plus-video-glide64 Glide64
|
||||
(old)
|
||||
.It
|
||||
.Lk https://github.com/mupen64plus/mupen64plus-video-z64 Z64
|
||||
(must be used with the rsp-z64 plugin)
|
||||
.El
|
||||
.Pp
|
||||
The most current documentation can be found at the project\(cqs
|
||||
.Lk https://mupen64plus.org/ homepage .
|
||||
.Pp
|
||||
The options are as follows:
|
||||
.Bl -tag -width x
|
||||
.It Fl h , Fl Fl help
|
||||
Print help message.
|
||||
.It Fl Fl noosd
|
||||
Disable onscreen display.
|
||||
.It Fl Fl osd
|
||||
Enable onscreen display.
|
||||
.It Fl Fl fullscreen
|
||||
Run emulator in fullscreen display mode.
|
||||
.It Fl Fl windowed
|
||||
Run emulator in windowed display mode.
|
||||
.It Fl Fl resolution Ar res
|
||||
Display resolution (640\(mu480, 800\(mu600, 1024\(mu768, etc)
|
||||
.It Fl Fl nospeedlimit
|
||||
Disable core speed limiter.
|
||||
This should be used with the dummy audio plugin.
|
||||
.It Fl Fl cheats Ar cheat\(hyspec
|
||||
Enable or list cheat codes for the given rom file.
|
||||
.It Fl Fl corelib Ar filepath
|
||||
Specifies a filename (optionally with a preceding directory path) to load a specific
|
||||
.Nm
|
||||
core library.
|
||||
.It Fl Fl configdir Ar directory
|
||||
Specifies a directory to look for the
|
||||
.Pa mupen64plus.cfg
|
||||
file.
|
||||
Default is
|
||||
.Pa ~/.config/mupen64plus/ .
|
||||
.It Fl Fl datadir Ar directory
|
||||
Specifies a directory to search for shared data files (fonts, cheat codes, .ini files).
|
||||
Default is
|
||||
.Pa ${PREFIX}/share/mupen64plus/ .
|
||||
.It Fl Fl plugindir Ar directory
|
||||
Specifies a directory to search for plugin files.
|
||||
Default is
|
||||
.Pa ${PREFIX}/lib/mupen64plus/ .
|
||||
.It Fl Fl sshotdir Ar directory
|
||||
Specifies a directory to save screenshots captured during gameplay.
|
||||
Default is
|
||||
.Pa ~/.local/share/mupen64plus/screenshot/ .
|
||||
.It Fl Fl gfx Ar plugin\(hyspec
|
||||
Specifies a
|
||||
.Ar plugin\(hyspec
|
||||
to select a graphics plugin for use during emulation.
|
||||
.It Fl Fl audio Ar plugin\(hyspec
|
||||
Specifies a
|
||||
.Ar plugin\(hyspec
|
||||
to select an audio plugin for use during emulation.
|
||||
.It Fl Fl input Ar plugin\(hyspec
|
||||
Specifies a
|
||||
.Ar plugin\(hyspec
|
||||
to select an input plugin for use during emulation.
|
||||
.It Fl Fl rsp Ar plugin\(hyspec
|
||||
Specifies a
|
||||
.Ar plugin\(hyspec
|
||||
to select an RSP plugin for use during emulation.
|
||||
.It Fl Fl emumode Ar mode
|
||||
Specifies which mode the emulator core should run in.
|
||||
.Ar mode
|
||||
should be set to one of the following numbers:
|
||||
.Bl -inset
|
||||
.It 0
|
||||
Pure Interpreter
|
||||
.It 1
|
||||
Cached Interpreter
|
||||
.It 2
|
||||
Dynamic Recompiler (DynaRec)
|
||||
.El
|
||||
.It Fl Fl testshots Ar list
|
||||
Take screenshots at frames given in the comma\(hyseparated
|
||||
.Ar list ,
|
||||
then quit.
|
||||
.It Fl Fl core-compare-send
|
||||
Use the core comparison debugging feature, in data sending mode.
|
||||
If the core was not compiled with support for the Core Comparison feature, then the emulator will exit with an error.
|
||||
.It Fl Fl core-compare-recv
|
||||
Use the core comparison debugging feature, in data receiving mode.
|
||||
If the core was not compiled with support for the Core Comparison feature, then the emulator will exit with an error.
|
||||
.It Fl Fl set Ar param\(hyspec
|
||||
Set the value of a
|
||||
.Nm
|
||||
configuration parameter.
|
||||
This option may be used multiple times.
|
||||
The format of
|
||||
.Ar param\(hyspec
|
||||
is
|
||||
.Dl Section\(hyName[Param\(hyName]=Value
|
||||
.It Fl Fl nosaveoptions
|
||||
Do not save the given command\(hyline options into the
|
||||
.Nm
|
||||
configuration file to use as defaults in the future.
|
||||
.It Fl Fl verbose
|
||||
Print lots of information.
|
||||
Useful for debugging but unnecessary for normal use.
|
||||
.El
|
||||
.Sh plugin\(hyspec
|
||||
.Bl -ohang
|
||||
.It (plugin\(hyname)
|
||||
Filename (without path) of plugin to use.
|
||||
Application will search through several directories to look for a matching plugin name.
|
||||
.It (plugin\(hypath)
|
||||
Full directory path and filename of plugin.
|
||||
.It Sq dummy
|
||||
Use the dummy plugin.
|
||||
.El
|
||||
.Sh cheat\(hyspec
|
||||
.Bl -ohang
|
||||
.It Sq list
|
||||
Show all of the available cheat codes.
|
||||
.It Sq all
|
||||
Enable all of the available cheat codes.
|
||||
.It (codelist)
|
||||
A comma separated list of cheat code numbers to enable.
|
||||
.El
|
||||
.Sh KEY COMMANDS
|
||||
The following shortcut keys can be used during emulation.
|
||||
These are the default key values; nearly all of them may be set to different keys by editing the
|
||||
.Nm
|
||||
configuration file.
|
||||
.Bl -tag -width Alt\(hyEnter
|
||||
.It Escape
|
||||
Quit the emulator.
|
||||
.It 0\(en9
|
||||
Select virtual
|
||||
.Sq slot
|
||||
for save/load state.
|
||||
.It F5
|
||||
Save emulator state to current slot.
|
||||
.It F7
|
||||
Load emulator state from current slot.
|
||||
.It F9
|
||||
Reset emulator.
|
||||
.It F10
|
||||
Slow down emulator speed by 5 percent.
|
||||
.It F11
|
||||
Speed up emulator speed by 5 percent.
|
||||
.It F12
|
||||
Take screenshot.
|
||||
.It Alt\(hyEnter
|
||||
Toggle fullscreen mode.
|
||||
This is not supported on Windows.
|
||||
.It p or P
|
||||
Pause/continue emulation.
|
||||
.It m or M
|
||||
Mute/unmute sound.
|
||||
.It f or F
|
||||
Fast Forward (playback at 250% normal speed as long as key is pressed).
|
||||
.It g or G
|
||||
Press GameShark button (if cheats are enabled).
|
||||
.It / or \&?
|
||||
Advance one frame if paused.
|
||||
.It \(lB
|
||||
Decrease volume.
|
||||
.It \(rB
|
||||
Increase volume.
|
||||
.El
|
||||
.Sh FILES
|
||||
The default location for the
|
||||
.Nm
|
||||
configuration file is
|
||||
.Pa ~/.config/mupen64plus/ .
|
||||
The default location of the saved screenshots is
|
||||
.Pa ~/.local/share/mupen64plus/screenshot/ .
|
||||
The default location of the save states is
|
||||
.Pa ~/.local/share/mupen64plus/save/ .
|
||||
.Sh AUTHORS
|
||||
.An -nosplit
|
||||
.Nm
|
||||
was originally started by
|
||||
.An Richard42
|
||||
and
|
||||
.An nmn ,
|
||||
and is based on Mupen64 (originally written by
|
||||
.An Hacktarux ) .
|
||||
.Pp
|
||||
This man page was written by
|
||||
.An ebenblues ,
|
||||
and updated by
|
||||
.An Richard42
|
||||
and
|
||||
.An Anthony J. Bentley .
|
||||
.Sh COPYRIGHT
|
||||
Mupen64plus is \(co 2008\(en2013 The Mupen64plus Team
|
||||
.Pp
|
||||
License GPLv2+,
|
||||
.Lk https://gnu.org/licenses/gpl.html GNU GPL version 2 or later
|
||||
.Pp
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is
|
||||
.Em no warranty ,
|
||||
to the extent permitted by law.
|
||||
.Sh BUGS
|
||||
To report bugs or make feature requests, use the
|
||||
.Lk https://github.com/mupen64plus/mupen64plus-core/issues "issue tracker"
|
Binary file not shown.
100
projects/msvc/mupen64plus-ui-console.sln
Normal file
100
projects/msvc/mupen64plus-ui-console.sln
Normal file
|
@ -0,0 +1,100 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.852
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-ui-console", "mupen64plus-ui-console.vcxproj", "{0E29D9F8-C675-4D21-AF16-AA80EDDB264E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-core", "..\..\..\mupen64plus-core\projects\msvc\mupen64plus-core.vcxproj", "{92D3FEB9-2129-41C5-8577-BCD7D961EF41}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-input-sdl", "..\..\..\mupen64plus-input-sdl\projects\msvc\mupen64plus-input-sdl.vcxproj", "{7F3178D0-0E2E-471B-9160-69F0354F9DE9}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-rsp-hle", "..\..\..\mupen64plus-rsp-hle\projects\msvc\mupen64plus-rsp-hle.vcxproj", "{2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-rsp-cxd4", "..\..\..\mupen64plus-rsp-cxd4\projects\msvc\mupen64plus-rsp-cxd4.vcxproj", "{F597CC21-12F9-459F-A257-38BD7F102BC8}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-video-rice", "..\..\..\mupen64plus-video-rice\projects\msvc\mupen64plus-video-rice.vcxproj", "{7D4AFF6A-B7D9-4C25-975A-038B8079098E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-audio-sdl", "..\..\..\mupen64plus-audio-sdl\projects\msvc\mupen64plus-audio-sdl.vcxproj", "{96969748-EA54-43FC-8103-A346E9AD98E7}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mupen64plus-video-glide64mk2", "..\..\..\mupen64plus-video-glide64mk2\projects\msvc\mupen64plus-video-glide64mk2.vcxproj", "{A4D13408-A794-4199-8FC7-4A9A32505005}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0E29D9F8-C675-4D21-AF16-AA80EDDB264E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0E29D9F8-C675-4D21-AF16-AA80EDDB264E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0E29D9F8-C675-4D21-AF16-AA80EDDB264E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0E29D9F8-C675-4D21-AF16-AA80EDDB264E}.Debug|x64.Build.0 = Debug|x64
|
||||
{0E29D9F8-C675-4D21-AF16-AA80EDDB264E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0E29D9F8-C675-4D21-AF16-AA80EDDB264E}.Release|Win32.Build.0 = Release|Win32
|
||||
{0E29D9F8-C675-4D21-AF16-AA80EDDB264E}.Release|x64.ActiveCfg = Release|x64
|
||||
{0E29D9F8-C675-4D21-AF16-AA80EDDB264E}.Release|x64.Build.0 = Release|x64
|
||||
{92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Debug|x64.Build.0 = Debug|x64
|
||||
{92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Release|Win32.Build.0 = Release|Win32
|
||||
{92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Release|x64.ActiveCfg = Release|x64
|
||||
{92D3FEB9-2129-41C5-8577-BCD7D961EF41}.Release|x64.Build.0 = Release|x64
|
||||
{7F3178D0-0E2E-471B-9160-69F0354F9DE9}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7F3178D0-0E2E-471B-9160-69F0354F9DE9}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7F3178D0-0E2E-471B-9160-69F0354F9DE9}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{7F3178D0-0E2E-471B-9160-69F0354F9DE9}.Debug|x64.Build.0 = Debug|x64
|
||||
{7F3178D0-0E2E-471B-9160-69F0354F9DE9}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7F3178D0-0E2E-471B-9160-69F0354F9DE9}.Release|Win32.Build.0 = Release|Win32
|
||||
{7F3178D0-0E2E-471B-9160-69F0354F9DE9}.Release|x64.ActiveCfg = Release|x64
|
||||
{7F3178D0-0E2E-471B-9160-69F0354F9DE9}.Release|x64.Build.0 = Release|x64
|
||||
{2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Debug|x64.Build.0 = Debug|x64
|
||||
{2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Release|Win32.Build.0 = Release|Win32
|
||||
{2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Release|x64.ActiveCfg = Release|x64
|
||||
{2EC7CEE3-C7A7-4F2E-B2C8-4DF6AFEC3E9A}.Release|x64.Build.0 = Release|x64
|
||||
{F597CC21-12F9-459F-A257-38BD7F102BC8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F597CC21-12F9-459F-A257-38BD7F102BC8}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F597CC21-12F9-459F-A257-38BD7F102BC8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{F597CC21-12F9-459F-A257-38BD7F102BC8}.Debug|x64.Build.0 = Debug|x64
|
||||
{F597CC21-12F9-459F-A257-38BD7F102BC8}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F597CC21-12F9-459F-A257-38BD7F102BC8}.Release|Win32.Build.0 = Release|Win32
|
||||
{F597CC21-12F9-459F-A257-38BD7F102BC8}.Release|x64.ActiveCfg = Release|x64
|
||||
{F597CC21-12F9-459F-A257-38BD7F102BC8}.Release|x64.Build.0 = Release|x64
|
||||
{7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Debug|x64.Build.0 = Debug|x64
|
||||
{7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Release|Win32.Build.0 = Release|Win32
|
||||
{7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Release|x64.ActiveCfg = Release|x64
|
||||
{7D4AFF6A-B7D9-4C25-975A-038B8079098E}.Release|x64.Build.0 = Release|x64
|
||||
{96969748-EA54-43FC-8103-A346E9AD98E7}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{96969748-EA54-43FC-8103-A346E9AD98E7}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{96969748-EA54-43FC-8103-A346E9AD98E7}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{96969748-EA54-43FC-8103-A346E9AD98E7}.Debug|x64.Build.0 = Debug|x64
|
||||
{96969748-EA54-43FC-8103-A346E9AD98E7}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{96969748-EA54-43FC-8103-A346E9AD98E7}.Release|Win32.Build.0 = Release|Win32
|
||||
{96969748-EA54-43FC-8103-A346E9AD98E7}.Release|x64.ActiveCfg = Release|x64
|
||||
{96969748-EA54-43FC-8103-A346E9AD98E7}.Release|x64.Build.0 = Release|x64
|
||||
{A4D13408-A794-4199-8FC7-4A9A32505005}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{A4D13408-A794-4199-8FC7-4A9A32505005}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{A4D13408-A794-4199-8FC7-4A9A32505005}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{A4D13408-A794-4199-8FC7-4A9A32505005}.Debug|x64.Build.0 = Debug|x64
|
||||
{A4D13408-A794-4199-8FC7-4A9A32505005}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{A4D13408-A794-4199-8FC7-4A9A32505005}.Release|Win32.Build.0 = Release|Win32
|
||||
{A4D13408-A794-4199-8FC7-4A9A32505005}.Release|x64.ActiveCfg = Release|x64
|
||||
{A4D13408-A794-4199-8FC7-4A9A32505005}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {9EB69B45-A3A7-4B0F-AEAB-76677AE895FF}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
220
projects/msvc/mupen64plus-ui-console.vcxproj
Normal file
220
projects/msvc/mupen64plus-ui-console.vcxproj
Normal file
|
@ -0,0 +1,220 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{0E29D9F8-C675-4D21-AF16-AA80EDDB264E}</ProjectGuid>
|
||||
<RootNamespace>mupen64plusuiconsole</RootNamespace>
|
||||
</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>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<IntDir>$(Platform)\$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x86\SDL2main.lib;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x86\SDL2.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Message>Copying shared data and libraries to build directory...</Message>
|
||||
<Command>copy ..\..\..\mupen64plus-core\data\* "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-video-rice\data\* "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-video-glide64mk2\data\* "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-input-sdl\data\* "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\freetype-2.13.0\lib\x86\*.dll "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\libpng-1.6.39\lib\x86\*.dll "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x86\*.dll "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\SDL2_net-2.2.0\lib\x86\*.dll "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\zlib-1.2.13\lib\x86\*.dll "$(OutDir)"
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x64\SDL2main.lib;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x64\SDL2.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Message>Copying shared data and libraries to build directory...</Message>
|
||||
<Command>copy ..\..\..\mupen64plus-core\data\* "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-video-rice\data\* "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-video-glide64mk2\data\* "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-input-sdl\data\* "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\freetype-2.13.0\lib\x64\*.dll "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\libpng-1.6.39\lib\x64\*.dll "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x64\*.dll "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\SDL2_net-2.2.0\lib\x64\*.dll "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\zlib-1.2.13\lib\x64\*.dll "$(OutDir)"
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x86\SDL2main.lib;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x86\SDL2.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Message>Copying shared data and libraries to build directory...</Message>
|
||||
<Command>copy ..\..\..\mupen64plus-core\data\* "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-video-rice\data\* "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-video-glide64mk2\data\* "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-input-sdl\data\* "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\freetype-2.13.0\lib\x86\*.dll "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\libpng-1.6.39\lib\x86\*.dll "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x86\*.dll "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\SDL2_net-2.2.0\lib\x86\*.dll "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\zlib-1.2.13\lib\x86\*.dll "$(OutDir)"
|
||||
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\..\..\mupen64plus-core\src\api;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x64\SDL2main.lib;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x64\SDL2.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
</Link>
|
||||
<PostBuildEvent>
|
||||
<Message>Copying shared data and libraries to build directory...</Message>
|
||||
<Command>copy ..\..\..\mupen64plus-core\data\* "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-video-rice\data\* "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-video-glide64mk2\data\* "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-input-sdl\data\* "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\freetype-2.13.0\lib\x64\*.dll "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\libpng-1.6.39\lib\x64\*.dll "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\lib\x64\*.dll "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\SDL2_net-2.2.0\lib\x64\*.dll "$(OutDir)"
|
||||
copy ..\..\..\mupen64plus-win32-deps\zlib-1.2.13\lib\x64\*.dll "$(OutDir)"
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\src\cheat.c" />
|
||||
<ClCompile Include="..\..\src\compare_core.c" />
|
||||
<ClCompile Include="..\..\src\core_interface.c" />
|
||||
<ClCompile Include="..\..\src\debugger.c" />
|
||||
<ClCompile Include="..\..\src\main.c" />
|
||||
<ClCompile Include="..\..\src\osal_dynamiclib_win32.c" />
|
||||
<ClCompile Include="..\..\src\osal_files_win32.c" />
|
||||
<ClCompile Include="..\..\src\plugin.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\cheat.h" />
|
||||
<ClInclude Include="..\..\src\compare_core.h" />
|
||||
<ClInclude Include="..\..\src\core_interface.h" />
|
||||
<ClInclude Include="..\..\src\debugger.h" />
|
||||
<ClInclude Include="..\..\src\main.h" />
|
||||
<ClInclude Include="..\..\src\osal_dynamiclib.h" />
|
||||
<ClInclude Include="..\..\src\osal_files.h" />
|
||||
<ClInclude Include="..\..\src\osal_preproc.h" />
|
||||
<ClInclude Include="..\..\src\plugin.h" />
|
||||
<ClInclude Include="..\..\src\version.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -1,6 +1,6 @@
|
|||
#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
# * Mupen64plus - Makefile *
|
||||
# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
# * Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
# * Copyright (C) 2009 Richard42 *
|
||||
# * *
|
||||
# * This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -21,23 +21,39 @@
|
|||
# Makefile for Mupen64plus-ui-console
|
||||
|
||||
# detect operation system
|
||||
UNAME = $(shell uname -s)
|
||||
UNAME ?= $(shell uname -s)
|
||||
OS := NONE
|
||||
ifeq ("$(UNAME)","Linux")
|
||||
OS = LINUX
|
||||
endif
|
||||
ifeq ("$(UNAME)","linux")
|
||||
OS = LINUX
|
||||
endif
|
||||
ifneq ("$(filter GNU hurd,$(UNAME))","")
|
||||
OS = LINUX
|
||||
endif
|
||||
ifeq ("$(UNAME)","Darwin")
|
||||
OS = OSX
|
||||
endif
|
||||
ifeq ("$(UNAME)","FreeBSD")
|
||||
OS = FREEBSD
|
||||
endif
|
||||
ifeq ("$(UNAME)","OpenBSD")
|
||||
OS = FREEBSD
|
||||
endif
|
||||
ifneq ("$(filter GNU/kFreeBSD kfreebsd,$(UNAME))","")
|
||||
OS = LINUX
|
||||
endif
|
||||
ifeq ("$(patsubst MINGW%,MINGW,$(UNAME))","MINGW")
|
||||
OS = MINGW
|
||||
endif
|
||||
ifeq ("$(OS)","NONE")
|
||||
$(error OS type "$(UNAME)" not supported. Please file bug report at 'https://github.com/mupen64plus/mupen64plus-core/issues')
|
||||
endif
|
||||
|
||||
# detect system architecture
|
||||
# detect system architecture, only if it matters for build flags
|
||||
HOST_CPU ?= $(shell uname -m)
|
||||
NO_ASM ?= 1
|
||||
CPU := OTHER
|
||||
ifneq ("$(filter x86_64 amd64,$(HOST_CPU))","")
|
||||
CPU := X86
|
||||
ifeq ("$(BITS)", "32")
|
||||
|
@ -50,44 +66,67 @@ ifneq ("$(filter pentium i%86,$(HOST_CPU))","")
|
|||
CPU := X86
|
||||
ARCH_DETECTED := 32BITS
|
||||
endif
|
||||
ifneq ("$(filter ppc powerpc,$(HOST_CPU))","")
|
||||
CPU := PPC
|
||||
ARCH_DETECTED := 32BITS
|
||||
endif
|
||||
ifneq ("$(filter ppc64 powerpc64,$(HOST_CPU))","")
|
||||
CPU := PPC
|
||||
ARCH_DETECTED := 64BITS
|
||||
endif
|
||||
|
||||
# base CFLAGS, LIBS, and LDFLAGS
|
||||
CFLAGS = -ffast-math -funroll-loops -fexpensive-optimizations -fno-strict-aliasing -I../../src
|
||||
LDFLAGS = -ldl
|
||||
SRCDIR = ../../src
|
||||
OBJDIR = _obj$(POSTFIX)
|
||||
|
||||
# base CFLAGS, LDLIBS, and LDFLAGS
|
||||
OPTFLAGS ?= -O3 -flto
|
||||
WARNFLAGS ?= -Wall
|
||||
|
||||
CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -ffast-math -I$(SRCDIR)
|
||||
ifeq ($(OS), MINGW)
|
||||
CFLAGS += -lpthread
|
||||
LDLIBS += -lpthread
|
||||
else
|
||||
ifneq ($(OS), OSX)
|
||||
CFLAGS += -pthread
|
||||
LDLIBS += -pthread
|
||||
endif
|
||||
endif
|
||||
|
||||
# set special flags per-system
|
||||
ifeq ($(OS), LINUX)
|
||||
ifeq ($(CPU), X86)
|
||||
ifeq ($(ARCH_DETECTED), 64BITS)
|
||||
CFLAGS += -pipe -O3 -march=athlon64
|
||||
else
|
||||
CFLAGS += -pipe -O3 -mmmx -msse -march=i686 -mtune=pentium-m -fomit-frame-pointer
|
||||
endif
|
||||
endif
|
||||
LDLIBS += -ldl
|
||||
endif
|
||||
ifeq ($(OS), OSX)
|
||||
# The mac version of SDL requires inclusion of SDL_main in the executable
|
||||
LDFLAGS += $(shell sdl-config --libs)
|
||||
OSX_SDK_PATH = $(shell xcrun --sdk macosx --show-sdk-path)
|
||||
LDLIBS += -framework CoreFoundation
|
||||
|
||||
ifeq ($(CPU), X86)
|
||||
ifeq ($(ARCH_DETECTED), 64BITS)
|
||||
CFLAGS += -pipe -O3 -arch x86_64 -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk
|
||||
LDFLAGS += `sdl-config --libs` -arch x86_64
|
||||
CFLAGS += -pipe -arch x86_64 -mmacosx-version-min=10.9 -isysroot $(OSX_SDK_PATH)
|
||||
else
|
||||
CFLAGS += -pipe -O3 -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=10.5 -isysroot /Developer/SDKs/MacOSX10.5.sdk
|
||||
LDFLAGS += `sdl-config --libs` -arch i686
|
||||
CFLAGS += -pipe -mmmx -msse -fomit-frame-pointer -arch i686 -mmacosx-version-min=10.9 -isysroot $(OSX_SDK_PATH)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
ifeq ($(CPU), PPC)
|
||||
CFLAGS += -mcpu=powerpc
|
||||
|
||||
# test for essential build dependencies
|
||||
ifeq ($(origin PKG_CONFIG), undefined)
|
||||
PKG_CONFIG = $(CROSS_COMPILE)pkg-config
|
||||
ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),)
|
||||
$(error $(PKG_CONFIG) not found)
|
||||
endif
|
||||
endif
|
||||
|
||||
# test for presence of SDL
|
||||
ifeq ($(origin SDL_CFLAGS) $(origin SDL_LDLIBS), undefined undefined)
|
||||
ifeq ($(shell $(PKG_CONFIG) --modversion sdl2 2>/dev/null),)
|
||||
$(error No SDL2 development libraries found!)
|
||||
endif
|
||||
SDL_CFLAGS += $(shell $(PKG_CONFIG) --cflags sdl2)
|
||||
SDL_LDLIBS += $(shell $(PKG_CONFIG) --libs sdl2)
|
||||
endif
|
||||
CFLAGS += $(SDL_CFLAGS)
|
||||
LDLIBS += $(SDL_LDLIBS)
|
||||
|
||||
ifeq ($(OS), MINGW)
|
||||
LDLIBS += -mconsole
|
||||
endif
|
||||
|
||||
ifeq ($(BIG_ENDIAN), 1)
|
||||
CFLAGS += -DM64P_BIG_ENDIAN
|
||||
endif
|
||||
|
||||
# tweak flags for 32-bit build on 64-bit system
|
||||
|
@ -95,8 +134,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 += -m32 -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 mupen64plus core API header path
|
||||
|
@ -121,24 +172,77 @@ else
|
|||
endif
|
||||
endif
|
||||
|
||||
# set shell function names
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
LD = g++
|
||||
INSTALL = install
|
||||
ifeq ($(OS),LINUX)
|
||||
STRIP = strip -s
|
||||
# reduced compile output when running make without V=1
|
||||
ifneq ($(findstring $(MAKEFLAGS),s),s)
|
||||
ifndef V
|
||||
Q_CC = @echo ' CC '$@;
|
||||
Q_LD = @echo ' LD '$@;
|
||||
endif
|
||||
ifeq ($(OS),OSX)
|
||||
STRIP = strip -x
|
||||
endif
|
||||
|
||||
# set base program pointers and flags
|
||||
CC = $(CROSS_COMPILE)gcc
|
||||
CXX = $(CROSS_COMPILE)g++
|
||||
RM ?= rm -f
|
||||
INSTALL ?= install
|
||||
MKDIR ?= mkdir -p
|
||||
COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
|
||||
LINK.o = $(Q_LD)$(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_ARCH)
|
||||
|
||||
ifndef PIE
|
||||
ifeq ($(CC),$(CROSS_COMPILE)gcc)
|
||||
# check if PIE is the default for the compiler
|
||||
PIE_DEFAULT = $(shell $(CC) -v 2>&1 | grep enable-default-pie)
|
||||
ifeq ($(PIE_DEFAULT),)
|
||||
PIE = 1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef PIE
|
||||
ifeq ($(PIE), 1)
|
||||
CFLAGS += -fPIE
|
||||
LDFLAGS += -pie
|
||||
else
|
||||
ifeq ($(PIE), 0)
|
||||
CFLAGS += -fno-PIE
|
||||
LDFLAGS += -no-pie
|
||||
else
|
||||
$(error Invalid PIE value.)
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# set installation options
|
||||
ifeq ($(PREFIX),)
|
||||
PREFIX := /usr/local
|
||||
endif
|
||||
ifeq ($(LIBDIR),)
|
||||
LIBDIR := $(PREFIX)/lib
|
||||
endif
|
||||
ifeq ($(BINDIR),)
|
||||
BINDIR := $(PREFIX)/bin
|
||||
endif
|
||||
ifeq ($(MANDIR),)
|
||||
MANDIR := $(PREFIX)/share/man
|
||||
endif
|
||||
ifeq ($(APPSDIR),)
|
||||
APPSDIR := $(PREFIX)/share/applications
|
||||
endif
|
||||
ifeq ($(ICONSDIR),)
|
||||
ICONSDIR := $(PREFIX)/share/icons/hicolor
|
||||
endif
|
||||
|
||||
# set special flags for given Makefile parameters
|
||||
# note: COREDIR _must_ end in a slash if you want it to work; not necessary for the others
|
||||
ifneq ($(PLUGINDIR),)
|
||||
ifeq ($(PLUGINDIR),)
|
||||
CFLAGS += '-DPLUGINDIR="$(LIBDIR)/mupen64plus"'
|
||||
else
|
||||
CFLAGS += '-DPLUGINDIR="$(PLUGINDIR)"'
|
||||
endif
|
||||
ifneq ($(COREDIR),)
|
||||
# note: COREDIR _must_ end in a slash if you want it to work; not necessary for the others
|
||||
ifeq ($(COREDIR),)
|
||||
CFLAGS += '-DCOREDIR="$(LIBDIR)/"'
|
||||
else
|
||||
CFLAGS += '-DCOREDIR="$(COREDIR)"'
|
||||
endif
|
||||
ifneq ($(SHAREDIR),)
|
||||
|
@ -146,40 +250,43 @@ ifneq ($(SHAREDIR),)
|
|||
endif
|
||||
ifeq ($(DEBUG),1)
|
||||
CFLAGS += -g
|
||||
STRIP = true # disable binary strip
|
||||
INSTALL_STRIP_FLAG ?=
|
||||
else
|
||||
INSTALL_STRIP_FLAG ?= -s
|
||||
endif
|
||||
|
||||
# set installation options
|
||||
ifeq ($(PREFIX),)
|
||||
PREFIX := /usr/local
|
||||
ifeq ("$(OS)","MINGW")
|
||||
EXEEXT = .exe
|
||||
else
|
||||
EXEEXT =
|
||||
endif
|
||||
ifeq ($(BINDIR),)
|
||||
BINDIR := $(PREFIX)/bin
|
||||
endif
|
||||
ifeq ($(MANDIR),)
|
||||
MANDIR := $(PREFIX)/man/man6
|
||||
endif
|
||||
|
||||
SRCDIR = ../../src
|
||||
OBJDIR = _obj
|
||||
|
||||
# list of source files to compile
|
||||
SOURCE = \
|
||||
$(SRCDIR)/cheat.c \
|
||||
$(SRCDIR)/compare_core.c \
|
||||
$(SRCDIR)/core_interface.c \
|
||||
$(SRCDIR)/debugger.c \
|
||||
$(SRCDIR)/main.c \
|
||||
$(SRCDIR)/plugin.c \
|
||||
$(SRCDIR)/plugin.c
|
||||
|
||||
ifeq ($(OS), MINGW)
|
||||
SOURCE += \
|
||||
$(SRCDIR)/osal_dynamiclib_win32.c \
|
||||
$(SRCDIR)/osal_files_win32.c
|
||||
else
|
||||
SOURCE += \
|
||||
$(SRCDIR)/osal_dynamiclib_unix.c \
|
||||
$(SRCDIR)/osal_files_unix.c
|
||||
endif
|
||||
|
||||
# generate a list of object files build, make a temporary directory for them
|
||||
OBJECTS := $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(filter %.c, $(SOURCE)))
|
||||
OBJDIRS = $(dir $(OBJECTS))
|
||||
$(shell mkdir -p $(OBJDIRS))
|
||||
$(shell $(MKDIR) $(OBJDIRS))
|
||||
|
||||
# build targets
|
||||
TARGET = mupen64plus
|
||||
TARGET = mupen64plus$(POSTFIX)$(EXEEXT)
|
||||
|
||||
targets:
|
||||
@echo "Mupen64Plus-ui-console makefile."
|
||||
|
@ -193,35 +300,58 @@ targets:
|
|||
@echo " COREDIR=path == default path to search for Mupen64Plus Core (must end with slash)"
|
||||
@echo " PLUGINDIR=path == default path to search for plugins"
|
||||
@echo " SHAREDIR=path == default path to search for shared data files"
|
||||
@echo " APIDIR=path == path to find Mupen64Plus Core headers"
|
||||
@echo " OPTFLAGS=flags == compiler optimization (default: -O3 -flto)"
|
||||
@echo " WARNFLAGS=flag == compiler warning levels (default: -Wall)"
|
||||
@echo " PIE=(1|0) == Force enable/disable of position independent executables"
|
||||
@echo " POSTFIX=name == String added to the name of the the build (default: '')"
|
||||
@echo " Install Options:"
|
||||
@echo " PREFIX=path == install/uninstall prefix (default: /usr/local/)"
|
||||
@echo " BINDIR=path == path to install mupen64plus binary (default: PREFIX/bin/)"
|
||||
@echo " MANDIR=path == path to install mupen64plus manual page (default: PREFIX/man/man6/)"
|
||||
@echo " PREFIX=path == install/uninstall prefix (default: /usr/local)"
|
||||
@echo " BINDIR=path == path to install mupen64plus binary (default: PREFIX/bin)"
|
||||
@echo " MANDIR=path == path to install mupen64plus manual page (default: PREFIX/share/man)"
|
||||
@echo " APPSDIR=path == path to install desktop file (default: PREFIX/share/applications)"
|
||||
@echo " ICONSDIR=path == path to install icon files (default: PREFIX/share/icons/hicolor)"
|
||||
@echo " DESTDIR=path == path to prepend to all installation paths (only for packagers)"
|
||||
@echo " Debugging Options:"
|
||||
@echo " DEBUG=1 == add debugging symbols to application binary"
|
||||
@echo " V=1 == show verbose compiler output"
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
clean:
|
||||
rm -rf ./_obj/* $(TARGET)
|
||||
$(RM) -r $(OBJDIR) $(TARGET)
|
||||
|
||||
rebuild: clean all
|
||||
|
||||
install: $(TARGET)
|
||||
$(INSTALL) -d -v "$(BINDIR)"
|
||||
$(INSTALL) -m 0755 $(TARGET) "$(BINDIR)"
|
||||
$(INSTALL) -d -v "$(MANDIR)"
|
||||
$(INSTALL) -m 0644 ../../doc/mupen64plus.6.gz "$(MANDIR)"
|
||||
$(INSTALL) -d "$(DESTDIR)$(BINDIR)"
|
||||
$(INSTALL) -m 0755 $(INSTALL_STRIP_FLAG) $(TARGET) "$(DESTDIR)$(BINDIR)"
|
||||
$(INSTALL) -d "$(DESTDIR)$(MANDIR)/man6"
|
||||
$(INSTALL) -m 0644 $(SRCDIR)/../doc/mupen64plus.6 "$(DESTDIR)$(MANDIR)/man6"
|
||||
$(INSTALL) -d "$(DESTDIR)$(APPSDIR)"
|
||||
$(INSTALL) -m 0644 $(SRCDIR)/../data/mupen64plus.desktop "$(DESTDIR)$(APPSDIR)"
|
||||
$(INSTALL) -d "$(DESTDIR)$(ICONSDIR)/48x48/apps"
|
||||
$(INSTALL) -m 0644 $(SRCDIR)/../data/icons/48x48/apps/mupen64plus.png "$(DESTDIR)$(ICONSDIR)/48x48/apps"
|
||||
$(INSTALL) -d "$(DESTDIR)$(ICONSDIR)/scalable/apps"
|
||||
$(INSTALL) -m 0644 $(SRCDIR)/../data/icons/scalable/apps/mupen64plus.svg "$(DESTDIR)$(ICONSDIR)/scalable/apps"
|
||||
|
||||
|
||||
uninstall:
|
||||
rm -f "$(BINDIR)/$(TARGET)" "$(MANDIR)/mupen64plus.6.gz"
|
||||
$(RM) "$(DESTDIR)$(BINDIR)/$(TARGET)" "$(DESTDIR)$(MANDIR)/man6/mupen64plus.6"
|
||||
$(RM) "$(DESTDIR)$(APPSDIR)/mupen64plus.desktop"
|
||||
$(RM) "$(DESTDIR)$(ICONSDIR)/48x48/apps/mupen64plus.png"
|
||||
$(RM) "$(DESTDIR)$(ICONSDIR)/scalable/apps/mupen64plus.svg"
|
||||
|
||||
# build rules
|
||||
$(TARGET): $(OBJECTS)
|
||||
$(CC) $^ $(LDFLAGS) $(SRC_LIBS) -o $@
|
||||
$(STRIP) $@
|
||||
|
||||
# build dependency files
|
||||
CFLAGS += -MD -MP
|
||||
-include $(OBJECTS:.o=.d)
|
||||
|
||||
# standard build rules
|
||||
$(OBJDIR)/%.o: $(SRCDIR)/%.c
|
||||
$(CC) -o $@ $(CFLAGS) -c $<
|
||||
$(COMPILE.c) -o $@ $<
|
||||
|
||||
$(TARGET): $(OBJECTS)
|
||||
$(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -o $@
|
||||
|
||||
.PHONY: all clean install uninstall targets
|
||||
|
|
423
src/cheat.c
423
src/cheat.c
|
@ -1,7 +1,8 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus - cheat.c *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Copyright (C) 2009 Richard Goedeken *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2009-2010 Richard Goedeken *
|
||||
* Copyright (C) 2010 Rhett Osborne (spinout) *
|
||||
* *
|
||||
* 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 *
|
||||
|
@ -19,33 +20,43 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "m64p_types.h"
|
||||
#include "cheat.h"
|
||||
#include "core_interface.h"
|
||||
#include "m64p_types.h"
|
||||
#include "main.h"
|
||||
|
||||
/* local definitions */
|
||||
#define DATABASE_FILENAME "mupen64plus.cht"
|
||||
#define CHEAT_FILE "mupencheat.txt"
|
||||
|
||||
typedef struct {
|
||||
int address;
|
||||
int *variables;
|
||||
char **variable_names;
|
||||
int var_to_use;
|
||||
int var_count;
|
||||
} cheat_code;
|
||||
|
||||
typedef struct _sCheatInfo {
|
||||
int Number;
|
||||
int Count;
|
||||
int VariableLine;
|
||||
const char *Name;
|
||||
const char *Description;
|
||||
const char *Codes;
|
||||
cheat_code *Codes;
|
||||
struct _sCheatInfo *Next;
|
||||
} sCheatInfo;
|
||||
|
||||
/* local variables */
|
||||
static m64p_rom_header l_RomHeader;
|
||||
|
||||
static char *l_IniText = NULL;
|
||||
static const char *l_CheatGameName = NULL;
|
||||
static sCheatInfo *l_CheatList = NULL;
|
||||
static int l_CheatCodesFound = 0;
|
||||
static int l_RomFound = 0;
|
||||
static m64p_rom_header l_RomHeader;
|
||||
static char *l_IniText = NULL;
|
||||
static char *l_CheatGameName = NULL;
|
||||
static sCheatInfo *l_CheatList = NULL;
|
||||
static int l_CheatCodesFound = 0;
|
||||
static int l_RomFound = 0;
|
||||
|
||||
/*********************************************************************************************************
|
||||
* Static (Local) functions
|
||||
|
@ -56,32 +67,7 @@ static int isSpace(char ch)
|
|||
return (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n');
|
||||
}
|
||||
|
||||
static void CheatNewCode(char *CheatName, int CheatNum, char *CheatCodes)
|
||||
{
|
||||
/* allocate memory for a new sCheatInfo struct */
|
||||
sCheatInfo *pNew = (sCheatInfo *) malloc(sizeof(sCheatInfo));
|
||||
if (pNew == NULL) return;
|
||||
|
||||
/* fill in the data members */
|
||||
pNew->Number = CheatNum;
|
||||
pNew->Name = CheatName;
|
||||
pNew->Description = NULL;
|
||||
pNew->Codes = CheatCodes;
|
||||
pNew->Next = NULL;
|
||||
|
||||
l_CheatCodesFound++;
|
||||
|
||||
/* stick it at the end of the list */
|
||||
if (l_CheatList == NULL)
|
||||
{
|
||||
l_CheatList = pNew;
|
||||
return;
|
||||
}
|
||||
sCheatInfo *pLast = l_CheatList;
|
||||
while (pLast->Next != NULL) pLast = pLast->Next;
|
||||
pLast->Next = pNew;
|
||||
}
|
||||
|
||||
/* Find cheat code */
|
||||
static sCheatInfo *CheatFindCode(int Number)
|
||||
{
|
||||
sCheatInfo *pCur = l_CheatList;
|
||||
|
@ -93,15 +79,133 @@ static sCheatInfo *CheatFindCode(int Number)
|
|||
return pCur;
|
||||
}
|
||||
|
||||
/*
|
||||
* Read and parse the Cheat DATABASE (PJ64), and load up any cheat codes found for the specified ROM section
|
||||
*/
|
||||
void CheatParseIni(const char *RomSection)
|
||||
|
||||
/* Activate a code */
|
||||
static void CheatActivate(sCheatInfo *pCheat)
|
||||
{
|
||||
const char *romdbpath = ConfigGetSharedDataFilepath(DATABASE_FILENAME);
|
||||
int i;
|
||||
|
||||
/* Get a m64p_cheat_code object */
|
||||
m64p_cheat_code * code = (m64p_cheat_code*) calloc(pCheat->Count, sizeof(m64p_cheat_code));
|
||||
if (code == NULL)
|
||||
{
|
||||
DebugMessage(M64MSG_WARNING, "could not allocate memory for code '%s'", pCheat->Name);
|
||||
return;
|
||||
}
|
||||
/* Fill in members */
|
||||
for (i = 0; i < pCheat->Count; i++)
|
||||
{
|
||||
code[i].address = pCheat->Codes[i].address;
|
||||
code[i].value = pCheat->Codes[i].variables[pCheat->Codes[i].var_to_use];
|
||||
}
|
||||
/* Enable cheat */
|
||||
if (CoreAddCheat(pCheat->Name, code, pCheat->Count) != M64ERR_SUCCESS)
|
||||
{
|
||||
DebugMessage(M64MSG_WARNING, "CoreAddCheat() failed for cheat code %i (%s)", pCheat->Number, pCheat->Name);
|
||||
free(code);
|
||||
return;
|
||||
}
|
||||
|
||||
free(code);
|
||||
DebugMessage(M64MSG_STATUS, "activated cheat code %i: %s", pCheat->Number, pCheat->Name);
|
||||
}
|
||||
|
||||
static void CheatFreeAll(void)
|
||||
{
|
||||
if (l_IniText != NULL)
|
||||
free(l_IniText);
|
||||
l_IniText = NULL;
|
||||
|
||||
sCheatInfo *pCur = l_CheatList;
|
||||
while (pCur != NULL)
|
||||
{
|
||||
sCheatInfo *pNext = pCur->Next;
|
||||
if (pCur->Codes != NULL)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i < pCur->Count; i++)
|
||||
{
|
||||
if (pCur->Codes[i].variables != NULL)
|
||||
free(pCur->Codes[i].variables);
|
||||
if (pCur->Codes[i].variable_names != NULL)
|
||||
free(pCur->Codes[i].variable_names);
|
||||
}
|
||||
free(pCur->Codes);
|
||||
}
|
||||
free(pCur);
|
||||
pCur = pNext;
|
||||
}
|
||||
|
||||
l_CheatList = NULL;
|
||||
}
|
||||
|
||||
/* Append new code */
|
||||
static sCheatInfo * NewCode(char *CheatName, int CheatNum)
|
||||
{
|
||||
/* allocate memory for a new sCheatInfo struct */
|
||||
sCheatInfo *pNew = (sCheatInfo *) malloc(sizeof(sCheatInfo));
|
||||
if (pNew == NULL) return NULL;
|
||||
|
||||
/* fill in the data members */
|
||||
pNew->Number = CheatNum;
|
||||
pNew->Count = 0;
|
||||
pNew->VariableLine = -1;
|
||||
pNew->Name = CheatName;
|
||||
pNew->Description = NULL;
|
||||
pNew->Codes = NULL;
|
||||
pNew->Next = NULL;
|
||||
|
||||
l_CheatCodesFound++;
|
||||
|
||||
/* stick it at the end of the list */
|
||||
if (l_CheatList == NULL)
|
||||
{
|
||||
l_CheatList = pNew;
|
||||
return pNew;
|
||||
}
|
||||
sCheatInfo *pLast = l_CheatList;
|
||||
while (pLast->Next != NULL) pLast = pLast->Next;
|
||||
pLast->Next = pNew;
|
||||
return pNew;
|
||||
}
|
||||
|
||||
static void CheatAddVariables(cheat_code * Code, char *varlist)
|
||||
{
|
||||
/* needs to be more verbose? */
|
||||
Code->variables = NULL;
|
||||
Code->variable_names = NULL;
|
||||
Code->var_count = 0;
|
||||
while (*varlist != 0)
|
||||
{
|
||||
if ((Code->variables = (int*) realloc(Code->variables, sizeof(int) * (Code->var_count + 1))) == NULL)
|
||||
return;
|
||||
if ((Code->variable_names = (char**) realloc(Code->variable_names, sizeof(char*) * (Code->var_count + 1))) == NULL)
|
||||
return;
|
||||
if (sscanf(varlist, "%04X", &Code->variables[Code->var_count]) != 1)
|
||||
Code->variables[Code->var_count] = 0;
|
||||
if (strchr(varlist, '"') == NULL)
|
||||
return;
|
||||
Code->variable_names[Code->var_count] = strchr(varlist, '"') + 1;
|
||||
if ((varlist = strchr(Code->variable_names[Code->var_count], '"')) == NULL)
|
||||
return;
|
||||
*varlist++ = 0;
|
||||
if (*varlist == ',')
|
||||
varlist++;
|
||||
Code->var_count++;
|
||||
}
|
||||
}
|
||||
|
||||
/*********************************************************************************************************
|
||||
* global functions
|
||||
*/
|
||||
|
||||
static void ReadCheats(char *RomSection)
|
||||
{
|
||||
sCheatInfo *curr_code = NULL;
|
||||
const char *romdbpath = ConfigGetSharedDataFilepath(CHEAT_FILE);
|
||||
if (romdbpath == NULL)
|
||||
{
|
||||
printf("UI-Console: Cheat code database file '%s' not found.\n", DATABASE_FILENAME);
|
||||
DebugMessage(M64MSG_WARNING, "cheat code database file '%s' not found.", CHEAT_FILE);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -110,22 +214,22 @@ void CheatParseIni(const char *RomSection)
|
|||
fPtr = fopen(romdbpath, "rb");
|
||||
if (fPtr == NULL)
|
||||
{
|
||||
printf("UI-Console: Couldn't open cheat code database file '%s'.\n", romdbpath);
|
||||
DebugMessage(M64MSG_WARNING, "Couldn't open cheat code database file '%s'.", romdbpath);
|
||||
return;
|
||||
}
|
||||
fseek(fPtr, 0L, SEEK_END);
|
||||
long IniLength = ftell(fPtr);
|
||||
fseek(fPtr, 0L, SEEK_SET);
|
||||
l_IniText = malloc(IniLength + 1);
|
||||
l_IniText = (char *) malloc(IniLength + 1);
|
||||
if (l_IniText == NULL)
|
||||
{
|
||||
printf("UI-Console: Couldn't allocate %li bytes of memory to read cheat ini file.\n", IniLength);
|
||||
DebugMessage(M64MSG_WARNING, "Couldn't allocate %li bytes of memory to read cheat file.", IniLength);
|
||||
fclose(fPtr);
|
||||
return;
|
||||
}
|
||||
if (fread(l_IniText, 1, IniLength, fPtr) != IniLength)
|
||||
{
|
||||
printf("UI-Console: Couldn't read %li bytes from cheat ini file.\n", IniLength);
|
||||
DebugMessage(M64MSG_WARNING, "Couldn't read %li bytes from cheat file.", IniLength);
|
||||
free(l_IniText);
|
||||
l_IniText = NULL;
|
||||
fclose(fPtr);
|
||||
|
@ -137,6 +241,7 @@ void CheatParseIni(const char *RomSection)
|
|||
/* parse lines from cheat database */
|
||||
char *curline = NULL;
|
||||
char *nextline = l_IniText;
|
||||
|
||||
while(nextline != NULL && *nextline != 0)
|
||||
{
|
||||
curline = nextline;
|
||||
|
@ -153,16 +258,18 @@ void CheatParseIni(const char *RomSection)
|
|||
char *endptr = curline + strlen(curline) - 1;
|
||||
while(isSpace(*endptr)) *endptr-- = 0;
|
||||
|
||||
/* ignore line if comment or empty */
|
||||
if (*curline == '#' || strncmp(curline, "//", 2) == 0 || *curline == 0)
|
||||
continue;
|
||||
|
||||
/* handle beginning of new rom section */
|
||||
if (*curline == '[' && *endptr == ']')
|
||||
if (strncmp(curline, "crc ", 4) == 0)
|
||||
{
|
||||
/* if we have already found cheats for the given ROM file, then exit upon encountering a new ROM section */
|
||||
if (l_RomFound)
|
||||
if (l_RomFound && (l_CheatGameName != NULL || l_CheatList != NULL))
|
||||
return;
|
||||
/* else see if this Rom Section matches */
|
||||
curline++;
|
||||
*endptr-- = 0;
|
||||
if (strcmp(curline, RomSection) == 0)
|
||||
if (strcmp(curline+4, RomSection) == 0)
|
||||
l_RomFound = 1;
|
||||
continue;
|
||||
}
|
||||
|
@ -171,137 +278,96 @@ void CheatParseIni(const char *RomSection)
|
|||
if (!l_RomFound)
|
||||
continue;
|
||||
|
||||
/* skip over any comments or blank lines */
|
||||
if (curline[0] == '/' && curline[1] == '/')
|
||||
/* Game name */
|
||||
if (strncmp(curline, "gn ", 3) == 0)
|
||||
{
|
||||
l_CheatGameName = curline+3;
|
||||
continue;
|
||||
if (strlen(curline) == 0)
|
||||
}
|
||||
|
||||
/* code name */
|
||||
if (strncmp(curline, "cn ", 3) == 0)
|
||||
{
|
||||
curr_code = NewCode(curline + 3, l_CheatCodesFound);
|
||||
if (curr_code == NULL)
|
||||
DebugMessage(M64MSG_WARNING, "error getting new code (%s)", curline+3);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* if curr_code is NULL, don't do these checks */
|
||||
if (curr_code == NULL)
|
||||
continue;
|
||||
|
||||
/* Handle the game's name in the cheat file */
|
||||
if (strncmp(curline, "Name=", 5) == 0)
|
||||
/* code description */
|
||||
if (strncmp(curline, "cd ", 3) == 0)
|
||||
{
|
||||
l_CheatGameName = curline + 5;
|
||||
curr_code->Description = curline+3;
|
||||
continue;
|
||||
}
|
||||
/* Handle new cheat codes */
|
||||
char lineextra[64]; /* this isn't used but is needed because sscanf sucks */
|
||||
int CheatNum;
|
||||
if (sscanf(curline, "Cheat%i = \"%32s", &CheatNum, lineextra) == 2)
|
||||
|
||||
/* code line */
|
||||
int address;
|
||||
if (sscanf(curline, "%8X %*s", &address) == 1)
|
||||
{
|
||||
char *CheatName = strchr(curline, '"') + 1;
|
||||
/* NULL-terminate the cheat code's name and get a pointer to the start of the codes */
|
||||
char *CheatCodes = strchr(CheatName, '"');
|
||||
if (CheatCodes == NULL) continue;
|
||||
*CheatCodes++ = 0;
|
||||
CheatCodes = strchr(CheatCodes, ',');
|
||||
if (CheatCodes == NULL) continue;
|
||||
CheatCodes++;
|
||||
/* If this is a cheat code with options, just skip it; too complicated for command-line UI */
|
||||
if (strchr(CheatCodes, '?') != NULL)
|
||||
continue;
|
||||
/* create a new cheat code in our list */
|
||||
CheatNewCode(CheatName, CheatNum, CheatCodes);
|
||||
continue;
|
||||
}
|
||||
/* Handle descriptions for cheat codes */
|
||||
if (sscanf(curline, "Cheat%i_N =%32s", &CheatNum, lineextra) == 2)
|
||||
{
|
||||
char *CheatDesc = strchr(curline, '=') + 1;
|
||||
sCheatInfo *pCheat = CheatFindCode(CheatNum);
|
||||
if (pCheat != NULL)
|
||||
pCheat->Description = CheatDesc;
|
||||
continue;
|
||||
}
|
||||
/* Handle options for cheat codes */
|
||||
char *CheatOptions;
|
||||
if (sscanf(curline, "Cheat%i_O =%32s", &CheatNum, lineextra) == 2)
|
||||
{
|
||||
/* just skip it, options are too complicated for command-line UI */
|
||||
curr_code->Codes = (cheat_code*) realloc(curr_code->Codes, sizeof(cheat_code) * (curr_code->Count + 1));
|
||||
if (strncmp(curline+9, "????", 4) == 0)
|
||||
{
|
||||
curr_code->Codes[curr_code->Count].var_count = 0;
|
||||
CheatAddVariables(&curr_code->Codes[curr_code->Count], curline+14);
|
||||
curr_code->VariableLine = curr_code->Count;
|
||||
}
|
||||
else
|
||||
{
|
||||
int var;
|
||||
curr_code->Codes[curr_code->Count].var_count = 1;
|
||||
curr_code->Codes[curr_code->Count].variables = (int*) malloc(sizeof(int));
|
||||
if(curr_code->Codes[curr_code->Count].variables == NULL)
|
||||
{
|
||||
DebugMessage(M64MSG_WARNING, "couldn't allocate memory; ignoring line: '%s'", curline);
|
||||
continue;
|
||||
}
|
||||
if (sscanf(curline+9, "%04X", &var) != 1)
|
||||
var = 0;
|
||||
curr_code->Codes[curr_code->Count].variables[0] = var;
|
||||
curr_code->Codes[curr_code->Count].variable_names = NULL;
|
||||
}
|
||||
curr_code->Codes[curr_code->Count].var_to_use = 0;
|
||||
curr_code->Codes[curr_code->Count].address = address;
|
||||
curr_code->Count++;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* otherwise we don't know what this line is */
|
||||
printf("UI-Console Warning: unrecognized line in cheat ini file: '%s'\n", curline);
|
||||
DebugMessage(M64MSG_WARNING, "unrecognized line in cheat file: '%s'", curline);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void CheatActivate(sCheatInfo *pCheat)
|
||||
{
|
||||
m64p_cheat_code CodeArray[32];
|
||||
const char *pCodes = pCheat->Codes;
|
||||
int NumCodes = 0;
|
||||
|
||||
while (pCodes != NULL && *pCodes != 0 && NumCodes < 32) /* I'm pretty sure none of the cheats contain 30 codes or more */
|
||||
{
|
||||
unsigned int address;
|
||||
int value;
|
||||
if (sscanf(pCodes, "%x %x", &address, &value) != 2)
|
||||
{
|
||||
printf("UI-Console Error: reading hex values in cheat code %i (%s)\n", pCheat->Number, pCodes);
|
||||
return;
|
||||
}
|
||||
CodeArray[NumCodes].address = address;
|
||||
CodeArray[NumCodes].value = value;
|
||||
NumCodes++;
|
||||
pCodes = strchr(pCodes, ',');
|
||||
if (pCodes != NULL) pCodes++;
|
||||
}
|
||||
|
||||
if (CoreAddCheat(pCheat->Name, CodeArray, NumCodes) != M64ERR_SUCCESS)
|
||||
{
|
||||
printf("UI-Console Warning: CoreAddCheat() failed for cheat code %i (%s)\n", pCheat->Number, pCheat->Name);
|
||||
return;
|
||||
}
|
||||
|
||||
printf("UI-Console: activated cheat code %i: %s\n", pCheat->Number, pCheat->Name);
|
||||
}
|
||||
|
||||
static void CheatFreeAll(void)
|
||||
{
|
||||
if (l_IniText != NULL)
|
||||
free(l_IniText);
|
||||
l_IniText = NULL;
|
||||
|
||||
sCheatInfo *pCur = l_CheatList;
|
||||
while (pCur != NULL)
|
||||
{
|
||||
sCheatInfo *pNext = pCur->Next;
|
||||
free(pCur);
|
||||
pCur = pNext;
|
||||
}
|
||||
|
||||
l_CheatList = NULL;
|
||||
}
|
||||
|
||||
/*********************************************************************************************************
|
||||
* global functions
|
||||
*/
|
||||
|
||||
void CheatStart(eCheatMode CheatMode, int *CheatNumList, int CheatListLength)
|
||||
void CheatStart(eCheatMode CheatMode, char *CheatNumList)
|
||||
{
|
||||
/* if cheat codes are disabled, then we don't have to do anything */
|
||||
if (CheatMode == CHEAT_DISABLE || (CheatMode == CHEAT_LIST && CheatListLength < 1))
|
||||
if (CheatMode == CHEAT_DISABLE || (CheatMode == CHEAT_LIST && strlen(CheatNumList) == 0))
|
||||
{
|
||||
printf("UI-Console: Cheat codes disabled.\n");
|
||||
DebugMessage(M64MSG_STATUS, "Cheat codes disabled.");
|
||||
return;
|
||||
}
|
||||
|
||||
/* get the ROM header for the currently loaded ROM image from the core */
|
||||
if ((*CoreDoCommand)(M64CMD_ROM_GET_HEADER, sizeof(l_RomHeader), &l_RomHeader) != M64ERR_SUCCESS)
|
||||
{
|
||||
printf("UI-Console: couldn't get ROM header information from core library\n");
|
||||
DebugMessage(M64MSG_WARNING, "couldn't get ROM header information from core library");
|
||||
return;
|
||||
}
|
||||
|
||||
/* generate section name from ROM's CRC and country code */
|
||||
char RomSection[24];
|
||||
sprintf(RomSection, "%X-%X-C:%X", sl(l_RomHeader.CRC1), sl(l_RomHeader.CRC2), l_RomHeader.Country_code & 0xff);
|
||||
sprintf(RomSection, "%08X-%08X-C:%X", sl(l_RomHeader.CRC1), sl(l_RomHeader.CRC2), l_RomHeader.Country_code & 0xff);
|
||||
|
||||
/* parse through the cheat INI file and load up any cheat codes found for this ROM */
|
||||
CheatParseIni(RomSection);
|
||||
ReadCheats(RomSection);
|
||||
if (!l_RomFound || l_CheatCodesFound == 0)
|
||||
{
|
||||
printf("UI-Console: no cheat codes found for ROM image '%.20s'\n", l_RomHeader.Name);
|
||||
DebugMessage(M64MSG_WARNING, "no cheat codes found for ROM image '%.20s'", l_RomHeader.Name);
|
||||
CheatFreeAll();
|
||||
return;
|
||||
}
|
||||
|
@ -309,14 +375,20 @@ void CheatStart(eCheatMode CheatMode, int *CheatNumList, int CheatListLength)
|
|||
/* handle the list command */
|
||||
if (CheatMode == CHEAT_SHOW_LIST)
|
||||
{
|
||||
printf("UI-Console: %i cheat code(s) found for ROM '%s'\n", l_CheatCodesFound, l_CheatGameName);
|
||||
DebugMessage(M64MSG_INFO, "%i cheat code(s) found for ROM '%s'", l_CheatCodesFound, l_CheatGameName);
|
||||
sCheatInfo *pCur = l_CheatList;
|
||||
while (pCur != NULL)
|
||||
{
|
||||
if (pCur->Description == NULL)
|
||||
printf(" %i: %s\n", pCur->Number, pCur->Name);
|
||||
DebugMessage(M64MSG_INFO, " %i: %s", pCur->Number, pCur->Name);
|
||||
else
|
||||
printf(" %i: %s (%s)\n", pCur->Number, pCur->Name, pCur->Description);
|
||||
DebugMessage(M64MSG_INFO, " %i: %s (%s)", pCur->Number, pCur->Name, pCur->Description);
|
||||
if(pCur->VariableLine != -1)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < pCur->Codes[pCur->VariableLine].var_count; i++)
|
||||
DebugMessage(M64MSG_INFO, " %i: %s", i, pCur->Codes[pCur->VariableLine].variable_names[i]);
|
||||
}
|
||||
pCur = pCur->Next;
|
||||
}
|
||||
CheatFreeAll();
|
||||
|
@ -339,22 +411,47 @@ void CheatStart(eCheatMode CheatMode, int *CheatNumList, int CheatListLength)
|
|||
/* handle list of cheats enabled mode */
|
||||
if (CheatMode == CHEAT_LIST)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < CheatListLength; i++)
|
||||
int option, number;
|
||||
char *cheat_next;
|
||||
sCheatInfo *pCheat;
|
||||
while(CheatNumList != NULL && *CheatNumList)
|
||||
{
|
||||
sCheatInfo *pCheat = CheatFindCode(CheatNumList[i]);
|
||||
if (pCheat == NULL)
|
||||
printf("UI-Console Warning: invalid cheat code number %i\n", CheatNumList[i]);
|
||||
if ((cheat_next = strchr(CheatNumList, ',')) != NULL)
|
||||
{
|
||||
*cheat_next = 0;
|
||||
cheat_next ++;
|
||||
}
|
||||
|
||||
if (strchr(CheatNumList, '-') != NULL)
|
||||
{
|
||||
sscanf(CheatNumList, "%i-%i", &number, &option); /* option */
|
||||
}
|
||||
else
|
||||
{
|
||||
option=0;
|
||||
sscanf(CheatNumList, "%i", &number);
|
||||
}
|
||||
|
||||
pCheat = CheatFindCode(number);
|
||||
if (pCheat == NULL)
|
||||
DebugMessage(M64MSG_WARNING, "invalid cheat code number %i", number);
|
||||
else
|
||||
{
|
||||
if (pCheat->VariableLine != -1 && pCheat->Count > pCheat->VariableLine && option < pCheat->Codes[pCheat->VariableLine].var_count)
|
||||
pCheat->Codes[pCheat->VariableLine].var_to_use = option;
|
||||
CheatActivate(pCheat);
|
||||
}
|
||||
|
||||
CheatNumList = cheat_next;
|
||||
}
|
||||
CheatFreeAll();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* otherwise the mode is invalid */
|
||||
printf("UI-Console: internal error; invalid CheatMode in CheatStart()\n");
|
||||
DebugMessage(M64MSG_WARNING, "internal error; invalid CheatMode in CheatStart()");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus - cheat.h *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2009 Richard Goedeken *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -22,7 +22,7 @@
|
|||
#ifndef CHEAT_H
|
||||
#define CHEAT_H
|
||||
|
||||
#ifdef _BIG_ENDIAN
|
||||
#ifdef M64P_BIG_ENDIAN
|
||||
#define sl(mot) mot
|
||||
#else
|
||||
#define sl(mot) (((mot & 0xFF) << 24) | ((mot & 0xFF00) << 8) | ((mot & 0xFF0000) >> 8) | ((mot & 0xFF000000) >> 24))
|
||||
|
@ -35,7 +35,7 @@ typedef enum {
|
|||
CHEAT_SHOW_LIST
|
||||
} eCheatMode;
|
||||
|
||||
void CheatStart(eCheatMode CheatMode, int *CheatNumList, int CheatListLength);
|
||||
void CheatStart(eCheatMode CheatMode, char *CheatNumList);
|
||||
|
||||
#endif // #define CHEAT_H
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus - compare_core.h *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2009 Richard Goedeken *
|
||||
* Copyright (C) 2002 Hacktarux *
|
||||
* *
|
||||
|
@ -21,11 +21,13 @@
|
|||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "m64p_types.h"
|
||||
#include "compare_core.h"
|
||||
#include "core_interface.h"
|
||||
#include "m64p_types.h"
|
||||
#include "main.h"
|
||||
|
||||
/* local variables */
|
||||
|
||||
|
@ -48,8 +50,12 @@ static void stop_it(void)
|
|||
(*CoreDoCommand)(M64CMD_STOP, 0, NULL);
|
||||
|
||||
errors++;
|
||||
if (errors > 7)
|
||||
asm("int $3;");
|
||||
#if !defined(WIN32)
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
if (errors > 7)
|
||||
asm("int $3;");
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static void display_error(char *txt)
|
||||
|
@ -119,7 +125,7 @@ static void compare_core_check(unsigned int cur_opcode)
|
|||
sprintf(errHead, "Compare #%i old_op: %x op: %x\n", comparecnt++, old_op, cur_opcode);
|
||||
|
||||
/* get pointer to current R4300 Program Counter address */
|
||||
ptr_PC = DebugGetCPUDataPtr(M64P_CPU_PC); /* this changes for every instruction */
|
||||
ptr_PC = (int *) DebugGetCPUDataPtr(M64P_CPU_PC); /* this changes for every instruction */
|
||||
|
||||
if (l_CoreCompareMode == CORE_COMPARE_RECV)
|
||||
{
|
||||
|
@ -190,30 +196,35 @@ static void compare_core_check(unsigned int cur_opcode)
|
|||
/* global functions */
|
||||
void compare_core_init(int mode)
|
||||
{
|
||||
#if defined(WIN32)
|
||||
DebugMessage(M64MSG_VERBOSE, "core comparison feature not supported on Windows platform.");
|
||||
return;
|
||||
#else
|
||||
/* set mode */
|
||||
l_CoreCompareMode = mode;
|
||||
/* set callback functions in core */
|
||||
if (DebugSetCoreCompare(compare_core_check, compare_core_sync_data) != M64ERR_SUCCESS)
|
||||
{
|
||||
l_CoreCompareMode = CORE_COMPARE_DISABLE;
|
||||
printf("UI-console: DebugSetCoreCompare() failed, core comparison disabled.\n");
|
||||
DebugMessage(M64MSG_WARNING, "DebugSetCoreCompare() failed, core comparison disabled.");
|
||||
return;
|
||||
}
|
||||
/* get pointers to emulated R4300 CPU registers */
|
||||
ptr_reg = DebugGetCPUDataPtr(M64P_CPU_REG_REG);
|
||||
ptr_cop0 = DebugGetCPUDataPtr(M64P_CPU_REG_COP0);
|
||||
ptr_fgr = DebugGetCPUDataPtr(M64P_CPU_REG_COP1_FGR_64);
|
||||
ptr_reg = (long long *) DebugGetCPUDataPtr(M64P_CPU_REG_REG);
|
||||
ptr_cop0 = (int *) DebugGetCPUDataPtr(M64P_CPU_REG_COP0);
|
||||
ptr_fgr = (long long *) DebugGetCPUDataPtr(M64P_CPU_REG_COP1_FGR_64);
|
||||
/* open file handle to FIFO pipe */
|
||||
if (l_CoreCompareMode == CORE_COMPARE_RECV)
|
||||
{
|
||||
mkfifo("compare_pipe", 0600);
|
||||
printf("UI-console: Core Comparison Waiting to read pipe.\n");
|
||||
DebugMessage(M64MSG_INFO, "Core Comparison Waiting to read pipe.");
|
||||
fPipe = fopen("compare_pipe", "r");
|
||||
}
|
||||
else if (l_CoreCompareMode == CORE_COMPARE_SEND)
|
||||
{
|
||||
printf("UI-console: Core Comparison Waiting to write pipe.\n");
|
||||
DebugMessage(M64MSG_INFO, "Core Comparison Waiting to write pipe.");
|
||||
fPipe = fopen("compare_pipe", "w");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus - compare_core.h *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2009 Richard Goedeken *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus-ui-console - core_interface.c *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2009 Richard Goedeken *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -23,21 +23,26 @@
|
|||
* library and pointers to the core functions
|
||||
*/
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "m64p_types.h"
|
||||
#include "core_interface.h"
|
||||
#include "m64p_common.h"
|
||||
#include "m64p_frontend.h"
|
||||
#include "m64p_config.h"
|
||||
#include "m64p_debugger.h"
|
||||
|
||||
#include "osal_preproc.h"
|
||||
#include "m64p_frontend.h"
|
||||
#include "m64p_types.h"
|
||||
#include "main.h"
|
||||
#include "osal_dynamiclib.h"
|
||||
|
||||
#include "osal_preproc.h"
|
||||
#include "version.h"
|
||||
|
||||
/* global data definitions */
|
||||
int g_CoreCapabilities;
|
||||
int g_CoreAPIVersion;
|
||||
|
||||
/* definitions of pointers to Core common functions */
|
||||
ptr_CoreErrorMessage CoreErrorMessage = NULL;
|
||||
|
@ -55,10 +60,13 @@ ptr_CoreCheatEnabled CoreCheatEnabled = NULL;
|
|||
/* definitions of pointers to Core config functions */
|
||||
ptr_ConfigListSections ConfigListSections = NULL;
|
||||
ptr_ConfigOpenSection ConfigOpenSection = NULL;
|
||||
ptr_ConfigDeleteSection ConfigDeleteSection = NULL;
|
||||
ptr_ConfigSaveSection ConfigSaveSection = NULL;
|
||||
ptr_ConfigListParameters ConfigListParameters = NULL;
|
||||
ptr_ConfigSaveFile ConfigSaveFile = NULL;
|
||||
ptr_ConfigSetParameter ConfigSetParameter = NULL;
|
||||
ptr_ConfigGetParameter ConfigGetParameter = NULL;
|
||||
ptr_ConfigGetParameterType ConfigGetParameterType = NULL;
|
||||
ptr_ConfigGetParameterHelp ConfigGetParameterHelp = NULL;
|
||||
ptr_ConfigSetDefaultInt ConfigSetDefaultInt = NULL;
|
||||
ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat = NULL;
|
||||
|
@ -69,6 +77,11 @@ ptr_ConfigGetParamFloat ConfigGetParamFloat = NULL;
|
|||
ptr_ConfigGetParamBool ConfigGetParamBool = NULL;
|
||||
ptr_ConfigGetParamString ConfigGetParamString = NULL;
|
||||
|
||||
ptr_ConfigExternalOpen ConfigExternalOpen = NULL;
|
||||
ptr_ConfigExternalClose ConfigExternalClose = NULL;
|
||||
ptr_ConfigExternalGetParameter ConfigExternalGetParameter = NULL;
|
||||
ptr_ConfigHasUnsavedChanges ConfigHasUnsavedChanges = NULL;
|
||||
|
||||
ptr_ConfigGetSharedDataFilepath ConfigGetSharedDataFilepath = NULL;
|
||||
ptr_ConfigGetUserConfigPath ConfigGetUserConfigPath = NULL;
|
||||
ptr_ConfigGetUserDataPath ConfigGetUserDataPath = NULL;
|
||||
|
@ -99,6 +112,9 @@ ptr_DebugGetCPUDataPtr DebugGetCPUDataPtr = NULL;
|
|||
ptr_DebugBreakpointLookup DebugBreakpointLookup = NULL;
|
||||
ptr_DebugBreakpointCommand DebugBreakpointCommand = NULL;
|
||||
|
||||
ptr_DebugBreakpointTriggeredBy DebugBreakpointTriggeredBy = NULL;
|
||||
ptr_DebugVirtualToPhysical DebugVirtualToPhysical = NULL;
|
||||
|
||||
/* global variables */
|
||||
m64p_dynlib_handle CoreHandle = NULL;
|
||||
|
||||
|
@ -122,6 +138,27 @@ m64p_error AttachCoreLib(const char *CoreLibFilepath)
|
|||
{
|
||||
rval = osal_dynlib_open(&CoreHandle, COREDIR OSAL_DEFAULT_DYNLIB_FILENAME);
|
||||
}
|
||||
#endif
|
||||
/* for MacOS, look for the library in the Frameworks folder of the app bundle */
|
||||
#if defined(__APPLE__)
|
||||
if (rval != M64ERR_SUCCESS || CoreHandle == NULL)
|
||||
{
|
||||
CFBundleRef mainBundle = CFBundleGetMainBundle();
|
||||
if (mainBundle != NULL)
|
||||
{
|
||||
CFURLRef frameworksURL = CFBundleCopyPrivateFrameworksURL(mainBundle);
|
||||
if (frameworksURL != NULL)
|
||||
{
|
||||
char libPath[1024 + 32];
|
||||
if (CFURLGetFileSystemRepresentation(frameworksURL, TRUE, (uint8_t *) libPath, 1024))
|
||||
{
|
||||
strcat(libPath, "/" OSAL_DEFAULT_DYNLIB_FILENAME);
|
||||
rval = osal_dynlib_open(&CoreHandle, libPath);
|
||||
}
|
||||
CFRelease(frameworksURL);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/* then try just the filename of the shared library, to let dlopen() look through the system lib dirs */
|
||||
if (rval != M64ERR_SUCCESS || CoreHandle == NULL)
|
||||
|
@ -136,7 +173,7 @@ m64p_error AttachCoreLib(const char *CoreLibFilepath)
|
|||
/* if we haven't found a good core library by now, then we're screwed */
|
||||
if (rval != M64ERR_SUCCESS || CoreHandle == NULL)
|
||||
{
|
||||
fprintf(stderr, "AttachCoreLib() Error: failed to find Mupen64Plus Core library\n");
|
||||
DebugMessage(M64MSG_ERROR, "AttachCoreLib() Error: failed to find Mupen64Plus Core library");
|
||||
CoreHandle = NULL;
|
||||
return M64ERR_INPUT_NOT_FOUND;
|
||||
}
|
||||
|
@ -146,42 +183,63 @@ m64p_error AttachCoreLib(const char *CoreLibFilepath)
|
|||
CoreVersionFunc = (ptr_PluginGetVersion) osal_dynlib_getproc(CoreHandle, "PluginGetVersion");
|
||||
if (CoreVersionFunc == NULL)
|
||||
{
|
||||
fprintf(stderr, "AttachCoreLib() Error: Shared library '%s' invalid; no PluginGetVersion() function found.\n", CoreLibFilepath);
|
||||
DebugMessage(M64MSG_ERROR, "AttachCoreLib() Error: Shared library '%s' invalid; no PluginGetVersion() function found.", CoreLibFilepath);
|
||||
osal_dynlib_close(CoreHandle);
|
||||
CoreHandle = NULL;
|
||||
return M64ERR_INPUT_INVALID;
|
||||
}
|
||||
m64p_plugin_type PluginType = 0;
|
||||
m64p_plugin_type PluginType = (m64p_plugin_type) 0;
|
||||
int Compatible = 0;
|
||||
int CoreVersion = 0, APIVersion = 0;
|
||||
int CoreVersion = 0;
|
||||
const char *CoreName = NULL;
|
||||
(*CoreVersionFunc)(&PluginType, &CoreVersion, &APIVersion, &CoreName, &g_CoreCapabilities);
|
||||
(*CoreVersionFunc)(&PluginType, &CoreVersion, &g_CoreAPIVersion, &CoreName, &g_CoreCapabilities);
|
||||
if (PluginType != M64PLUGIN_CORE)
|
||||
fprintf(stderr, "AttachCoreLib() Error: Shared library '%s' invalid; wrong plugin type %i.\n", CoreLibFilepath, (int) PluginType);
|
||||
DebugMessage(M64MSG_ERROR, "AttachCoreLib() Error: Shared library '%s' invalid; this is not the emulator core.", CoreLibFilepath);
|
||||
else if (CoreVersion < MINIMUM_CORE_VERSION)
|
||||
fprintf(stderr, "AttachCoreLib() Error: Shared library '%s' invalid; core version %i.%i.%i is below minimum supported %i.%i.%i\n",
|
||||
DebugMessage(M64MSG_ERROR, "AttachCoreLib() Error: Shared library '%s' incompatible; core version %i.%i.%i is below minimum supported %i.%i.%i",
|
||||
CoreLibFilepath, VERSION_PRINTF_SPLIT(CoreVersion), VERSION_PRINTF_SPLIT(MINIMUM_CORE_VERSION));
|
||||
else if (APIVersion < MINIMUM_API_VERSION)
|
||||
fprintf(stderr, "AttachCoreLib() Error: Shared library '%s' invalid; core API version %i.%i.%i is below minimum supported %i.%i.%i\n",
|
||||
CoreLibFilepath, VERSION_PRINTF_SPLIT(APIVersion), VERSION_PRINTF_SPLIT(MINIMUM_API_VERSION));
|
||||
else if ((g_CoreAPIVersion & 0xffff0000) != (CORE_API_VERSION & 0xffff0000))
|
||||
DebugMessage(M64MSG_ERROR, "AttachCoreLib() Error: Shared library '%s' incompatible; core API major version %i.%i.%i doesn't match with this application (%i.%i.%i)",
|
||||
CoreLibFilepath, VERSION_PRINTF_SPLIT(g_CoreAPIVersion), VERSION_PRINTF_SPLIT(CORE_API_VERSION));
|
||||
else
|
||||
Compatible = 1;
|
||||
/* exit if not compatible */
|
||||
if (Compatible == 0)
|
||||
{
|
||||
osal_dynlib_close(CoreHandle);
|
||||
CoreHandle = NULL;
|
||||
return M64ERR_INCOMPATIBLE;
|
||||
}
|
||||
|
||||
/* attach and call the CoreGetAPIVersion function, check Config API version for compatibility */
|
||||
ptr_CoreGetAPIVersions CoreAPIVersionFunc;
|
||||
CoreAPIVersionFunc = (ptr_CoreGetAPIVersions) osal_dynlib_getproc(CoreHandle, "CoreGetAPIVersions");
|
||||
if (CoreAPIVersionFunc == NULL)
|
||||
{
|
||||
DebugMessage(M64MSG_ERROR, "AttachCoreLib() Error: Library '%s' broken; no CoreAPIVersionFunc() function found.", CoreLibFilepath);
|
||||
osal_dynlib_close(CoreHandle);
|
||||
CoreHandle = NULL;
|
||||
return M64ERR_INPUT_INVALID;
|
||||
}
|
||||
int ConfigAPIVersion, DebugAPIVersion, VidextAPIVersion;
|
||||
(*CoreAPIVersionFunc)(&ConfigAPIVersion, &DebugAPIVersion, &VidextAPIVersion, NULL);
|
||||
if ((ConfigAPIVersion & 0xffff0000) != (CONFIG_API_VERSION & 0xffff0000) || ConfigAPIVersion < CONFIG_API_VERSION)
|
||||
{
|
||||
DebugMessage(M64MSG_ERROR, "AttachCoreLib() Error: Emulator core '%s' incompatible; Config API version %i.%i.%i doesn't match application: %i.%i.%i",
|
||||
CoreLibFilepath, VERSION_PRINTF_SPLIT(ConfigAPIVersion), VERSION_PRINTF_SPLIT(CONFIG_API_VERSION));
|
||||
osal_dynlib_close(CoreHandle);
|
||||
CoreHandle = NULL;
|
||||
return M64ERR_INCOMPATIBLE;
|
||||
}
|
||||
|
||||
/* print some information about the core library */
|
||||
printf("UI-console: attached to core library '%s' version %i.%i.%i\n", CoreName, VERSION_PRINTF_SPLIT(CoreVersion));
|
||||
DebugMessage(M64MSG_INFO, "attached to core library '%s' version %i.%i.%i", CoreName, VERSION_PRINTF_SPLIT(CoreVersion));
|
||||
if (g_CoreCapabilities & M64CAPS_DYNAREC)
|
||||
printf(" Includes support for Dynamic Recompiler.\n");
|
||||
DebugMessage(M64MSG_INFO, " Includes support for Dynamic Recompiler.");
|
||||
if (g_CoreCapabilities & M64CAPS_DEBUGGER)
|
||||
printf(" Includes support for MIPS r4300 Debugger.\n");
|
||||
DebugMessage(M64MSG_INFO, " Includes support for MIPS r4300 Debugger.");
|
||||
if (g_CoreCapabilities & M64CAPS_CORE_COMPARE)
|
||||
printf(" Includes support for r4300 Core Comparison.\n");
|
||||
DebugMessage(M64MSG_INFO, " Includes support for r4300 Core Comparison.");
|
||||
|
||||
/* get function pointers to the common and front-end functions */
|
||||
CoreErrorMessage = (ptr_CoreErrorMessage) osal_dynlib_getproc(CoreHandle, "CoreErrorMessage");
|
||||
|
@ -197,10 +255,13 @@ m64p_error AttachCoreLib(const char *CoreLibFilepath)
|
|||
/* get function pointers to the configuration functions */
|
||||
ConfigListSections = (ptr_ConfigListSections) osal_dynlib_getproc(CoreHandle, "ConfigListSections");
|
||||
ConfigOpenSection = (ptr_ConfigOpenSection) osal_dynlib_getproc(CoreHandle, "ConfigOpenSection");
|
||||
ConfigDeleteSection = (ptr_ConfigDeleteSection) osal_dynlib_getproc(CoreHandle, "ConfigDeleteSection");
|
||||
ConfigSaveSection = (ptr_ConfigSaveSection) osal_dynlib_getproc(CoreHandle, "ConfigSaveSection");
|
||||
ConfigListParameters = (ptr_ConfigListParameters) osal_dynlib_getproc(CoreHandle, "ConfigListParameters");
|
||||
ConfigSaveFile = (ptr_ConfigSaveFile) osal_dynlib_getproc(CoreHandle, "ConfigSaveFile");
|
||||
ConfigSetParameter = (ptr_ConfigSetParameter) osal_dynlib_getproc(CoreHandle, "ConfigSetParameter");
|
||||
ConfigGetParameter = (ptr_ConfigGetParameter) osal_dynlib_getproc(CoreHandle, "ConfigGetParameter");
|
||||
ConfigGetParameterType = (ptr_ConfigGetParameterType) osal_dynlib_getproc(CoreHandle, "ConfigGetParameterType");
|
||||
ConfigGetParameterHelp = (ptr_ConfigGetParameterHelp) osal_dynlib_getproc(CoreHandle, "ConfigGetParameterHelp");
|
||||
ConfigSetDefaultInt = (ptr_ConfigSetDefaultInt) osal_dynlib_getproc(CoreHandle, "ConfigSetDefaultInt");
|
||||
ConfigSetDefaultFloat = (ptr_ConfigSetDefaultFloat) osal_dynlib_getproc(CoreHandle, "ConfigSetDefaultFloat");
|
||||
|
@ -211,6 +272,11 @@ m64p_error AttachCoreLib(const char *CoreLibFilepath)
|
|||
ConfigGetParamBool = (ptr_ConfigGetParamBool) osal_dynlib_getproc(CoreHandle, "ConfigGetParamBool");
|
||||
ConfigGetParamString = (ptr_ConfigGetParamString) osal_dynlib_getproc(CoreHandle, "ConfigGetParamString");
|
||||
|
||||
ConfigExternalOpen = (ptr_ConfigExternalOpen) osal_dynlib_getproc(CoreHandle, "ConfigExternalOpen");
|
||||
ConfigExternalClose = (ptr_ConfigExternalClose) osal_dynlib_getproc(CoreHandle, "ConfigExternalClose");
|
||||
ConfigExternalGetParameter = (ptr_ConfigExternalGetParameter) osal_dynlib_getproc(CoreHandle, "ConfigExternalGetParameter");
|
||||
ConfigHasUnsavedChanges = (ptr_ConfigHasUnsavedChanges) osal_dynlib_getproc(CoreHandle, "ConfigHasUnsavedChanges");
|
||||
|
||||
ConfigGetSharedDataFilepath = (ptr_ConfigGetSharedDataFilepath) osal_dynlib_getproc(CoreHandle, "ConfigGetSharedDataFilepath");
|
||||
ConfigGetUserConfigPath = (ptr_ConfigGetUserConfigPath) osal_dynlib_getproc(CoreHandle, "ConfigGetUserConfigPath");
|
||||
ConfigGetUserDataPath = (ptr_ConfigGetUserDataPath) osal_dynlib_getproc(CoreHandle, "ConfigGetUserDataPath");
|
||||
|
@ -232,15 +298,18 @@ m64p_error AttachCoreLib(const char *CoreLibFilepath)
|
|||
DebugMemRead16 = (ptr_DebugMemRead16) osal_dynlib_getproc(CoreHandle, "DebugMemRead16");
|
||||
DebugMemRead8 = (ptr_DebugMemRead8) osal_dynlib_getproc(CoreHandle, "DebugMemRead8");
|
||||
|
||||
DebugMemWrite64 = (ptr_DebugMemWrite64) osal_dynlib_getproc(CoreHandle, "DebugMemRead64");
|
||||
DebugMemWrite32 = (ptr_DebugMemWrite32) osal_dynlib_getproc(CoreHandle, "DebugMemRead32");
|
||||
DebugMemWrite16 = (ptr_DebugMemWrite16) osal_dynlib_getproc(CoreHandle, "DebugMemRead16");
|
||||
DebugMemWrite8 = (ptr_DebugMemWrite8) osal_dynlib_getproc(CoreHandle, "DebugMemRead8");
|
||||
DebugMemWrite64 = (ptr_DebugMemWrite64) osal_dynlib_getproc(CoreHandle, "DebugMemWrite64");
|
||||
DebugMemWrite32 = (ptr_DebugMemWrite32) osal_dynlib_getproc(CoreHandle, "DebugMemWrite32");
|
||||
DebugMemWrite16 = (ptr_DebugMemWrite16) osal_dynlib_getproc(CoreHandle, "DebugMemWrite16");
|
||||
DebugMemWrite8 = (ptr_DebugMemWrite8) osal_dynlib_getproc(CoreHandle, "DebugMemWrite8");
|
||||
|
||||
DebugGetCPUDataPtr = (ptr_DebugGetCPUDataPtr) osal_dynlib_getproc(CoreHandle, "DebugGetCPUDataPtr");
|
||||
DebugBreakpointLookup = (ptr_DebugBreakpointLookup) osal_dynlib_getproc(CoreHandle, "DebugBreakpointLookup");
|
||||
DebugBreakpointCommand = (ptr_DebugBreakpointCommand) osal_dynlib_getproc(CoreHandle, "DebugBreakpointCommand");
|
||||
|
||||
DebugBreakpointTriggeredBy = (ptr_DebugBreakpointTriggeredBy) osal_dynlib_getproc(CoreHandle, "DebugBreakpointTriggeredBy");
|
||||
DebugVirtualToPhysical = (ptr_DebugVirtualToPhysical) osal_dynlib_getproc(CoreHandle, "DebugVirtualToPhysical");
|
||||
|
||||
return M64ERR_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -262,9 +331,12 @@ m64p_error DetachCoreLib(void)
|
|||
|
||||
ConfigListSections = NULL;
|
||||
ConfigOpenSection = NULL;
|
||||
ConfigDeleteSection = NULL;
|
||||
ConfigSaveSection = NULL;
|
||||
ConfigListParameters = NULL;
|
||||
ConfigSetParameter = NULL;
|
||||
ConfigGetParameter = NULL;
|
||||
ConfigGetParameterType = NULL;
|
||||
ConfigGetParameterHelp = NULL;
|
||||
ConfigSetDefaultInt = NULL;
|
||||
ConfigSetDefaultBool = NULL;
|
||||
|
@ -273,6 +345,11 @@ m64p_error DetachCoreLib(void)
|
|||
ConfigGetParamBool = NULL;
|
||||
ConfigGetParamString = NULL;
|
||||
|
||||
ConfigExternalOpen = NULL;
|
||||
ConfigExternalClose = NULL;
|
||||
ConfigExternalGetParameter = NULL;
|
||||
ConfigHasUnsavedChanges = NULL;
|
||||
|
||||
ConfigGetSharedDataFilepath = NULL;
|
||||
ConfigGetUserDataPath = NULL;
|
||||
ConfigGetUserCachePath = NULL;
|
||||
|
@ -301,6 +378,9 @@ m64p_error DetachCoreLib(void)
|
|||
DebugBreakpointLookup = NULL;
|
||||
DebugBreakpointCommand = NULL;
|
||||
|
||||
DebugBreakpointTriggeredBy = NULL;
|
||||
DebugVirtualToPhysical = NULL;
|
||||
|
||||
/* detach the shared library */
|
||||
osal_dynlib_close(CoreHandle);
|
||||
CoreHandle = NULL;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus-ui-console - core_interface.h *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2009 Richard Goedeken *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -22,11 +22,11 @@
|
|||
#if !defined(CORE_INTERFACE_H)
|
||||
#define CORE_INTERFACE_H
|
||||
|
||||
#include "m64p_types.h"
|
||||
#include "m64p_common.h"
|
||||
#include "m64p_frontend.h"
|
||||
#include "m64p_config.h"
|
||||
#include "m64p_debugger.h"
|
||||
#include "m64p_frontend.h"
|
||||
#include "m64p_types.h"
|
||||
|
||||
/* function declarations */
|
||||
extern m64p_error AttachCoreLib(const char *CoreLibFilepath);
|
||||
|
@ -34,6 +34,7 @@ extern m64p_error DetachCoreLib(void);
|
|||
|
||||
/* global variables from core_interface.c */
|
||||
extern int g_CoreCapabilities;
|
||||
extern int g_CoreAPIVersion;
|
||||
|
||||
/* declarations of Core library handle and pointers to common functions */
|
||||
extern m64p_dynlib_handle CoreHandle;
|
||||
|
@ -52,10 +53,13 @@ extern ptr_CoreCheatEnabled CoreCheatEnabled;
|
|||
/* declarations of pointers to Core config functions */
|
||||
extern ptr_ConfigListSections ConfigListSections;
|
||||
extern ptr_ConfigOpenSection ConfigOpenSection;
|
||||
extern ptr_ConfigDeleteSection ConfigDeleteSection;
|
||||
extern ptr_ConfigSaveSection ConfigSaveSection;
|
||||
extern ptr_ConfigListParameters ConfigListParameters;
|
||||
extern ptr_ConfigSaveFile ConfigSaveFile;
|
||||
extern ptr_ConfigSetParameter ConfigSetParameter;
|
||||
extern ptr_ConfigGetParameter ConfigGetParameter;
|
||||
extern ptr_ConfigGetParameterType ConfigGetParameterType;
|
||||
extern ptr_ConfigGetParameterHelp ConfigGetParameterHelp;
|
||||
extern ptr_ConfigSetDefaultInt ConfigSetDefaultInt;
|
||||
extern ptr_ConfigSetDefaultFloat ConfigSetDefaultFloat;
|
||||
|
@ -66,6 +70,11 @@ extern ptr_ConfigGetParamFloat ConfigGetParamFloat;
|
|||
extern ptr_ConfigGetParamBool ConfigGetParamBool;
|
||||
extern ptr_ConfigGetParamString ConfigGetParamString;
|
||||
|
||||
extern ptr_ConfigExternalOpen ConfigExternalOpen;
|
||||
extern ptr_ConfigExternalClose ConfigExternalClose;
|
||||
extern ptr_ConfigExternalGetParameter ConfigExternalGetParameter;
|
||||
extern ptr_ConfigHasUnsavedChanges ConfigHasUnsavedChanges;
|
||||
|
||||
extern ptr_ConfigGetSharedDataFilepath ConfigGetSharedDataFilepath;
|
||||
extern ptr_ConfigGetUserConfigPath ConfigGetUserConfigPath;
|
||||
extern ptr_ConfigGetUserDataPath ConfigGetUserDataPath;
|
||||
|
@ -96,5 +105,8 @@ extern ptr_DebugGetCPUDataPtr DebugGetCPUDataPtr;
|
|||
extern ptr_DebugBreakpointLookup DebugBreakpointLookup;
|
||||
extern ptr_DebugBreakpointCommand DebugBreakpointCommand;
|
||||
|
||||
extern ptr_DebugBreakpointTriggeredBy DebugBreakpointTriggeredBy;
|
||||
extern ptr_DebugVirtualToPhysical DebugVirtualToPhysical;
|
||||
|
||||
#endif /* #define CORE_INTERFACE_H */
|
||||
|
||||
|
|
580
src/debugger.c
Normal file
580
src/debugger.c
Normal file
|
@ -0,0 +1,580 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus-ui-console - debugger.c *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2014 Will Nayes *
|
||||
* *
|
||||
* 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 <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "core_interface.h"
|
||||
#include "debugger.h"
|
||||
|
||||
#include <SDL.h>
|
||||
|
||||
/*
|
||||
* Variables
|
||||
*/
|
||||
|
||||
// General Purpose Register names
|
||||
const char *register_names[] = {
|
||||
"$r0",
|
||||
"$at",
|
||||
"v0", "v1",
|
||||
"a0", "a1", "a2", "a3",
|
||||
"t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7",
|
||||
"s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
|
||||
"t8", "t9",
|
||||
"k0", "k1",
|
||||
"$gp",
|
||||
"$sp",
|
||||
"sB",
|
||||
"$ra"
|
||||
};
|
||||
|
||||
// Holds the previous GPR values for comparison details.
|
||||
long long int prev_reg_values[32];
|
||||
char reg_ran_previously = 0;
|
||||
|
||||
// Used to wait for core response before requesting next command.
|
||||
int debugger_loop_wait = 1;
|
||||
|
||||
// Counter indicating the number of DebugStep() calls we need to make yet.
|
||||
static int debugger_steps_pending = 0;
|
||||
|
||||
// Keep track of the run state.
|
||||
static int cur_run_state = 0;
|
||||
|
||||
// Remember the current program counter.
|
||||
static unsigned int cur_pc = 0;
|
||||
|
||||
// Keep track of breakpoints locally.
|
||||
static m64p_breakpoint *breakpoints;
|
||||
static int num_breakpoints = 0;
|
||||
|
||||
/*
|
||||
* Debugger callbacks.
|
||||
*/
|
||||
void dbg_frontend_init() {
|
||||
breakpoints = (m64p_breakpoint *) malloc(BREAKPOINTS_MAX_NUMBER * sizeof(m64p_breakpoint));
|
||||
printf("Debugger initialized.\n");
|
||||
}
|
||||
|
||||
void dbg_frontend_update(unsigned int pc) {
|
||||
cur_pc = pc;
|
||||
if (!debugger_steps_pending) {
|
||||
printf("\nPC at 0x%08X.\n", pc);
|
||||
debugger_loop_wait = 0;
|
||||
cur_run_state = 0;
|
||||
}
|
||||
else {
|
||||
--debugger_steps_pending;
|
||||
debugger_step();
|
||||
}
|
||||
}
|
||||
|
||||
void dbg_frontend_vi() {
|
||||
//printf("Debugger vertical int.\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Debugger methods.
|
||||
*/
|
||||
int debugger_setup_callbacks() {
|
||||
m64p_error rval = (*DebugSetCallbacks)(dbg_frontend_init,
|
||||
dbg_frontend_update,
|
||||
dbg_frontend_vi);
|
||||
return rval != M64ERR_SUCCESS;
|
||||
}
|
||||
|
||||
int debugger_set_run_state(int state) {
|
||||
m64p_error rval = (*DebugSetRunState)((m64p_dbg_runstate) state);
|
||||
return rval != M64ERR_SUCCESS;
|
||||
}
|
||||
|
||||
int debugger_step() {
|
||||
m64p_error rval = (*DebugStep)();
|
||||
return rval != M64ERR_SUCCESS;
|
||||
}
|
||||
|
||||
// Retrieve the program counter.
|
||||
int debugger_get_prev_pc() {
|
||||
return (*DebugGetState)(M64P_DBG_PREVIOUS_PC);
|
||||
}
|
||||
|
||||
int64_t debugger_read_64(unsigned int addr) {
|
||||
return (*DebugMemRead64)(addr);
|
||||
}
|
||||
int debugger_read_32(unsigned int addr) {
|
||||
return (*DebugMemRead32)(addr);
|
||||
}
|
||||
int debugger_read_16(unsigned int addr) {
|
||||
return (*DebugMemRead16)(addr);
|
||||
}
|
||||
int debugger_read_8(unsigned int addr) {
|
||||
return (*DebugMemRead8)(addr);
|
||||
}
|
||||
|
||||
void debugger_write_64(unsigned int addr, unsigned long long value) {
|
||||
(*DebugMemWrite64)(addr, value);
|
||||
}
|
||||
void debugger_write_32(unsigned int addr, unsigned int value) {
|
||||
(*DebugMemWrite32)(addr, value);
|
||||
}
|
||||
void debugger_write_16(unsigned int addr, unsigned short value) {
|
||||
(*DebugMemWrite16)(addr, value);
|
||||
}
|
||||
void debugger_write_8(unsigned int addr, unsigned char value) {
|
||||
(*DebugMemWrite8)(addr, value);
|
||||
}
|
||||
|
||||
int debugger_print_registers() {
|
||||
unsigned long long int *regs = (unsigned long long int *) (*DebugGetCPUDataPtr)(M64P_CPU_REG_REG);
|
||||
if (regs == NULL)
|
||||
return -1;
|
||||
|
||||
printf("General Purpose Registers:\n");
|
||||
int i;
|
||||
const char *format_padded = "%4s %016llX ";
|
||||
const char *format_nopad = "%4s %16llX ";
|
||||
for (i = 0; i < 32; ++i) {
|
||||
char val_changed = reg_ran_previously && regs[i] != prev_reg_values[i];
|
||||
|
||||
// Use bold font if the value has changed since last time.
|
||||
if (val_changed)
|
||||
printf("%c[1m", 27); // Bold on
|
||||
|
||||
// Print the register value, no padding if it is all zeroes.
|
||||
printf(regs[i] == 0 ? format_nopad : format_padded,
|
||||
register_names[i], regs[i]);
|
||||
|
||||
// Unset bold.
|
||||
if (val_changed)
|
||||
printf("%c[0m", 27); // Bold off
|
||||
|
||||
reg_ran_previously = 1;
|
||||
prev_reg_values[i] = regs[i];
|
||||
|
||||
// Two registers per line.
|
||||
if (i % 2 != 0)
|
||||
printf("\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
typedef enum {
|
||||
M64P_ASM_FLAG_INDEX = 0x01,
|
||||
M64P_ASM_FLAG_ADDR = 0x02,
|
||||
M64P_ASM_FLAG_BINARY = 0x04
|
||||
} disassembly_flags;
|
||||
|
||||
/*
|
||||
* Debugger main loop
|
||||
*/
|
||||
int debugger_loop(void *arg) {
|
||||
char input[256];
|
||||
while (1) {
|
||||
if (debugger_loop_wait) {
|
||||
SDL_Delay(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
printf("(dbg) ");
|
||||
if (fgets(input, 256, stdin) == NULL) {
|
||||
break;
|
||||
}
|
||||
input[strlen(input) - 1] = 0;
|
||||
|
||||
if (strcmp(input, "run") == 0) {
|
||||
cur_run_state = 2;
|
||||
if (debugger_set_run_state(cur_run_state))
|
||||
printf("Error setting run_state: run\n");
|
||||
else {
|
||||
debugger_step(); // Hack to kick-start the emulation.
|
||||
}
|
||||
}
|
||||
else if (strcmp(input, "pause") == 0) {
|
||||
cur_run_state = 0;
|
||||
if (debugger_set_run_state(cur_run_state))
|
||||
printf("Error setting run_state: pause\n");
|
||||
}
|
||||
else if (strncmp(input, "step", 4) == 0) {
|
||||
if (cur_run_state == 2) {
|
||||
printf("Cannot step while running. Type `pause' first.\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
debugger_loop_wait = 1;
|
||||
debugger_steps_pending = 1;
|
||||
sscanf(input, "step %d", &debugger_steps_pending);
|
||||
if (debugger_steps_pending < 1)
|
||||
debugger_steps_pending = 1;
|
||||
--debugger_steps_pending;
|
||||
debugger_step();
|
||||
}
|
||||
else if (strcmp(input, "regs") == 0) {
|
||||
debugger_print_registers();
|
||||
}
|
||||
else if (strcmp(input, "pc") == 0) {
|
||||
printf("PC: %08X\n", cur_pc);
|
||||
}
|
||||
else if (strcmp(input, "pc-1") == 0) {
|
||||
printf("Previous PC: %08X\n", debugger_get_prev_pc());
|
||||
}
|
||||
else if (strncmp(input, "asm", 3) == 0) {
|
||||
// simple linear sweep disassembly
|
||||
uint32_t addr = cur_pc, size=1, flags=0;
|
||||
|
||||
uint32_t lookupAddr, lookupData;
|
||||
char op[64];
|
||||
char args[64];
|
||||
|
||||
if (sscanf(input, "asm %i %i %i", &addr, &size, &flags) == 3) {
|
||||
} else if (sscanf(input, "asm %i %i", &addr, &size) == 2) {
|
||||
} else if (sscanf(input, "asm %i", &addr) == 1) {
|
||||
} else if (strcmp(input, "asm") == 0) {
|
||||
} else {
|
||||
printf("Improperly formatted disassembly command: '%s'\n", input);
|
||||
continue;
|
||||
}
|
||||
addr &= ~0x03; // align to 4 byte boundary
|
||||
printf("Disassembly of %d instruction%s @ 0x%08x:\n", size, (size == 1 ? "" : "s"), addr);
|
||||
for (uint32_t i = 0; i < size; i++) {
|
||||
lookupAddr = addr + (i * 4);
|
||||
lookupData = debugger_read_32(lookupAddr);
|
||||
(*DebugDecodeOp)(lookupData, op, args, lookupAddr);
|
||||
if (flags & M64P_ASM_FLAG_INDEX) { // 0x01
|
||||
printf("% 3d ", i);
|
||||
}
|
||||
if (flags & M64P_ASM_FLAG_ADDR) { // 0x02
|
||||
printf("%08x ", lookupAddr);
|
||||
}
|
||||
if (flags & M64P_ASM_FLAG_BINARY) { // 0x04
|
||||
printf("[%08x] ", lookupData);
|
||||
}
|
||||
printf("%s %s\n", op, args);
|
||||
}
|
||||
}
|
||||
else if (strncmp(input, "mem", 3) == 0) {
|
||||
uint32_t readAddr, length=1, rows=1, size=4;
|
||||
uint32_t i, j;
|
||||
char chSize;
|
||||
if ((sscanf(input, "mem /%ux%u%c %x", &rows, &length, &chSize, &readAddr) == 4 ||
|
||||
sscanf(input, "mem /%ux%u%c %u", &rows, &length, &chSize, &readAddr) == 4)
|
||||
&& (chSize == 'b' || chSize == 'h' || chSize == 'w' || chSize == 'd'))
|
||||
{
|
||||
if (chSize == 'b')
|
||||
size = 1;
|
||||
else if (chSize == 'h')
|
||||
size = 2;
|
||||
else if (chSize == 'w')
|
||||
size = 4;
|
||||
else // chSize == 'd'
|
||||
size = 8;
|
||||
}
|
||||
else if (sscanf(input, "mem /%ux%u %x", &rows, &length, &readAddr) == 3 ||
|
||||
sscanf(input, "mem /%ux%u %u", &rows, &length, &readAddr) == 3)
|
||||
{
|
||||
}
|
||||
else if ((sscanf(input, "mem /%u%c %x", &length, &chSize, &readAddr) == 3 ||
|
||||
sscanf(input, "mem /%u%c %u", &length, &chSize, &readAddr) == 3)
|
||||
&& (chSize == 'b' || chSize == 'h' || chSize == 'w' || chSize == 'd'))
|
||||
{
|
||||
rows = 1;
|
||||
if (chSize == 'b')
|
||||
size = 1;
|
||||
else if (chSize == 'h')
|
||||
size = 2;
|
||||
else if (chSize == 'w')
|
||||
size = 4;
|
||||
else // chSize == 'd'
|
||||
size = 8;
|
||||
}
|
||||
else if (sscanf(input, "mem /%u %x", &length, &readAddr) == 2 ||
|
||||
sscanf(input, "mem /%u %u", &length, &readAddr) == 2)
|
||||
{
|
||||
rows = 1;
|
||||
}
|
||||
else if (sscanf(input, "mem %x", &readAddr) == 1 ||
|
||||
sscanf(input, "mem %u", &readAddr) == 1)
|
||||
{
|
||||
rows = 1;
|
||||
length = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Improperly formatted memory read command: '%s'\n", input);
|
||||
continue;
|
||||
}
|
||||
for (i = 0; i < rows; i++)
|
||||
{
|
||||
for (j = 0; j < length; j++)
|
||||
{
|
||||
uint32_t thisAddr = readAddr + ((i * length) + j) * size;
|
||||
switch(size)
|
||||
{
|
||||
case 1:
|
||||
printf("%02x ", debugger_read_8(thisAddr));
|
||||
break;
|
||||
case 2:
|
||||
printf("%04x ", debugger_read_16(thisAddr));
|
||||
break;
|
||||
case 4:
|
||||
printf("%08x ", debugger_read_32(thisAddr));
|
||||
break;
|
||||
case 8:
|
||||
printf("%016llx ", (long long unsigned int) debugger_read_64(thisAddr));
|
||||
break;
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
else if (strncmp(input, "dumpmem", 7) == 0) {
|
||||
uint32_t addr;
|
||||
uint32_t len;
|
||||
char filename[64];
|
||||
|
||||
uint8_t *membase;
|
||||
FILE *f;
|
||||
|
||||
if (sscanf(input, "dumpmem %x 0x%x %63s", &addr, &len, filename) != 3 &&
|
||||
sscanf(input, "dumpmem %x %u %63s", &addr, &len, filename) != 3) {
|
||||
printf("Improperly formatted dumpmem command: '%s'\n", input);
|
||||
continue;
|
||||
}
|
||||
|
||||
filename[sizeof(filename) - 1] = '\0';
|
||||
|
||||
addr = (*DebugVirtualToPhysical)(addr);
|
||||
if (addr >= 0x800000) {
|
||||
printf("Requested address must be within RDRAM region\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
// 8 MB is the upper limit
|
||||
if (len > 0x800000 - addr)
|
||||
len = 0x800000 - addr;
|
||||
|
||||
membase = (*DebugMemGetPointer)(M64P_DBG_PTR_RDRAM);
|
||||
|
||||
f = fopen(filename, "wb");
|
||||
if (f == NULL) {
|
||||
printf("Could not open file '%s' for write\n", filename);
|
||||
continue;
|
||||
}
|
||||
|
||||
fwrite(membase + addr, len, 1, f);
|
||||
|
||||
fclose(f);
|
||||
|
||||
printf("Dumped 0x%08x bytes starting at 0x%08x to %s\n",
|
||||
len, addr, filename);
|
||||
}
|
||||
else if (strncmp(input, "translate", 9) == 0) {
|
||||
uint32_t virt_addr, phys_addr;
|
||||
if (sscanf(input, "translate %i", &virt_addr) == 1) {
|
||||
} else {
|
||||
printf("Improperly formatted translate command: '%s'\n", input);
|
||||
continue;
|
||||
}
|
||||
phys_addr = (*DebugVirtualToPhysical)(virt_addr);
|
||||
printf("virtual 0x%08x -> physical 0x%08x\n", virt_addr, phys_addr);
|
||||
}
|
||||
else if (strncmp(input, "write", 5) == 0) {
|
||||
uint32_t writeAddr, size=1;
|
||||
long long unsigned int writeVal;
|
||||
char chSize;
|
||||
if (sscanf(input, "write %i %c %llx", &writeAddr, &chSize, &writeVal) == 3 &&
|
||||
(chSize == 'b' || chSize == 'h' || chSize == 'w' || chSize == 'd')) {
|
||||
if (chSize == 'b') {
|
||||
size = 1;
|
||||
} else if (chSize == 'h') {
|
||||
size = 2;
|
||||
} else if (chSize == 'w') {
|
||||
size = 4;
|
||||
} else {
|
||||
size = 8;
|
||||
}
|
||||
} else if (sscanf(input, "write %i %llx", &writeAddr, &writeVal) == 2) {
|
||||
} else {
|
||||
printf("Improperly formatted memory write command: '%s'\n", input);
|
||||
continue;
|
||||
}
|
||||
|
||||
switch(size) {
|
||||
case 1:
|
||||
debugger_write_8(writeAddr, (unsigned char)writeVal);
|
||||
printf("0x%08x <- 0x%02x\n", writeAddr, (unsigned char)writeVal);
|
||||
break;
|
||||
case 2:
|
||||
debugger_write_16(writeAddr, (unsigned short)writeVal);
|
||||
printf("0x%08x <- 0x%04x\n", writeAddr, (unsigned short)writeVal);
|
||||
break;
|
||||
case 4:
|
||||
debugger_write_32(writeAddr, (unsigned int)writeVal);
|
||||
printf("0x%08x <- 0x%08x\n", writeAddr, (unsigned int)writeVal);
|
||||
break;
|
||||
case 8:
|
||||
debugger_write_64(writeAddr, writeVal);
|
||||
printf("0x%08x <- 0x%016llx\n", writeAddr, writeVal);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (strcmp(input, "bp list") == 0 || strcmp(input, "bp ls") == 0) {
|
||||
if (num_breakpoints == 0) {
|
||||
printf("No breakpoints added. Add with 'bp add 0x...'\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
printf("Breakpoints:\n");
|
||||
int i;
|
||||
unsigned int flags;
|
||||
for (i = 0; i < num_breakpoints; i++) {
|
||||
flags = breakpoints[i].flags;
|
||||
if (breakpoints[i].address == breakpoints[i].endaddr) {
|
||||
printf("[%d] 0x%08X [%c%c%c]",
|
||||
i, breakpoints[i].address,
|
||||
flags & M64P_BKP_FLAG_READ ? 'R' : ' ',
|
||||
flags & M64P_BKP_FLAG_WRITE ? 'W' : ' ',
|
||||
flags & M64P_BKP_FLAG_EXEC ? 'X' : ' ');
|
||||
} else {
|
||||
printf("[%d] 0x%08X - 0x%08X [%c%c%c]",
|
||||
i, breakpoints[i].address, breakpoints[i].endaddr,
|
||||
flags & M64P_BKP_FLAG_READ ? 'R' : ' ',
|
||||
flags & M64P_BKP_FLAG_WRITE ? 'W' : ' ',
|
||||
flags & M64P_BKP_FLAG_EXEC ? 'X' : ' ');
|
||||
}
|
||||
|
||||
if ((breakpoints[i].flags & M64P_BKP_FLAG_ENABLED) == 0)
|
||||
printf(" (Disabled)");
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
else if (strncmp(input, "bp add ", 7) == 0) {
|
||||
uint32_t addr, size = 0, flags = M64P_BKP_FLAG_READ |
|
||||
M64P_BKP_FLAG_WRITE |
|
||||
M64P_BKP_FLAG_EXEC;
|
||||
if (strcmp(input, "bp add pc") == 0) {
|
||||
addr = cur_pc;
|
||||
} else if (sscanf(input, "bp add %i %i %i", &addr, &size, &flags) == 3) {
|
||||
} else if (sscanf(input, "bp add %i %i", &addr, &size) == 2) {
|
||||
} else if (sscanf(input, "bp add %i", &addr) == 1) {
|
||||
} else {
|
||||
printf("Improperly formatted breakpoint add command: '%s'\n", input);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (addr == 0) {
|
||||
printf("Invalid breakpoint address.\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
m64p_breakpoint bkpt;
|
||||
bkpt.address = addr;
|
||||
bkpt.endaddr = addr + size;
|
||||
bkpt.flags = M64P_BKP_FLAG_ENABLED |
|
||||
flags |
|
||||
M64P_BKP_FLAG_LOG;
|
||||
int numBkps =
|
||||
(*DebugBreakpointCommand)(M64P_BKP_CMD_ADD_STRUCT, 0, &bkpt);
|
||||
if (numBkps == -1) {
|
||||
printf("Maximum breakpoint limit already reached.\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
breakpoints[num_breakpoints] = bkpt;
|
||||
num_breakpoints++;
|
||||
if (size > 0) {
|
||||
printf("Added breakpoint at range [0x%08X to 0x%08X].\n", addr, addr + size);
|
||||
} else {
|
||||
printf("Added breakpoint at 0x%08X.\n", addr);
|
||||
}
|
||||
|
||||
if (flags & (M64P_BKP_FLAG_READ | M64P_BKP_FLAG_WRITE)) {
|
||||
// setting a memory read/write breakpoint -- warn if physical address differs from the user input
|
||||
uint32_t phys_addr = (*DebugVirtualToPhysical)(addr);
|
||||
if (phys_addr != 0 && addr != phys_addr) {
|
||||
printf("Warning: Physical address %08x != virtual address %08x for memory read/write breakpoint.\n",
|
||||
phys_addr, addr);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (strncmp(input, "bp trig", 7) == 0) {
|
||||
uint32_t flags, addr;
|
||||
(*DebugBreakpointTriggeredBy)(&flags, &addr);
|
||||
|
||||
if (flags != 0) {
|
||||
printf("Breakpoint @ PC 0x%08x triggered on 0x%08x [%c%c%c]\n",
|
||||
cur_pc, addr,
|
||||
flags & M64P_BKP_FLAG_READ ? 'R' : ' ',
|
||||
flags & M64P_BKP_FLAG_WRITE ? 'W' : ' ',
|
||||
flags & M64P_BKP_FLAG_EXEC ? 'X' : ' ');
|
||||
}
|
||||
}
|
||||
else if (strncmp(input, "bp rm ", 6) == 0) {
|
||||
int index = -1;
|
||||
unsigned int addr = 0;
|
||||
if (strncmp(input, "bp rm 0x", 8) == 0) {
|
||||
sscanf(input, "bp rm 0x%X", &addr);
|
||||
if (addr == 0)
|
||||
sscanf(input, "bp rm 0x%x", &addr);
|
||||
|
||||
int i;
|
||||
for (i = 0; i < num_breakpoints; i++) {
|
||||
if (breakpoints[i].address == addr)
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
else {
|
||||
sscanf(input, "bp rm %d", &index);
|
||||
if (index >= 0 && index < num_breakpoints)
|
||||
addr = breakpoints[index].address;
|
||||
}
|
||||
|
||||
if (index == -1 || addr == 0) {
|
||||
printf("Invalid value passed. ");
|
||||
printf("Pass an address or breakpoint number.\n");
|
||||
continue;
|
||||
}
|
||||
|
||||
(*DebugBreakpointCommand)(M64P_BKP_CMD_REMOVE_IDX, index, NULL);
|
||||
num_breakpoints--;
|
||||
printf("Breakpoint [%d] 0x%08X removed.\n", index, addr);
|
||||
|
||||
// Shift the array elements ahead of index down.
|
||||
int j;
|
||||
for (j = index + 1; j < num_breakpoints; j++) {
|
||||
breakpoints[j - 1] = breakpoints[j];
|
||||
}
|
||||
|
||||
}
|
||||
else if (strcmp(input, "exit") == 0 || strcmp(input, "quit") == 0) {
|
||||
(*CoreDoCommand)(M64CMD_STOP, 0, NULL);
|
||||
break;
|
||||
}
|
||||
else if (strlen(input) == 0)
|
||||
continue;
|
||||
else
|
||||
printf("Unrecognized: %s\n", input);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
36
src/debugger.h
Normal file
36
src/debugger.h
Normal file
|
@ -0,0 +1,36 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus-ui-console - debugger.h *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2014 Will Nayes *
|
||||
* *
|
||||
* 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. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#ifndef __DEBUGGER_H__
|
||||
#define __DEBUGGER_H__
|
||||
|
||||
extern int debugger_loop_wait;
|
||||
|
||||
typedef struct {
|
||||
unsigned int addr;
|
||||
unsigned char enabled;
|
||||
} breakpoint_t;
|
||||
|
||||
int debugger_setup_callbacks();
|
||||
int debugger_step();
|
||||
int debugger_loop(void *arg);
|
||||
|
||||
#endif /* __DEBUGGER_H__ */
|
776
src/main.c
776
src/main.c
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus - main.h *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2009 Richard42 *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -22,6 +22,13 @@
|
|||
#ifndef __MAIN_H__
|
||||
#define __MAIN_H__
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define ATTR_FMT(fmtpos, attrpos) __attribute__ ((format (printf, fmtpos, attrpos)))
|
||||
#else
|
||||
#define ATTR_FMT(fmtpos, attrpos)
|
||||
#endif
|
||||
|
||||
extern void DebugMessage(int level, const char *message, ...) ATTR_FMT(2,3);
|
||||
extern void DebugCallback(void *Context, int level, const char *message);
|
||||
|
||||
extern int g_Verbose;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus-ui-console - osal_dynamiclib.h *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2009 Richard Goedeken *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus-ui-console - osal_dynamiclib_unix.c *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2009 Richard Goedeken *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -19,11 +19,13 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "m64p_types.h"
|
||||
#include "main.h"
|
||||
#include "osal_dynamiclib.h"
|
||||
|
||||
m64p_error osal_dynlib_open(m64p_dynlib_handle *pLibHandle, const char *pccLibraryPath)
|
||||
|
@ -35,7 +37,10 @@ m64p_error osal_dynlib_open(m64p_dynlib_handle *pLibHandle, const char *pccLibra
|
|||
|
||||
if (*pLibHandle == NULL)
|
||||
{
|
||||
fprintf(stderr, "dlopen('%s') error: %s\n", pccLibraryPath, dlerror());
|
||||
/* only print an error message if there is a directory separator (/) in the pathname */
|
||||
/* this prevents us from throwing an error for the use case where Mupen64Plus is not installed */
|
||||
if (strchr(pccLibraryPath, '/') != NULL)
|
||||
DebugMessage(M64MSG_ERROR, "dlopen('%s') failed: %s", pccLibraryPath, dlerror());
|
||||
return M64ERR_INPUT_NOT_FOUND;
|
||||
}
|
||||
|
||||
|
@ -56,7 +61,7 @@ m64p_error osal_dynlib_close(m64p_dynlib_handle LibHandle)
|
|||
|
||||
if (rval != 0)
|
||||
{
|
||||
fprintf(stderr, "dlclose() error: %s\n", dlerror());
|
||||
DebugMessage(M64MSG_ERROR, "dlclose() failed: %s", dlerror());
|
||||
return M64ERR_INTERNAL;
|
||||
}
|
||||
|
||||
|
|
75
src/osal_dynamiclib_win32.c
Normal file
75
src/osal_dynamiclib_win32.c
Normal file
|
@ -0,0 +1,75 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus-ui-console - osal_dynamiclib_win32.c *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2009 Richard Goedeken *
|
||||
* *
|
||||
* 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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include "m64p_types.h"
|
||||
#include "main.h"
|
||||
#include "osal_dynamiclib.h"
|
||||
|
||||
m64p_error osal_dynlib_open(m64p_dynlib_handle *pLibHandle, const char *pccLibraryPath)
|
||||
{
|
||||
if (pLibHandle == NULL || pccLibraryPath == NULL)
|
||||
return M64ERR_INPUT_ASSERT;
|
||||
|
||||
*pLibHandle = LoadLibrary(pccLibraryPath);
|
||||
|
||||
if (*pLibHandle == NULL)
|
||||
{
|
||||
char *pchErrMsg;
|
||||
DWORD dwErr = GetLastError();
|
||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL);
|
||||
DebugMessage(M64MSG_ERROR, "LoadLibrary('%s') error: %s", pccLibraryPath, pchErrMsg);
|
||||
LocalFree(pchErrMsg);
|
||||
return M64ERR_INPUT_NOT_FOUND;
|
||||
}
|
||||
|
||||
return M64ERR_SUCCESS;
|
||||
}
|
||||
|
||||
void * osal_dynlib_getproc(m64p_dynlib_handle LibHandle, const char *pccProcedureName)
|
||||
{
|
||||
if (pccProcedureName == NULL)
|
||||
return NULL;
|
||||
|
||||
return GetProcAddress(LibHandle, pccProcedureName);
|
||||
}
|
||||
|
||||
m64p_error osal_dynlib_close(m64p_dynlib_handle LibHandle)
|
||||
{
|
||||
int rval = FreeLibrary(LibHandle);
|
||||
|
||||
if (rval == 0)
|
||||
{
|
||||
char *pchErrMsg;
|
||||
DWORD dwErr = GetLastError();
|
||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &pchErrMsg, 0, NULL);
|
||||
DebugMessage(M64MSG_ERROR, "FreeLibrary() error: %s", pchErrMsg);
|
||||
LocalFree(pchErrMsg);
|
||||
return M64ERR_INTERNAL;
|
||||
}
|
||||
|
||||
return M64ERR_SUCCESS;
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus-ui-console - osal_files.h *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2009 Richard Goedeken *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -29,6 +29,21 @@
|
|||
#include "m64p_types.h"
|
||||
#include "osal_preproc.h"
|
||||
|
||||
/* some file-related preprocessor definitions */
|
||||
#if defined(WIN32) && !defined(__MINGW32__)
|
||||
#include <io.h> // For _unlink()
|
||||
|
||||
#define unlink _unlink
|
||||
#define snprintf _snprintf
|
||||
#define strdup _strdup
|
||||
|
||||
#define OSAL_DIR_SEPARATORS "\\/"
|
||||
#else /* Not WIN32 */
|
||||
#include <unistd.h> // for unlink()
|
||||
|
||||
#define OSAL_DIR_SEPARATORS "/"
|
||||
#endif
|
||||
|
||||
/* data structure for linked list of shared libraries found in a directory */
|
||||
typedef struct _osal_lib_search {
|
||||
char filepath[PATH_MAX];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus-ui-console - osal_files_unix.c *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2009 Richard Goedeken *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -23,15 +23,17 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <dirent.h> // for opendir(), readdir(), closedir()
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h> // for opendir(), readdir(), closedir()
|
||||
|
||||
#include "m64p_types.h"
|
||||
#include "osal_preproc.h"
|
||||
#include "main.h"
|
||||
#include "osal_files.h"
|
||||
#include "osal_preproc.h"
|
||||
|
||||
/* definitions for system directories to search when looking for mupen64plus plugins */
|
||||
#if defined(PLUGINDIR)
|
||||
|
@ -68,7 +70,7 @@ osal_lib_search *osal_library_search(const char *searchpath)
|
|||
newlib = malloc(sizeof(osal_lib_search));
|
||||
if (newlib == NULL)
|
||||
{
|
||||
fprintf(stderr, "Memory allocation error in osal_library_search()!\n");
|
||||
DebugMessage(M64MSG_ERROR, "Memory allocation error in osal_library_search()!");
|
||||
osal_free_lib_list(head);
|
||||
closedir(dir);
|
||||
return NULL;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus-ui-console - osal_files_win32.c *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2009 Richard Goedeken *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -23,8 +23,84 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include "m64p_types.h"
|
||||
#include "main.h"
|
||||
#include "osal_files.h"
|
||||
#include "osal_preproc.h"
|
||||
|
||||
/* definitions for system directories to search when looking for mupen64plus plugins */
|
||||
const int osal_libsearchdirs = 1;
|
||||
const char *osal_libsearchpath[1] = { ".\\" };
|
||||
|
||||
osal_lib_search *osal_library_search(const char *searchpath)
|
||||
{
|
||||
osal_lib_search *head = NULL, *curr = NULL;
|
||||
WIN32_FIND_DATA entry;
|
||||
HANDLE hDir;
|
||||
|
||||
char *pchSearchPath = (char *) malloc(strlen(searchpath) + 16);
|
||||
if (pchSearchPath == NULL)
|
||||
{
|
||||
DebugMessage(M64MSG_ERROR, "Couldn't allocate memory for file search path in osal_library_search()!");
|
||||
return NULL;
|
||||
}
|
||||
sprintf(pchSearchPath, "%s\\*.dll", searchpath);
|
||||
hDir = FindFirstFile(pchSearchPath, &entry);
|
||||
free(pchSearchPath);
|
||||
if (hDir == INVALID_HANDLE_VALUE)
|
||||
return NULL;
|
||||
|
||||
/* look for any shared libraries in this folder */
|
||||
do
|
||||
{
|
||||
osal_lib_search *newlib = NULL;
|
||||
/* this is a .dll file, so add it to the list */
|
||||
newlib = (osal_lib_search *) malloc(sizeof(osal_lib_search));
|
||||
if (newlib == NULL)
|
||||
{
|
||||
DebugMessage(M64MSG_ERROR, "Memory allocation error in osal_library_search()!");
|
||||
osal_free_lib_list(head);
|
||||
FindClose(hDir);
|
||||
return NULL;
|
||||
}
|
||||
if (head == NULL)
|
||||
{
|
||||
head = curr = newlib;
|
||||
}
|
||||
else
|
||||
{
|
||||
curr->next = newlib;
|
||||
curr = newlib;
|
||||
}
|
||||
/* set up the filepath and filename members */
|
||||
strncpy(curr->filepath, searchpath, PATH_MAX-2);
|
||||
curr->filepath[PATH_MAX-2] = 0;
|
||||
if (curr->filepath[strlen(curr->filepath)-1] != '\\')
|
||||
strcat(curr->filepath, "\\");
|
||||
int pathlen = (int) strlen(curr->filepath);
|
||||
curr->filename = curr->filepath + pathlen;
|
||||
strncat(curr->filepath, entry.cFileName, PATH_MAX - pathlen - 1);
|
||||
curr->filepath[PATH_MAX-1] = 0;
|
||||
/* set plugin_type and next pointer */
|
||||
curr->plugin_type = (m64p_plugin_type) 0;
|
||||
curr->next = NULL;
|
||||
} while (FindNextFile(hDir, &entry));
|
||||
|
||||
FindClose(hDir);
|
||||
return head;
|
||||
}
|
||||
|
||||
void osal_free_lib_list(osal_lib_search *head)
|
||||
{
|
||||
while (head != NULL)
|
||||
{
|
||||
osal_lib_search *next = head->next;
|
||||
free(head);
|
||||
head = next;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus-ui-console - osal_preproc.h *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2009 Richard Goedeken *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -29,27 +29,44 @@
|
|||
#if defined(WIN32)
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#define PATH_MAX 2048
|
||||
#define OSAL_DEFAULT_DYNLIB_FILENAME "mupen64plus.dll"
|
||||
#define OSAL_DIR_SEPARATOR '\\'
|
||||
#define OSAL_CURRENT_DIR ".\\"
|
||||
#define OSAL_DLL_EXTENSION ".dll"
|
||||
#define osal_insensitive_strcmp(x, y) _stricmp(x, y)
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
|
||||
#include <limits.h> // for PATH_MAX
|
||||
|
||||
#define OSAL_DEFAULT_DYNLIB_FILENAME "libmupen64plus.dylib"
|
||||
#define OSAL_DIR_SEPARATOR '/'
|
||||
#define OSAL_CURRENT_DIR "./"
|
||||
#define OSAL_DLL_EXTENSION ".dylib"
|
||||
|
||||
#define osal_insensitive_strcmp(x, y) strcasecmp(x, y)
|
||||
|
||||
#else /* Linux-like UNIX */
|
||||
|
||||
#if defined(ANDROID)
|
||||
#include <android/log.h>
|
||||
|
||||
#define printf(...) __android_log_print(ANDROID_LOG_VERBOSE, "UI-Console", __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#include <limits.h> // for PATH_MAX
|
||||
|
||||
#define OSAL_DEFAULT_DYNLIB_FILENAME "libmupen64plus.so.2"
|
||||
#define OSAL_DIR_SEPARATOR '/'
|
||||
#define OSAL_CURRENT_DIR "./"
|
||||
#define OSAL_DLL_EXTENSION ".so"
|
||||
#define osal_insensitive_strcmp(x, y) strcasecmp(x, y)
|
||||
|
||||
/* PATH_MAX only may be defined by limits.h */
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 4096
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
60
src/plugin.c
60
src/plugin.c
|
@ -1,6 +1,6 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus-ui-console - plugin.c *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2009 Richard42 *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -19,17 +19,22 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "m64p_types.h"
|
||||
#include "m64p_common.h"
|
||||
#if defined(__APPLE__)
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#endif
|
||||
|
||||
#include "core_interface.h"
|
||||
#include "m64p_common.h"
|
||||
#include "m64p_types.h"
|
||||
#include "main.h" /* for the debug callback function */
|
||||
#include "osal_dynamiclib.h"
|
||||
#include "osal_files.h"
|
||||
#include "osal_preproc.h"
|
||||
#include "plugin.h"
|
||||
#include "main.h" /* for the debug callback function */
|
||||
#include "version.h"
|
||||
|
||||
/* global variables */
|
||||
|
@ -57,11 +62,12 @@ static m64p_error PluginLoadTry(const char *filepath, int MapIndex)
|
|||
ptr_PluginGetVersion PluginGetVersion = (ptr_PluginGetVersion) osal_dynlib_getproc(handle, "PluginGetVersion");
|
||||
if (PluginGetVersion == NULL)
|
||||
{
|
||||
fprintf(stderr, "Error: library '%s' is not a Mupen64Plus library.\n", filepath);
|
||||
if (g_Verbose)
|
||||
DebugMessage(M64MSG_ERROR, "library '%s' is not a Mupen64Plus library.", filepath);
|
||||
osal_dynlib_close(handle);
|
||||
return M64ERR_INCOMPATIBLE;
|
||||
}
|
||||
m64p_plugin_type PluginType = 0;
|
||||
m64p_plugin_type PluginType = (m64p_plugin_type) 0;
|
||||
int PluginVersion = 0;
|
||||
const char *PluginName = NULL;
|
||||
(*PluginGetVersion)(&PluginType, &PluginVersion, NULL, &PluginName, NULL);
|
||||
|
@ -74,17 +80,17 @@ static m64p_error PluginLoadTry(const char *filepath, int MapIndex)
|
|||
/* the front-end doesn't talk to the plugins, so we don't care about the plugin version or api version */
|
||||
|
||||
/* call the plugin's initialization function and make sure it starts okay */
|
||||
ptr_PluginStartup PluginStartup = osal_dynlib_getproc(handle, "PluginStartup");
|
||||
ptr_PluginStartup PluginStartup = (ptr_PluginStartup) osal_dynlib_getproc(handle, "PluginStartup");
|
||||
if (PluginStartup == NULL)
|
||||
{
|
||||
fprintf(stderr, "Error: library '%s' broken. No PluginStartup() function found.\n", filepath);
|
||||
DebugMessage(M64MSG_ERROR, "library '%s' broken. No PluginStartup() function found.", filepath);
|
||||
osal_dynlib_close(handle);
|
||||
return M64ERR_INCOMPATIBLE;
|
||||
}
|
||||
rval = (*PluginStartup)(CoreHandle, g_PluginMap[MapIndex].name, DebugCallback); /* DebugCallback is in main.c */
|
||||
if (rval != M64ERR_SUCCESS)
|
||||
{
|
||||
fprintf(stderr, "Error: %s plugin library '%s' failed to start.\n", g_PluginMap[MapIndex].name, filepath);
|
||||
DebugMessage(M64MSG_ERROR, "Error: %s plugin library '%s' failed to start.", g_PluginMap[MapIndex].name, filepath);
|
||||
osal_dynlib_close(handle);
|
||||
return rval;
|
||||
}
|
||||
|
@ -110,7 +116,7 @@ m64p_error PluginSearchLoad(m64p_handle ConfigUI)
|
|||
lib_filelist = osal_library_search(g_PluginDir);
|
||||
if (lib_filelist == NULL)
|
||||
{
|
||||
fprintf(stderr, "Error: No plugins found in --plugindir path: %s\n", g_PluginDir);
|
||||
DebugMessage(M64MSG_ERROR, "No plugins found in --plugindir path: %s", g_PluginDir);
|
||||
return M64ERR_INPUT_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
|
@ -122,6 +128,29 @@ m64p_error PluginSearchLoad(m64p_handle ConfigUI)
|
|||
lib_filelist = osal_library_search(plugindir);
|
||||
}
|
||||
|
||||
/* for MacOS, look for plugins in the Frameworks folder of the app bundle */
|
||||
#if defined(__APPLE__)
|
||||
if (lib_filelist == NULL)
|
||||
{
|
||||
CFBundleRef mainBundle = CFBundleGetMainBundle();
|
||||
if (mainBundle != NULL)
|
||||
{
|
||||
CFURLRef frameworksURL = CFBundleCopyPrivateFrameworksURL(mainBundle);
|
||||
if (frameworksURL != NULL)
|
||||
{
|
||||
char libPath[1024];
|
||||
if (CFURLGetFileSystemRepresentation(frameworksURL, TRUE, (uint8_t *) libPath, 1024))
|
||||
{
|
||||
strcat(libPath, "/");
|
||||
DebugMessage(M64MSG_INFO, "Searching for plugins at: %s", libPath);
|
||||
lib_filelist = osal_library_search(libPath);
|
||||
}
|
||||
CFRelease(frameworksURL);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* if still no plugins found, search some common system folders */
|
||||
if (lib_filelist == NULL)
|
||||
{
|
||||
|
@ -173,7 +202,7 @@ m64p_error PluginSearchLoad(m64p_handle ConfigUI)
|
|||
/* exit with error if we couldn't find the specified plugin */
|
||||
if (!use_dummy && g_PluginMap[i].handle == NULL)
|
||||
{
|
||||
fprintf(stderr, "Error: Specified %s plugin not found: %s\n", g_PluginMap[i].name, cmdline_path);
|
||||
DebugMessage(M64MSG_ERROR, "Specified %s plugin not found: %s", g_PluginMap[i].name, cmdline_path);
|
||||
osal_free_lib_list(lib_filelist);
|
||||
return M64ERR_INPUT_NOT_FOUND;
|
||||
}
|
||||
|
@ -217,14 +246,13 @@ m64p_error PluginSearchLoad(m64p_handle ConfigUI)
|
|||
/* print out the particular plugin used */
|
||||
if (g_PluginMap[i].handle == NULL)
|
||||
{
|
||||
printf("UI-console: using %s plugin: <dummy>\n", g_PluginMap[i].name);
|
||||
DebugMessage(M64MSG_INFO, "using %s plugin: <dummy>", g_PluginMap[i].name);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("UI-console: using %s plugin: '%s' v%i.%i.%i\n", g_PluginMap[i].name,
|
||||
DebugMessage(M64MSG_INFO, "using %s plugin: '%s' v%i.%i.%i", g_PluginMap[i].name,
|
||||
g_PluginMap[i].libname, VERSION_PRINTF_SPLIT(g_PluginMap[i].libversion));
|
||||
if (g_Verbose)
|
||||
printf("UI-console: %s plugin library: %s\n", g_PluginMap[i].name, g_PluginMap[i].filename);
|
||||
DebugMessage(M64MSG_VERBOSE, "%s plugin library: %s", g_PluginMap[i].name, g_PluginMap[i].filename);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus-ui-console - plugin.h *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2009 Richard42 *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -22,6 +22,8 @@
|
|||
#if !defined(PLUGIN_H)
|
||||
#define PLUGIN_H
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#include "m64p_types.h"
|
||||
#include "osal_preproc.h"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Mupen64plus-ui-console - version.h *
|
||||
* Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
|
||||
* Mupen64Plus homepage: https://mupen64plus.org/ *
|
||||
* Copyright (C) 2009 Richard Goedeken *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
@ -26,12 +26,12 @@
|
|||
#if !defined(VERSION_H)
|
||||
#define VERSION_H
|
||||
|
||||
#define CONSOLE_UI_VERSION 0x016301
|
||||
#define CONSOLE_API_VERSION 0x10000
|
||||
#define CONSOLE_UI_NAME "Mupen64Plus Console User-Interface"
|
||||
#define CONSOLE_UI_VERSION 0x020600
|
||||
#define CORE_API_VERSION 0x020001
|
||||
#define CONFIG_API_VERSION 0x020301
|
||||
|
||||
#define MINIMUM_CORE_VERSION 0x016300
|
||||
#define MINIMUM_API_VERSION 0x10000
|
||||
#define MINIMUM_CORE_VERSION 0x016300
|
||||
|
||||
#define VERSION_PRINTF_SPLIT(x) (((x) >> 16) & 0xffff), (((x) >> 8) & 0xff), ((x) & 0xff)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue