Compare commits

...

302 commits

Author SHA1 Message Date
Richard Goedeken
a3a53cc73a
Merge pull request #88 from kwolekr/master
debugger: Add dumpmem command
2024-12-04 18:25:30 -08:00
kwolekr
16f138052c debugger: Add dumpmem command 2024-12-02 14:59:14 -05:00
Richard Goedeken
198eeaa08c
Merge pull request #87 from orbea/makefile
build: remove executable permissions from the Makefile
2024-11-02 21:12:07 -07:00
orbea
d2309bc9ca build: remove executable permissions from the Makefile 2024-10-29 07:42:24 -07:00
Richard Goedeken
12d57e4098
Merge pull request #85 from orbea/SDL2
Remove SDL1 support
2024-10-26 20:52:34 -07:00
Richard Goedeken
210309c525
Merge pull request #86 from orbea/strict-aliasing
build: remove -fno-strict-aliasing
2024-10-24 22:39:33 -07:00
orbea
94a307628e src: remove SDL1 code path
Closes: https://github.com/mupen64plus/mupen64plus-ui-console/issues/15
2024-10-24 09:34:30 -07:00
orbea
d431a01581 build: remove -fno-strict-aliasing
It builds with -Werror=strict-aliasing so this should not be required.
2024-10-24 08:32:01 -07:00
orbea
6c3627866b build: remove SDL1 support + use pkg-config for SDL2 2024-10-24 08:17:53 -07:00
Richard Goedeken
beddd15785
Merge pull request #84 from GhostlyDark/osx_library_path
core_interface.c: Don't force macOS app bundle path
2024-09-09 20:13:26 -07:00
GhostlyDark
1cab2e6dfe core_interface.c: Don't force macOS app bundle path 2024-09-06 22:36:17 +02:00
Richard Goedeken
1a68327fdd update version and release info for v2.6.0 release 2024-07-14 17:52:12 -07:00
Richard Goedeken
c69c0d74de update minimum macos SDK in makefile 2024-07-14 12:01:10 -07:00
Richard Goedeken
3a5793ebc3
Merge pull request #83 from Jj0YzL5nvJ/up2024
CI/CD: Update to generic scripts, independent schedule, etc
2024-05-26 19:58:12 -07:00
Jj0YzL5nvJ
76dad4fb55 CI/CD: Update to generic scripts, independent schedule, etc 2024-05-24 11:20:32 -06:00
Richard Goedeken
335e826aea
Merge pull request #82 from Jj0YzL5nvJ/up2023
CI/CD: Fixes Ubuntu i386 builds, among other changes
2023-06-11 12:22:09 -07:00
Jj0YzL5nvJ
11720558ab CI/CD: Fixes Ubuntu i386 builds, among other changes 2023-05-22 01:13:29 -06:00
GhostlyDark
1340c4bdfc main.c: Fix 64DD ROM loading 2023-04-18 13:43:38 +02:00
Richard Goedeken
674dc3e9ec
Merge pull request #80 from Jj0YzL5nvJ/ci-schedule
CI/CD: Integrate scheduled builds and other...
2023-03-02 22:01:40 -08:00
Jj0YzL5nvJ
46225f27df CI/CD: Integrate scheduled builds and other necessary updates 2023-02-14 23:50:15 -06:00
Richard Goedeken
3ad5cbb56f
Merge pull request #78 from Jj0YzL5nvJ/up2022
CI/CD: Update MSVC
2022-09-30 17:00:21 -07:00
Jj0YzL5nvJ
b02f0c3985 CI/CD: Update MSVC 2022-09-28 02:33:02 -06:00
Richard Goedeken
42546ab00b
Merge pull request #77 from Jj0YzL5nvJ/ci-update
CI/CD: Update
2022-07-13 19:31:21 -07:00
Jj0YzL5nvJ
6365caa007 CI/CD: Update 2022-07-10 18:52:51 -06:00
Richard Goedeken
cd0c0e6c10
Merge pull request #72 from Jj0YzL5nvJ/ci-github
CI/CD: Implement GitHub Actions and public nightly builds
2022-04-11 20:58:22 -07:00
GhostlyDark
b5f62979ed README: Update parameters documentation 2022-03-08 14:57:12 +01:00
Jj0YzL5nvJ
a056188d84 CI/CD: Implement GitHub Actions and public nightly builds 2021-12-05 09:00:38 -07:00
Dorian Fevrier
32e2734421 remove redundant condition about PIE value un Makefile 2021-01-02 19:39:32 +01:00
Dorian Fevrier
20cdcb3755 fix build with mingw64
build failed with mingw64 due to usage of "PIE" option on system without explicit PIE
2021-01-02 16:33:36 +01:00
orbea
7b23651028 build: Fix the build with 'cc' on gentoo.
Fixes https://github.com/mupen64plus/mupen64plus-ui-console/issues/65
2020-12-29 14:19:49 +01:00
orbea
ae2d353cab build: Allow out of tree builds. 2020-12-15 10:17:09 +01:00
Logan
96834d5a18 Use PIF_ROM_SIZE 2020-10-11 23:10:36 +02:00
Logan McNaughton
42f91fec0d PIF binary support 2020-10-11 23:10:36 +02:00
Richard Goedeken
6210d5cce2 Revert "Allow non-default compilers without resorting to symbolic links"
This reverts commit d0fdeafeb2.
2020-09-16 22:27:26 -07:00
Richard Goedeken
e147b94f3c
Merge pull request #61 from Jj0YzL5nvJ/alter_cc_cxx
Allow non-default compilers without resorting to symbolic links
2020-08-30 18:53:04 -07:00
Jj0YzL5nvJ
d0fdeafeb2 Allow non-default compilers without resorting to symbolic links 2020-08-30 04:01:18 -06:00
Richard Goedeken
089be953f2
Merge pull request #60 from Jj0YzL5nvJ/alter
Allow to set custom platform toolset from commands
2020-08-19 23:36:10 -07:00
Jj0YzL5nvJ
91a1dcd483 Allow to set custom platform toolset from commands 2020-08-13 12:14:26 -06:00
Richard Goedeken
0c32ac42ae
Merge pull request #59 from Jj0YzL5nvJ/sdl2_net
Add SDL2_net dependency
2020-07-01 06:51:24 -07:00
Jj0YzL5nvJ
96e284b6ec Add SDL2_net dependency 2020-07-01 03:01:33 -06:00
Jj0YzL5nvJ
77a2adea93 AppVeyor with artifact packaging 2020-03-02 14:01:40 +01:00
Jj0YzL5nvJ
9f5ab4a8dc Changes to have more generic project files 2020-02-26 12:38:42 +01:00
Gillou68310
5ec0b2a23a Migrate to VS2017 2019-11-13 17:16:06 +01:00
Richard Goedeken
117d2e8fa4 fix warnings in win32 2019-06-02 23:13:14 -07:00
Richard Goedeken
b8fa2dea54 add function attributes so GCC can find bugs in calls to string formatting functions with variadic arguments 2019-03-03 09:41:03 -08:00
Richard Goedeken
8f7b6b07ca fix issue #54 - front-end application uses Config API functions from v2.3.1 2019-03-01 19:21:37 -08:00
Richard Goedeken
8548eb39f1 update version and release info for v2.5.9 BETA release 2019-02-10 10:14:35 -08:00
Richard Goedeken
d940c9323e fix Travis CI test builds for MXE 32 and 64 bits 2019-01-29 22:14:55 -08:00
Richard Goedeken
d4303d96c4
Merge pull request #52 from bugfood/fix-options
Fix setting plugin parameters when configuration file not present.
2019-01-26 23:30:37 -08:00
Corey Hickey
e46434df3a Fix setting plugin parameters when configuration file not present.
Currently, several plugins test for a specific version number to be set
in the config; if the version number is not present, then such plugins
initialize themselves with default parameters, completely ignoring any
parameters that had been set previously.

