Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config/BW1W120/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3028,7 +3028,8 @@ Lionhead/LHLib/ver5.0/LHMem.cpp:
.text start:0x007E69D0 end:0x007E6A50

Lionhead/LHLib/ver5.0/LHScript.cpp:
.text start:0x007E72C0 end:0x007EA0B0
.text start:0x007E7260 end:0x007EA0B0
.data start:0x00C341C0 end:0x00C34DF0 align:4

Lionhead/LHLib/ver5.0/LHSpriteList.cpp:
.text start:0x007EE540 end:0x007EE6E0
Expand Down
242 changes: 198 additions & 44 deletions config/BW1W120/symbols.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@

# Tool versions
config.binutils_tag = "2.42-2"
config.dtk_tag = "v0.0.19"
config.dtk_tag = "v0.0.20"
config.objdiff_tag = "v3.7.2"
config.sjiswrap_tag = "v1.2.2"
config.wibo_tag = "1.1.0"
Expand Down Expand Up @@ -1299,7 +1299,7 @@ def LibObject(completed, archive, member, **options):
Object(NonMatching, "Lionhead/LHLib/ver5.0/LHText.cpp"),
Object(NonMatching, "Lionhead/LHLib/ver5.0/LHHeap2.cpp", extra_cflags=["/GX"]),
Object(NonMatching, "Lionhead/LHLib/ver5.0/LHMouse.cpp"),
Object(NonMatching, "Lionhead/LHLib/ver5.0/LHScript.cpp"),
Object(NonMatching, "Lionhead/LHLib/ver5.0/LHScript.cpp", extra_cflags=["/GX", "/Ob0"]),
Object(NonMatching, "Lionhead/LHLib/ver5.0/LHSpriteList.cpp"),
Object(NonMatching, "Lionhead/LHLib/ver5.0/LHConvert.cpp"),
Object(NonMatching, "Lionhead/LHLib/ver5.0/LHSprite.cpp"),
Expand Down
17 changes: 8 additions & 9 deletions src/Lionhead/LH3DLib/development/LHColor.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
#ifndef BW1_DECOMP_LH_COLOR_INCLUDED_H
#define BW1_DECOMP_LH_COLOR_INCLUDED_H

#include <assert.h> /* For static_assert */
#include <stdint.h> /* For uint8_t */
#include <assert.h>
#include <stdint.h>

// Memory order is B, G, R, A. Confirmed by LHScreen::Clear, which packs
// b | (g << 8) | (r << 16) into a 0x00RRGGBB DDBLTFX colour-fill value.
struct LHColor
{
uint8_t b; /* 0x0 */
uint8_t g; /* 0x1 */
uint8_t r; /* 0x2 */
uint8_t a; /* 0x3 */
uint8_t b;
uint8_t g;
uint8_t r;
uint8_t a;

void Set(uint8_t red, uint8_t green, uint8_t blue);
};
static_assert(sizeof(LHColor) == 0x4, "Data type is of wrong size");

#endif /* BW1_DECOMP_LH_COLOR_INCLUDED_H */
24 changes: 24 additions & 0 deletions src/Lionhead/LHLib/ver5.0/LHConvert.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
#ifndef BW1_DECOMP_LHCONVERT_INCLUDED_H
#define BW1_DECOMP_LHCONVERT_INCLUDED_H

#include <stdint.h>

#include "LHReturn.h"

struct FlicHeader;
struct LHColor;
struct LHSprite;
struct LHSpriteList;

// Image-to-sprite conversion. The global instance lives at 0xE85874.
// TODO: layout unknown (0x90 bytes); only ToSprites is declared so far.
class LHConvert
{
public:
uint8_t field_0x0[0x90];

// BW1W120 007efcf0 LHConvert::ToSprites(char*, LHSpriteList*, LHColor*, unsigned long, long*, FlicHeader*, unsigned long*)
LH_RETURN ToSprites(char* file_name, LHSpriteList* sprite_list, LHColor* colors, unsigned long flags, long* param_5,
FlicHeader* flic_header, unsigned long* param_7);
};

// BW1W120 007efb60 LHLoadABMP(char*, LHSprite*, unsigned long)
LH_RETURN LHLoadABMP(char* file_name, LHSprite* sprite, unsigned long param_3);

#endif /* BW1_DECOMP_LHCONVERT_INCLUDED_H */
11 changes: 6 additions & 5 deletions src/Lionhead/LHLib/ver5.0/LHDraw.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ struct LHRegion;

struct LHPixel16
{
uint16_t value; /* 0x0 */
uint16_t value;

// BW1W120 00449650 LHPixel16::Set(LHColor)
// Packs an LHColor into this pixel using the active LHScreen format.
void Set(LHColor color);
// BW1W120 00521a90 LHPixel16::Set(unsigned char, unsigned char, unsigned char)
void Set(uint8_t red, uint8_t green, uint8_t blue);
};

struct LHSprite
{
uint16_t Width; /* 0x0 */
uint16_t Height; /* 0x2 */
uint8_t* PixelData; /* 0x4 */
uint16_t Width;
uint16_t Height;
uint8_t* PixelData;
};

class LHDraw
Expand Down
14 changes: 14 additions & 0 deletions src/Lionhead/LHLib/ver5.0/LHReturn.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef BW1_DECOMP_LH_RETURN_INCLUDED_H
#define BW1_DECOMP_LH_RETURN_INCLUDED_H

// Generic Lionhead status code, returned throughout LHLib and LHMultiplayer.
// TODO: value 1 is unnamed (never observed); header filename is fabricated.
enum LH_RETURN
{
LH_OK = 0x0,
LH_FAIL = 0x2,
LH_ERROR = 0x3,
LH_NO_MEMORY = 0x4,
};

#endif /* BW1_DECOMP_LH_RETURN_INCLUDED_H */
12 changes: 0 additions & 12 deletions src/Lionhead/LHLib/ver5.0/LHScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1098,15 +1098,3 @@ int LHScreen::IsAppMinimized()
{
return g_appMinimized;
}

// BW1W120 007e8a20 LHScreen::Depth(void)
uint8_t LHScreen::Depth()
{
return depth;
}

// BW1W120 007e9df0 LHScreen::MaxDepth(void)
uint8_t LHScreen::MaxDepth()
{
return 32;
}
4 changes: 2 additions & 2 deletions src/Lionhead/LHLib/ver5.0/LHScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ struct LHScreen
// BW1W120 007ded50 LHScreen::IsAppMinimized(void)
int IsAppMinimized();
// BW1W120 007e8a20 LHScreen::Depth(void)
uint8_t Depth();
uint8_t Depth() { return depth; }
// BW1W120 007e9df0 LHScreen::MaxDepth(void)
uint8_t MaxDepth();
uint8_t MaxDepth() { return 32; }
};
static_assert(sizeof(LHScreen) == 0x1b4, "Data type is of wrong size");

Expand Down
Loading
Loading