Commit Graph

5420 Commits

Author SHA1 Message Date
revel8n 71803eed5c
Additional fixes for constant register usage and argument modifier replacement
- Fixed constant register logic erroneously keeping Modifier and Multiplier values
- Fixed incorrect argument modifier masks used when replacing argument modifiers
- Fixed incorrect parameter set for invert argument modifier replacement
- Added more specific instruction comments for replaced argument modifiers
- Moved argument modifier replacement step outside of recursive fixup method
2018-08-28 09:21:44 -05:00
revel8n d78d58206d
Updates to fix replacement of instruction modifiers in 2.0+ pixel shaders 2018-08-28 09:21:40 -05:00
revel8n 565636aa4e
More improvements to pixel shader compilation in model 1.4+
- Moved recompiled results into shader structure as mappings are needed when resolving constant register indexes
- Moved texture mode decoding to before fixups and optimizations
- Added initial method to fix uninitialized registers components
- Added fixes for accesses to registers that became read-only in 1.4+
- Updated logic that initialized texture coordinate register accesses
- Additional logic to fix LRP instruction that accessed registers more than allowed
- Preparations for method to handle general register access limitations
- Moved patching of scalar instructions to catch those missed before
2018-08-28 09:21:36 -05:00
revel8n 694f518567
Additional minor fixes, clarifications and cleanup as suggested in review 2018-08-28 09:21:33 -05:00
revel8n 2b7a74036d
Consolidate argument modifier flag checks to make use of 'HasModifier' helper method 2018-08-28 09:21:28 -05:00
revel8n 2adf4a03d5
Initial changes to add pixel shader 2.0 support
- Added enumeration values for additional DCL instructions
- Added enumeration values for additional TEXLD and TEXCRD instructions
- Added enumeration values for Sampler and Output Color registers
- Added additional constant declarations for use as scaling parameters when replacing unsupported instruction and argument modifiers
- Added helper method for checking set argument modifier flags
- Added helper method for setting parameter to declared constant register value
- Increased number of Intermediate slots
- Added helper method to set parameter to unclamped color value
- Added helper methods that allow for searching for free registers to be used as outputs
- Added helper method to retrieve maximum register counts based on type
- Updated register replacement methods to allow specifying range and exclusion
- Added helper method to determine which registers are valid for output on PC
- Added additional optimizations for MAD instructions
- Added conversion of CND instruction on unsupported pixel shader versions
- Added additional methods to fix destination register usage, constant value parameters, and argument and instruction modifiers
- Added additional method to add output to color register when required
- Updated texture mode decoding to support requirements for pixel shader version 2.0 (declare samplers, declare input registers, texcoord and texcrd usage, etc.)
- Fix for loops that were overrunning parameter counts
- Added additional constant value logic to attempt to use constant registers when possible
2018-08-28 09:21:22 -05:00
Luke Usher 8a846c357e
Merge pull request #1419 from ergo720/nt_query
Report correctly free/committed placeholder memory
2018-08-27 20:03:23 +01:00
ergo720 e28909e0f5 Report correctly free/committed placeholder memory 2018-08-27 20:00:30 +02:00
Luke Usher 878712c9a0
Merge pull request #1418 from LukeUsher/fix-window-draw
Fix an issue with window redraw when dragging over screen boundary
2018-08-27 18:43:37 +01:00
Luke Usher 22f3cc32f1 Fix an issue with window redraw when dragging over screen boundary 2018-08-27 18:38:47 +01:00
Luke Usher 346c077c87
Merge pull request #1417 from ergo720/vm_existVMA_fix
Removed CheckExistenceVMA, it's actually redundant
2018-08-27 16:08:01 +01:00
ergo720 286ff4612d Removed CheckExistenceVMA, it's actually redundant 2018-08-27 16:51:53 +02:00
RadWolfie 7b8d698fcf
Merge pull request #1413 from RadWolfie/fix-reboot-target-directory
Fix both retail and demo discs with given current directory
2018-08-26 19:42:37 -05:00
PatrickvL 51189b71be
Merge pull request #1415 from ergo720/vm_quick_fix
Count reserved bytes by the xbe image too
2018-08-26 20:03:19 +02:00
PatrickvL b760a9623f
Merge pull request #1414 from ergo720/fix_fable
Add INVLPG to X86 decoder
2018-08-26 20:02:36 +02:00
ergo720 92ffe2fb39 Count reserved bytes by the xbe image too 2018-08-26 19:47:48 +02:00
ergo720 29969913e3 Add INVLPG to X86 decoder 2018-08-26 19:16:27 +02:00
RadWolfie ce6e625954 update comment
Not really a root, more of a current directory
2018-08-26 05:50:19 -05:00
RadWolfie 503b2061ea Fix both retail and demo discs
Following titles are functional: (demos didn't work right before)
* Xbox Demos [XK-001 v1.01]
* Whacked
  * Xbox demos
* RalliSport Challenge
  * Xbox demos
* Quantum Redshift
  * Xbox demos

Confirmed does not regress:
* Xbox dashboard
  * Xbox Live
2018-08-26 04:48:04 -05:00
Luke Usher 02fda3862b
Merge pull request #1411 from ergo720/free_vma_overflow
Check overflow in free VMA
2018-08-26 09:25:24 +01:00
Luke Usher 91ed6995bf
Merge pull request #1412 from RadWolfie/kernel-mount-alt-title-link-fix
Unpatch XMountAlternateTitleA and XMountAlternateTitleA
2018-08-26 09:24:54 +01:00
RadWolfie f842ec8b38 Unpatch XMountAlternateTitleA and XMountAlternateTitleA
Plus fix NtQuerySymbolicLinkObject function.
2018-08-25 17:23:24 -05:00
ergo720 90aaa2a446 Check overflow in free VMA 2018-08-25 16:10:32 +02:00
Luke Usher 7fe7ad4f40
Merge pull request #1404 from LukeUsher/ke-kernel-fixes
General Tweaks/Improvements.
2018-08-25 09:37:45 +01:00
Luke Usher cbf018e990
Merge pull request #1410 from ergo720/fix_ff1
VMManager: allow commiting in the region xbe image - XBE_MAX_VA
2018-08-24 19:13:22 +01:00
Luke Usher 8e77819d17 Prevent double-locking: This is a work-around b/c we don't have CPU emulation to fix it properly yet 2018-08-24 19:11:56 +01:00
ergo720 1921b37310 VMManager: allow commiting in the region xbe image - XBE_MAX_VA 2018-08-24 18:54:02 +02:00
PatrickvL 71cc74a740
Merge pull request #1408 from revel8n/vertex_declaration_fixes
Fix for vertex declaration failures
2018-08-24 07:43:05 +02:00
revel8n 3ad255df4b
Fix for vertex declaration failures due to incorrectly handled Step size for VshConvertToken_CONSTMEM / D3DVSD_CONST
fixes #1381
2018-08-23 18:47:23 -05:00
Luke Usher 74c572f70a Fix deadlock in Sonic Heroes: WaitBlock support is too lacking in the
rest of the kernel.

NOTE: This brings back the previous KeBugCheck issue: Turns out it
wasn't solved by the previous commit, instead, the thread triggering the
error was hanging, preventing the error from appearing. Need to find a
better solution.

Perhaps we need to write our own custom KeWait implementation for now,
rather than attempting to mirror Xbox functionality 1:1. Direct Code
execution severely reduces the viability of an accurate
implementation of this.
2018-08-23 23:40:04 +01:00
Luke Usher 370fdf0d34 Fix unintended comment change 2018-08-23 22:14:34 +01:00
Luke Usher 02c045b4d7 Attempt at fixing KeBugCheck error: Seems to work for WWE2 Raw 2018-08-23 21:58:28 +01:00
ergo720 91ad39e934
Merge pull request #1407 from RadWolfie/fix-dinput-controller-with-spaces
Fix device name since the ending do contain spaces
2018-08-23 19:54:34 +02:00
RadWolfie 062e5b9aaf Fix device name since the ending do contain spaces
This is the only setting has spaces in it.

Other strings, list below, does not have any spaces at beginning and ending.
* VideoResolution
* File paths
2018-08-23 12:34:33 -05:00
RadWolfie e38f381d99 Fix indent alignment 2018-08-23 10:00:15 +01:00
Luke Usher 0d02840ab9 Oops: Fix compilation 2018-08-23 10:00:15 +01:00
Luke Usher 81b2017541 Experimental Chihiro Media Board ROM (Segaboot) support
Currently disabled as it doesn't work yet/is incomplete.
Work will be resumed once LLE OCHI is stable and enabled.

For now, we'll just have to skip Segaboot and launch games directly.
2018-08-23 10:00:15 +01:00
Luke Usher 910bb02b7d Fix a crash when Xbox titles attempt to access CRX registers 2018-08-23 09:59:31 +01:00
Luke Usher 06f860dd30 Don't hardcode AVPack in the kernel, read it from SMC instead 2018-08-23 09:59:31 +01:00
Luke Usher 31e3cea0f7 Fix an issue where AVPack version read from Kernel or Direct from SMC don't match 2018-08-23 09:59:31 +01:00
Luke Usher f6db500c07 Fix an issue where SMC Version String was read incorrectly 2018-08-23 09:59:31 +01:00
Luke Usher fe24e4c344 less log pollution in non-debug levels 2018-08-23 09:59:31 +01:00
Luke Usher 92d5de47aa oops, it doesn't compile without these! 2018-08-23 09:59:31 +01:00
Luke Usher 69527e5f8c Implement CriticalSections + KeWait + KeEvents* without host forwarding 2018-08-23 09:59:31 +01:00
Luke Usher 0620b1a983 Fix CritialSection, implement KeWait*Object as best as we can without custom thread scheduler 2018-08-23 09:59:31 +01:00
Luke Usher 8c9d8e448e
Merge pull request #1405 from RadWolfie/file-path-fix
Fix file path to use RootDirectory properly.
2018-08-23 09:56:51 +01:00
RadWolfie bec2b6bd3b fix indent (spaces to tab)... 2018-08-22 19:33:18 -05:00
RadWolfie 778fcddbe1 perm fix for file path
Turok Evolution now finally able to save the game.

RootDirectory handle is very important role when a title pass down with non-null handle in the structure.

Ideally should not cause any regression.
2018-08-22 19:29:21 -05:00
RadWolfie bde08beea2 workaround fix (for study) 2018-08-22 16:53:02 -05:00
Luke Usher 2e0f788805
Merge pull request #1403 from LukeUsher/fix-delete-vertex-shader-crash
Fix a crash when deleting a declaration-only shader
2018-08-21 10:41:40 +01:00