Example:
Input Warning: Missing or incompatible config section 'Input-SDL-Control1'. Clearing.

This behavior makes command-line plugin parameters largely unusable
until the configuration file has been written to (with an appropriate
"version" parameter).

To fix this, parse plugin parameters in another phase: after loading the
plugins but before attaching them to the core. This allows plugins to
load their own defaults before the command-line parameters are overlaid.

Plugins should be able to handle this; the operation is similar to how
mupen64plus-gui loads plugins to get defaults, allows the user to modify
the parameters, and then attaches the plugins to the core.
2019-01-26 21:18:41 -08:00
Richard Goedeken
b4db22f1fd
Merge pull request #48 from bugfood/fix-nosaveoptions
Fix nosaveoptions
2019-01-12 10:35:33 -08:00
Richard Goedeken
5926250b86 initialize variable. fix warnings 2018-11-16 19:56:32 -08:00
Richard Goedeken
7158199d94
Merge pull request #51 from thyth/upstream-debugger-rebase
Enhancements to debugging interface
2018-11-16 19:52:24 -08:00
Daniel Selifonov
9df31d93f9
Fixed two issues in the new 'asm' debugger command 2018-11-11 23:16:52 -08:00
Daniel Selifonov
a0034474ad
Documented debugger command augmentation in the README 2018-11-11 22:39:34 -08:00
Daniel Selifonov
1ffb52b17a
Warn memory breakpoint users about physical/virtual address differences 2018-11-11 22:20:22 -08:00
Daniel Selifonov
2cdb10de7e
Added "translate" debugger command for virtual->physical address lookup 2018-11-11 22:13:38 -08:00
Daniel Selifonov
3c28ab2d54
Added "bp trig" command to see flags/address data for last hit breakpoint 2018-11-11 22:10:42 -08:00
Daniel Selifonov
c510ac4fc5
added more arguments to 'asm' debugger command
Zero arguments: disassemble one instruction at the current PC
One argument (address): disassemble one instruction at the address
Two arguments (address, size): disassemble 'size' instructions at 'address'
Three arguments (address, size, flags): disassemble 'size' instructions at 'address'
 - If bit-3 is set (i.e. & 0x04): also print binary representation of instructions
 - If bit-2 is set (i.e. & 0x02): prefix each instruction with its memory address
 - If bit-1 is set (i.e. & 0x01): prefix each instruction with an index from the start of disassembly
2018-11-11 22:06:52 -08:00
Daniel Selifonov
39c5800112
added breakpoint range and flag control to the add command 2018-11-11 21:59:04 -08:00
Daniel Selifonov
cd65527203
added simple memory writing command to debugger_loop 2018-11-11 21:37:33 -08:00
Richard Goedeken
838d4d4f2f oops, correctly set PLUGINDIR macro in makefile 2018-11-07 20:20:03 -08:00
Richard Goedeken
e502f2b66b fix for issue #50: use LIBDIR for PLUGINDIR and COREDIR if they are not explicitly given 2018-11-06 21:24:59 -08:00
Richard Goedeken
859dda24f4 disable the debugger in the core if we are not running it in the ui-console, otherwise it will hang forever in the paused state 2018-11-06 07:30:55 -08:00
Richard Goedeken
cbbfeaad14 fix last commit; we need to support hex addresses too 2018-10-19 19:13:22 -07:00
Richard Goedeken
0dc8782b4d debugger fix: memory addresses must be unsigned 2018-10-18 20:45:19 -07:00
Daniel Selifonov
d1d184009a fixed bug in core_interface.c; getting function handles to DebugMemWrite* were actually getting handles to DebugMemRead* 2018-10-14 21:49:35 -07:00
Richard Goedeken
b1add1f806 fix register printout in debugger: need to tell printf that we have 64-bit values 2018-10-01 21:25:53 -07:00
Corey Hickey
2409aff737 avoid saving configuration unnecessarily
1. Check for changes before saving.
2. The command-line options are only parsed once, so no need to save
them again.
2018-08-29 22:37:35 -07:00
Corey Hickey
0bb63fe6f5 save configuration (if desired) right before running game
Currently, plugins frequently call ConfigSaveSection(), which results in
the configuration being rewritten. I intend to submit patches to remove
these calls.

In exchange, the front-end should save the configuration at the latest
safe opportunity, to capture any changes before most chances of crashes,
power outages, kill -9, etc.
2018-08-29 22:36:54 -07:00
Richard Goedeken
5c1e2e8f0a
Merge pull request #47 from bugfood/fix-nosaveoptions
Make --nosaveoptions not ever save options.
2018-08-28 16:55:41 -07:00
Corey Hickey
678c534d27 Parse --nosaveoptions earlier in order to respect it.
The '--nosaveoptions' option does not work currently, due to various
reasons.

1. The core saves its configuration when loaded (addressed in a separate
   PR).
2. Plugins often save their configuration (to be addresses separately,
   if this change is acceptable).
3. The UI does not parse --nosaveoptions early enough to avoid saving
   the configuration (addressed in this patch).

This does not fully make --nosaveoptions work, but it is an incremental
improvement.
2018-08-27 21:52:59 -07:00
Richard Goedeken
5b9eba4cab update readme for 64DD usability issues 2018-05-12 07:36:24 -07:00
Richard Goedeken
adfcea709b
Merge pull request #43 from bsmiles32/dd
Add basic support for 64DD.
2018-05-12 07:29:03 -07:00
Bobby Smiles
9125460cd7 Add basic support for 64DD.
Definition of DD IPL rom and disk is done through the mupen64plus.cfg
file as follow:

