diff --git a/Config/Glide64.rdb b/Config/Glide64.rdb index fd7684bd3..af42a9bc6 100644 --- a/Config/Glide64.rdb +++ b/Config/Glide64.rdb @@ -15,6 +15,9 @@ // 6 - S2DEX 1.XX (Yoshi's Story - SimCity 2000) // 7 - RSP SW PD (Perfect Dark) // 8 - F3DEXBG 2.08 (Conker's Bad Fur Day) +// 9 - zSort +// 10 - F3DTEXA (64 de Hakken) +// 21 - Turbo 3D [ucode] 006bd77f=0 03044b84=2 @@ -158,7 +161,7 @@ e89c2b92=1 e9231df2=1 ec040469=1 ee47381b=1 -ef54ee35=1 +ef54ee35=10 f9893f70=21 fb816260=1 ff372492=21 diff --git a/Source/Project64-video/F3DTEXA.cpp b/Source/Project64-video/F3DTEXA.cpp new file mode 100644 index 000000000..47ea473ab --- /dev/null +++ b/Source/Project64-video/F3DTEXA.cpp @@ -0,0 +1,58 @@ +/*************************************************************************** +* * +* Project64-video - A Nintendo 64 gfx plugin. * +* http://www.pj64-emu.com/ * +* Copyright (C) 2017 Project64. All rights reserved. * +* Copyright (C) 2003-2009 Sergey 'Gonetz' Lipski * +* Copyright (C) 2002 Dave2001 * +* * +* License: * +* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html * +* version 2 of the License, or (at your option) any later version. * +* * +****************************************************************************/ +#pragma once +#include +#include +#include "F3DTEXA.h" + +void f3dttexa_loadtex() +{ + uint32_t cmd0, cmd1; + cmd0 = rdp.cmd0; + cmd1 = rdp.cmd1; + + rdp.cmd0 = 0x3d100000; + rdp_settextureimage(); + + rdp.cmd0 = 0x35100000; + rdp.cmd1 = 0x07000000; + rdp_settile(); + + rdp.cmd0 = 0x33000000; + rdp.cmd1 = 0x27000000 | (cmd0 & 0x00FFFFFF); + rdp_loadblock(); + + rdp.cmd0 = cmd0; //restore to original values + rdp.cmd1 = cmd1; +} + +void f3dttexa_settilesize() +{ + uint32_t cmd0, cmd1, firstHalf; + cmd0 = rdp.cmd0; + cmd1 = rdp.cmd1; + + firstHalf = (cmd1 & 0xFF000000) >> 15; + + rdp.cmd0 = 0x35400000 | firstHalf; + rdp.cmd1 = cmd0 & 0x00FFFFFF; + rdp_settile(); + + rdp.cmd0 = 0x32000000; + rdp.cmd1 = cmd1 & 0x00FFFFFF; + rdp_settilesize(); + + rdp.cmd0 = cmd0; //restore to original values + rdp.cmd1 = cmd1; +} \ No newline at end of file diff --git a/Source/Project64-video/F3DTEXA.h b/Source/Project64-video/F3DTEXA.h new file mode 100644 index 000000000..3ae3dae8e --- /dev/null +++ b/Source/Project64-video/F3DTEXA.h @@ -0,0 +1,17 @@ +/*************************************************************************** +* * +* Project64-video - A Nintendo 64 gfx plugin. * +* http://www.pj64-emu.com/ * +* Copyright (C) 2017 Project64. All rights reserved. * +* Copyright (C) 2003-2009 Sergey 'Gonetz' Lipski * +* Copyright (C) 2002 Dave2001 * +* * +* License: * +* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html * +* version 2 of the License, or (at your option) any later version. * +* * +****************************************************************************/ +#pragma once + +void f3dttexa_loadtex(); +void f3dttexa_settilesize(); \ No newline at end of file diff --git a/Source/Project64-video/Project64-video.vcxproj b/Source/Project64-video/Project64-video.vcxproj index 7639f232e..1f7b5d833 100644 --- a/Source/Project64-video/Project64-video.vcxproj +++ b/Source/Project64-video/Project64-video.vcxproj @@ -47,6 +47,7 @@ + @@ -120,6 +121,7 @@ + true diff --git a/Source/Project64-video/Project64-video.vcxproj.filters b/Source/Project64-video/Project64-video.vcxproj.filters index c52622c6e..01797c857 100644 --- a/Source/Project64-video/Project64-video.vcxproj.filters +++ b/Source/Project64-video/Project64-video.vcxproj.filters @@ -160,6 +160,9 @@ Renderer + + ucode + @@ -275,6 +278,9 @@ Renderer + + ucode + diff --git a/Source/Project64-video/Settings.h b/Source/Project64-video/Settings.h index bb70aa581..bf9abe195 100644 --- a/Source/Project64-video/Settings.h +++ b/Source/Project64-video/Settings.h @@ -164,6 +164,7 @@ public: ucode_PerfectDark = 7, ucode_CBFD = 8, ucode_zSort = 9, + ucode_F3DTEXA = 10, ucode_Turbo3d = 21, }; diff --git a/Source/Project64-video/ucode.cpp b/Source/Project64-video/ucode.cpp index 718e05530..4e92f2fed 100644 --- a/Source/Project64-video/ucode.cpp +++ b/Source/Project64-video/ucode.cpp @@ -25,8 +25,9 @@ #include "ucode07.h" #include "ucode08.h" #include "ucode09.h" +#include "F3DTEXA.h" -rdp_instr gfx_instruction[10][256] = +rdp_instr gfx_instruction[11][256] = { { // uCode 0 - RSP SW 2.0X @@ -774,4 +775,81 @@ rdp_instr gfx_instruction[10][256] = rdp_setfogcolor, rdp_setblendcolor, rdp_setprimcolor, rdp_setenvcolor, rdp_setcombine, rdp_settextureimage, rdp_setdepthimage, rdp_setcolorimage }, + + { + // uCode 10 - F3DTEXA + // games: 64 de Hakken + // 00-3f + spnoop, uc0_matrix, rsp_reserved0, uc0_movemem, + uc1_vertex, rsp_reserved1, uc0_displaylist, rsp_reserved2, + rsp_reserved3, uc6_sprite2d, undef, undef, + undef, undef, undef, undef, + + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + // 40-7f: unused + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + // 80-bf + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, uc2_load_ucode, + + uc1_branch_z, uc2_quad, uc2_modifyvtx, rdphalf_2, + rdphalf_1, f3dttexa_loadtex, uc0_cleargeometrymode, uc0_setgeometrymode, + uc0_enddl, uc0_setothermode_l, uc0_setothermode_h, uc0_texture, + uc0_moveword, uc0_popmatrix, f3dttexa_settilesize, uc1_tri1, + // c0-ff: RDP commands + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + undef, undef, undef, undef, + + undef, undef, undef, undef, + rdp_texrect, rdp_texrect, rdp_loadsync, rdp_pipesync, + rdp_tilesync, rdp_fullsync, rdp_setkeygb, rdp_setkeyr, + rdp_setconvert, rdp_setscissor, rdp_setprimdepth, rdp_setothermode, + + rdp_loadtlut, undef, rdp_settilesize, rdp_loadblock, + rdp_loadtile, rdp_settile, rdp_fillrect, rdp_setfillcolor, + rdp_setfogcolor, rdp_setblendcolor, rdp_setprimcolor, rdp_setenvcolor, + rdp_setcombine, rdp_settextureimage, rdp_setdepthimage, rdp_setcolorimage + }, }; diff --git a/Source/Project64-video/ucode.h b/Source/Project64-video/ucode.h index daa01e804..cf49417e6 100644 --- a/Source/Project64-video/ucode.h +++ b/Source/Project64-video/ucode.h @@ -15,4 +15,4 @@ typedef void(*rdp_instr)(); -extern rdp_instr gfx_instruction[10][256]; \ No newline at end of file +extern rdp_instr gfx_instruction[11][256]; \ No newline at end of file