1 /******************************************************************************
2 * Arachnoid Graphics Plugin for Mupen64Plus
3 * http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
5 * Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
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.
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.
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 *****************************************************************************/
22 #ifndef ROM_DETECTOR_H_
23 #define ROM_DETECTOR_H_
27 //*****************************************************************************
29 //! Stored in each rom, gives us information about rom.
30 //*****************************************************************************
31 //#pragma pack(push, 1)
34 unsigned char x1, x2, x3, x4;
35 unsigned int clockRate;
36 unsigned int bootAddressOffset;
38 unsigned int CRC1; //!< Hash value
39 unsigned int CRC2; //!< Hash value
40 unsigned long long unknown0;
41 char romName[20]; //!< Name of rom, used to identify what rom it is.
42 unsigned int unknown1;
43 unsigned short unknown2;
44 unsigned char unknown3;
45 unsigned char nManufacturer;
46 unsigned short cartID;
47 signed char countryID;
48 unsigned char unknown4;
51 //*****************************************************************************
53 //! What kind of combiner to use
54 //*****************************************************************************
62 //*****************************************************************************
64 //! When to clear screen
65 //*****************************************************************************
69 CT_AFTER_ONE_DISPLAY_LIST,
70 CT_AFTER_TWO_DISPLAY_LIST,
71 CT_AFTER_THREE_DISPLAY_LIST,
74 //*****************************************************************************
76 //! Class for detecting which rom it is and settings states after that.
77 //*****************************************************************************
86 static ROMDetector& getSingleton()
88 static ROMDetector instance;
93 void initialize(unsigned char* romHeader);
95 const char* getRomName() { return m_romHeader.romName; }
100 //! @return ID of the current running rom (game).
101 N64_ROM_ID getRomID() { return m_currentRomID; }
103 //! Get Combiner Type
104 //! @return ID of the combiner to use.
105 COMBINER_TYPE getCombinerType() { return m_combinerType; }
108 //! @return when to clear screen.
109 CLEAR_TYPE getClearType() { return m_clearType; }
111 //! Get Ignore Fill Rects
112 //! @return True if we should ignore fill rect instructions.
113 bool getIgnoreFillRects() { return m_ignoreFillRects; }
115 //! Get Disable Face Culling
116 //! @return True if we never should enable Face Culling.
117 bool getDisableFaceCulling() { return m_forceDisableFaceCulling; }
119 //! Get Use Multi Texturing
120 //! @return True if we should use multiple textures when rendering
121 bool getUseMultiTexture() { return m_useMultiTexture; }
123 //! Get Use Secondary Color
124 //! @return True if we should secondary color when rendering
125 bool getUseSecondaryColor() { return m_useSecondaryColor; }
133 N64_ROM_ID _getRomID(char romName[20]);
137 ROMHeader m_romHeader; //!< Rom header with information about rom
139 N64_ROM_ID m_currentRomID; //!< What rom is running
140 COMBINER_TYPE m_combinerType; //!< What combiner to use
141 CLEAR_TYPE m_clearType; //!< When to clear screen
142 bool m_ignoreFillRects; //!< Ignore fill rectangles?
143 bool m_forceDisableFaceCulling; //!< Disable face culling?
144 bool m_useMultiTexture; //!< Use multitextureing?
145 bool m_useSecondaryColor; //!< Use secondary color?