[64DD]
IPL-ROM="path/to/64DD_IPL_ROM.bin"
Disk="path/to/64DDDisk.ndd"

Setting an empty IPL-ROM disable the 64DD.
Setting an empty Disk acts as if the 64DD had no disk plugged in.

You can also specify these at program startup using command-line
arguments --dd-ipl-rom and --dd-disk.
2018-03-25 22:48:39 +02:00
Richard Goedeken
5485240100 compilers which dont build in C99 mode by default are super lame 2018-03-12 22:10:40 -07:00
Richard Goedeken
e90085e34d update README and add new mem read command to console debugger 2018-03-12 21:53:31 -07:00
Richard Goedeken
6f44877ba6 fix win32 build 2018-02-11 15:18:22 -08:00
Richard Goedeken
c99996235e need this header file for the SDL version macro 2018-02-07 22:58:25 -08:00
Richard Goedeken
b49c7a6275 fix memory leak, warning, build with SDL 1.2 2018-02-07 22:43:03 -08:00
Richard Goedeken
b7cfc11513 force core config parameter EnableDebugger to True when launching debugger 2018-02-07 22:15:28 -08:00
Richard Goedeken
da4df0e27f fix warning and use SDL_Delay() instead of usleep() 2018-02-07 22:04:45 -08:00
Richard Goedeken
f641c94b3d merge console debugger from wnayes on github into ui-console front-end 2018-02-07 20:33:00 -08:00
Richard Goedeken
8e20ab8f70 update FSF address in license 2018-02-04 12:59:24 -08:00
Richard Goedeken
a105ae0c6f on macOS systems, use corefoundation framework to get the absolute path to the frameworks folder in the bundle, and look for the core library and plugins there 2018-01-23 19:18:33 -08:00
Anthony J. Bentley
78d3d6c955 Update homepage. 2018-01-01 17:46:49 +01:00
Anthony J. Bentley
aa292ba32d Update homepage links in program output, manpage, readme. 2018-01-01 17:46:49 +01:00
Anthony J. Bentley
50a0714ab6 Update link to bug tracker. 2018-01-01 17:46:49 +01:00
Gillou68310
990e24d7bc Fix VS2013 compilation 2017-12-12 17:23:34 +01:00
Richard Goedeken
1cdc745ad2 update Makefile method for finding OSX_SDK_PATH 2017-11-14 16:21:49 -08:00
Dorian Fevrier
9f663670bb
Merge pull request #44 from charlemagnelasse/travis-mxe
Build MXE targets as additional tests in travis build matrix
2017-11-06 12:19:37 +01:00
Charlemagne Lasse
92514d1ced Build MXE targets as additional tests in travis build matrix 2017-11-05 15:34:19 +01:00
Bobby Smiles
e54b7c1a24 Rename GB cart loader to media loader. 2017-10-14 03:39:02 +02:00
Bobby Smiles
5e17accad0 Basic support for GB cart loader command.
Definition of GB carts loaded inside transferpak is done through the
mupen64plus.cfg file as follow :

[TransferPak]
GB-rom-1 = "path/to/gb_rom.gb"
GB-ram-1 = "path/to/gb_rom.sav"
GB-rom-2 ...
GB-ram-2 ...

Setting an empty GB ROM acts as if GB cart was removed form TransferPak.
Setting an empty GB RAM let the Core generate a blank save file.

These parameters are modifiable during emulator execution. You just need
to trigger the GB cart change button, and these parameters will be
reloaded.

You can also specify these at program startup using command-line
arguments --gb-{rom,ram}-{1,2,3,4}
2017-10-14 03:39:02 +02:00
Richard Goedeken
36d7cd8eb3 Merge pull request #40 from loganmc10/patch-1
Fix for #39
2017-09-25 19:09:39 -07:00
Logan
36145e5bdf Fix for #39 2017-09-25 08:39:32 -06:00
Richard Goedeken
7daadc8e57 Merge pull request #36 from loganmc10/pie
Fix no-pie mode for compilers that default to PIE
2017-09-21 21:41:19 -07:00
Logan McNaughton
187d3a3bda Fix no-pie mode for compilers that default to PIE 2017-09-21 12:43:15 -06:00
Dorian Fevrier
f5bf3777cb Merge pull request #35 from charlemagnelasse/travis-container
Use faster container based Travis CI
2017-09-13 11:08:56 +02:00
Charlemagne Lasse
c2331cb564 Use faster container based Travis CI 2017-09-01 09:57:14 +02:00
Charlemagne Lasse
60b193c95c Let travis handle the package installation directly
The before_install  currently fails on Travis CI with:

    The following packages have unmet dependencies:
     libsdl2-dev : Depends: libegl1-mesa-dev
                   Depends: libgles2-mesa-dev
    E: Unable to correct problems, you have held broken packages.

