1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00
Commit Graph

148 Commits

Author SHA1 Message Date
Sergey Lipskiy
e068a9dd77 Revert "Change texture coordinates."
This reverts commit 89406223f5.

Commit causes regression in motion blur effect in Zelda MM.
Reverted until further investigation.
2017-11-19 20:41:18 +07:00
Sergey Lipskiy
038c74af12 Correct gSPModifyVertex for case when widescreen hack enabled.
Widescreen hack breaks Disney's Tarzan amusingly #1501
(problem with 2D backgrounds in widescreen mode still exists and hardly can be fixed)
2017-11-17 13:45:50 +07:00
Sergey Lipskiy
29c9a778d9 Correct debug output 2017-11-16 18:52:32 +07:00
Sergey Lipskiy
5a037474a2 Code cleanup: fix compilation warnings. 2017-11-15 15:07:52 +07:00
Sergey Lipskiy
06b995c5f7 Code refactor: use _FIXED2FLOATCOLOR instead of _FIXED2FLOAT for color transformation from int to float. 2017-11-11 21:35:19 +07:00
Sergey Lipskiy
dcdf66dc0b Fix hardware lighting. It was broken when lighting method was rewritten in 6af6e2c17f
Hardware lighting is incompatible with new lighting method.
Model matrix may be different for different vartices, but only latest state of inverted light vectors are loaded to shader.
Thus I reverted calculations of data for hardware lighting.

Minor code cleanup.

Fixed: Zelda OOT, bad lighting with HW per pixel lighting #1652
2017-11-11 21:35:08 +07:00
Sergey Lipskiy
dcf8784dca Disable hardware lighting for ucodes with custom lighting methods.
Fixed #1542 Turok 2/Turok 3 Per Pixel Lighting Rainbow Weapons.
2017-10-31 17:42:48 +07:00
Logan McNaughton
168dccde2a Allow Gauntlet Legends to boot in HLE
Code by LegendOfDragoon
2017-10-24 15:45:37 +07:00
Sergey Lipskiy
35cc66bad4 Code cleanup:
* make RSPInfo::busy and RSPInfo::halt boolean
* remove RSPInfo::close
* rename RSPInfo::bLLE to RSPInfo::LLE
2017-10-24 15:44:37 +07:00
gizmo98
7d22828193 gSPNEON.cpp: merge gSPLightVertex_NEON and gSPLightVertex4_NEON 2017-10-10 14:04:37 +07:00
gizmo98
39d4b223c8 arm neon: add gSPInverseTransformVector function
Fix declaration of gSPInverseTransformVector as well. Replace vtx[4]
with vec[3].
2017-10-10 14:04:36 +07:00
Sergey Lipskiy
c75985b9d8 Code refactor: rewrite HLE vertices loading.
Enable __VEC4_OPT for Windows release builds.
2017-10-06 17:03:11 +07:00
Sergey Lipskiy
d197db5b90 Rewrite Zelda MM Point Light 2017-10-06 17:03:11 +07:00
S2S
89406223f5 Change texture coordinates.
Subtracting 1 might not be accurate,
but it is done anyway in the rest of the code regarding sprites.
Just for the record, implementing correct texture coordinate handling
for sprites might need reverting this.
2017-10-04 16:15:46 +07:00
S2S
feb0e53034 Fix sprite sizes
Fixes https://github.com/gonetz/GLideN64/issues/936
2017-10-04 16:15:46 +07:00
Sergey Lipskiy
70c540b073 Rewrite fix for #1539 : keep in tile descriptor start address of frame buffer, not pointer on it.
Should be more safe.
2017-09-29 22:25:56 +07:00
Sergey Lipskiy
a2a96f3d92 Set CHANGED_LIGHT|CHANGED_LOOKAT bits when index in modelview stack changes.
Fixed #1417 [HLE] Lighting issue
2017-09-21 21:33:08 +07:00
Sergey Lipskiy
41aa06523e Move ucodes source files to uCodes folder. 2017-09-21 21:33:08 +07:00
Sergey Lipskiy
47d718f287 Add F3DFLX2 ucode for F-Zero. Implement F3DFLX2 lighting method. 2017-09-21 21:33:08 +07:00
Sergey Lipskiy
8985e38bc0 Fix implementation of 0xD5 (Special_1) command for F3DEX2 ucode.
olivieryuyu found that 0xD5 command, when presents in ucode, updates combined matrix.
I could not remeber, which game uses implementation of F3DEX2_Special_1 with gSPDlistCount call.
Probably such game does not exists and this code was added by mistake. I removed it.
2017-09-13 18:01:15 +07:00
Sergey Lipskiy
21e7cae6aa Implement F3DEX2_Special_1 command for F3DEX 2.0XH ucodes.
Fixed #1562 Pokemon Snap/Kirby 64/Super Smash Bros. unimplemented command
2017-09-12 21:06:38 +07:00
Sergey Lipskiy
62eb76e7d9 Correct DebugMsg for gSPMatrix 2017-08-11 12:23:39 +07:00
Sergey Lipskiy
20c2fb9b5e Fix gSPSWVertex for __VEC4_OPT 2017-08-11 12:23:39 +07:00
Sergey Lipskiy
1fb8653dae Rewrite DL commands. 2017-08-11 12:23:39 +07:00
Sergey Lipskiy
0f99077724 Log SWRS commands 2017-08-11 12:23:39 +07:00
Sergey Lipskiy
02e84b90f2 Command 05 - 02 WIP 2017-08-11 12:23:39 +07:00
Sergey Lipskiy
089dd2df0e Fix fog for F3DSWRS 2017-08-11 12:23:39 +07:00
Sergey Lipskiy
a9248c5a26 Port of Lemmy's implementation of SWRS ucode. 2017-08-11 12:23:39 +07:00
Sergey Lipskiy
5691fcbc23 Implement F3DAM ucode.
Decoded by olivieryuyu

