Skip to content

Commit 7e934b1

Browse files
committed
2 parents 8568018 + 58d7a5b commit 7e934b1

File tree

7 files changed

+98
-6
lines changed

7 files changed

+98
-6
lines changed

configure.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,23 @@
235235
"-rostr"
236236
]
237237

238+
cflags_rat_base_libgc = [
239+
*cflags_base,
240+
"-pool off",
241+
"-schedule on",
242+
"-str reuse,pool,readonly",
243+
"-fp fmadd",
244+
"-use_lmw_stmw on",
245+
'-pragma "cpp_extensions on"',
246+
"-sym on",
247+
"-inline on",
248+
"-opt level=4, peep, space",
249+
"-i src/Engine/includes",
250+
"-i src/LibGC/includes",
251+
"-i src/Rat/includes",
252+
"-i src/sdk/includes",
253+
"-O4,p"
254+
]
238255
# Debug flags
239256
if args.debug:
240257
# Or -sym dwarf-2 for Wii compilers

src/Engine/Bitmap_Z.cpp

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#include "Bitmap_Z.h"
2+
#include "Assert_Z.h"
3+
extern void Z_FreeContiguous(void* ptr);
24

35
Bitmap_Z::Bitmap_Z()
46
{
@@ -31,4 +33,63 @@ void Bitmap_Z::Init() {
3133
m_PrecalculatedSize = 0;
3234
m_PalFormat = PAL_8888;
3335
}
34-
36+
37+
void Bitmap_Z::Invalidate() {
38+
//stub
39+
};
40+
41+
void Bitmap_Z::Reset() {
42+
Invalidate();
43+
if (this->m_Datas) {
44+
Z_FreeContiguous(this->m_Datas);
45+
}
46+
this->m_Datas = 0;
47+
48+
if (this->m_Palette) {
49+
delete this->m_Palette;
50+
}
51+
this->m_Palette = 0;
52+
53+
Init();
54+
}
55+
56+
void Bitmap_Z::InitBmap(S32 m_Width, S32 m_Height, U8 m_Format, U8* m_Palette, U8 m_Datas)
57+
{
58+
//stub
59+
}
60+
61+
//far from matching
62+
Float Bitmap_Z::GetBytePerPixel() {
63+
Float result; // st7
64+
65+
switch ( this->m_Format )
66+
{
67+
case BM_4:
68+
result = 0.5;
69+
break;
70+
case BM_8:
71+
case BM_I4A4:
72+
result = 1.0;
73+
break;
74+
case BM_5551:
75+
case BM_565:
76+
case BM_4444:
77+
case BM_1555:
78+
result = 2.0;
79+
break;
80+
case BM_8888:
81+
result = 4.0;
82+
break;
83+
case BM_888:
84+
result = 3.0;
85+
break;
86+
case BM_CMPR:
87+
result = 0.0;
88+
break;
89+
default:
90+
ExceptionFonc_Z("FALSE", "Bitmap_Z.cpp", 117, "Bitmap_Z::GetBytePerPixel", 0, 0, 0, 0, 0, 0);
91+
result = 0.0;
92+
break;
93+
}
94+
return result;
95+
}

src/Engine/Fonts_Z.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#include "Fonts_Z.h"
2+
#include "Main_Z.h"
3+
4+
extern Globals gData;
25

36
S32 GetUTF8CharBytes(const S8* a1)
47
{

src/Engine/includes/BaseObject_Z.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class BaseObject_Z
99
Name_Z m_Name;
1010
BaseObject_ZHdl m_Handle;
1111
BaseObject_Z();
12-
virtual void Init();
12+
virtual void Init() {};
1313
~BaseObject_Z();
1414
virtual void Load(void* a1);
1515
virtual void EndLoad();

src/Engine/includes/Bitmap_Z.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ class Bitmap_Z : public ResourceObject_Z
4747
virtual void Load(void* a1);
4848
virtual void Clean();
4949
void InitBmap(S32 m_Width, S32 m_Height, U8 m_Format, U8* m_Palette, U8 m_Datas);
50-
void EnableFlag(U8 i_Flag) {m_Flag|=i_Flag;}
50+
void EnableFlag(S16 i_Flag) {m_Flag|=i_Flag;}
5151
void Reset();
52+
void Invalidate();
53+
Float GetBytePerPixel();
5254
private:
5355
void* m_Datas;
5456
void* m_Palette;
@@ -62,8 +64,7 @@ class Bitmap_Z : public ResourceObject_Z
6264
U8 m_Transp;
6365
U8 m_MipmapCount;
6466
U8 m_UnkU8_0x31; // Always set to 4
65-
U8 m_Flag;
66-
U8 m_DontDelete;
67+
S16 m_Flag;
6768
};
6869

6970
#endif

src/Engine/includes/Fonts_Z.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,13 @@
55
S32 GetUTF8CharBytes(const S8* a1);
66
U32 GetUTF8CharCode(const S8* a1);
77

8+
class Fonts_Z
9+
{
10+
virtual ~Fonts_Z();
11+
virtual void Load(void* a1);
12+
virtual void EndLoad();
13+
virtual void AfterEndLoad();
14+
virtual void MarkHandles();
15+
};
16+
817
#endif

src/Engine/includes/Main_Z.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ class Globals {
1313
virtual U32 GetMgrSize(Name_Z *l_Name, S32 *a1, S32 *a2);
1414
virtual void Minimize();
1515
virtual void GetDate();
16+
void InitTime();
1617

1718
U8 m_Pad_0x0[0x4];
1819
GCConsole_Z* Cons;
1920
U8 m_Pad_0xc[0x4]; // GCRenderer_Z
2021
HandleManager_Z* ClassMgr; // Actually is ClassManager_Z
2122
U8 m_Pad_0x14[0x7CC];
2223

23-
Globals() {
24+
inline Globals() {
2425
m_Pad_0x14[137] = 0;
2526
m_Pad_0x14[393] = 0;
2627
m_Pad_0x14[649] = 0;

0 commit comments

Comments
 (0)