This can currently only be solved by using the apt addon to install
packages.
2017-09-01 09:56:19 +02:00
Bobby Smiles
8e63bfa5f7 Revert "Allow using compiler other than gcc"
This reverts commit f13e35b373.
2017-06-24 13:34:53 -06:00
bsmiles32
dc36c1e7ac Merge pull request #32 from loganmc10/patch-1
Allow using compiler other than gcc
2017-06-22 20:20:53 -06:00
Logan McNaughton
f13e35b373 Allow using compiler other than gcc 2017-06-20 21:16:16 -06:00
Richard Goedeken
20f18fc435 Merge pull request #29 from loganmc10/vidext
Add support for VIDEXT_HEADER
2017-04-05 22:59:15 -07:00
Richard Goedeken
0abb73fcb7 Merge pull request #28 from fprimex/fprimex-macos-version-min
bump macosx-version-min to 10.6 for SDL2.0.5
2017-03-16 23:57:48 -07:00
Logan McNaughton
7aac7adb5f Add support for VIDEXT_HEADER 2017-03-16 21:20:48 -06:00
Brent Woodruff
5639129cfc bump macosx-version-min to 10.6 for SDL2.0.5 2017-03-16 22:52:35 -04:00
Dorian Fevrier
1e9a53456c Merge pull request #27 from Gillou68310/load_on_first_int
New implementation of the savestate loaded at startup option.
2016-10-20 13:32:30 +02:00
Gillou68310
334db80b55 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.
2016-10-19 17:15:06 +02:00
Richard Goedeken
07dba790c8 Merge pull request #26 from charlemagnelasse/master
Use Ubuntu Trusty as base system for Travis CI
2016-09-01 18:04:19 -07:00
Charlemagne Lasse
fcca5a0813 Use Ubuntu Trusty as base system for Travis CI 2016-09-01 20:23:59 +02:00
Richard Goedeken
bdcd13b3ed change VS2013 project files to build with the XP-compatible vc120 toolset, so the resulting binaries will run on pre-vista machines 2016-07-13 20:04:06 -07:00
Richard Goedeken
c52baffa34 revert last commit, put the x64 builds back in the MSVC project file 2016-03-27 19:51:07 -07:00
Richard Goedeken
6b8aa2e63c win32 build fixes 2016-03-17 22:26:54 -07:00
Richard Goedeken
1474de74d7 Merge pull request #22 from Gillou68310/x64
Added x64 configuration to VisualStudio2013 project file
2015-09-12 21:52:14 -07:00
Gillou68310
f5db412261 Added x64 configuration to VisualStudio2013 project file 2015-08-28 15:58:58 +02:00
Richard Goedeken
3fc549b5c3 Merge pull request #21 from bentley/openbsd
Remove unnecessary OpenBSD warning.
2015-06-08 06:31:56 -07:00
Anthony J. Bentley
b8dff88aed Remove unnecessary OpenBSD warning. 2015-06-08 01:51:13 -06:00
Richard Goedeken
f89efa27d1 add new solution configuration for Release (New Dynarec) 2015-04-26 13:41:22 -07:00
Richard Goedeken
58cf524522 update text files and version number for upcoming 2.5 release 2015-04-26 12:32:06 -07:00
Richard Goedeken
cd103ec918 Merge pull request #20 from conchurnavid/includes
Cleanup includes order and add missing includes
2015-03-21 21:33:23 -07:00
Conchúr Navid
e1b4a8f1e3 Add missing includes and forward declarations 2015-03-21 13:47:40 +01:00
Conchúr Navid
9818963be4 Sort the includes based on type and names 2015-03-21 10:58:40 +01:00
Conchúr Navid
f0b0a1249e Fix executable bits of files 2015-03-21 10:53:38 +01:00
Richard Goedeken
398b96c3b2 added project/solution file for Visual Studio 2013. removed older MSVS project files. fix code compatilibity problems with MSVC 2015-02-22 07:13:34 -08:00
Richard Goedeken
42747beafd Merge pull request #18 from Nebuleon/build-changes
Drop architecture checks for cross-platform project
2015-02-01 14:14:33 -08:00
Nebuleon Fumika
ac12e2cf3a Ignore the correct Unix executable in .gitignore 2015-01-26 09:27:21 +00:00
Nebuleon Fumika
cb4e055c54 Unix Makefile: Discard unnecessary architecture checks
Unlike the Mupen64Plus Core, which is sensitive to the architecture
it's compiled for due to its just-in-time compilers, this project does
not require architecture-specific glue code, only operating system
checks to load dynamic libraries.
2015-01-26 09:22:04 +00:00
Dorian Fevrier
48441f5647 Merge pull request #17 from littleguy77/master
Fix windows build regression introduced in PR 12.



The EXPORT command breaks the build in windows due to conflicting
declaration of sdl_main by SDL_main.h, when built for WIN32. No such
conflict exists for non-windows builds.

Here we just substitute the non-windows definition of EXPORT.
2015-01-17 22:34:15 -05:00
littleguy77
44f0f5060d Fix windows build regression introduced in PR 12.
The EXPORT command breaks the build in windows due to conflicting
declaration of sdl_main by SDL_main.h, when built for WIN32.  No such
conflict exists for non-windows builds.

Here we just substitute the non-windows definition of EXPORT.
2015-01-17 20:18:37 -05:00
Dorian Fevrier
8c56a77f45 Merge pull request #16 from mupen64plus/revert-14-master
Revert "Remove SDL build dependency."
2015-01-14 11:27:38 -05:00
Dorian Fevrier
b2bbc856ab Revert "Remove SDL build dependency." 2015-01-14 08:34:08 -05:00
Dorian Fevrier
8edabd0a78 Merge pull request #14 from littleguy77/master
Remove SDL build dependency.
2015-01-14 00:32:26 -05:00
littleguy77
87ef78922a Remove SDL build dependency. 2015-01-13 12:43:58 -05:00
Richard Goedeken
fb5134b37e Merge pull request #13 from mupen64plus-ae/vanilla
Merge Android Edition history
2015-01-10 18:57:25 -08:00
littleguy77
ce0619035b Merge remote-tracking branch 'upstream/master' 2015-01-10 20:55:10 -05:00
Richard Goedeken
3ddfb4d973 Merge pull request #12 from littleguy77/master
Allow external state callback to be specified via build flag...
2015-01-10 09:09:21 -08:00
littleguy77
f3d45ddbbe Allow external state callback to be specified via build flag...
... and allow main() to be called by external module.

Useful for UI implementations that simply layer on top of ui-console
(rather than reimplement it).  In such cases, ui-console can be built as
a library rather than top-level executable.  The higher-level UI can
then "launch" the ui-console implementation in its own process/thread
by calling main directly (rather than spawning a separate ui-console
process).  This is not only a general convenience, but also allows the
higher-level UI to provide a state callback to synchronize its display.

This commit facilitates downstream UI development, but is not likely to
be of interest to general users who build ui-console from makefile.
Therefore, the CALLBACK_* build flags are omitted from the makefile help
text.
2015-01-08 22:55:40 -05:00
Richard Goedeken
be26692c40 Merge pull request #11 from Gillou68310/master
Added project files for MSVC2010
2015-01-07 22:54:21 -08:00
Gillou68310
1b08f8c445 Added project files for MSVC2010 2015-01-07 15:40:29 +01:00
Will Nayes
4e145eae6e Updated README with regs, bp commands. 2014-12-30 16:37:08 -06:00
Will Nayes
969970dcde Added basic breakpoints add/rm. Added printout of current op. Added exit/quit. 2014-12-30 16:34:47 -06:00
littleguy77
7c140db778 build: Remove Android makefile. 2014-12-18 22:09:51 -05:00
littleguy77
5dcf54f00d Merge remote-tracking branch 'upstream/master' 2014-12-18 22:09:19 -05:00
Will Nayes
175503cde5 No padding on all-zeroes register values. 2014-12-18 19:35:24 -06:00
Will Nayes
8fb22f1096 Use SDL threading instead of pthreads. 2014-12-18 19:29:23 -06:00
Will Nayes
5ce862533c Added GPR printout with value-changed indication. 2014-12-16 21:10:33 -06:00
Richard Goedeken
90fefcab64 Merge pull request #7 from mupen64plus/invert_callbacks
fix: can't load saved state and do screenshot because only one callback ...
2014-12-14 07:44:03 -08:00
Dorian Fevrier
c495ff81e6 fix bad logic to set frame callback 2014-12-13 15:56:26 -05:00
Dorian Fevrier
7d5247b399 fix: can't load saved state and do screenshot because only one callback function is allowed. Now everything is done inside one single callback function 2014-12-12 20:07:29 -05:00
Richard Goedeken
36c51b5c8f Merge pull request #6 from mupen64plus/savestate_loading
add savestate loading at rom startup support
2014-12-11 21:43:27 -08:00
Dorian Fevrier
0bc3036a58 Merge branch 'savestate_loading' of https://github.com/mupen64plus/mupen64plus-ui-console into savestate_loading
Conflicts:
	src/main.c