Fixed #97 hey you pikachu:hilarious texture bug
2017-07-17 23:08:26 +07:00
Sergey Lipskiy
dabbad0ba2 Implement Acclaim point lighting.
Fixed #147 Turok2: missing flashlight
Fixed #381 Armorines - Project S.W.A.R.M. missing lightning effect in HLE mode
2017-06-30 21:56:03 +07:00
Sergey Lipskiy
08f2b8be31 Improve log quality 2017-06-25 15:06:50 +07:00
Sergey Lipskiy
ee60040a78 Rewrite debug logging 2017-06-25 15:02:36 +07:00
Sergey Lipskiy
3e4a499a9b Add support for Super3D ucode.
Details: https://github.com/gonetz/GLideN64/issues/6#issuecomment-310126139

Fixed #6 wrong viewport in some games
2017-06-22 13:19:35 +07:00
Sergey Lipskiy
4722a75b24 Implement T3DUX ucode.
Ucode decoded by olivieryuyu.

Details:
Toukon road 1 & 2, last legion UX: HLE implementation (extended turbo3D)? #624
https://github.com/gonetz/GLideN64/wiki/T3DUX-ucode
2017-06-16 13:23:00 +07:00
gizmo98
e52f39aebe arm neon: add gSPLightVertex and gSPLightVertex4 neon version 2017-05-28 20:36:10 +07:00
gizmo98
542d083840 arm neon: Cleanup InverseTransformVectorNormalize
Add a arm asm multivector function of InverseTransformVectorNormalize which
replaces 2x and 4x functions.
2017-05-28 20:36:10 +07:00
Sergey Lipskiy
45139a60d5 Correct light vector length calculation for point lighting, #778 2017-05-06 19:49:18 +07:00
Sergey Lipskiy
eae155d741 Update point lighting calculaton according to Gillou68310 recommendations, #778
Point lighting still works incorrect.
2017-05-04 16:07:48 +07:00
Sergey Lipskiy
0630a76308 Fix negative viewport, #6 2017-04-05 17:08:00 +07:00
gizmo98
b8a18f57e4 arm neon: add faster versions of InverseTransformVectorNormalize 2x and 4x
2x, opt level -O2
old 0,42 runtime of c function
new 0,36 runtime of c function

