summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/gc_wii/card.h148
-rw-r--r--include/gc_wii/dvdfs.h20
-rw-r--r--include/tp/JFWSystem.h3
-rw-r--r--include/tp/JKRDvdRipper.h27
-rw-r--r--include/tp/d_com_inf_game.h8
-rw-r--r--include/tp/d_item.h3
-rw-r--r--include/tp/d_msg_object.h6
-rw-r--r--include/tp/d_s_logo.h31
-rw-r--r--include/tp/d_save.h11
-rw-r--r--include/tp/d_stage.h3
-rw-r--r--include/tp/dzx.h3
-rw-r--r--include/tp/resource.h4
12 files changed, 193 insertions, 74 deletions
diff --git a/include/gc_wii/card.h b/include/gc_wii/card.h
index ea1a36a..d46ab17 100644
--- a/include/gc_wii/card.h
+++ b/include/gc_wii/card.h
@@ -103,40 +103,45 @@ namespace libtp::gc_wii::card
// Functions
/**
- * @brief Initializes memory card API control blocks. Must be called once before using any other CARD API functions.
+ * @brief Initializes memory card API control blocks. Must be called once
+ * before using any other CARD API functions.
*/
void CARDInit( void );
/**
- * @brief Checks for the file system consistency of the memory card and repair it if possible.
+ * @brief Checks for the file system consistency of the memory card and repair
+ * it if possible.
*
* @param chan EXI channel number
*/
int32_t CARDCheck( int32_t chan );
// int32_t CARDCheckAsync( int32_t chan, CARDCallback callback );
- // int32_t CARDCreate( int32_t chan, char* fileName, u32 size, CARDFileInfo* fileInfo );
- // int32_t CARDCreateAsync( int32_t chan, char* fileName, u32 size, CARDFileInfo* fileInfo, CARDCallback callback );
- // int32_t CARDDelete( int32_t chan, char* fileName );
- // int32_t CARDDeleteAsync( int32_t chan, char* fileName, CARDCallback callback );
- // int32_t CARDFastDelete( int32_t chan, int32_t fileNo );
- // int32_t CARDFastDeleteAsync( int32_t chan, int32_t fileNo, CARDCallback callback );
- // int32_t CARDFastOpen( int32_t chan, int32_t fileNo, CARDFileInfo* fileInfo );
- // int32_t CARDFormat( int32_t chan );
- // int32_t CARDFormatAsync( int32_t chan, CARDCallback callback );
- // int32_t CARDFreeBlocks( int32_t chan, int32_t* byteNotUsed, int32_t* filesNotUsed );
+ // int32_t CARDCreate( int32_t chan, char* fileName, u32 size, CARDFileInfo*
+ // fileInfo ); int32_t CARDCreateAsync( int32_t chan, char* fileName, u32 size,
+ // CARDFileInfo* fileInfo, CARDCallback callback ); int32_t CARDDelete( int32_t
+ // chan, char* fileName ); int32_t CARDDeleteAsync( int32_t chan, char*
+ // fileName, CARDCallback callback ); int32_t CARDFastDelete( int32_t chan,
+ // int32_t fileNo ); int32_t CARDFastDeleteAsync( int32_t chan, int32_t fileNo,
+ // CARDCallback callback ); int32_t CARDFastOpen( int32_t chan, int32_t fileNo,
+ // CARDFileInfo* fileInfo ); int32_t CARDFormat( int32_t chan ); int32_t
+ // CARDFormatAsync( int32_t chan, CARDCallback callback ); int32_t
+ // CARDFreeBlocks( int32_t chan, int32_t* byteNotUsed, int32_t* filesNotUsed );
// int32_t CARDGetResultCode( int32_t chan );
// int32_t CARDGetEncoding( int32_t chan, u16* encode );
// int32_t CARDGetStatus( int32_t chan, int32_t fileNo, CARDStat* stat );
- // int32_t CARDMountAsync( int32_t chan, void* workArea, CARDCallback detachCallback, CARDCallback attachCallback );
+ // int32_t CARDMountAsync( int32_t chan, void* workArea, CARDCallback
+ // detachCallback, CARDCallback attachCallback );
/**
* @brief Mounts a memory card synchronously.
*
* @param chan EXI channel number
- * @param workArea pointer to the work area to be used while a memory card is in use.
- * The work area must be 32 byte aligned and must be larger than or equal to CARD_WORKAREA_SIZE.
- * @param detachCallback callback function to be called when the memory card is removed from the slot.
+ * @param workArea pointer to the work area to be used while a memory card is
+ * in use. The work area must be 32 byte aligned and must be larger than or
+ * equal to CARD_WORKAREA_SIZE.
+ * @param detachCallback callback function to be called when the memory card is
+ * removed from the slot.
*/
int32_t CARDMount( int32_t chan, void* workArea, CARDCallback detachCallback );
@@ -144,7 +149,8 @@ namespace libtp::gc_wii::card
* @brief Unmounts a memory card Synchronously.
*
* The work area specified by CARDMount() or CARDMountAsync() is also released.
- * The function returns CARD_RESULT_READY if the memory card is successfully unmounted.
+ * The function returns CARD_RESULT_READY if the memory card is successfully
+ * unmounted.
*
* @param chan EXI channel number
*/
@@ -162,22 +168,25 @@ namespace libtp::gc_wii::card
// bool CARDProbe( int32_t chan );
/**
- * @brief This function verifies whether a memory card (of any type) is inserted in the specified slot.
+ * @brief This function verifies whether a memory card (of any type) is
+ * inserted in the specified slot.
*
- * The memory card size returned, in megabits, will be 4, 8, 16, 32, 64, or 128 Mb.
- * The sector size returned, in bytes, will be 8, 16, 32, 64, or 128 KB. A game program must support memory cards whose
+ * The memory card size returned, in megabits, will be 4, 8, 16, 32, 64, or 128
+ * Mb. The sector size returned, in bytes, will be 8, 16, 32, 64, or 128 KB. A
+ * game program must support memory cards whose
*
* @param chan Slot number (0: slot A, 1: slot B).
- * @param memSize Pointer to s32 object to store the memory card size, in megabits. Specify NULL if it is not
- * necessary.
- * @param sectorSize Pointer to s32 object to store the memory card sector size, in bytes. Specify NULL if it is not
- * necessary.
+ * @param memSize Pointer to s32 object to store the memory card size, in
+ * megabits. Specify NULL if it is not necessary.
+ * @param sectorSize Pointer to s32 object to store the memory card sector
+ * size, in bytes. Specify NULL if it is not necessary.
*/
int32_t CARDProbeEx( int32_t chan, int32_t* memSize, int32_t* sectorSize );
// int32_t CARDRename( int32_t chan, char* oldName, char* newName );
- // int32_t CARDRenameAsync( int32_t chan, char* oldName, char* newName, CARDCallback callback );
- // int32_t CARDSetStatus( int32_t chan, int32_t fileNo, CARDStat* stat );
- // int32_t CARDSetStatusAsync( int32_t chan, int32_t fileNo, CARDStat* stat, CARDCallback callback );
+ // int32_t CARDRenameAsync( int32_t chan, char* oldName, char* newName,
+ // CARDCallback callback ); int32_t CARDSetStatus( int32_t chan, int32_t fileNo,
+ // CARDStat* stat ); int32_t CARDSetStatusAsync( int32_t chan, int32_t fileNo,
+ // CARDStat* stat, CARDCallback callback );
/**
* @brief Closes a file.
@@ -193,40 +202,46 @@ namespace libtp::gc_wii::card
* @param fileInfo file info of the file to be read
* @param buf buffer address (32 bytes aligned)
* @param length number of bytes to be read (multiple of CARD_READ_SIZE)
- * @param offset file position at which to start the read (multiple of CARD_READ_SIZE)
+ * @param offset file position at which to start the read (multiple of
+ * CARD_READ_SIZE)
*/
int32_t CARDRead( CARDFileInfo* fileInfo, void* addr, int32_t length, int32_t offset );
- // int32_t CARDReadAsync( CARDFileInfo* fileInfo, void* addr, int32_t length, int32_t offset, CARDCallback callback );
+ // int32_t CARDReadAsync( CARDFileInfo* fileInfo, void* addr, int32_t length,
+ // int32_t offset, CARDCallback callback );
/**
* @brief Writes data to a file synchronously.
*
* @param fileInfo file info of the file to be written
* @param buf buffer address (32 bytes aligned)
- * @param length number of bytes to write. The length must be multiple of the card sector size returned by
- * CARDGetSectorSize.
- * @param offset file position at which to start the read. The offset must be multiple of the card sector size returned
- * by CARDGetSectorSize.
+ * @param length number of bytes to write. The length must be multiple of the
+ * card sector size returned by CARDGetSectorSize.
+ * @param offset file position at which to start the read. The offset must be
+ * multiple of the card sector size returned by CARDGetSectorSize.
*/
int32_t CARDWrite( CARDFileInfo* fileInfo, void* addr, int32_t length, int32_t offset );
- // int32_t CARDWriteAsync( CARDFileInfo* fileInfo, void* addr, int32_t length, int32_t offset, CARDCallback callback );
+ // int32_t CARDWriteAsync( CARDFileInfo* fileInfo, void* addr, int32_t length,
+ // int32_t offset, CARDCallback callback );
// Internal CARD functions; Use with caution
/**
- * @brief Default CARDCallback function to be used when the user did not specify one
+ * @brief Default CARDCallback function to be used when the user did not
+ * specify one
*
* @param chan Slot number (0: slot A, 1: slot B).
- * @param result Return value of the most recent CARD function (This description may be incorrect)
+ * @param result Return value of the most recent CARD function (This
+ * description may be incorrect)
*/
void __CARDDefaultApiCallback( int32_t chan, int32_t result );
/**
- * @brief Callback function to resume the current thread after the most resent asynchronous CARD function has finished
- * its operation
+ * @brief Callback function to resume the current thread after the most resent
+ * asynchronous CARD function has finished its operation
*
* @param chan Slot number (0: slot A, 1: slot B).
- * @param result Return value of the most recent CARD function (This description may be incorrect)
+ * @param result Return value of the most recent CARD function (This
+ * description may be incorrect)
*/
void __CARDSyncCallback( int32_t chan, int32_t result );
@@ -234,43 +249,52 @@ namespace libtp::gc_wii::card
* @brief Gets the control block for the desired memory card slot
*
* @param chan Slot number (0: slot A, 1: slot B).
- * @param card Output for the pointer to the current card block (Struct for this not defined yet)
+ * @param card Output for the pointer to the current card block (Struct for
+ * this not defined yet)
*/
int32_t __CARDGetControlBlock( int32_t chan, void** card );
/**
* @brief Puts the control block for the desired memory card slot
*
- * @param card Pointer to the current card block (Struct for this not defined yet)
- * @param result Return value of the most recent CARD function (This description may be incorrect)
+ * @param card Pointer to the current card block (Struct for this not defined
+ * yet)
+ * @param result Return value of the most recent CARD function (This
+ * description may be incorrect)
*/
int32_t __CARDPutControlBlock( void* card, int32_t result );
/**
- * @brief Suspends the current thread until the most resent asynchronous CARD function has finished its operation
+ * @brief Suspends the current thread until the most resent asynchronous CARD
+ * function has finished its operation
*
* @param chan Slot number (0: slot A, 1: slot B).
*/
int32_t __CARDSync( int32_t chan );
/**
- * @brief Updates the fat block section for a specific file on the memory card (This description may be incorrect)
+ * @brief Updates the fat block section for a specific file on the memory card
+ * (This description may be incorrect)
*
* @param chan Slot number (0: slot A, 1: slot B).
- * @param fatBlock Fat block section to be updated (Struct for this not defined yet)
+ * @param fatBlock Fat block section to be updated (Struct for this not defined
+ * yet)
* @param callback Callback function
*/
int32_t __CARDUpdateFatBlock( int32_t chan, void* fatBlock, CARDCallback callback );
/**
- * @brief Gets the directly block for a specified file on the memory card (This description may be incorrect)
+ * @brief Gets the directly block for a specified file on the memory card (This
+ * description may be incorrect)
*
- * @param card Pointer to the current card block (Struct for this not defined yet)
+ * @param card Pointer to the current card block (Struct for this not defined
+ * yet)
*/
void* __CARDGetDirBlock( void* card );
/**
- * @brief Updates the directly block for a specified file on the memory card (This description may be incorrect)
+ * @brief Updates the directly block for a specified file on the memory card
+ * (This description may be incorrect)
*
* @param chan Slot number (0: slot A, 1: slot B).
* @param callback Callback function
@@ -278,10 +302,12 @@ namespace libtp::gc_wii::card
int32_t __CARDUpdateDir( int32_t chan, CARDCallback callback );
/**
- * @brief Determines if the file name of the file in the current directly block is the same as the fileName parameter
+ * @brief Determines if the file name of the file in the current directly block
+ * is the same as the fileName parameter
*
- * @param dirBlock Pointer the directly block for a specified file on the memory card (This description may be
- * incorrect) (Struct for this not defined yet)
+ * @param dirBlock Pointer the directly block for a specified file on the
+ * memory card (This description may be incorrect) (Struct for this not defined
+ * yet)
* @param fileName Internal name for the desired file on the memory card
*/
bool __CARDCompareFileName( void* dirBlock, const char* fileName );
@@ -289,16 +315,19 @@ namespace libtp::gc_wii::card
/**
* @brief Determines if the current file on the memory card can be accessed
*
- * @param card Pointer to the current card block (Struct for this not defined yet)
- * @param dirBlock Pointer the directly block for a specified file on the memory card (This description may be
- * incorrect) (Struct for this not defined yet)
+ * @param card Pointer to the current card block (Struct for this not defined
+ * yet)
+ * @param dirBlock Pointer the directly block for a specified file on the
+ * memory card (This description may be incorrect) (Struct for this not defined
+ * yet)
*/
int32_t __CARDAccess( void* card, void* dirBlock );
}
// Manually written functions
/**
- * @brief Frees the fat blocks for a specific file (This description may be incorrect)
+ * @brief Frees the fat blocks for a specific file (This description may be
+ * incorrect)
*
* @param chan Slot number (0: slot A, 1: slot B).
* @param block Starting block
@@ -307,17 +336,20 @@ namespace libtp::gc_wii::card
int32_t __CARDFreeBlock( int32_t chan, uint16_t block, CARDCallback callback );
/**
- * @brief Callback to be called when a file is ready to be deleted (This description may be incorrect)
+ * @brief Callback to be called when a file is ready to be deleted (This
+ * description may be incorrect)
*
* @param chan Slot number (0: slot A, 1: slot B).
- * @param result Return value of the most recent CARD function (This description may be incorrect)
+ * @param result Return value of the most recent CARD function (This
+ * description may be incorrect)
*/
void DeleteCallback( int32_t chan, int32_t result );
/**
* @brief Gets the file number of the desired file on the memory card
*
- * @param card Pointer to the current card block (Struct for this not defined yet)
+ * @param card Pointer to the current card block (Struct for this not defined
+ * yet)
* @param fileName Internal name for the desired file on the memory card
* @param fileNo Output for the index to the desired file on the memory card
*/
diff --git a/include/gc_wii/dvdfs.h b/include/gc_wii/dvdfs.h
new file mode 100644
index 0000000..9e5f0ab
--- /dev/null
+++ b/include/gc_wii/dvdfs.h
@@ -0,0 +1,20 @@
+/** @file dvdfs.h
+ * @brief Holds functions that use the dvd files
+ *
+ *
+ * @author Zephiles
+ * @bug No known bugs.
+ */
+#ifndef GC_WII_DVDFS_H
+#define GC_WII_DVDFS_H
+
+#include <cstdint>
+
+namespace libtp::gc_wii::dvdfs
+{
+ extern "C"
+ {
+ int32_t DVDConvertPathToEntrynum( const char* fileName );
+ }
+} // namespace libtp::gc_wii::dvdfs
+#endif \ No newline at end of file
diff --git a/include/tp/JFWSystem.h b/include/tp/JFWSystem.h
index 121d258..4d244c1 100644
--- a/include/tp/JFWSystem.h
+++ b/include/tp/JFWSystem.h
@@ -8,7 +8,8 @@
#ifndef TP_JFWSYSTEM_H
#define TP_JFWSYSTEM_H
-// Dedicated console line used to print messages wtihout relying on the Console Class from libtp
+// Dedicated console line used to print messages wtihout relying on the Console
+// Class from libtp
#define JFW_DEBUG_LINE 24
#include <cstdint>
diff --git a/include/tp/JKRDvdRipper.h b/include/tp/JKRDvdRipper.h
new file mode 100644
index 0000000..4b9d1c5
--- /dev/null
+++ b/include/tp/JKRDvdRipper.h
@@ -0,0 +1,27 @@
+/** @file JKRDvdRipper.h
+ * @brief Contains function definitions that read data from the game disc.
+ *
+ * @author Lunar Soap
+ * @bug No known bugs.
+ */
+#ifndef TP_JKRDVDRIPPER_H
+#define TP_JKRDVDRIPPER_H
+
+#include <cstdint>
+
+namespace libtp::tp::JKRDvdRipper
+{
+ extern "C"
+ {
+ void* loadToMainRAM2( int32_t fileIndex,
+ uint8_t* unk2,
+ uint32_t jkrExpandSwitch,
+ uint32_t unk4,
+ void* jkrHeap,
+ uint32_t eAllocDirection,
+ uint32_t unk7,
+ int32_t* unk8,
+ uint32_t* unk9 );
+ }
+} // namespace libtp::tp::JKRDvdRipper
+#endif \ No newline at end of file
diff --git a/include/tp/d_com_inf_game.h b/include/tp/d_com_inf_game.h
index b8bd382..ef1fbbd 100644
--- a/include/tp/d_com_inf_game.h
+++ b/include/tp/d_com_inf_game.h
@@ -127,20 +127,22 @@ namespace libtp::tp::d_com_inf_game
extern GameInfo dComIfG_gameInfo;
/**
- * @brief Checks the current time and sets the proper layer based on the current layer.
+ * @brief Checks the current time and sets the proper layer based on the
+ * current layer.
*
* @param pLayer The pointer to the current layer.
*/
void dComIfG_get_timelayer( int32_t* pLayer );
/**
- * @brief Returns the layer for the current stage after checking the appropriate flags.
+ * @brief Returns the layer for the current stage after checking the
+ * appropriate flags.
*
* @param stageName The current stage.
* @param roomId The current room.
* @param layerOverride The initial layer to be returned.
*/
- int32_t getLayerNo_common_common(const char* stageName, int32_t roomId, int32_t layerOverride);
+ int32_t getLayerNo_common_common( const char* stageName, int32_t roomId, int32_t layerOverride );
}
} // namespace libtp::tp::d_com_inf_game
#endif \ No newline at end of file
diff --git a/include/tp/d_item.h b/include/tp/d_item.h
index 457486f..5917d16 100644
--- a/include/tp/d_item.h
+++ b/include/tp/d_item.h
@@ -28,7 +28,8 @@ namespace libtp::tp::d_item
int32_t checkItemGet( uint8_t item, int32_t defaultValue );
/**
- * @brief Initializes the dSv_player_get_item_c function with the current value
+ * @brief Initializes the dSv_player_get_item_c function with the current
+ *value
*
* @param item id of the item being recieved
*/
diff --git a/include/tp/d_msg_object.h b/include/tp/d_msg_object.h
index 6853545..8f11033 100644
--- a/include/tp/d_msg_object.h
+++ b/include/tp/d_msg_object.h
@@ -1,5 +1,6 @@
/** @file d_msg_object.h
- * @brief Contains some of the functions used in getting the values for a message
+ * @brief Contains some of the functions used in getting the values for a
+ *message
*
* @author Lunar Soap
* @author Zephiles
@@ -37,7 +38,8 @@ namespace libtp::tp::d_msg_object
/**
* @param param_1 - Unknown
* @param itemIndex - The itemId of the item received + 0x65
- * @param param_3 - Unknown. I think it checks for a valid message but more research is needed
+ * @param param_3 - Unknown. I think it checks for a valid message but more
+ * research is needed
*/
void setMessageIndex( uint32_t param_1, uint32_t itemIndex, bool param_3 );
}
diff --git a/include/tp/d_s_logo.h b/include/tp/d_s_logo.h
new file mode 100644
index 0000000..a04331b
--- /dev/null
+++ b/include/tp/d_s_logo.h
@@ -0,0 +1,31 @@
+/** @file d_s_logo.h
+ * @brief Contains language definitions for different game regions
+ *
+ * @author Zephiles
+ * @bug No known bugs.
+ */
+#ifndef TP_D_S_LOGO_H
+#define TP_D_S_LOGO_H
+
+#include <cstdint>
+
+namespace libtp::tp::d_s_logo
+{
+ enum class Languages : int32_t
+ {
+ uk = 0, // English
+ de, // German
+ fr, // French
+ sp, // Spanish
+ it // Italian
+ };
+
+ extern "C"
+ {
+#ifdef TP_EU
+ // This function only exists in the PAL version
+ Languages getPalLanguage2( void* dScnLogo_c ); // dScnLogo_c is unused
+#endif
+ }
+} // namespace libtp::tp::d_s_logo
+#endif \ No newline at end of file
diff --git a/include/tp/d_save.h b/include/tp/d_save.h
index e14536c..792a481 100644
--- a/include/tp/d_save.h
+++ b/include/tp/d_save.h
@@ -2,7 +2,7 @@
* @brief Holds symbols of the d_save field
*
* @author AECX
-* @author Lunar Soap
+ * @author Lunar Soap
* @bug No known bugs.
*/
#ifndef TP_D_SAVE_H
@@ -72,21 +72,22 @@ namespace libtp::tp::d_save
/**
* @brief Checks whether the player has cleared the specified twilight.
- *
+ *
* @param playerStatusPtr The pointer to the PlayerStatus struct.
* @param twilightNode The twilight instance to be checked.
*/
bool isDarkClearLV( void* playerStatusPtr, int32_t twilightNode );
/**
- * @brief Checks whether or not Link has been transformed into wolf by a twilight CS
- *
+ * @brief Checks whether or not Link has been transformed into wolf by a
+ * twilight CS
+ *
* @param playerStatusPtr The pointer to the PlayerStatus struct.
* @param twilightEvent The twilight cutscene event to be checked.
*/
bool isTransformLV( void* playerStatusPtr, int32_t twilightEvent );
- extern uint16_t saveBitLabels[0x336]; //saveBitLabels__16dSv_event_flag_c
+ extern uint16_t saveBitLabels[0x336]; // saveBitLabels__16dSv_event_flag_c
}
} // namespace libtp::tp::d_save
#endif \ No newline at end of file
diff --git a/include/tp/d_stage.h b/include/tp/d_stage.h
index d32ca73..9afb7f7 100644
--- a/include/tp/d_stage.h
+++ b/include/tp/d_stage.h
@@ -33,7 +33,8 @@ namespace libtp::tp::d_stage
void roomTresureInit( void* unk1, dzx::ChunkTypeInfo* chunkTypeInfo, int32_t unk3, void* unk4 );
/**
- * @brief Initialises Actors, can run multiple times per load - Global Based on Room
+ * @brief Initialises Actors, can run multiple times per load - Global Based on
+ * Room
*
* @param mStatus_roomControl Pointer to roomControl data (unknown)
* @param chunkTypeInfo Pointer to dzxHeader
diff --git a/include/tp/dzx.h b/include/tp/dzx.h
index 41ffc23..cb5e6a6 100644
--- a/include/tp/dzx.h
+++ b/include/tp/dzx.h
@@ -1,5 +1,6 @@
/** @file dzx.h
- * @brief dzr related definitions and structs, mainly used for working with actors
+ * @brief dzr related definitions and structs, mainly used for working with
+ *actors
*
* @author AECX
* @author Zephiles
diff --git a/include/tp/resource.h b/include/tp/resource.h
index 7172126..8a553de 100644
--- a/include/tp/resource.h
+++ b/include/tp/resource.h
@@ -20,7 +20,7 @@ namespace libtp::tp::resource
char parseCharacter_1Byte( const char** text );
}
- // Macros for custom messages
+// Macros for custom messages
#define MSG_BEGIN( name ) char* name =
#define MSG_BEGIN_CONST( name ) const char* name =
@@ -31,7 +31,7 @@ namespace libtp::tp::resource
#define MSG_COLOR( id ) "\x1A\x06\xFF\x00\x00" id
- // Message Text Color Values
+// Message Text Color Values
#define MSG_COLOR_WHITE "\x00"
#define MSG_COLOR_RED "\x01"
#define MSG_COLOR_GREEN "\x02"