2014-12-11 23:28:55 -05:00
Dorian Fevrier
566c9f9903 add savestate loading at rom startup support 2014-12-11 23:25:30 -05:00
Dorian Fevrier
91f0a28d85 add savestate loading at rom startup support 2014-12-11 23:21:45 -05:00
Paul Lamb
a04f4f2b53 Merge from upstream 2014-12-02 19:05:21 -06:00
Will Nayes
29363909e0 Fixes after fetching upstream. 2014-11-23 17:54:01 -06:00
Will Nayes
1703b25649 Initial debugger code with run/pause/step. 2014-11-23 16:36:50 -06:00
Richard Goedeken
76937ae2e8 Merge pull request #5 from bentley/manpage-flags
Minor manpage macro improvements
2014-11-09 16:23:45 -08:00
Anthony J. Bentley
7ee1328d4d Use Unicode hyphens and apostrophes when available. 2014-11-08 19:29:57 -07:00
Anthony J. Bentley
fe425d1bcf Mark up author names with the An macro. 2014-11-08 19:26:23 -07:00
Anthony J. Bentley
e7e218406c The Fl macro nests, so use that for marking up --flags. 2014-11-08 19:21:52 -07:00
Paul Lamb
af28634085 Merge from upstream 2014-11-08 11:26:04 -06:00
Richard Goedeken
fe680206dc Merge pull request #4 from fayvel/xdg-desktop
Fix xdg desktop file
2014-09-06 21:00:44 -07:00
Fayvel Victor
fc64df7ae7 Don't show desktop entry in start menu
mupen64plus just closes when it is started without valid ROM as argument. It
should only be shown as program to open application/x-n64-rom files.
2014-09-05 13:39:20 +02:00
Fayvel Victor
c5381217a2 Add Keywords to desktop file 2014-09-05 13:38:39 +02:00
Richard Goedeken
fb21340f22 Merge pull request #3 from fayvel/travisci
Add Travis CI configuration file for automatic build tests
2014-07-07 22:08:27 -07:00
Fayvel Victor
b393896e1b Add Travis CI configuration file for automatic build tests
Github provides a Travis CI integration which makes it easy to have a quick
check of a patch before a pull request is accepted. It is not enough to prove
the correctness of a contribution but at least helps to avoid some of the worst
build problems.

This feature *must* be enabled by the mupen64plus administrator *before this
commit is merged*:

- https://travis-ci.org/profile/mupen64plus
- Login via your Github account
- Make sure you are on "https://travis-ci.org/profile/mupen64plus"
- Switch repository to "On"
2014-07-06 12:31:58 +02:00
Richard Goedeken
6f0b800cd1 SDL 1.2 is not deprecated for us, and we shouldnt frighten the user with 6 lines of exclamation points 2014-05-04 11:32:31 -07:00
Ursula Abendroth
ad9815f6c4 Switch by default to SDL2 for Mupen64Plus 2.1
The current version of SDL is 2.0.3. All new releases of distributions contain
this library already. Current Linux distributions and OpenBSD even backporting
patches from Mupen64Plus 2.1 repo to use SDL 2. Android and other mobile
platform don't have support for legacy SDL 1.2.

People like Anthony J. Bentley and Riley Labrecque already requested
a new release of Mupen64Plus 2.1 with SDL2
2014-04-23 19:32:56 +02:00
Richard Goedeken
79022e7499 Merge pull request #1 from bsmiles32/desktop_integration
Add application desktop file and icons.
2014-02-16 21:27:08 -08:00
Bobby Smiles
60d72dc650 Add application desktop file and icons.
SVG logo information
source: https://en.wikipedia.org/wiki/File:Mupen64plus.svg
author: Scott 'Tillin9' Knauert
license: Creative Commons Attribution-Share Alike 3.0 Unported
2014-02-15 03:28:59 +01:00
littleguy77
8622e12da3 android: Add android edition customizations. 2014-01-28 17:35:58 -05:00
littleguy77
ac8a254ac7 build: Add android makefile. 2014-01-28 17:35:45 -05:00
Sven Eckelmann
d1bbbcca5f Replace references to bitbucket with github 2013-12-19 14:35:03 +01:00
Sven Eckelmann
da9e9b4d3b Force line ending type for specific files
Different operation systems (Unix vs. Windows) use different line ending types.
It can easily happen that users from different systems edit files and replace
all line endings of a file with the system specific version. This screws up
diffs and makes merges harder.

Git can normalize line endings for specific files and avoid this problem.
Binary files should be marked to avoid accidentally normalization.
2013-12-19 14:19:07 +01:00
Sven Eckelmann
4999d06015 Convert .hgignore to .gitignore 2013-12-19 14:13:38 +01:00
Richard Goedeken
16996c73bd merged heads, made a few man page changes 2013-09-21 14:11:04 -07:00
Anthony J. Bentley
6c4695cae5 Use more appropriate lists. 2013-09-20 23:02:28 -06:00
Anthony J. Bentley
9986f7a85d Update outdated plugin information. 2013-09-20 22:57:58 -06:00
Anthony J. Bentley
d1408e91c2 Make the manpage match what --help prints out. 2013-09-20 22:50:45 -06:00
Anthony J. Bentley
69cfb75a50 Update manpage to use semantic mdoc macros. 2013-09-20 22:44:46 -06:00
Sven Eckelmann
212be30f54 Don't fail rebuild when header is removed
The *.d depends files for make just list the files used when building an
object file. Removing a file listed in such a dependency file causes make to
search for a way to recreate it. This usually cannot work because these files
aren't autogenerated.