4x, opt level -O2
old 0,30 runtime of c function
new 0,23 runtime of c function
2017-04-05 10:40:01 +07:00
gizmo98
abdba2c149 Refactor gSP.lights and gSP.lookat 2017-04-05 10:40:01 +07:00
Sergey Lipskiy
5e51b386f1 Make Resident Evil 2 playable. 2017-04-02 12:02:38 +07:00
Sergey Lipskiy
b92af6ddad Correct condition for max number of lights in gSPNumLights.
Thanks to gizmo98 for pointing on it.
2017-04-01 21:11:37 +07:00
gizmo98
2acc3c7775 arm neon: add multivector versions of InverseTransformVectorNormalize
Arm neon performance is much better if more data can be loaded and
processed.

Four vectors. Opt level -O3
—————————————-
runtime 100% - C function
runtime 99% - Neon function
runtime 56% - Neon 2x function
runtime 36% - Neon 4x function

Four vectors. Opt level -O2
—————————————-
runtime 100% - C function
runtime 71% - Neon function
runtime 43% - Neon 2x function
runtime 30% - Neon 4x function
2017-03-27 14:22:49 +07:00
gizmo98
7c628edc58 arm neon: add neon version of gSPTransformVertex 2017-03-22 21:03:34 +07:00
Sergey Lipskiy
2e00b0ef5a Correct height in _drawYUVImageToFrameBuffer 2017-03-16 18:50:15 +07:00
Sergey Lipskiy
e6811b4d4f Move gDP.colorImage.height update to FrameBufferList::setBufferChanged. 2017-03-16 18:50:14 +07:00
Sergey Lipskiy
6b4ae04f5e Rewrite polygons drawing in N64 depth compare mode.
Fixed #1418: Various regressions since PR2.0 with N64 depth compare enabled
2017-03-16 14:56:20 +07:00
Sergey Lipskiy
827b6bb9cd Code refactor: replace graphics::ObjectHandle() by graphics::ObjectHandle::null 2017-02-22 16:45:27 +07:00
Sergey Lipskiy
203a26794f Fix TODO issue in gSP::_copyDepthBuffer() 2017-01-25 21:01:59 +07:00
Sergey Lipskiy
80ed169e24 Remove use of OpenGL.h 2017-01-22 20:43:05 +07:00
Sergey Lipskiy
f147927af9 Remove OpenGL use from FrameBuffer 2017-01-21 16:35:00 +07:00
Sergey Lipskiy
e83c3489a3 Replace OGLVideo by DisplayWindow
Replace OGLRender by GraphicsDrawer
2017-01-16 20:56:11 +07:00
Sergey Lipskiy
4cbb2d0189 Move #define INDEXMAP_SIZE to gSP.cpp 2017-01-09 21:05:42 +07:00
Sergey Lipskiy
daf6646b97 BufferManipulationObjects 2: createRenderbuffer, initRenderbuffer 2017-01-02 22:40:41 +07:00
Sergey Lipskiy
e8c47c0316 Use F3D_TRIX instead of F3D_Tri4.
Fixed #1307
2016-12-22 18:39:40 +07:00
Sergey Lipskiy
43d281e5bd Correct F3DEX2MM_Branch_W 2016-12-21 11:26:04 +07:00
Sergey Lipskiy
a7df7c13ac Rename parameter in gSPBranchLessW 2016-12-20 21:36:31 +07:00
Sergey Lipskiy
ae67daca9f Remove branchLessZ flag from MicrocodeInfo. Remove F3DEX2MM from specialMicrocodes list. 2016-12-20 17:50:03 +07:00
Gillou68310
9e8b32fc89 Implement ucode for Majora's Mask 2016-12-20 17:40:33 +07:00
Logan McNaughton
380725da53 remove inline specifier for gSPFlushTriangles 2016-12-15 07:30:52 -08:00
Sergey Lipskiy
cb2da455b6 gSPProcessVertex4: transform vertex normale with modelview matrix when LookAt is not used. 2016-12-04 11:46:13 +07:00
Sergey Lipskiy
74144d6126 Transform vertex normale with modelview matrix when LookAt is not used.
Fixed Quake 2 metallic effect in the menu is broken. #1279
2016-12-03 17:34:30 +07:00
Sergey Lipskiy
6af6e2c17f Rewrite lighting.
Fixed chopper attack wrong textures #99
Thanks Gillou68310 for detection of the problem's origin.
2016-11-26 19:31:50 +07:00
Sergey Lipskiy
83ff7f9ae5 Implement gSPSelectDL and gSPSelectBranchDL
Fixed Nushi Zuri 64 - Shiokaze ni Notte: #1230
2016-11-17 16:47:31 +07:00
Sergey Lipskiy
cf2bce9176 Implement gSPSetStatus. 2016-11-17 16:47:27 +07:00
Sergey Lipskiy
2b29b6c09a Fix linear texture coordinate transformation.
Fixed Zelda OOT rotating "N" is miscolored (HLE) #661
2016-10-27 13:24:19 +07:00
Sergey Lipskiy
abcbe96095 Fix gSPBillboardVertex4_default
Fixed alloons invisible in DKR with VEC4_OPT #1159
2016-10-08 14:29:50 +07:00
Sergey Lipskiy
ce5abcb21b Correct FrameBuffer::isValid - do not update m_validityChecked when isValid called from VI_UpdateScreen
Fixed Broken Pokemon stadium 2 in-game portraits #1149
2016-10-05 15:39:41 +07:00
Sergey Lipskiy
966b2d0f93 Fix compare of vertex Z and test Z in gSPBranchLessZ.
Fixed GT64 - Championship Edition: missing polygon #151
2016-09-28 23:24:17 +07:00
Sergey Lipskiy
25aa8889a8 Do not use 8bit CI frame buffer as texture for gSpBg commands.
Fixed Yoshi's Story black screen in some levels if frame buffer is enabled #1143

