-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #277 from lhearachel/graphics
Document palette.c and graphics.c
- Loading branch information
Showing
462 changed files
with
4,481 additions
and
4,740 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,4 @@ | ||
#ifndef POKEPLATINUM_CONSTANTS_PALETTE_H | ||
#define POKEPLATINUM_CONSTANTS_PALETTE_H | ||
|
||
enum PaletteBufferId { | ||
PLTTBUF_MAIN_BG = 0, | ||
PLTTBUF_SUB_BG, | ||
PLTTBUF_MAIN_OBJ, | ||
PLTTBUF_SUB_OBJ, | ||
PLTTBUF_EX_BEGIN, | ||
|
||
PLTTBUF_MAIN_EX_BG_0 = PLTTBUF_EX_BEGIN, | ||
PLTTBUF_MAIN_EX_BG_1, | ||
PLTTBUF_MAIN_EX_BG_2, | ||
PLTTBUF_MAIN_EX_BG_3, | ||
PLTTBUF_SUB_EX_BG_0, | ||
PLTTBUF_SUB_EX_BG_1, | ||
PLTTBUF_SUB_EX_BG_2, | ||
PLTTBUF_SUB_EX_BG_3, | ||
PLTTBUF_MAIN_EX_OBJ, | ||
PLTTBUF_SUB_EX_OBJ, | ||
|
||
PLTTBUF_MAX, | ||
}; | ||
|
||
#define PLTTBUF_MAIN_BG_F (1 << PLTTBUF_MAIN_BG) | ||
#define PLTTBUF_SUB_BG_F (1 << PLTTBUF_SUB_BG) | ||
#define PLTTBUF_MAIN_OBJ_F (1 << PLTTBUF_MAIN_OBJ) | ||
#define PLTTBUF_SUB_OBJ_F (1 << PLTTBUF_SUB_OBJ) | ||
#define PLTTBUF_MAIN_EX_BG_0_F (1 << PLTTBUF_MAIN_EX_BG_0) | ||
#define PLTTBUF_MAIN_EX_BG_1_F (1 << PLTTBUF_MAIN_EX_BG_1) | ||
#define PLTTBUF_MAIN_EX_BG_2_F (1 << PLTTBUF_MAIN_EX_BG_2) | ||
#define PLTTBUF_MAIN_EX_BG_3_F (1 << PLTTBUF_MAIN_EX_BG_3) | ||
#define PLTTBUF_SUB_EX_BG_0_F (1 << PLTTBUF_SUB_EX_BG_0) | ||
#define PLTTBUF_SUB_EX_BG_1_F (1 << PLTTBUF_SUB_EX_BG_1) | ||
#define PLTTBUF_SUB_EX_BG_2_F (1 << PLTTBUF_SUB_EX_BG_2) | ||
#define PLTTBUF_SUB_EX_BG_3_F (1 << PLTTBUF_SUB_EX_BG_3) | ||
#define PLTTBUF_MAIN_EX_OBJ_F (1 << PLTTBUF_MAIN_EX_OBJ) | ||
#define PLTTBUF_SUB_EX_OBJ_F (1 << PLTTBUF_SUB_EX_OBJ) | ||
#define PLTTBUF_ALL_F ((1 << PLTTBUF_MAX) - 1) | ||
|
||
enum PaletteSelector { | ||
PLTTSEL_TRANSPARENT, | ||
PLTTSEL_OPAQUE, | ||
PLTTSEL_BOTH, | ||
}; | ||
|
||
#endif // POKEPLATINUM_CONSTANTS_PALETTE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#ifndef POKEPLATINUM_GRAPHICS_H | ||
#define POKEPLATINUM_GRAPHICS_H | ||
|
||
#include <nnsys.h> | ||
|
||
#include "bg_window.h" | ||
#include "narc.h" | ||
|
||
enum PaletteLoadLocation { | ||
PAL_LOAD_MAIN_BG = 0, | ||
PAL_LOAD_MAIN_OBJ, | ||
PAL_LOAD_MAIN_BGEXT, | ||
PAL_LOAD_MAIN_OBJEXT, | ||
PAL_LOAD_SUB_BG, | ||
PAL_LOAD_SUB_OBJ, | ||
PAL_LOAD_SUB_BGEXT, | ||
PAL_LOAD_SUB_OBJEXT, | ||
}; | ||
|
||
enum ImageMappingLayout { | ||
IMAGE_MAPPING_LAYOUT_1D = 0, | ||
IMAGE_MAPPING_LAYOUT_2D, | ||
}; | ||
|
||
void *LoadCompressedMemberFromNARC(u32 narcID, u32 narcMemberIdx, u32 heapID); | ||
void *LoadMemberFromNARC(u32 narcID, u32 narcMemberIdx, BOOL compressed, u32 heapID, BOOL allocAtEnd); | ||
void *LoadMemberFromNARC_OutFileSize(u32 narcID, u32 narcMemberIdx, BOOL compressed, u32 heapID, BOOL allocAtEnd, u32 *fileSize); | ||
void *LoadMemberFromOpenNARC(NARC *narc, u32 narcMemberIdx, BOOL compressed, u32 heapID, BOOL allocAtEnd); | ||
void *LoadMemberFromOpenNARC_OutFileSize(NARC *narc, u32 narcMemberIdx, BOOL compressed, u32 heapID, BOOL allocAtEnd, u32 *fileSize); | ||
|
||
u32 Graphics_LoadTilesToBgLayer(u32 narcID, u32 narcMemberIdx, BgConfig *bgConfig, u32 bgLayer, u32 offset, u32 size, BOOL compressed, u32 heapID); | ||
void Graphics_LoadTilemapToBgLayer(u32 narcID, u32 narcMemberIdx, BgConfig *bgConfig, u32 bgLayer, u32 offset, u32 size, BOOL compressed, u32 heapID); | ||
void Graphics_LoadPalette(u32 narcID, u32 narcMemberIdx, enum PaletteLoadLocation loadLocation, u32 palOffset, u32 size, u32 heapID); | ||
void Graphics_LoadPaletteWithSrcOffset(u32 narcID, u32 narcMemberIdx, enum PaletteLoadLocation loadLocation, u32 srcOffset, u32 palOffset, u32 size, u32 heapID); | ||
u32 Graphics_LoadObjectTiles(u32 narcID, u32 narcMemberIdx, enum DSScreen display, u32 offset, u32 size, BOOL compressed, u32 heapID); | ||
void Graphics_LoadPartialPalette(u32 narcID, u32 narcMemberIdx, NNS_G2D_VRAM_TYPE vramType, u32 baseAddr, u32 heapID, NNSG2dImagePaletteProxy *paletteProxy); | ||
u32 Graphics_LoadImageMapping(u32 narcID, u32 narcMemberIdx, BOOL compressed, enum ImageMappingLayout layout, u32 size, NNS_G2D_VRAM_TYPE vramType, u32 baseAddr, u32 heapID, NNSG2dImageProxy *imageProxy); | ||
void Graphics_LoadImageMappingAndSetVramMode(u32 narcID, u32 narcMemberIdx, BOOL compressed, enum ImageMappingLayout layout, u32 size, NNS_G2D_VRAM_TYPE vramType, u32 baseAddr, u32 heapID, NNSG2dImageProxy *imageProxy); | ||
|
||
void *Graphics_GetCharData(u32 narcID, u32 narcMemberIdx, BOOL compressed, NNSG2dCharacterData **outCharData, u32 heapID); | ||
void *Graphics_GetScrnData(u32 narcID, u32 narcMemberIdx, BOOL compressed, NNSG2dScreenData **outScreenData, u32 heapID); | ||
void *Graphics_GetPlttData(u32 narcID, u32 narcMemberIdx, NNSG2dPaletteData **outPaletteData, u32 heapID); | ||
void *Graphics_GetCellBank(u32 narcID, u32 narcMemberIdx, BOOL compressed, NNSG2dCellDataBank **outCellBank, u32 heapID); | ||
void *Graphics_GetAnimBank(u32 narcID, u32 narcMemberIdx, BOOL compressed, NNSG2dAnimBankData **outAnimBank, u32 heapID); | ||
|
||
u32 Graphics_LoadTilesToBgLayerFromOpenNARC(NARC *narc, u32 narcMemberIdx, BgConfig *bgConfig, u32 bgLayer, u32 offset, u32 size, BOOL compressed, u32 heapID); | ||
void Graphics_LoadTilemapToBgLayerFromOpenNARC(NARC *narc, u32 narcMemberIdx, BgConfig *bgConfig, u32 bgLayer, u32 offset, u32 size, BOOL compressed, u32 heapID); | ||
void Graphics_LoadPaletteFromOpenNARC(NARC *narc, u32 narcMemberIdx, enum PaletteLoadLocation loadLocation, u32 offset, u32 size, u32 heapID); | ||
void Graphics_LoadPaletteWithSrcOffsetFromOpenNARC(NARC *narc, u32 narcMemberIdx, enum PaletteLoadLocation loadLocation, u32 srcOffset, u32 offset, u32 size, u32 heapID); | ||
void Graphics_LoadPartialPaletteFromOpenNARC(NARC *narc, u32 narcMemberIdx, NNS_G2D_VRAM_TYPE vramType, u32 baseAddr, u32 heapID, NNSG2dImagePaletteProxy *paletteProxy); | ||
u32 Graphics_LoadImageMappingFromOpenNARC(NARC *narc, u32 narcMemberIdx, BOOL compressed, enum ImageMappingLayout layout, u32 size, NNS_G2D_VRAM_TYPE vramType, u32 baseAddr, u32 heapID, NNSG2dImageProxy *imageProxy); | ||
|
||
void *Graphics_GetCharDataFromOpenNARC(NARC *narc, u32 narcMemberIdx, BOOL compressed, NNSG2dCharacterData **outCharData, u32 heapID); | ||
void *Graphics_GetScrnDataFromOpenNARC(NARC *narc, u32 narcMemberIdx, BOOL compressed, NNSG2dScreenData **outScreenData, u32 heapID); | ||
void *Graphics_GetPlttDataFromOpenNARC(NARC *narc, u32 narcMemberIdx, NNSG2dPaletteData **outPaletteData, u32 heapID); | ||
void *Graphics_GetCellBankFromOpenNARC(NARC *narc, u32 narcMemberIdx, BOOL compressed, NNSG2dCellDataBank **outCellBank, u32 heapID); | ||
void *Graphics_GetAnimBankFromOpenNARC(NARC *narc, u32 narcMemberIdx, BOOL compressed, NNSG2dAnimBankData **outAnimBank, u32 heapID); | ||
|
||
#endif // POKEPLATINUM_GRAPHICS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#ifndef POKEPLATINUM_HARDWARE_PALETTE_H | ||
#define POKEPLATINUM_HARDWARE_PALETTE_H | ||
|
||
u16 *GetHardwareMainBgPaletteAddress(void); | ||
u32 GetHardwareMainBgPaletteSize(void); | ||
u16 *GetHardwareSubBgPaletteAddress(void); | ||
u32 GetHardwareSubBgPaletteSize(void); | ||
u16 *GetHardwareMainObjPaletteAddress(void); | ||
u16 *GetHardwareSubObjPaletteAddress(void); | ||
|
||
#endif // POKEPLATINUM_HARDWARE_PALETTE_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.