The gcc option -MP can be used to generate empty rule for these files. Removing
a file in a dependency list will then execute this empty rule and continue with
the execution of the creation of the object file. This compilation process will
then automatically correct the dependency file.
2013-09-20 10:31:48 +02:00
littleguy77
4cff083518 Define printf/debug callback for Android builds. 2013-08-30 09:42:28 -04:00
richard42
5d19eca9b5 simplify OSX platform detection in makefile using xcode-select. based on patch from John Pender 2013-07-08 07:39:48 -07:00
Richard Goedeken
ccfa8cf3c3 Added tag 2.0 for changeset 6665d52da57b 2013-07-04 15:48:15 -07:00
Richard Goedeken
04fe4dad22 update version number to 2.0 2013-07-03 07:09:38 -07:00
Richard Goedeken
61c419cee7 updated README 2013-06-27 22:57:15 -07:00
Richard Goedeken
ba2e1d0192 update README and command-line usage console output 2013-06-27 22:31:55 -07:00
Richard Goedeken
77748f1c00 update text files for upcoming 2.0 release 2013-06-26 22:53:10 -07:00
Sven Eckelmann
9a3c294a88 Avoid crash caused by missing initial SDL startup
SDL needs to overwrite the main function to initialize the inner state on some
operating systems. Not doing it this way will cause random crashes and
undefined behaviour.

Systems which need a special main function are for example Apple MacOS,
Android, iPhone or Win32. SDL will handle it automatically and keep systems
without such requirement with an untouched main function.
2013-06-25 14:57:05 +02:00
Richard Goedeken
64d7fa307e tagged v2.0-rc2 2013-06-01 18:00:33 -07:00
richard42
5bf3cc39f6 update msvc11 solution file to use the moved glide64mk2 project files in 'msvc11' 2013-06-01 08:19:46 -07:00
richard42
d1b19e9893 Update msvc11 project file to visual studio 2012 (msvc11) 2013-06-01 07:58:59 -07:00
Sven Eckelmann
dccdaa03ee Allow to statically set SDL_(CFLAGS|LIBS) without sdl-config
n.pepinpe requested in #540 to allow overwriting the automatically searched
CFLAGS and LIBS for used libraries. This should allow distributors to set the
build configuration without patching the makefile. This is important for
systems were pkg-config or sdl-config aren't normally used.
2013-05-11 12:26:18 +02:00
Sven Eckelmann
ff73a2f421 Enable Link-time optimization by default
The GCC introduced Link-time optimization in GCC 4.5 (2010-04-14). This should
be long enough available that interested users have upgraded to a compiler
supporting it.

The MSVC project already enabled WholeProgramOptimization since a long time.
Enabling it by default in GCC seems to be equally valid.
2013-05-11 11:25:56 +02:00
Sven Eckelmann
ef07d7d1c7 Add CFLAGS to the linker step
The GCC manual states for different parameters that the options for compilation
must also be used when linking. The options for compilation are stored in
CFLAGS and added to LINK.o to fix the behavior.

Option which need this are for example -fPIC/-fPIE or -flto.
2013-05-11 10:51:36 +02:00
Richard Goedeken
d048eee443 add glide64mk2 to the solution file 2013-03-20 22:31:21 -07:00
Richard Goedeken
d0cebb5307 add msvc11 project and solution files from mudlord 2013-03-20 22:25:20 -07:00
Richard Goedeken
340c135b7c fixed compiler warnings 2013-03-09 21:30:06 -08:00
richard42
e7d1692e44 merge heads 2013-02-11 09:05:27 -08:00
richard42
f34f491110 changes to fix compile errors in OSX 10.7.5 2013-02-11 09:05:01 -08:00
richard42
f7532d62cd OSX build fix 2013-02-02 22:16:48 -08:00
Sven Eckelmann
aa3e838d0a Introduce WARNFLAGS for default (removable) compiler warning flags 2013-01-02 16:13:45 +01:00
n pepinpe
69e4a968e7 Include SDL header without SDL/ directory 2012-12-31 10:52:25 +01:00
n pepinpe
f8827b148a Fix path to OSX SDK with XCode >=4.3 2012-12-31 10:43:00 +01:00
Richard Goedeken
b7ce0a97a4 merged heads 2012-12-30 15:48:49 -08:00
Anthony J. Bentley
45346e9ccb Minor formatting improvements. 2012-12-24 02:51:36 -07:00
Anthony J. Bentley
ed4f8d906b New sentence, new line. Troff relies on this to detect sentences properly. 2012-12-24 02:47:35 -07:00
Anthony J. Bentley
c17d2bae69 Decompress the manual page. 2012-12-24 02:43:03 -07:00
Sven Eckelmann
42f26b8a03 Use $(OBJDIR) in clean target instead of hardcoded path 2012-12-13 14:53:05 +01:00
Sven Eckelmann
14af485493 Allow to add a postfix for each build
The POSTFIX make option is useful for distributions to compile different
versions of the plugin in parallel. The object files will be stored in a
directory with the postfix appended and the linker result will also have this
postfix appended.
2012-12-13 14:47:33 +01:00
Sven Eckelmann
25217eacdd Fix clean of mupen64plus.exe 2012-12-13 14:19:37 +01:00
Sven Eckelmann
3b7bee6a33 Add CROSS_COMPILE make option
The CROSS_COMPILE make option can be used to automatically prepend the prefix
to all build relevant tools to seamlessly allow cross compilation without
setting each tool name separately.