Problem:
The game draws background with BG command.
Background texture is 8bit CI.
For some reason the game set 8bit CI at the address of the
background texture, but renders nothing to it.
Plugin uses empty frame buffer texture instead of background texture.

Solution: Do not use 8bit CI frame buffer as BG textures.

Note: probably the game rendres something to the BG texture at some point
of the game. This can't be emulated in hardware anyway.
2016-09-28 22:29:45 +07:00
Sergey Lipskiy
d6dbfad902 Correct fix for #977 2016-09-23 10:57:44 +07:00
Sergey Lipskiy
38ff9e97d5 Reset texture mode to normal in gSPSetSpriteTile.
Fixed Nushi Zuri 64 incorrect gfx #977
2016-09-22 20:50:51 +07:00
Sergey Lipskiy
91f03c70bc Use dmaVertices when draw with drawScreenSpaceTriangle. 2016-09-21 15:24:15 +07:00
Sergey Lipskiy
77d0c9aada Code refactor: rename drawLLETriangle to drawScreenSpaceTriangle. 2016-09-20 16:21:54 +07:00
Sergey Lipskiy
e28bebd17e Add validity check for background fb textures.
Fixed Nushi Zuri 64: fb background doesn't work anymore #1115

Problem: The game normally uses color and depth buffers.
When it needs to show rectangle with text, CPU copies current color buffer
by depth buffer address. This buffer rendered as background, text rendered over.
Plugin detects buffer usage and tries to use depth buffer as background texture.
That buffer in video memory has no color information, because data copied by CPU and contained in RDRAM.

