Merge branch 'master' of https://github.com/pret/pokeemerald into EXPandFollow

This commit is contained in:
Suppai_Neko committed 2023-04-13 19:00:09 -07:00
commit 626c3240fa
8 files changed
+33 -46

No files matched your search

+3 -3
View File
@@ -36,7 +36,7 @@ static u32 GetGlyphWidth_Narrow(u16, bool32);
static u32 GetGlyphWidth_SmallNarrow(u16, bool32); static u32 GetGlyphWidth_SmallNarrow(u16, bool32);
static EWRAM_DATA struct TextPrinter sTempTextPrinter = {0}; static EWRAM_DATA struct TextPrinter sTempTextPrinter = {0};
static EWRAM_DATA struct TextPrinter sTextPrinters[NUM_TEXT_PRINTERS] = {0}; static EWRAM_DATA struct TextPrinter sTextPrinters[WINDOWS_MAX] = {0};
static u16 sFontHalfRowLookupTable[0x51]; static u16 sFontHalfRowLookupTable[0x51];
static u16 sLastTextBgColor; static u16 sLastTextBgColor;
@@ -244,7 +244,7 @@ static void SetFontsPointer(const struct FontInfo *fonts)
void DeactivateAllTextPrinters(void) void DeactivateAllTextPrinters(void)
{ {
int printer; int printer;
for (printer = 0; printer < NUM_TEXT_PRINTERS; ++printer) for (printer = 0; printer < WINDOWS_MAX; ++printer)
sTextPrinters[printer].active = FALSE; sTextPrinters[printer].active = FALSE;
} }
@@ -322,7 +322,7 @@ void RunTextPrinters(void)
if (!gDisableTextPrinters) if (!gDisableTextPrinters)
{ {
for (i = 0; i < NUM_TEXT_PRINTERS; ++i) for (i = 0; i < WINDOWS_MAX; ++i)
{ {
if (sTextPrinters[i].active) if (sTextPrinters[i].active)
{ {
-2
View File
@@ -3,8 +3,6 @@
#include "characters.h" #include "characters.h"
#define NUM_TEXT_PRINTERS 32
// Given as a text speed when all the text should be // Given as a text speed when all the text should be
// loaded at once but not copied to vram yet. // loaded at once but not copied to vram yet.
#define TEXT_SKIP_DRAW 0xFF #define TEXT_SKIP_DRAW 0xFF
-2
View File
@@ -9,8 +9,6 @@ u8 gTransparentTileNumber;
void *gWindowBgTilemapBuffers[NUM_BACKGROUNDS]; void *gWindowBgTilemapBuffers[NUM_BACKGROUNDS];
extern u32 gWindowTileAutoAllocEnabled; extern u32 gWindowTileAutoAllocEnabled;
#define WINDOWS_MAX 32
EWRAM_DATA struct Window gWindows[WINDOWS_MAX] = {0}; EWRAM_DATA struct Window gWindows[WINDOWS_MAX] = {0};
EWRAM_DATA static struct Window* sWindowPtr = NULL; EWRAM_DATA static struct Window* sWindowPtr = NULL;
EWRAM_DATA static u16 sWindowSize = 0; EWRAM_DATA static u16 sWindowSize = 0;
+2
View File
@@ -1,6 +1,8 @@
#ifndef GUARD_WINDOW_H #ifndef GUARD_WINDOW_H
#define GUARD_WINDOW_H #define GUARD_WINDOW_H
#define WINDOWS_MAX 32
#define PIXEL_FILL(num) ((num) | ((num) << 4)) #define PIXEL_FILL(num) ((num) | ((num) << 4))
enum { enum {
File renamed without changes.
BIN
View File
Binary file not shown.
+27 -38
View File
@@ -27,9 +27,11 @@
#define STATE_END 0xFF #define STATE_END 0xFF
#define TAG_CABLE_CAR 1 enum {
#define TAG_DOOR 2 TAG_CABLE_CAR = 1,
#define TAG_CABLE 3 TAG_DOOR,
TAG_CABLE,
};
struct CableCar struct CableCar
{ {
@@ -62,8 +64,8 @@ struct CableCar
u16 *groundTilemap; u16 *groundTilemap;
u16 *treesTilemap; u16 *treesTilemap;
u16 *bgMountainsTilemap; u16 *bgMountainsTilemap;
const u16 *pylonHookTilemapEntries; const u16 *pylonTopTilemap;
u8 *pylonStemTilemap; u16 *pylonPoleTilemap;
}; };
static EWRAM_DATA struct CableCar *sCableCar = NULL; static EWRAM_DATA struct CableCar *sCableCar = NULL;
@@ -129,24 +131,11 @@ static const struct BgTemplate sBgTemplates[4] = {
}, },
}; };
static const u8 sGround_Tilemap[] = INCBIN_U8("graphics/cable_car/ground.bin.lz"); static const u16 sGround_Tilemap[] = INCBIN_U16("graphics/cable_car/ground.bin.lz");
static const u8 sTrees_Tilemap[] = INCBIN_U8("graphics/cable_car/trees.bin.lz"); static const u16 sTrees_Tilemap[] = INCBIN_U16("graphics/cable_car/trees.bin.lz");
static const u8 sBgMountains_Tilemap[] = INCBIN_U8("graphics/cable_car/bg_mountains.bin.lz"); static const u16 sBgMountains_Tilemap[] = INCBIN_U16("graphics/cable_car/bg_mountains.bin.lz");
static const u16 sPylonTop_Tilemap[] = INCBIN_U16("graphics/cable_car/pylon_top.bin");
static const u16 sPylonHook_TilemapEntries[] = { static const u16 sPylonPole_Tilemap[] = INCBIN_U16("graphics/cable_car/pylon_pole.bin.lz");
0x3000,
0x3001,
0x3002,
0x3003,
0x3004,
0x3005,
0x3006,
0x3007,
0x3008,
0x3009,
};
static const u8 sPylonStems_Tilemap[] = INCBIN_U8("graphics/cable_car/pylons.bin.lz");
static const struct CompressedSpriteSheet sSpriteSheets[] = { static const struct CompressedSpriteSheet sSpriteSheets[] = {
{ gCableCar_Gfx, 0x800, TAG_CABLE_CAR }, { gCableCar_Gfx, 0x800, TAG_CABLE_CAR },
@@ -299,8 +288,8 @@ static void CB2_LoadCableCar(void)
sCableCar->groundTilemap = malloc_and_decompress(sGround_Tilemap, &sizeOut); sCableCar->groundTilemap = malloc_and_decompress(sGround_Tilemap, &sizeOut);
sCableCar->treesTilemap = malloc_and_decompress(sTrees_Tilemap, &sizeOut); sCableCar->treesTilemap = malloc_and_decompress(sTrees_Tilemap, &sizeOut);
sCableCar->bgMountainsTilemap = malloc_and_decompress(sBgMountains_Tilemap, &sizeOut); sCableCar->bgMountainsTilemap = malloc_and_decompress(sBgMountains_Tilemap, &sizeOut);
sCableCar->pylonStemTilemap = malloc_and_decompress(sPylonStems_Tilemap, &sizeOut); sCableCar->pylonPoleTilemap = malloc_and_decompress(sPylonPole_Tilemap, &sizeOut);
sCableCar->pylonHookTilemapEntries = sPylonHook_TilemapEntries; sCableCar->pylonTopTilemap = sPylonTop_Tilemap;
DecompressAndCopyTileDataToVram(0, gCableCarBg_Gfx, 0, 0, 0); DecompressAndCopyTileDataToVram(0, gCableCarBg_Gfx, 0, 0, 0);
gMain.state++; gMain.state++;
break; break;
@@ -335,8 +324,8 @@ static void CB2_LoadCableCar(void)
case 6: case 6:
CopyToBgTilemapBufferRect_ChangePalette(1, sCableCar->treesTilemap, 0, 17, 32, 15, 17); CopyToBgTilemapBufferRect_ChangePalette(1, sCableCar->treesTilemap, 0, 17, 32, 15, 17);
CopyToBgTilemapBufferRect_ChangePalette(2, sCableCar->bgMountainsTilemap, 0, 0, 30, 20, 17); CopyToBgTilemapBufferRect_ChangePalette(2, sCableCar->bgMountainsTilemap, 0, 0, 30, 20, 17);
CopyToBgTilemapBufferRect_ChangePalette(3, sCableCar->pylonHookTilemapEntries, 0, 0, 5, 2, 17); CopyToBgTilemapBufferRect_ChangePalette(3, sCableCar->pylonTopTilemap, 0, 0, 5, 2, 17);
CopyToBgTilemapBufferRect_ChangePalette(3, sCableCar->pylonStemTilemap, 0, 2, 2, 20, 17); CopyToBgTilemapBufferRect_ChangePalette(3, sCableCar->pylonPoleTilemap, 0, 2, 2, 20, 17);
gMain.state++; gMain.state++;
break; break;
case 7: case 7:
@@ -404,8 +393,8 @@ static void CB2_EndCableCar(void)
UnsetBgTilemapBuffer(2); UnsetBgTilemapBuffer(2);
UnsetBgTilemapBuffer(3); UnsetBgTilemapBuffer(3);
ResetBgsAndClearDma3BusyFlags(0); ResetBgsAndClearDma3BusyFlags(0);
sCableCar->pylonHookTilemapEntries = NULL; sCableCar->pylonTopTilemap = NULL;
FREE_AND_SET_NULL(sCableCar->pylonStemTilemap); FREE_AND_SET_NULL(sCableCar->pylonPoleTilemap);
FREE_AND_SET_NULL(sCableCar->bgMountainsTilemap); FREE_AND_SET_NULL(sCableCar->bgMountainsTilemap);
FREE_AND_SET_NULL(sCableCar->treesTilemap); FREE_AND_SET_NULL(sCableCar->treesTilemap);
FREE_AND_SET_NULL(sCableCar->groundTilemap); FREE_AND_SET_NULL(sCableCar->groundTilemap);
@@ -514,8 +503,8 @@ static void Task_AnimateBgGoingUp(u8 taskId)
FillBgTilemapBufferRect(3, 0, 2, 0, 1, 2, 17); FillBgTilemapBufferRect(3, 0, 2, 0, 1, 2, 17);
break; break;
case 16: case 16:
CopyToBgTilemapBufferRect_ChangePalette(3, sCableCar->pylonHookTilemapEntries, 0, 0, 5, 2, 17); CopyToBgTilemapBufferRect_ChangePalette(3, sCableCar->pylonTopTilemap, 0, 0, 5, 2, 17);
CopyToBgTilemapBufferRect_ChangePalette(3, sCableCar->pylonStemTilemap, 0, 2, 2, 30, 17); CopyToBgTilemapBufferRect_ChangePalette(3, sCableCar->pylonPoleTilemap, 0, 2, 2, 30, 17);
sCableCar->bg3VerticalOffset = 64; sCableCar->bg3VerticalOffset = 64;
break; break;
} }
@@ -542,7 +531,7 @@ static void Task_AnimateBgGoingDown(u8 taskId)
switch (sCableCar->bg3HorizontalOffset) switch (sCableCar->bg3HorizontalOffset)
{ {
case 176: case 176:
CopyToBgTilemapBufferRect_ChangePalette(3, sCableCar->pylonStemTilemap, 0, 2, 2, 30, 17); CopyToBgTilemapBufferRect_ChangePalette(3, sCableCar->pylonPoleTilemap, 0, 2, 2, 30, 17);
break; break;
case 16: case 16:
FillBgTilemapBufferRect(3, 0, 2, 0, 3, 2, 17); FillBgTilemapBufferRect(3, 0, 2, 0, 3, 2, 17);
@@ -550,14 +539,14 @@ static void Task_AnimateBgGoingDown(u8 taskId)
sCableCar->bg3VerticalOffset = 192; sCableCar->bg3VerticalOffset = 192;
break; break;
case 32: case 32:
FillBgTilemapBufferRect(3, sCableCar->pylonHookTilemapEntries[2], 2, 0, 1, 1, 17); FillBgTilemapBufferRect(3, sCableCar->pylonTopTilemap[2], 2, 0, 1, 1, 17);
FillBgTilemapBufferRect(3, sCableCar->pylonHookTilemapEntries[3], 3, 0, 1, 1, 17); FillBgTilemapBufferRect(3, sCableCar->pylonTopTilemap[3], 3, 0, 1, 1, 17);
FillBgTilemapBufferRect(3, sCableCar->pylonHookTilemapEntries[7], 2, 1, 1, 1, 17); FillBgTilemapBufferRect(3, sCableCar->pylonTopTilemap[7], 2, 1, 1, 1, 17);
FillBgTilemapBufferRect(3, sCableCar->pylonHookTilemapEntries[8], 3, 1, 1, 1, 17); FillBgTilemapBufferRect(3, sCableCar->pylonTopTilemap[8], 3, 1, 1, 1, 17);
break; break;
case 40: case 40:
FillBgTilemapBufferRect(3, sCableCar->pylonHookTilemapEntries[4], 4, 0, 1, 1, 17); FillBgTilemapBufferRect(3, sCableCar->pylonTopTilemap[4], 4, 0, 1, 1, 17);
FillBgTilemapBufferRect(3, sCableCar->pylonHookTilemapEntries[9], 4, 1, 1, 1, 17); FillBgTilemapBufferRect(3, sCableCar->pylonTopTilemap[9], 4, 1, 1, 1, 17);
break; break;
} }
} }
+1 -1
View File
@@ -5500,7 +5500,7 @@ static void ContestBG_FillBoxWithTile(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 wi
static bool32 Contest_RunTextPrinters(void) static bool32 Contest_RunTextPrinters(void)
{ {
RunTextPrinters(); RunTextPrinters();
return IsTextPrinterActive(4); return IsTextPrinterActive(WIN_GENERAL_TEXT);
} }
static void Contest_SetBgCopyFlags(u32 flagIndex) static void Contest_SetBgCopyFlags(u32 flagIndex)