Commit graph

2504 commits

Author SHA1 Message Date
Carlos R
d1eebabe55 Fixed PSP build
Tidy AudioPluginPSP
2020-08-02 15:23:48 -07:00
Carlos R
01a3356327 More improvements for Sprite2D
*Fixed typo in the bound check from last commit
*Added hack for WCW Nitro, fixes sprite issues, this game should be playable now
*Refactored Sprite2D for consistency (same structure as S2DEX)
2020-08-01 14:29:49 -07:00
Carlos R
29f3709776 Accuracy and optimizations for Sprite2D ucode
*When executing sprite2d instructions, fetch the next instructions at once and bail out sooner when there's an invalid instruction
*Avoid using Swap function for FlipX/Y, is faster to manually swap
*Properly set left, top, right and bottom coordinates
*Properly set texture width, we were wrongly using ImageW, also renamed fields that were named incorrectly in Sprite2Struct
*Added bound checks
2020-08-01 13:57:26 -07:00
Carlos R
02f3b02352 Optimizations for Convertile (accurate tmem)
*Optimized ConvertRGBA32 (this is the last function that could be optimized \o/)
*Fixed up ConvertYUV16 and optimized YUVtoRGBA
2020-07-30 23:11:20 -07:00
Carlos R
5f45683d74 Fixed check that determines if rom format its handled 2020-07-28 07:50:48 -07:00
Carlos R
c59cd8759c Added ConvertFormats.h 2020-07-26 11:21:54 -07:00
Carlos R
bfffb7be1c Removed duplicate from convertimage/tile
*Moved all the conversion routines to ConvertFormats.h
*Fixed a lot of wrong bitshift operations (Rinnegatamante)
2020-07-26 11:18:46 -07:00
Carlos R
7b1d43a3c7 Removed unused Comment and Info entries from roms.ini 2020-07-19 15:06:26 -07:00
Carlos R
b06ba224f4 Roms.ini fixes
*Fixed a bug causing some roms to not get properly parsed (thanks Rinnegatamante for the fix!)
*Added roms.ini entries from the Vita repo, also deleted duplicate entries
2020-07-19 14:51:17 -07:00
Carlos R
37db2e4337 Removed -1 from uViHeight/uViWidth
*This was actually breaking the fix for New Tetris.. Originally we were doing -1 for the clear screen check in Fillrect, this been updated too. The check in SetScissor did not need to be updated as it was already clamping when the if the N64 resolution was equal or greater..
*Always clear z buffer first in fillrect
2020-07-18 13:15:58 -07:00
Carlos R
c01cb5ac90 More Improvements for Accurate TMEM
*Added macro for A8R8G8B8 conversion
*Make the tile conversion code clamp reads to the 4k tmem space (thanks strmnnrmn!)
*Moved DAEDALUS_ACCURATE_TMEM to be platform defined since this feature should not be enabled for low-end systems, ex PSP
2020-07-18 11:23:50 -07:00
Carlos R
80bb566033 Implemented YUV16 for accurate TMEM 2020-07-16 22:57:46 -07:00
Carlos R
7a7706eb72 Merge remote-tracking branch 'origin/master' 2020-07-16 20:15:14 -07:00
Carlos R
757505fb43 Optimization for accurate TMEM
Optimized ConvertIA16, this an old change I had that I forgot to commit :/
2020-07-16 20:14:13 -07:00
Wally4000
d782bc73e3 Readded shadows :) 2020-07-16 21:04:04 +10:00
Wally4000
24bb0cbe23 Update Intrafont with latest sources from https://gitlab.com/HaydenKow/libintrafont
This fixes the horrible menu issue we've been having
2020-07-16 12:34:27 +10:00
Carlos R
e9e0999540 Fixed crash in Pokemon Puzzle League, Fifa 98 and other games
This is a workaround to prevent crashing the emulator when trying to load excessive large textures
2020-07-14 21:59:41 -07:00
Carlos R
e0070b6861 Fix for blast corps and more bound checks
*Properly trigger DP interrupt, some games are very sensitive when we ignore it. Blast Corps no longer hangs after the Rare logo. Also ensure to trigger the interrupt when frameskip its enabled to avoid stalls
*Added bound checks for DLinMem and DLCount
*Disabled invalid address bound checks for the PSP. With the recent changes, now its safer to disable it
2020-07-12 15:10:16 -07:00
Carlos R
3de6b8210e Fixes and improvements for hle cache and mempack support
*Fixed mempack support when savetype is not unknown, for simplicity we always assume the presence of the mempack. Ill add proper support to disable it later
*Removed force flag for Save_Flush, this was a legacy flag mainly used to manually allow users to force saving
*Moved hle cache directory inside the SaveGames folder and removed all the duplicate code added when it was moved to its own directory
*Fixed accurate TMEM for the PSP (still disabled on the PSP)
2020-07-12 14:10:40 -07:00
Carlos R
b39e6d119e *Do not set the texture tile and scale when texture its disabled, also handle properly when the texture scale its 0, DKR does this
*Convert segment address to a physical address (fixes an ancient bug discovered by recent changes to RDPSegAddr (fixes a crash in DKR)
2020-07-11 15:29:31 -07:00
Carlos R
b37c629d8a *Defined DAEDALUS_SILENT for release builds to
*Fixed batch test for Linux and tidy when setting path for executable
*Fixed rom.db for linux
2020-07-11 15:10:55 -07:00
Carlos R
3c1a74d1b7 *Properly mask down RDPSegAddr, also removed now redundant masks
*Added more bound checks
*Removed compiler workaround in MatrixFromN64FixedPoint and GBI1_DL, I checked and latest PSP toolchain optimizes this correctly now
2020-07-10 15:16:07 -07:00
Carlos R
da6b5132b3 *Proper implementation for Branchz and added Zelda implementation, thanks Rinnegatamante
*Optimization in CPU_CheckStuffToDo
2020-07-10 13:30:21 -07:00
Carlos R
de782b19ae Implemented Trix for GE and PD 2020-07-05 15:18:45 -07:00
Carlos R
3d1184f990 *Removed vertex stride from the ucode cache, now vertex stride its applied at compile time for all microcodes
*Removed GBI0_Tri4 (F3D microcode doesn't support it)
*Moved GBI0_Tri4 implementation to Ucode_GE.h since this is actually part of the custom microcode used by GE and PD.
2020-07-04 17:37:52 -07:00
Carlos R
9801199bf6 Clean ups from last commit
*Removed CLIP_TEST_FLAGS usage, I tested several games and I did not find any issue when all the clipping flags were set
*Refactored set ClipFlags to avoid duplicate code and make it easier to debug
2020-07-04 02:29:23 -07:00
Carlos R
ad31af0d97 Optimized CullDl
*Fixed culling for Aydin Chronicles (first and last param its reversed)
*Avoid doing a bound check twice for testverts, the display list would get culled regardless
*Return early when Dlist its visible

PS: CLIP_TEST_FLAGS its meaningless right now since all clipping flags are checked, we can remove it after testing further if that's ok or if we need to relax the clipping flags for No Near Plane microcodes
2020-07-03 19:46:49 -07:00
Carlos R
6733dbc19d F3D improvements
*Implemented CullDL for F3D microcode, small speed up for games that use this, ex Wave Race 64
*Fixed max light constant for F3D/EX/2
*Continue WIP to optimize the vertex indices at compile time  (F3D its done now)
2020-07-02 22:37:56 -07:00
Carlos R
f70c0180b5 Prep work to add more custom ucode implementations
*Refactored RDP_MoveMemLight to prevent duplicate code and simplified it for adding custom lighting impls. Also added bound checks for invalid light index and addresses
*Added hash for Rogue Squadron (this a custom GBI1 ucode), currently unimplemented 
*Do not hardcode GBI commands when patching custom ucode tables
*Fixed DKR's index mtx address, thanks Rinnegatamante for pointing out this error
2020-07-02 09:15:45 -07:00
Carlos R
4e48f03020 Fix some uninitialised states in the renderer which was breaking lightning in debug builds. Thanks StrmnNrmn! 2020-07-01 22:44:17 -07:00
Carlos R
ef3752e3d2 Implement F3DBETA ucode (this an early version of Fast3D)
*Remove SOTE ucode implementation, this was wrong. Now both SOTE and WRUS will use the Beta ucode
*Fix typo from previous commit that caused that changed ucode hash.
*Added WIP to set the vertex stride at compile time to allow the compiler to do further optimizations when the stride its a power of two. Currently its only done for the new F3DBETA ucode as a test.
2020-06-28 23:13:42 -07:00
Carlos R
9bec25e3ca More improvements to the gfx ucode detection
* Auto defect and cache ucode functions and vertex stride
* Speed up custom ucode detection, avoid string detection and return as soon as there's a match
* Do not attempt to auto defect ucodes that lack a version string
*Alot of code clean up, now custom ucodes should be easier to add (everything related its now in Microcode.cpp)
*Bound checking for InitMicrocode and make sure to set a default ucode version if there's a failure
*Hardcode code_size to avoid issues when hashing ucodes when games set an invalid size, ex Conker
*Simpler way to clear the ucode cache
*Always include gNormalInstructionName even on release builds, the memory we saved wasn't worth the hassle to keep it out of release builds..
2020-06-28 19:28:21 -07:00
Carlos R
ee22e26003 More bound checks
*Implemented IsVertexInfoValid to add proper bound checking our vertextinfo
*Implemented IsAddressValid to add proper bound checking when referencing an N64 ram address, currently its only used for DMA_Tri_DKR
*Fixed bug bugged addresses in DKR ucode
*Removed now redundant bound checks, some of these were either wrong pr inconsistent
2020-06-27 13:53:06 -07:00
Carlos R
d1ce452382 Improvements to BaseRenderer
*Avoid division by zero in the viewport code and properly handle PAL scaling // taken from bazel and Vita port
*Restored bound checks for AddTri , TestVerts and  ModifyVertexInfo
*Refactored CPU and VFPU vtx pipelines to make it easier to maintain
*Combined UpdateWorldProject and PokeWorldProject
*Added proper null check to LoadTextureDirectly
2020-06-27 12:08:58 -07:00
Carlos R
5a403c9f24 Refactored rom write support and clean ups for ROMBuffer.cpp 2020-06-12 17:17:58 -07:00
Carlos R
78734ef838 Misc changes to the memcpy swizzle and added a missing blender (GL) 2020-06-11 08:49:25 -07:00
Carlos R
e213b81291 Fixes for DMA SP and memcpy swizzle
[*] Fixed memcpy usage for aligned path for the memcpy swizzle and also enabled it for Linux/OSX
[*] Refactored unaligned path for memcpy swizzle and also fixed memcpy_test
[*] Set correctly sp mem region for DMA_SP
2020-06-10 09:25:14 -07:00
Carlos R
703b2663d4 Fixes for flash ram and rom read
[*] Removed redundant check for flashram read/write, actually this was incorrect for flashram read..
[*] Added return for failed DMA flashram transfers
[*] Set correct save type for Derby Stallion
[*] Set flashram type correctly, fixes saving for Derby Stallion
[*] Added check to prevent reading rom from out of range
2020-06-09 22:36:05 -07:00
Carlos R
f19e4262e5 DMA fixes
* Added check for odd PI DMA length, fixes Doraemon 3
* Fixed incorrect mask for spmem_address, thanks Rinnegatamante for pointing out this
* Moved rdram overflow check outside the count loop
* Added FAST_DMA_SP define and enforce 8 byte alignment for correctness. This is still only enabled for the PSP but should be safe to enable for other platforms where speed its important
* Small clean ups
2020-06-09 21:31:11 -07:00
=
f26134fa42 Finalise appropriate ptr changes 2020-05-28 09:47:31 +10:00
=
3707c880c2 Revert move to HWFog, we'll re-add this at a later date. 2020-05-28 09:38:37 +10:00
=
aa569512bb Small cleanup 2020-05-27 19:23:45 +10:00
=
1511baa25e Fix up paths in headers 2020-05-27 19:20:52 +10:00
Carlos R
0a1581d4e5 Fixes for MemoryUpdateSPStatus
*Make code more readable
*Fix bug where we weren't clearing the SP_STATUS_BROKE bit and ensure the RSP tasks are executed when clearing this bit
2020-05-26 22:02:37 -07:00
Carlos R
1ea107e15a Misc changes
*Added FB task from the Vita port. verified working on PPL
*Disabled OSHLE for linux/osx, we don't have a dynarec, no point to have it enabled
2020-05-26 20:32:50 -07:00
Wally4000
744fea9b71 Ensure we close the file on each instance we destroy a png object. 2020-05-24 21:53:12 +10:00
wally4000
46c23041ce
Merge pull request #19 from salvy/master
Accuracy fixes
2020-05-20 16:56:10 +10:00
Carlos R
934ea22c7f Fix crashes in Paper Mario and Yoshi
*Correct bad pointer casting for optimized copy in Yoshi_Memrect and fixed non optimized copy
*Store n64 ram offset rather than the system memory for Fast TMEM (thanks strmnnrmn!). Fixes random crashes when using the non accurate path for TMEM emulation
*Make sure to reset tmem block for fast TMEM even when accurate TMEM its used since we fall back to the non accurate path when games set line to 0
*Ignore load tile for accurate TMEM when line its 0, this was causing a crash in Paper Mario which sets line = 0
2020-05-16 16:09:17 -07:00
Carlos R
7937cc748c * Implement missing dom1/addr1/3
Fixes bug in Paper Mario where a save slot will get duplicated also fixes a bug in Majora's Mask where link did not have a shield and sword during the first movie
2020-05-16 15:02:35 -07:00
g
66b84def41 Revert "some fog changes better but not perfect."
This reverts commit 5a8720ecfb.
2020-05-16 21:19:22 +10:00