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
16 changes: 16 additions & 0 deletions include/game/sLib/s_crc.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once
#include <types.h>

/// @brief Wrapper around the runtime's CRC32 calculation function.
/// @ingroup slib
class sCrc {
public:
/**
* @brief Calculates the CRC32 checksum of a buffer.
*
* @param data The buffer to checksum.
* @param size The size of the buffer, in bytes.
* @return The CRC32 checksum.
*/
static ulong calcCRC32(const void *data, ulong size);
};
1 change: 1 addition & 0 deletions include/lib/revolution/OS.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ extern "C" {
#include <revolution/OS/OSAudioSystem.h>
#include <revolution/OS/OSCache.h>
#include <revolution/OS/OSContext.h>
#include <revolution/OS/OSCrc.h>
#include <revolution/OS/OSError.h>
#include <revolution/OS/OSExec.h>
#include <revolution/OS/OSFastCast.h>
Expand Down
13 changes: 13 additions & 0 deletions include/lib/revolution/OS/OSCrc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#ifndef RVL_SDK_OS_CRC_H
#define RVL_SDK_OS_CRC_H
#include <types.h>
#ifdef __cplusplus
extern "C" {
#endif

ulong OSCalcCRC32(const void *, ulong);

#ifdef __cplusplus
}
#endif
#endif
6 changes: 6 additions & 0 deletions slices/wiimj2d.json
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,12 @@
".sdata2": "0x2b70-0x2b78"
}
},
{
"source": "dol/sLib/s_crc.cpp",
"memoryRanges": {
".text": "0x158af0-0x158b00"
}
},
{
"source": "dol/sLib/s_lib.cpp",
"memoryRanges": {
Expand Down
6 changes: 6 additions & 0 deletions source/dol/sLib/s_crc.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <game/sLib/s_crc.hpp>
#include <revolution/OS.h>

ulong sCrc::calcCRC32(const void *data, ulong size) {
return OSCalcCRC32(data, size);
}
1 change: 1 addition & 0 deletions syms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ OSSuspendThread=0x801B5C40
OSSetThreadPriority=0x801B5FC0
OSGetThreadPriority=0x801B60B0
OSGetTime=0x801B60C0
OSCalcCRC32=0x801B8760
VIWaitForRetrace=0x801BCE30
VIEnableDimming=0x801BE430
PSMTXIdentity=0x801C0610
Expand Down
Loading