Cross compiling for MinGW32 would can be done using
$ make -C projects/unix/ CROSS_COMPILE=i686-pc-mingw32- HOST_CPU=i686 UNAME=MINGW
2012-12-13 12:25:38 +01:00
Sven Eckelmann
10b90e4647 Allow to change names of *-config tools for cross compiles 2012-12-13 11:33:49 +01:00
Sven Eckelmann
08b53f2444 Synchronize usage of environmental variables for UNAME with HOST_CPU 2012-12-13 10:52:49 +01:00
Sven Eckelmann
68a5b42c15 Remove duplicated definition of CC for MinGW 2012-12-13 10:46:17 +01:00
Sven Eckelmann
bbe021bc01 Really build mupen64plus.exe on MinGW 2012-12-12 23:19:39 +01:00
veganaize
b65642a899 Add support for MingW32 2012-12-04 21:17:52 +01:00
Anthony J. Bentley
79e0f12a6a Detect OpenBSD PowerPC platforms macppc and socppc. 2012-11-12 18:03:52 -07:00
Sven Eckelmann
b05ff7522a Add configuration for semi-supported architecture armel 2012-11-04 01:26:41 +01:00
Richard Goedeken
d8d9f23080 string safety for DebugMessage 2012-06-24 18:13:17 -07:00
casualjames casualjames
c939b8ca0c Make sure main.h is included. 2012-06-25 02:36:43 +02:00
casualjames casualjames
46549eea52 Implementation. 2012-06-25 02:33:47 +02:00
Sven Eckelmann
56159acc29 Enable experimental support for link-time optimization 2012-06-09 01:11:18 +02:00
Richard Goedeken
d7a60ce545 more specific parameter comment based on feedback from issue 489 2012-04-08 09:55:50 -07:00
Richard Goedeken
36a5c35b64 Added tag 1.99.5 for changeset 56aad2ed6c18 2012-03-10 10:30:16 -08:00
Richard Goedeken
5726cca201 updating README, RELEASE, and version info for v1.99.5 tag 2012-03-10 09:56:09 -08:00
richard42
39059928a9 default to save config file in ui-console front-end 2012-03-06 21:07:52 -08:00
richard42
ce7b345509 1. add project dependencies to solution file
2. bugfix: forgot newlines in warning messages
2012-03-06 20:48:41 -08:00
Richard Goedeken
c77f1134e0 fixed round-off error in config parameter version checking 2012-03-04 15:42:30 -08:00
Richard Goedeken
16f9c57b1c Added config version number for UI-Console section 2012-02-23 20:47:36 -08:00
Sven Eckelmann
e24f33b2c7 Remove additional -O3 on MacOSX 2011-10-14 19:58:42 +02:00
Sven Eckelmann
042700252e Explicitly disable PIC in case of PIC=0 2011-10-13 00:01:02 +02:00
Sven Eckelmann
0ad97d0897 Fix loading of cheat entries with leading zeros 2011-09-22 13:18:05 +02:00
Sven Eckelmann
01a44c4c53 Ignore generated files in hg-status 2011-08-29 14:30:47 +02:00
Sven Eckelmann
db675f1052 Enable ppc(64) as experimental target
nogagplz tested mupen64plus on 32-bit ppc and didn't detect any big show
stoppers with interpreter cores and the mupen64plus example rom. This makes the
PowerPC an interesting target for further tests and may reveal other endianness
problems.
2011-08-05 10:46:16 +02:00
Sven Eckelmann
2894af52e3 Enable big endian mode on ppc and ppc64 2011-08-05 10:19:21 +02:00
Sven Eckelmann
9d4018c551 Only use software interrupts on x86(_64) 2011-08-04 11:53:58 +02:00
Sven Eckelmann
c33e0725b1 Strip binaries during install 2011-07-23 21:22:52 +02:00
Richard Goedeken
d12a172dbd merge 2011-07-16 11:31:11 -07:00
Richard Goedeken
7b7873bcfa Support core front-end API v2.0.1, and add --nospeedlimit option for benchmarking 2011-07-16 11:30:41 -07:00
Sven Eckelmann
a755ced05a Allow PIE similar to PIC in the plugins 2011-07-10 13:23:40 +02:00
Sven Eckelmann
71b99273f8 Fix linker search for libstdc++.so 2011-07-08 08:24:36 +00:00
Sven Eckelmann
414ba078a3 Inform user about the possibility to make the build verbose 2011-07-03 18:04:48 +02:00
Sven Eckelmann
851ba40977 Set changeable default compiler optimization option 2011-07-03 18:03:15 +02:00
Sven Eckelmann
9772c338a2 Remove mupen64plus.6.gz in uninstall target 2011-06-27 13:21:45 +02:00
Sven Eckelmann
2acfd02362 Synchronize build rules with standard gnu make rules 2011-06-27 13:00:04 +02:00
Sven Eckelmann
649789679b Don't use _BIG_ENDIAN to check for endianness as it is always set on OpenBSD 2011-06-26 20:18:11 +02:00
Sven Eckelmann
ccfea343af Add OpenBSD as half-supported OS with FreeBSD userspace tools 2011-06-26 18:37:19 +02:00
Sven Eckelmann
f9c62d0081 Remove -v parameter of install which is not available everywhere 2011-06-26 18:29:25 +02:00
Sven Eckelmann
6b5de19fe7 Use FHS directory PREFIX/share/man as default man root dir 2011-06-26 02:21:18 +02:00
Sven Eckelmann
0f679f3a53 Only allow to configure man top level in install target 2011-06-26 02:02:22 +02:00
Sven Eckelmann
a9494e2c02 Mark local only functions as static or fix their definition 2011-06-25 23:46:50 +02:00
Sven Eckelmann
f4a9e8699f Fix compilation with BITS=32 when using gcc-4.6 2011-06-25 21:29:58 +02:00
Sven Eckelmann
cf11a07c99 Remove unused variable NumCheats 2011-06-25 17:21:23 +02:00
Sven Eckelmann
082aba7f75 Don't override optimisations set by linux build environment 2011-06-25 11:56:03 +02:00
Sven Eckelmann
753373768e Use -pthread gcc option to support systems with differently named pthread library 2011-06-25 10:33:27 +02:00
Richard Goedeken
d5fe6bbbba updated Console-UI front-end for new Mupen64plus 2.0 API versioning scheme 2011-05-16 21:49:45 -07:00
Richard Goedeken
ec6faeb750 Added tag 1.99.4 for changeset e96a0135de1b 2010-11-22 20:55:26 -05:00
Richard Goedeken
665e817b48 updated version and RELEASE info for 1.99.4 tag 2010-11-22 20:55:15 -05:00
Richard Goedeken
238ff7f8e9 add some parameter checking for --emumode option 2010-10-21 15:37:36 -04:00
Narann
7b2758def8 [fix] cheat.c now compile on visual studio. Just VS can't cast void pointer to typed pointer 2010-10-18 20:59:06 +02:00
Richard Goedeken
29e4230313 spinout's and my changes for new cheat file format, keyed off of CRC instead of GoodName 2010-10-04 22:09:06 -04:00
Richard Goedeken
25f8ade6e4 cleaned up source code and fixed a couple of bugs in new cheat code 2010-09-29 23:21:49 -04:00
Richard Goedeken
6b46d19ffd New cheat file parsing code from spinout for parsing a new cheat code file with a somewhat more readable format. This code also can deal with the cheats which have multiple options 2010-09-29 22:39:00 -04:00
Sven Eckelmann
f3db39ea83 Add dummy PATH_MAX on systems without it
Posix only defines that PATH_MAX may is defined through limits.h.
GNU/Hurd has removed this definition without violating the standards.

