Files
dusklight/include/JSystem/JKernel/JKRCompression.h
T
Jonathan Wase 04354aadb9 JKRAram and JKRAramStream (#80)
* before __register_global_object

* JKRThread::sThreadList, JKRHeap::sSystemHeap, etc.

* cleanup and started on JKRDvdArchive

* before changing JKRCompression

* more JKRDvdArchive, abs, and memset

* fixed JKRArchive::setExpandSize split

* JKRArchive::sCurrentDirID, JKRDvdFile::sDvdList, and matching JKRDvdFile constructors

* problems

* merge fixes and formatting

* updated clang version in clang-format-all to version 10

* Added OSPhysicalToCached and struct for global memory

* remove useless __attribute__

* changed from defines and macros to const variable and function

* changed FLAG_HAS to FLAG_ON

* JKRAram, linking problems

* fix JKRAram

* remove nonmatching stuff

* renamed static data

* more static class members

* JKRAramStream OK

* formatting

Co-authored-by: Julgodis <>
Co-authored-by: Pheenoh <pheenoh@gmail.com>
2021-01-09 20:15:52 -05:00

28 lines
792 B
C

#ifndef __JKRCOMPREESION_H__
#define __JKRCOMPREESION_H__
#include "JSystem/JKernel/SArc.h"
#include "dolphin/types.h"
inline u32 read_big_endian_u32(void* ptr) {
u8* uptr = (u8*)ptr;
return ((u32)uptr[0] << 0x18) | ((u32)uptr[1] << 0x10) | ((u32)uptr[2] << 8) | (u32)uptr[3];
}
inline u16 read_big_endian_u16(void* ptr) {
u8* uptr = (u8*)ptr;
return ((u16)uptr[0] << 8) | ((u16)uptr[1]);
}
typedef int JKRCompression;
const JKRCompression COMPRESSION_NONE = 0;
const JKRCompression COMPRESSION_YAY0 = 1;
const JKRCompression COMPRESSION_YAZ0 = 2;
const JKRCompression COMPRESSION_ASR = 3;
inline u32 JKRDecompExpandSize(SArcHeader* header) {
u8* fileLength = (u8*)&header->file_length;
return read_big_endian_u32(fileLength);
}
#endif