22726e4d |
1 | /****************************************************************************** |
2 | * Arachnoid Graphics Plugin for Mupen64Plus |
3 | * http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/ |
4 | * |
5 | * Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson |
6 | * |
7 | * This program is free software; you can redistribute it and/or |
8 | * modify it under the terms of the GNU General Public License |
9 | * as published by the Free Software Foundation; either version 2 |
10 | * of the License, or (at your option) any later version. |
11 | * |
12 | * This program is distributed in the hope that it will be useful, |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * GNU General Public License for more details. |
16 | * |
17 | * You should have received a copy of the GNU General Public License |
18 | * along with this program; if not, write to the Free Software |
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
20 | *****************************************************************************/ |
21 | |
22 | #ifndef UCODE_5_H_ |
23 | #define UCODE_5_H_ |
24 | |
25 | //Includes |
26 | #include "UCodeDefs.h" |
27 | |
28 | //Forward declaration |
29 | class GBI; |
30 | class RSP; |
31 | class RDP; |
32 | class Memory; |
33 | class DisplayListParser; |
34 | |
35 | #define F3DEX2_MOVEMEM 0xDC |
36 | #define F3DEX2_MOVEWORD 0xDB |
37 | |
38 | //***************************************************************************** |
39 | //! UCode5 (aka F3DEX2) |
40 | //! Microcode used for Zelda and newer games |
41 | //***************************************************************************** |
42 | class UCode5 |
43 | { |
44 | public: |
45 | |
46 | // Constructor / Destructor |
47 | UCode5(); |
48 | ~UCode5(); |
49 | |
50 | static void initialize(GBI* gbi, RSP* rsp, RDP* rdp, Memory* memory, DisplayListParser* dlp); |
51 | static void initializeGBI(); |
52 | |
53 | //Matrices |
54 | static void F3DEX2_Mtx( MicrocodeArgument* ucode ); |
55 | static void F3DEX2_PopMtx( MicrocodeArgument* ucode ); |
56 | |
57 | //Textures |
58 | static void F3DEX2_Texture( MicrocodeArgument* ucode ); |
59 | |
60 | //Vertices |
61 | static void F3DEX2_Vtx( MicrocodeArgument* ucode ); |
62 | static void F3DEX2_Tri1( MicrocodeArgument* ucode ); |
63 | static void F3DEX2_Quad( MicrocodeArgument* ucode ); |
64 | static void F3DEX2_Line3D( MicrocodeArgument* ucode ); |
65 | |
66 | //Misc |
67 | static void F3DEX2_MoveMem( MicrocodeArgument* ucode ); |
68 | static void F3DEX2_MoveWord( MicrocodeArgument* ucode ); |
69 | static void F3DEX2_GeometryMode( MicrocodeArgument* ucode ); |
70 | static void F3DEX2_SetOtherMode_H( MicrocodeArgument* ucode ); |
71 | static void F3DEX2_SetOtherMode_L( MicrocodeArgument* ucode ); |
72 | |
73 | //Other |
74 | static void F3DEX2_DMAIO( MicrocodeArgument* ucode ); |
75 | static void F3DEX2_Special_1( MicrocodeArgument* ucode ); |
76 | static void F3DEX2_Special_2( MicrocodeArgument* ucode ); |
77 | static void F3DEX2_Special_3( MicrocodeArgument* ucode ); |
78 | static void F3DEX2_Reserved1( MicrocodeArgument* ucode ); |
79 | |
80 | private: |
81 | |
82 | static GBI* m_gbi; //!< Graphics Binary Interface |
83 | static RSP* m_rsp; //!< Pointer to Reality Signal Processor |
84 | static RDP* m_rdp; //!< Pointer to Reality Drawing Processor |
85 | static Memory* m_memory; //!< Pointer accessing memory like RDRAM and Texture Memory |
86 | static DisplayListParser* m_displayListParser; |
87 | |
88 | }; |
89 | |
90 | #endif |