| 920 | // |
| 921 | //***************************************************************************** |
| 922 | void DLParser_TexRect( MicroCodeCommand command ) |
| 923 | { |
| 924 | MicroCodeCommand command2; |
| 925 | MicroCodeCommand command3; |
| 926 | |
| 927 | DLParser_FetchNextCommand( &command2 ); |
| 928 | DLParser_FetchNextCommand( &command3 ); |
| 929 | |
| 930 | RDP_TexRect tex_rect; |
| 931 | tex_rect.cmd0 = command.inst.cmd0; |
| 932 | tex_rect.cmd1 = command.inst.cmd1; |
| 933 | tex_rect.cmd2 = command2.inst.cmd1; |
| 934 | tex_rect.cmd3 = command3.inst.cmd1; |
| 935 | |
| 936 | #ifdef DAEDALUS_DEBUG_DISPLAYLIST |
| 937 | DAEDALUS_DL_ASSERT(gRDPOtherMode.cycle_type != CYCLE_COPY || tex_rect.dsdx == (4<<10), "Expecting dsdx of 4<<10 in copy mode, got %d", tex_rect.dsdx); |
| 938 | #endif |
| 939 | // NB: In FILL and COPY mode, rectangles are scissored to the nearest four pixel boundary. |
| 940 | // This isn't currently handled, but I don't know of any games that depend on it. |
| 941 | |
| 942 | //Keep integers for as long as possible //Corn |
| 943 | |
| 944 | // X for upper left corner should be less than X for lower right corner else skip rendering it, seems to happen in Rayman 2 and Star Soldier |
| 945 | //if( tex_rect.x0 >= tex_rect.x1 ) |
| 946 | |
| 947 | // Hack for Banjo Tooie shadow |
| 948 | if (g_ROM.GameHacks == BANJO_TOOIE && gRDPOtherMode.L == 0x00504241) |
| 949 | { |
| 950 | return; |
| 951 | } |
| 952 | |
| 953 | // Fixes black box in SSB when moving far way from the screen and offscreen in Conker |
| 954 | if (g_DI.Address == g_CI.Address || g_CI.Format != G_IM_FMT_RGBA) |
| 955 | { |
| 956 | #ifdef DAEDALUS_DEBUG_DISPLAYLIST |
| 957 | DL_PF(" Ignoring Texrect"); |
| 958 | #endif |
| 959 | return; |
| 960 | } |
| 961 | |
| 962 | // Removes offscreen texrect, also fixes several glitches like in John Romero's Daikatana |
| 963 | if( tex_rect.x0 >= (scissors.right<<2) || |
| 964 | tex_rect.y0 >= (scissors.bottom<<2) || |
| 965 | tex_rect.x1 < (scissors.left<<2) || |
| 966 | tex_rect.y1 < (scissors.top<<2) ) |
| 967 | { |
| 968 | #ifdef DAEDALUS_DEBUG_DISPLAYLIST |
| 969 | ++gNumRectsClipped; |
| 970 | #endif |
| 971 | return; |
| 972 | }; |
| 973 | |
| 974 | s16 rect_s0 {(s16)tex_rect.s}; |
| 975 | s16 rect_t0 {(s16)tex_rect.t}; |
| 976 | |
| 977 | s32 rect_dsdx {tex_rect.dsdx}; |
| 978 | s32 rect_dtdy {tex_rect.dtdy}; |
| 979 |
no test coverage detected