Sven Eckelmann
5dc3a32073
Only add gendebug when DBG_COMPARE is activated
2012-10-07 23:14:58 +02:00
Sven Eckelmann
d5f3ee88b0
Mark only locally used symbol FIN_BLOCK as static
2012-10-07 22:58:48 +02:00
Sven Eckelmann
7ae7152323
Mark symbols only used in memory/memory.c as static
2012-10-07 22:44:11 +02:00
Sven Eckelmann
48326c83d9
Mark symbols only used in main/savestates.c as static
2012-10-07 22:38:05 +02:00
Sven Eckelmann
f338d51b9f
Mark symbols only used in main/rom.c as static
2012-10-07 22:37:33 +02:00
Sven Eckelmann
ecedec3b7f
Mark symbols only used in r4300/r4300.c as static
2012-10-07 22:33:30 +02:00
Sven Eckelmann
6732eceee2
Mark symbols only used in main/main.c as static
2012-10-07 22:32:33 +02:00
Sven Eckelmann
6631f35c6f
Remove unused variables from r4300/r4300.c
2012-10-07 22:30:30 +02:00
Sven Eckelmann
4f99d4084e
Mark symbols only used in debugger/dbg_memory.c as static
2012-10-07 22:20:39 +02:00
Sven Eckelmann
2688e4db9f
Disable unused cryptographic functions in included minizip
2012-10-07 22:08:31 +02:00
Sven Eckelmann
044e9a4f6d
Don't depend on freetype2 for OSD=0 builds
2012-10-07 20:15:48 +02:00
Sven Eckelmann
81506b856f
Merge port of Ari64's new experimental dynamic recompiler for i386
...
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
doc/new_dynarec.txt | 413 ++
projects/unix/Makefile | 17 +
src/main/savestates.c | 25 +
src/memory/dma.c | 4 +
src/memory/memory.c | 21 +-
src/r4300/interupt.c | 9 +
src/r4300/new_dynarec/assem_x86.c | 4364 ++++++++++++++
src/r4300/new_dynarec/assem_x86.h | 20 +
src/r4300/new_dynarec/linkage_x86.s | 929 +++
src/r4300/new_dynarec/new_dynarec.c |10974 +++++++++++++++++++++++++++++++++++
src/r4300/new_dynarec/new_dynarec.h | 38 +
src/r4300/r4300.c | 23 +-
12 files changed, 16834 insertions(+), 3 deletions(-)
create mode 100644 doc/new_dynarec.txt
create mode 100644 src/r4300/new_dynarec/assem_x86.c
create mode 100644 src/r4300/new_dynarec/assem_x86.h
create mode 100644 src/r4300/new_dynarec/linkage_x86.s
create mode 100644 src/r4300/new_dynarec/new_dynarec.c
create mode 100644 src/r4300/new_dynarec/new_dynarec.h
2012-09-30 11:17:08 +02:00
Emil Langrock
ba195256ed
Synchronize cycle counting between cores
...
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
src/r4300/interpreter_cop0.def | 4 +++-
src/r4300/x86/gr4300.c | 9 +++++----
2 files changed, 8 insertions(+), 5 deletions(-)
2012-09-30 11:17:08 +02:00
Emil Langrock
f77324341f
Don't try to access uninitialized blocks[x] in dma_pi_write
...
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
src/memory/dma.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
2012-09-30 11:17:08 +02:00
Sven Eckelmann
839e192c68
Don't store mapped host registers on stack before dynarec call
...
The dynamic recompiler uses a simple register mapping for currently used
registers to reduce memory access for operations. The content of these
registers have to be saved back to the memory region containing the emulated
register bar before they will be remapped or may get damaged by an unsave
operation.
Emulated operations in the amd64 dynamic recompiler tried to avoid the complex
register free'ing operation before an call to a C function by storing the
content of mapped registers to the stack. This implementation is faulty because
* the return address (top most stack position when the dynamic recompiler
started a recompiled block) may get written during the execution of the C
function. The problem is that the return address is moved to another
position when the registers were stored in the stack and therefore the
content of a saved register gets damaged by this write.
* the called C function may want to access the content of an emulated
register. This is done by reading the content of the emulated register bar
in memory. This read will return an outdated value because the new value is
only stored on the stack.
This problem can be avoided without more complicated checks by not saving the
content on the stack and instead unmapping the registers and saving their
content in the emulated register bar.
2012-09-23 13:31:03 +02:00
Richard Goedeken
4e66aff82a
merged the split heads, hg doesnt complain
2012-09-16 15:21:44 -07:00
Sven Eckelmann
fd5cd73bd2
Allow to build without OpenGL support for non-OpenGL devices
2012-09-16 22:24:40 +02:00
Sven Eckelmann
168ae23a47
Allow to build without OpenGL support for non-OpenGL devices
2012-09-16 21:51:23 +02:00
Richard Goedeken
0b6d4fa50c
fix memset parameters from last commit
2012-09-12 22:47:30 -07:00
Sven Eckelmann
d2f23bae6b
Don't free random memory on config option type change
...
It is possible that the config parser changes a type of an option from any
other type to string. A string is actually only a pointer to another memory
region storing the string. ConfigSetParameter will try to free the old value in
hope to avoid memory leaks. This is a problem when the pointer shares the same
memory region as the previously stored value. The free(..) will try to free a
different part and create a crash at a later point.
2012-09-11 19:38:32 +02:00
Sven Eckelmann
d20269d780
Use test rom from separate repository mupen64plus-test
...
The test rom has an own repository called mupen64plus-test and doesn't have to
be shipped in tarballs for mupen64plus-core. This also makes the
mupen64plus-core-norom module tarball obsolete because the rom is never
included. The rom is still included in the source and build bundle versions of
mupen64plus.
2012-09-10 11:11:12 +02:00
Richard Goedeken
57d08111ae
increased FRONTEND_API_VERSION number for changes in commands, added documentation of api change
2012-09-09 21:54:01 -07:00
Richard Goedeken
388f321887
merged later changes from casualjames branch
2012-09-09 16:15:54 -07:00
casualjames casualjames
31aaa633ab
Crash fix for BC which doesn't depend on the plugins CheckInterrupts. This is just here because it's a simple fix and for documentation purposes, because I'll soon implement CheckInterrupts at this branch. Also, for the expansion PAK settings, instead of doing it if Count<0x100000 (which has potential for being run multiple times when Count overflows), do it on the main code transfer. This has potential for breaking some things, so testing is required.
2012-08-29 22:46:49 +02:00
casualjames casualjames
f37674f32d
Implement DP freeze bit (or rather, what can be done with HLE RSP and RDP). Properly fixes DK64, BC (intro speed bug, not the crash). FINALLYclear
...
I'm not sure if the implementation is correct, maybe the SP interrupt must be sent anyway and only the DP interrupt is delayed. Also there's still some polygon glitches and 'DIV_S by 0' errors, but at least it kinda works now, and documents what was wrong with it.
2012-08-29 03:47:32 +02:00
casualjames casualjames
3646c24d72
Remove tlb.c (this should have been sone when interpreter_tlb.def was added). Request the RSP to execute a lot of cycles (i.e. run until the end of the task), so the RSP plugin's DoRspCycles method can be changed to execute the requested amount of cycles in the future, which should make it easier to implement better RSP synchronization.
2012-08-27 17:51:22 +02:00
Richard Goedeken
ee21a0073c
fix bugs with NO_ASM=1 and DEBUGGER=1 builds
2012-08-26 15:33:58 -07:00
Richard Goedeken
8ebe1bda2d
update regression test script
2012-08-26 15:12:49 -07:00
Richard Goedeken
80804a5923
mask off the rsp register low 4 bits to ensure stack is 16-byte aligned in 64-bit rjump.c dyna_start()
2012-08-26 13:49:12 -07:00
Richard Goedeken
8f91e78144
fix several compiler errors and warnings. fix rjump.c code for 64-bit build
2012-08-26 13:12:29 -07:00
casualjames casualjames
252d09f30c
Implement SI register DMA busy bit. Fixes some message spamming (multiple SI DMA interrupts in queue) on diddy kong racing.
2012-08-26 02:20:52 +02:00
casualjames casualjames
9c86c74b4a
Unbreak soft reset, which I broke in the commit that introduced generic_jump_to.
2012-08-26 00:49:59 +02:00
casualjames casualjames
e10782a0ce
Don't use debug_count on the expansion pack setup, since it's not saved nor restored on savestates and may cause problems. I don't think this will cause problems, since it usually takes a lot of cycles before another PI DMA is done, and also debug_count just had a value of 0x5002 in all cases I've seen.
2012-08-25 22:27:47 +02:00
casualjames casualjames
2d9bbfc146
Move the endian swap stuff to util.c, and fix the rest of the savestates.c warnings.
2012-08-25 22:16:01 +02:00
casualjames casualjames
6d729c5b81
Simplify dynarec and block system setup. Instead of starting executing code straight away after calling dyna_start but waiting until NOTCOMPILED at 0xa4000040 executes to adjust the stack, adjust the stack on dyna_start then call a auxiliary function which sets up the code at 0xa4000040 (which doesn't require special cases now). I don't have access to a 64 bit machine right now so the 64 bit code is untested. Also, remove the old cached interpreter files from the VC project.
2012-08-25 16:28:51 +02:00
casualjames casualjames
0911d91861
Misc cleanup
2012-08-24 17:30:11 +02:00
casualjames casualjames
52290dbd59
Pure interpreter: Instead of dynamically allocating a precomp_instr in PC, use a global variable. Now, we can use PC->addr instead of interp_addr, so PC->addr is the instruction pointer irregardless of the CPU mode, simplifying some code.
2012-08-24 00:18:45 +02:00
casualjames casualjames
a1712c724f
Do cleanup simetrically and in the same place where initialization was done.
2012-08-23 23:47:41 +02:00
casualjames casualjames
a0bcd1abcd
Integrate the idle jump optimization of recomp.c with the pure interpreter.
2012-08-23 18:49:18 +02:00
casualjames casualjames
4c5f3c8000
Remove the write to R0 checks from the instruction code, since all instructions are now decoded by recomp.c, which already does the checks.
2012-08-23 18:21:45 +02:00
casualjames casualjames
cc34b8339d
Simplify the pure interpreter with the new instruction dispatch implementation.
2012-08-23 18:16:34 +02:00
casualjames casualjames
1f25cc2b2f
Complete last commit.
2012-08-23 18:09:56 +02:00
casualjames casualjames
ae0d54eaf4
Organize the R4300 opcodes in a single cpu_instruction_table structure, as a preparation for the future instruction dispatch simplification. Currently, current_intruction_table is always set to the cached interpreter table.
2012-08-23 18:05:38 +02:00
casualjames casualjames
fdb67d06f5
- Add the write to R0 checks (which were only on the pure interpreter) to the interpreter code (so now the cached interpreter has it too). I've left it disabled by default on the cached interpreter, just as before.
...
- Add all the necessary COP1 unusable checks everywhere. There were some checks which were only on pure interpreter, and some which were only on cached interpreter.
- Add the DIV by zero checks to the interpreter codebase (was only in pure interpreter)
- Minor code fixes
2012-08-21 23:02:34 +02:00
casualjames casualjames
18e3326d23
Fix the cached interpreter which I broke last commit.
2012-08-21 19:30:34 +02:00
casualjames casualjames
0a80a2d229
Fixes for the JALR and COP1 jump instructions.
2012-08-21 19:24:59 +02:00
casualjames casualjames
4f0298a0aa
Reimplement busy wait optimization on the pure interpreter (I forgot).
...
I did some small timing tests and I found no relevant difference between the old and the new pure interpreter implementation. So for now I'll center on fixing things.
2012-08-21 18:57:48 +02:00
casualjames casualjames
b05457b693
Initial attempt to join the pure interpreter and the cached interpreter main codebase.
...
This is just the bare minimum for it to work, since there's still some warnings/slowdowns/ugly code which has to be fixed.
2012-08-21 13:47:42 +02:00
casualjames casualjames
30c049b09b
Fix a bug that caused a leading space to be inserted to the config file every time it was loaded then saved.
2012-08-17 23:43:01 +02:00
casualjames casualjames
22c00013a5
Join all of the 'access executable memory quickly' tricks in one function.
...
I'm not sure if NOTCOMPILED is correct, just because the old code was a bit weird and maybe there was a reason for it.
Also, this adds support for executing code from SP_IMEM (this happens on a PIF boot).
2012-08-17 21:43:53 +02:00