Solution: check that found frame buffer is valid.
In this case validity check will fail because RDRAM content modified by CPU,
and background will be read from RDRAM.
2016-09-16 17:09:25 +07:00
Sergey Lipskiy
1a5e971eea Minor code cleanup in gSPModifyVertex. 2016-09-02 11:05:38 +07:00
Francisco Zurita
b81fb23363 Fix CBFD lighting in Android 2016-08-16 22:07:51 +07:00
Sergey Lipskiy
c7c90cb7eb Add widescreen hack support to gSPProcessVertex4
Fixed Widescreen hack broken #1078
2016-08-04 12:25:07 +07:00
Francisco Zurita
51b8547eba Fix __VEC4_OPT issue for CBFD in gSPCBFDVertex.
This fixes incorrect lighting with VEC4_OPT enabled in CBFD.
2016-07-20 01:45:11 -04:00
Francisco Zurita
7386a036ce Port glN64 for Android NEON optimizations 2016-07-06 11:00:40 +06:00
Sergey Lipskiy
c816f7deeb Code refactor: rename CLIP_Z to CLIP_W 2016-06-20 15:12:31 +06:00
Sergey Lipskiy
86fbea9edc Code refactor: replace NULL by nullptr. 2016-06-10 12:40:18 +06:00
Sergey Lipskiy
8ab1ca7468 Code refactor: replace hack_skipVIChangeCheck and hack_ZeldaCamera by one hack_ZeldaMM 2016-05-08 16:58:21 +06:00
Sergey Lipskiy
cfc7f25e1a Fix typo in gSPProcessVertex4 2016-05-05 16:28:53 +06:00
Sergey Lipskiy
bea7adf4b3 Add a hack for Jeremy McGrath Supercross 2000 jauge line, see #274
Fixed issue #942
2016-03-29 22:21:52 +06:00
Sergey Lipskiy
8673e9382c Correct gSPModifyVertex for POINT_XYSCREEN.
Fixed tarzan: gfx are completely wrong (regression) #939
2016-03-28 22:02:12 +06:00
Sergey Lipskiy
38bc2145d2 Do not set MODIFY_ST in gSPModifyVertex.
Fixed South Park - Chef's Luv Shack: incorrect gfx (regression) #942
2016-03-27 10:38:11 +06:00
Sergey Lipskiy
7875b6057f Detect microcodes, where texture perspective correction is always enabled.
Fixed Quake 64 HLE incorrect particles. #637
2016-03-23 22:15:19 +06:00
Sergey Lipskiy
3c675b1cfb Do not draw Sprite2D when sprite->stride <= 0.
Fixed crash in Super Robot Spirits: Crash rankings option in HLE. #909
2016-03-20 17:43:12 +06:00
Sergey Lipskiy
80c954e5cc Move modify_vtx transformations to vertex shader.
Fixed Jeremy McGrath Supercross 2000: missing jauge line in menu #274
This game sets coordinates of lines vertices via modify_vtx.
modify_vtx set screen coordinates for the vertex.
Screen coordinates must be converted back to normalized device coordinates (NDC)
to apply viewport transformation. Unfortunately, the screen coordinates set are out of current viewport
and just clipped after transformation to NDC coordinates and viewport transformation.
Solution: use fullscreen viewport for modified vertex coordinates and
transform coordinates according to this viewport.
2016-03-19 14:02:57 +06:00
Sergey Lipskiy
7549e04157 Move calculations from drawLLETriangle to vertex shader. 2016-03-19 14:02:49 +06:00
Sergey Lipskiy
24885907d8 Add hack_ZeldaCamera to fix camera in Zelda MM, #577
The game copies current frame buffer to the area, which initially allocated for depth buffer.
Game read camera data from that area, not from normal frame buffer.
That's why 'copy color buffer to RDRAM' option does not help there.
Special code needed to process that. Looks ugly, but works.
2015-09-27 10:10:05 +06:00
Sergey Lipskiy
a3f9b43b4a Disable _copyDepthBuffer() for GLES2 only. 2015-09-26 22:36:25 +06:00
Sergey Lipskiy
27c4cccd81 Code refactor in _copyDepthBuffer(). 2015-09-26 22:13:49 +06:00
Sergey Lipskiy
4a75d4d357 Add hack to fix both mario 64 and mario kart 64 background (blue sky) with widescreen hack enable.
Author: Gillou68310
2015-06-26 22:06:06 +06:00
Sergey Lipskiy
2525b86f49 Implement "widescreen hack". 2015-05-13 10:21:43 +06:00
Sergey Lipskiy
52d68d1389 Move all sources to src folder. 2015-05-13 10:21:32 +06:00