Commit graph

940 commits

Author SHA1 Message Date
Wally4000
0c04c1ada1 Merge branch 'master' into Tidy-Pointers 2023-06-28 10:39:43 +10:00
Wally4000
5c7d7d48a6 Updated a bunch of pointers so they're unique. 2023-06-26 22:11:29 +10:00
Wally4000
76eb881494 use shared_ptr instead of RefCounted Class 2023-06-22 15:47:48 +10:00
Wally4000
4e60fb4901 Remove AuxFunc.h 2023-06-22 14:57:25 +10:00
Wally4000
b688456fbd Use builtins for random function 2023-04-24 15:51:14 +10:00
Wally4000
6dca83df5e Clean up CMake (PSP Build is jank) 2023-04-15 09:35:45 +10:00
Wally4000
060557db9b Use smart pointers for singleton and graphics 2022-07-16 00:36:25 +10:00
Wally4000
7b31d717b8 Cannot align these 2022-06-22 08:13:25 +10:00
Wally
16a8f93856 add more std:arrays 2022-06-19 19:14:37 +10:00
Wally
9fe0d7666f Use modern alignas specifier 2022-06-19 13:55:08 +10:00
Wally4000
a69ee0a3f3 More std::array magic 2022-05-03 12:50:08 +10:00
Wally4000
0c1994d6b3 more std::filesystem 2022-04-20 20:07:20 +10:00
Wally4000
b0185d6441 Begin introducing std::filesystem more 2022-04-19 20:22:58 +10:00
Wally
23d60271b8 PSP will now build but crashes :( 2022-03-27 12:56:24 +11:00
Wally4000
3fec82b04d Remove stdafx.h for consistency 2022-03-22 18:06:17 +11:00
Wally4000
1804b898cf Overhaul CMake. May break PSP Build 2022-03-21 21:34:56 +11:00
wally4000
d52ce85ce8 replace Clamp with std::clamp 2021-10-23 23:08:27 +11:00
wally4000
4fbc81a4ac Use std::max and std::min 2021-10-23 22:12:40 +11:00
wally4000
6a619737ac Fixed Linux Build 2021-10-19 23:08:02 +11:00
Wally4000
eadc1b3758 move from typedef to modern using declaration 2021-10-18 18:58:14 +11:00
Wally4000
b1e6ac01da Adding in some std:: functions to replace some templates 2021-10-16 22:54:18 +11:00
z2442
383621ba0d Add window resize + fullscreen toggle 2020-12-31 08:52:37 -05:00
Wally4000
15e3e2a1d0 Update to the Bazel Directory Structure.. 2020-08-22 18:42:41 +10:00
Carlos R
f9a986a6cc S2DEX fixes
*Corrected inclusive typos for partial and no rotation modes (fixes gaps in V-Rally and Worms sprites)
*Implemented flipX/Y for full rotation (Worms uses this when the character fall down)
*Defined flags for flipX/Y
2020-08-10 22:04:58 -07:00
Carlos R
5470cebe96 Re-implement ConvertYUV16 for ConvertImage
*This is based off the accurate tmem implementation (ConvertTile), also simplified how we dispatch this texture format
*Removed workaround when the pallet is address is null, this no longer needed due to recent fixes
2020-08-09 23:38:01 -07:00
Carlos R
47652f082e Refactored S2DEX_BgCopy/Bg1cyc
These use the same struct and SpriteLoad function
Added list of games that use S2DEX, useful for testing
2020-08-09 17:02:48 -07:00
Carlos R
ff9f4811a2 Fixed typo in Sprite2D 2020-08-09 17:00:48 -07:00
Carlos R
5b3a42c749 TMEM clean ups
*Moved TMEM Copy routines to their own file (TMEM.cpp)
*Avoid loading tmemload info twice when the tmem lookup entry is invalid
2020-08-08 10:42:55 -07:00
Carlos R
59a8d35114 Ensure we point to the correct instruction for Sprite2D 2020-08-05 08:54:39 -07:00
Carlos R
264ded00a8 Refactored S2DEX, FB and Sprite2D 2020-08-02 15:46:55 -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
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
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
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
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
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
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