Mupen64Plus still relies on it and we work around that problem by
defining PATH_MAX as 4096 in all places it is needed. This is not 100%
correct as their are ways to generate longer paths, but mupen64plus must
be heavily refactored in some places to fix the actual problem.
---
2010-07-13 21:33:43 +02:00
Sven Eckelmann
ded3973463 Add GNU/Hurd as operating system with "linux" userland
---
2010-07-13 21:33:36 +02:00
Richard Goedeken
f79205201e FreeBSD makefile patches from David Demelier 2010-05-16 12:47:07 -04:00
Sven Eckelmann
9e015d30a8 Build kfreebsd and GNU/kFreeBSD like Linux 2010-03-19 12:16:37 +01:00
Sven Eckelmann
adb7b2e44c Reduced console output when running make without V=1 2010-03-18 10:59:21 +01:00
Sven Eckelmann
b1570a4b2c Use separate CXXFLAGS environment variable when calling CXX 2010-03-18 10:10:50 +01:00
Sven Eckelmann
f7e7785a34 Differentiate between hyphen and minus in manpage
groff differentiate between minus signs and hyphens. The default option is to
interpret '-' as hyphens (U+2010) and makes it hard to use copy and paste for
options in UTF-8 environments.

See http://lists.debian.org/debian-devel/2003/03/msg01481.html for more
information.
2010-03-11 12:57:27 +01:00
Richard Goedeken
d07cf9f8a2 add pthread back into link libs, so running in the debugger works 2010-03-05 12:58:16 -05:00
Sven Eckelmann
3a72b1a0e7 Add missing header 2010-03-04 23:31:18 +01:00
Sven Eckelmann
94877f6b77 Add automatically dependency tracking for C/C++ files
Every time a header is changed, the user had to cleanup the whole project and
then rebuild it. It is quite easy to fix and should help a lot when working on
the project. The dependency files will be created at the first run (when
dependency tracking isn't useful anyway) and should create nearly no overhead.
2010-03-04 22:52:18 +01:00
Richard Goedeken
31082b9ed7 fixed default plugin names 2010-03-02 19:39:03 -05:00
Richard Goedeken
e984740635 suppress dlopen() error message if system-installed core lib not found, because it will be searched for in the current directory later 2010-03-01 19:55:24 -05:00
Richard Goedeken
37550982da makefile updates: use CFLAGS+= instead of CFLAGS=, rmdir _obj, add APIDIR to targets help 2010-02-20 11:08:14 -05:00
Richard Goedeken
81f692eb50 Added tag 1.99.3 for changeset c51cfb141ec8 2010-02-13 16:55:46 -05:00
Richard Goedeken
6a68ccbd2b Updated RELEASE file and version info for 1.99.3 tag 2010-02-13 16:55:43 -05:00
Richard Goedeken
3b0d8c7317 add pthread to libs when linking so that GDB will run the emulator without throwing up a warning/error right after starting: Cannot find new threads: generic error 2010-01-26 23:48:36 -05:00
GoedekenR
88212f6656 Change from unix to dos line endings for osal_files_win32.c 2010-01-26 01:17:48 -05:00
Richard Goedeken
5951bba95e bugfix #257: added to makefile OS type GNU/kFreeBSD 2010-01-20 21:57:41 -05:00
Richard Goedeken
6292682492 updated MSVC8 project file to copy new input plugin auto-config .ini file after building 2010-01-18 21:15:20 -05:00
GoedekenR
38252128b9 Win32: fixed error (due to compiling .c files as .cpp) 2010-01-11 23:36:10 -05:00
Richard Goedeken
3d27c6dbe7 bugfix: memory leak from new function in last commit 2010-01-10 14:10:05 -05:00
Richard Goedeken
ca159d07f5 added new console-ui option --set for setting arbitrary configuration variables on the command line. This requires the latest core library, because it uses a new config function ConfigGetParameterType() 2010-01-10 00:31:23 -05:00
Richard Goedeken
38d372f5f9 updated MAN pgae for all the changes made in the 2.0 re-architecture 2010-01-09 19:36:25 -05:00
Richard Goedeken
2174b9096a Added tag 1.99.2 for changeset 8cf91241c3d4 2010-01-06 23:37:50 -05:00
Richard Goedeken
02596bdf31 Updated RELEASE and version info for 1.99.2 tag 2010-01-06 23:37:44 -05:00
GoedekenR
1d4c790fc8 update project file to copy the DLLs from the dependencies and shared data files from other projects into the output build directory. 2010-01-06 23:01:18 -05:00
GoedekenR
f3ba5fe609 Added audio-sdl plugin project file to MSVC8 solution 2010-01-02 20:26:29 -05:00
GoedekenR
1be5a8cf30 Added Input SDL plugin project to MSVC8 solution 2010-01-02 16:28:48 -05:00
GoedekenR
17b16b31cc Added RSP-HLE project to MSVC8 solution 2010-01-02 10:22:45 -05:00
GoedekenR
ff34d04fcf Changed a couple of excessive warnings which are always printed in the Win32 test environment to only be active with the --verbose option 2009-12-28 03:06:41 -05:00
GoedekenR
f4c547f3c6 Added rice video project to MSVC8 solution file 2009-12-27 17:18:30 -05:00
GoedekenR
098dd7c174 Added mupen64plus-core to the MSVC8 solution file 2009-12-24 16:35:33 -05:00
GoedekenR
88471f9649 Merge MSVC8 project files 2009-12-19 22:46:21 -05:00
GoedekenR
3dafaed16c Added visual studio 8 project files. Made some small syntax changes so that MSVC can compile the C code in C++ mode. This is necessary because the MSVC compiler still doesn't support some nice C99 features which are used in the C code. Builds and runs in Windows. 2009-12-19 22:36:55 -05:00
Richard Goedeken
945aea3c7b Makefile improvements: throw error if OS/CPU not supported, use DESTDIR in install/uninstall paths, per Lazhur request. Allow user-specified CC/CXX/LD paths, per Auria request 2009-12-19 20:09:42 -05:00
Richard Goedeken
6db6563706 Added tag 1.99.1 for changeset 9c6059a764e2 2009-12-14 21:36:14 -05:00
37 changed files with 5008 additions and 458 deletions

38
.gitattributes vendored Normal file
View 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
View 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
View 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
View file

@ -0,0 +1,2 @@
/projects/unix/_obj*/
/projects/unix/mupen64plus

48
.travis.yml Normal file
View 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

View file

@ -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
View file

@ -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
View file

@ -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
View 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)

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

File diff suppressed because it is too large Load diff

After

Width:  |  Height:  |  Size: 52 KiB

12
data/mupen64plus.desktop Normal file
View 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
View 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.

View 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

View 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>

View file

@ -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

View file

@ -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;
}

View file

@ -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

View file

@ -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
}

View file

@ -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 *

View file

@ -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;

View file

@ -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
View 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
View 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__ */

File diff suppressed because it is too large Load diff

View file

@ -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;

View file

@ -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 *

View file

@ -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;
}

View 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;
}

View file

@ -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];

View file

@ -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;

View file

@ -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;
}
}

View file

@ -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

View file

@ -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);
}
}

View file

@ -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"

View file

@ -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)