Commit graph

1883 commits

Author SHA1 Message Date
Nebuleon
1ef073e49e Remove a native test and branch from inter-block jumps. 2014-01-19 05:12:19 +00:00
Nebuleon
636ef6b14b Do not set the rounding mode before floating-point widening conversions.
The rounding mode is completely unneeded when converting from W (32-bit integer) or S (32-bit floating-point) to D (64-bit floating-point), and is actually unused on MIPS processors.

Quoting from the MIPS Programmer's Manual, volume 2, for CVT.D.fmt:
The value in FPR fs, in format fmt, is converted to a value in double floating point format and rounded according to the current rounding mode in FCSR. The result is placed in FPR fd. If fmt is S or W, then the operation is always exact.
2014-01-18 10:28:42 +00:00
Nebuleon
c61eb6feef Do not set the rounding mode before exact floating-point operations.
Setting the rounding mode on some host architectures (including x86, according to <http://www.mega-nerd.com/FPcast/>) empties the floating-point unit's pipeline, resulting in poorer performance. Omitting the rounding mode before exact operations restores some performance.

Affected opcodes are CVT.W.S, CVT.W.D, CVT.L.S, CVT.L.D, ABS.S, MOV.S, NEG.S, ABS.D, MOV.D and NEG.D.
2014-01-18 07:09:52 +00:00
Sven Eckelmann
d54b026d6d Provide definition of __GNUC_PREREQ for OpenBSD
OpenBSD doesn't seem to have the definition for __GNUC_PREREQ and thus fails to
i386 with PIC enabled (which is the default now).
2014-01-11 01:05:23 +01:00
Sven Eckelmann
2d9c882275 Fix interpreter marks for unused JR_IDLE and JALR_IDLE
The JR_IDLE and JALR_IDLE functions are unused in the pure interpreter and
cached interpreter. Thus these functions are marked with the attribute
"unused". Unfortunatelly, the declaration did not precede the definition. Also
the definition conflicted with the declaration.
2014-01-11 00:59:52 +01:00
Sven Eckelmann
b9ccfe4f51 Fix subscreen credits Zelda workaround
The second part of the credit cheat were executed independenly of the first
part. This was caused but the wrong syntax used for the if statement in commit
8e14cc9ba5 ("Add Missing Subscreen Delay Fix for
Ocarina of Time")
2014-01-11 00:52:58 +01:00
Richard Goedeken
83e85d4839 Merge pull request #2 from ecsv/const_rdramb
Avoid constant address resolution via a pointer in memory.c without -flto
2013-12-20 11:03:07 -08:00
Sven Eckelmann
5d0ffe2226 Avoid constant address resolution via a pointer in memory.c without -flto
GCC cannot identify the rdramb pointer as const and therefore not remove any
indirection when using it without link-time optimization. The missing const
reduces the performance slightly in (read|write)_rdram[bhd]? because extra
instructions have to be generated to get the value of rdramb from memory.

Reported-by: Nebuleon Fumika
2013-12-20 17:49:55 +01:00
Sven Eckelmann
fe9c08ba83 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-18 15:23:06 +01:00
Sven Eckelmann
67f8d10ac3 A cleared EEPROM block has all bits to 1 and not 0 2013-12-15 11:37:09 +01:00
Sven Eckelmann
83edfef8c7 Enable CountPerOp for the new_dynarec 2013-12-14 17:27:19 +01:00
Sven Eckelmann
85d5bf0066 Remove debug artifacts from CountPerOp commit 2013-12-14 16:56:04 +01:00
Sven Eckelmann
a19fac3325 Allow to disable interrupt delay after DMA SI read/write
Titles like Banjo Tooie are known to hang because the interrupt after the SI
read/write is delayed. But there are also titles which are known to have
problems when delay is enabled. Examples are

 * Body Harvest
 * City Tour Grandprix - Zennihon GT Senshuken
 * Cruis'n USA
 * GT 64 - Championship Edition
 * Nightmare Creatures
 * Ucchan Nanchan no Hono no Challenger - Denryuu Ira Ira Bou
2013-12-13 16:49:26 +01:00
Sven Eckelmann
5d5ff6af92 Allow to overwrite the cycles per instruction
Some ROMs require a different average cycles per instruction count than the
default one (2 per emulated instruction). This setting is necessary because
mupen64plus is not cycle accurate. A complete simulation of pipeline, cache,
bus and so on is necessary to get it perfectly without this workaround.

Known titles which require a CounterPerOp of 1 are

 * 64 de Hakken!! Tamagotchi - Minna de Tamagotchi World
 * 64 Oozumou
 * A Bug's Life
 * Airboarder 64
 * Bass Hunter 64
 * Bass Rush - ECOGEAR PowerWorm Championship
 * Bassmasters 2000
 * Biohazard 2
 * Body Harvest
 * California Speed
 * Carmageddon 64
 * Charlie Blast's Territory
 * City Tour Grandprix - Zennihon GT Senshuken
 * Destruction Derby 64
 * Disney's Tarzan
 * Donkey Kong 64
 * Duck Dodgers Starring Daffy Duck
 * Duke Nukem - ZER0 H0UR
 * Excitebike 64
 * Fighting Force 64
 * Flying Dragon
 * Fushigi no Dungeon - Fuurai no Shiren 2 - Oni Shuurai! Shiren Jou!
 * GT 64 - Championship Edition
 * Hamster Monogatari 64
 * Harvest Moon 64
 * Hercules - The Legendary Journeys
 * Hexen
 * Hiryuu no Ken Twin
 * In-Fisherman Bass Hunter 64
 * International Superstar Soccer 64
 * Itoi Shigesato no Bass Tsuri No. 1 Kettei Ban!
 * Jikkyou G1 Stable
 * Jikkyou World Soccer 3
 * Madden NFL 2000
 * Madden NFL 2001
 * Madden NFL 2002
 * Madden NFL 99
 * Mario Party
 * Mario Party 2
 * Mario Party 3
 * Mario Story
 * Monopoly
 * Mystical Ninja 2 Starring Goemon
 * NBA In the Zone '99
 * NBA Showtime - NBA on NBC
 * Nightmare Creatures
 * Nintama Rantarou 64 Game Gallery
 * Nuclear Strike 64
 * Nushi Duri 64
 * Nushi Duri 64 - Shiokaze ni Notte
 * Paper Mario
 * Pro Mahjong Kiwame 64
 * Pro Mahjong Tsuwamono 64 - Jansou Battle ni Chousen
 * Quake II
 * Razor Freestyle Scooter
 * Ready 2 Rumble Boxing Round 2
 * Resident Evil 2
 * Roadsters Trophy
 * Rush 2 - Extreme Racing USA
 * San Francisco Rush 2049
 * Shadow Man
 * Tigger's Honey Hunt
 * Toy Story 2
 * Triple Play 2000
 * Ucchan Nanchan no Hono no Challenger - Denryuu Ira Ira Bou
 * Vigilante 8
 * Vigilante 8 - 2nd Offence
 * Virtual Pool 64
 * War Gods
 * WCW-nWo Revenge
 * Wipeout 64
 * HardCoded by Iceage
 * Spacer by Memir (POM '99)

Known titles which require a CounterPerOp of 3 are

 * BattleTanx
 * BattleTanx - Global Assault
 * Beetle Adventure Racing!
 * Disney's Donald Duck - Goin' Quackers
 * Donald Duck - Quack Attack
 * HSV Adventure Racing
 * Jikkyou Powerful Pro Yakyuu Basic Ban 2001
 * LEGO Racers
 * Monster Truck Madness 64
 * Pilotwings 64
 * Road Rash 64
 * Wave Race 64 - Shindou Edition
 * WCW Nitro
 * Wetrix
2013-12-13 16:49:26 +01:00
Joel 'iLag' Hammond
8e14cc9ba5 Add Missing Subscreen Delay Fix for Ocarina of Time
Mupen64plus contains built-in cheats for Ocarina of Time, which activates the
essential subscreen delay fix.  However, the built-in code for Master Quest
only works for the (E) version of Master Quest, and not the (U) version. The
file also does not include the (U) (GC) version of Ocarina of Time. Master
Quest and the GC versions of Ocarina of Time also need the End Credits Fix,
otherwise these games will crash when the credits are displayed.
2013-12-13 16:49:26 +01:00
Sven Eckelmann
020ae86b81 Fix multiple definitions of main in same namespace 2013-12-13 16:49:26 +01:00
littleguy77
a4b3bbf9a8 R4300: Remove obsolete variable; caused crashes in PD/Goldeneye in Android Ed.
Issue pinpointed by xperia64 and discussed in greater length here:
http://www.paulscode.com/forum/index.php?topic=1199.msg11751#msg11751

This may be just a band-aid to a deeper issue.  Was discovered in Android while
trying to reload save states for Perfect Dark and Goldeneye from the latest
master revision of mupen64plus-ae.  Recent changes to mupen64plus-ae have elim-
inated the blanket call to System.exit() it was using previously, which may have
been masking this issue before now.  AE is also different from the upstream PC
version because it loads ui-console dynamically and calls main as a subroutine
of a larger multi-threaded android process (rather than ui-console being an
entry point to a new process). Not sure of all the ramifications, or if this is
even the correct fix, but it does fix the problem in AE.
2013-11-29 09:25:06 -05:00
littleguy77
56a5cb4322 Remove unneeded #include <SDL_opengl.h> in screenshot.cpp
Enables compiling for OpenGL ES hardware.
2013-09-16 10:38:56 -04:00
littleguy77
9f21c2248b Bugfix: Use correct config parameter string (CurrentSaveSlot->CurrentStateSlot) 2013-09-15 15:25:48 -04:00
Sven Eckelmann
a6d1e14d77 Remove SDL unicode keycode compat code
SDL 2.0 cannot store unicode anymore. Pre-2.0 versions provided this
field but it was removed right before the 2.0 release. Still using it
makes the compile fail.
2013-08-17 12:11:22 +02:00
Sven Eckelmann
8ab20c2837 Fix saveslot selection for SDL2
The IDs for SDL scancodes don't start from SDL_SCANCODE_0 and end at
SDL_SCANCODE_9. Therefore, SDL_SCANCODE_9 is bigger than SDL_SCANCODE_0 (which
violates a precondition of the key check) and this makes it impossible to
select a saveslot using the numbers on the keyboard.

Using a special (order independent) function which translates to the slot ids
avoids this problem and can still be optimized to a simple range check +
calculation by the compiler.
2013-07-25 13:38:32 +02:00
Sven Eckelmann
5d1dac61ec Reset PIF_RAMb 46,47 after the n64_cic_nus_6105 challenge
The Banjo Tooie response check fails when the PIF RAM is is not set to zero
for byte 46 and 47.
2013-07-21 10:34:46 +02:00
Richard Goedeken
84d7543ef2 fix build error with MAKE DEBUGGER=1 and newer binutils 2013-07-12 20:32:02 -07:00
Richard Goedeken
09885d8874 merged heads 2013-07-04 17:58:29 -07:00
Richard Goedeken
ceb195f7b7 update version number to 2.0 2013-07-03 07:06:28 -07:00
Sven Eckelmann
b77d5512db Revert: Implement SI register DMA busy bit
The implementation of the SI regiser DMA busy bit caused regressions in games
like Mischief Makers (no gamepad input is detected by the game). The only known
benefit seems to be the reduced message spam about duplicated interrupts.

The message spam caused by some ROMS can be tolerated until the cause of the
regression is better understood.

This reverts 734b67b8ff647cc355b5f6b781799c42e75e81ea ("Implement SI register
DMA busy bit")
2013-07-01 18:24:01 +02:00
Richard Goedeken
5e463b17a5 apply patch from: https://bitbucket.org/rlabrecque/mupen64plus-core/overview 2013-06-23 13:07:26 -07:00
Sven Eckelmann
58c98a03a3 Use SDL1.2 keysym in the config when using SDL2
It is easier for a user to keep the old SDL1.2 values for the keys in the
config instead of converting them by hand. This is extreme important when the
default (automatic) config is used.
2013-06-22 14:11:10 +02:00
Sven Eckelmann
a1b5427bff Simply open joystick when needed in SDL2
The joysticks in SDL2 use reference counting and return just a new reference
when trying to reopen a joystick. SDL_JoystickOpened is not needed in SDL2.
2013-06-11 17:44:16 +02:00
Sven Eckelmann
0b3a67f292 Ignore key repeats caused by the OS keyrepeat 2013-06-11 17:23:30 +02:00
Sven Eckelmann
c56f99988e Ignore upper 8 bit of countrycode when checking for PAL/NTSC system
Only the lower 8 bits are checked by the country code to system type check to
decide whether a PAL or NTSC system should be emulated. 8707bea8b73c
("1. Update msvc11 project file to visual studio 2012 (msvc11)") changed the type to
be checked to 16 bit and forgot to mask the upper 8 bits out when doing the
system check.
2013-06-11 10:19:59 +02:00
Sven Eckelmann
e7d2be62ae Fix new video resize functionality when compiling against SDL 2.0 2013-06-10 11:16:15 +02:00
richard42
86c03f6ad3 fix numerous bugs in osal_mkdirp for win32 2013-06-01 22:27:39 -07:00
Richard Goedeken
5125e3ec54 apparently we need those inline statements, to avoid warnings in linux. but visual studio cant handle the 'inline' keyword for C, it requires __inline. So put it in osal 2013-06-01 09:41:41 -07:00
richard42
23f6da0502 1. Update msvc11 project file to visual studio 2012 (msvc11)
2. remove unnecessary 'inline' declarations
3. fix warnings reported by vs2012
2013-06-01 07:55:18 -07:00
Richard Goedeken
873dfb57eb merged heads and simplified code 2013-05-28 21:20:23 -07:00
Sven Eckelmann
d00b1a8992 Don't free user managed msg when doing osd_exit during resize
Doing free'ing user managed msg will cause an double-free later. Also free'ing
messages without deleting them from the list will lead to bad reads after the
resize finished.
2013-05-28 21:29:41 +02:00
Riley Labrecque
6bcbe44858 Fixed compiling with MSVC/C89 2013-05-28 08:14:12 +00:00
Richard Goedeken
3ddbf56806 1. Update FRONTEND_API_VERSION to v2.1.1: Core command M64CMD_CORE_STATE_SET will now accept M64CORE_VIDEO_SIZE parameter (will call the video plugin function ResizeVideoOutput())
2. Capture SDL_VIDEORESIZE events and call video plugin ResizeVideoOutput() function.
3. In VidExt_ResizeWindow(), destroy and re-create OSD when re-setting the screen size
4. Fix bug when checking video api version for <2.2.0 fallback
2013-05-26 22:15:18 -07:00
Richard Goedeken
a557d213fd video extension API version is increased to v3.0. This adds a new Flags parameter to the VidExtSetVideoMode() function, and adds a new function VidExt_ResizeWindow. This is to support resizable output windows 2013-05-24 23:34:10 -07:00
Richard Goedeken
f3b891f97c increase Video plugin API to v2.2.0, add new ResizeVideoOutput function 2013-05-23 22:22:08 -07:00
Richard Goedeken
baa484f46e autodetect savestate type when loading from a slot 2013-04-14 11:43:40 -07:00
Richard Goedeken
9e4bb27d53 for some reason the OGLFT text extent measuring function was returning negative coordinates for the box X,Y minimums. Due to the logic for calculating the drawing position of the OSD messages, this resulted in invalid starting positions for drawing the bitmaps when horizontal justification was set to LEFT (under AMD catalyst opengl drivers). Thus, any left-justified messages were not displayed. To fix this, I force the text bounding box X,Y minimums to 0 2013-04-13 15:46:06 -07:00
Richard Goedeken
10a0404517 1. from refactoring in afcfc3639075, the last_addr didn't get set before jump as it should. 2. the jump_to() function never returns in dynarec mode, so this must be last function call in a handler 2013-03-20 22:12:13 -07:00
Richard Goedeken
a1523ad2fc fix r4300 profiler with mingw build 2013-03-17 14:05:47 -07:00
Sven Eckelmann
8556c3a33a Use localtime for windows compatibility
localtime_r is prefered because it has no shared states. It creates less
problems when using threads or calling it multiple times with different
parameters. Mupen64plus doesn't do this right now, but has many workarounds for
windows compilers which don't work all the time and need extra workarounds
later. Using localtime instead may be the easiest solution right now.
2013-03-14 08:33:33 +01:00
Richard Goedeken
88e3834ecb fixed compiler warnings and errors in DEBUGGER=1 build after last commit 2013-03-09 21:36:38 -08:00
Richard Goedeken
e83a6f0dd4 - add M64P_MEM_FLAG_*_EMUONLY types to signify memory areas to which the emulated CPU may read or write, but the debugger cannot
- extended read_memory_32() in debugger/dbg_memory.c to be able to read from special memory blocks like RDRAMREG, RSPREG, RSP, DP, VI, AI, etc
- fixed byte order bugs in read_memory_32_unaligned() and write_memory_32_unaligned()
- extended get_memory_flags() in debugger/dbg_memory.c to return new flags and cover special memory spaces
2013-03-08 22:42:44 -08:00
Sven Eckelmann
46ce002964 Fix byte sign extensions for architectures with default -funsigned-char
Architectures like armel, armhf, arm64, avr32, powerpc, s390 and s390x use a
unsigned type definition for char. Therefore, the macro for sign extension is
just a nop instruction there. Being more specific on these arches about the
signedness avoids this problem.
2013-03-06 17:06:24 +01:00
Richard Goedeken
4084e97175 moved the debugger memory type and memory flags enumerated types from the dbg_memory.h header into m64p_types.h, and prefixed them with M64P_ 2013-03-03 22:39:49 -08:00