mirror of https://github.com/PrimeDecomp/prime.git
Match and link all remaining stream classes
This commit is contained in:
parent
ef751ff69f
commit
55617d2753
|
@ -10,12 +10,6 @@
|
|||
"editor.tabSize": 2,
|
||||
"files.associations": {
|
||||
"source_location": "cpp",
|
||||
"console_io.h": "c",
|
||||
"file_struc.h": "c",
|
||||
"osreset.h": "c",
|
||||
"vi.h": "c",
|
||||
"gxstruct.h": "c",
|
||||
"vifuncs.h": "c"
|
||||
},
|
||||
"files.autoSave": "onFocusChange",
|
||||
"files.insertFinalNewline": true,
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
.section .data
|
||||
.balign 8
|
||||
|
||||
.global lbl_803EE3A8
|
||||
lbl_803EE3A8:
|
||||
.global __vt__16CMemoryStreamOut
|
||||
__vt__16CMemoryStreamOut:
|
||||
# ROM: 0x3EB3A8
|
||||
.4byte 0
|
||||
.4byte 0
|
||||
|
@ -56,8 +56,8 @@ __dt__16CMemoryStreamOutFv:
|
|||
/* 8033F2D4 0033C234 93 C1 00 08 */ stw r30, 8(r1)
|
||||
/* 8033F2D8 0033C238 7C 7E 1B 79 */ or. r30, r3, r3
|
||||
/* 8033F2DC 0033C23C 41 82 00 44 */ beq lbl_8033F320
|
||||
/* 8033F2E0 0033C240 3C 80 80 3F */ lis r4, lbl_803EE3A8@ha
|
||||
/* 8033F2E4 0033C244 38 04 E3 A8 */ addi r0, r4, lbl_803EE3A8@l
|
||||
/* 8033F2E0 0033C240 3C 80 80 3F */ lis r4, __vt__16CMemoryStreamOut@ha
|
||||
/* 8033F2E4 0033C244 38 04 E3 A8 */ addi r0, r4, __vt__16CMemoryStreamOut@l
|
||||
/* 8033F2E8 0033C248 90 1E 00 00 */ stw r0, 0(r30)
|
||||
/* 8033F2EC 0033C24C 48 00 02 89 */ bl Flush__13COutputStreamFv
|
||||
/* 8033F2F0 0033C250 88 1E 00 88 */ lbz r0, 0x88(r30)
|
||||
|
@ -97,9 +97,9 @@ __ct__16CMemoryStreamOutFPvUlQ216CMemoryStreamOut10EOwnerShipi:
|
|||
/* 8033F364 0033C2C4 93 81 00 10 */ stw r28, 0x10(r1)
|
||||
/* 8033F368 0033C2C8 7C 7C 1B 78 */ mr r28, r3
|
||||
/* 8033F36C 0033C2CC 48 00 03 91 */ bl __ct__13COutputStreamFi
|
||||
/* 8033F370 0033C2D0 3C 60 80 3F */ lis r3, lbl_803EE3A8@ha
|
||||
/* 8033F370 0033C2D0 3C 60 80 3F */ lis r3, __vt__16CMemoryStreamOut@ha
|
||||
/* 8033F374 0033C2D4 7F E0 00 34 */ cntlzw r0, r31
|
||||
/* 8033F378 0033C2D8 38 63 E3 A8 */ addi r3, r3, lbl_803EE3A8@l
|
||||
/* 8033F378 0033C2D8 38 63 E3 A8 */ addi r3, r3, __vt__16CMemoryStreamOut@l
|
||||
/* 8033F37C 0033C2DC 38 80 00 00 */ li r4, 0
|
||||
/* 8033F380 0033C2E0 90 7C 00 00 */ stw r3, 0(r28)
|
||||
/* 8033F384 0033C2E4 54 00 D9 7E */ srwi r0, r0, 5
|
||||
|
|
|
@ -38,7 +38,5 @@ Alloc__11CZipSupportFPvUiUi:
|
|||
lbl_803D7A88:
|
||||
# ROM: 0x3D4A88
|
||||
.asciz "??(??)"
|
||||
.byte 0x31
|
||||
.asciz ".1.3"
|
||||
.asciz "1.1.3"
|
||||
.balign 4
|
||||
|
||||
|
|
|
@ -619,10 +619,10 @@ LIBS = [
|
|||
"Kyoto/rstl/RstlExtras",
|
||||
["Kyoto/Streams/CInputStream", True],
|
||||
["Kyoto/Streams/CMemoryInStream", True],
|
||||
"Kyoto/Streams/CMemoryStreamOut",
|
||||
"Kyoto/Streams/COutputStream",
|
||||
"Kyoto/Streams/CZipInputStream",
|
||||
"Kyoto/Streams/CZipSupport",
|
||||
["Kyoto/Streams/CMemoryStreamOut", True],
|
||||
["Kyoto/Streams/COutputStream", True],
|
||||
["Kyoto/Streams/CZipInputStream", True],
|
||||
["Kyoto/Streams/CZipSupport", True],
|
||||
"Kyoto/CSimplePool",
|
||||
"Kyoto/CToken",
|
||||
["Kyoto/IObj", True],
|
||||
|
|
|
@ -14,7 +14,7 @@ public:
|
|||
CInputStream(int len);
|
||||
CInputStream(const void* ptr, int len, bool owned);
|
||||
virtual ~CInputStream();
|
||||
virtual uint Read(void* dest, uint len) = 0;
|
||||
virtual size_t Read(void* dest, size_t len) = 0;
|
||||
|
||||
float ReadFloat();
|
||||
u64 ReadLongLong();
|
||||
|
@ -23,7 +23,7 @@ public:
|
|||
bool ReadBool();
|
||||
uchar ReadChar();
|
||||
uint ReadBits(uint len);
|
||||
uint ReadBytes(void* dest, unsigned long len);
|
||||
size_t ReadBytes(void* dest, size_t len);
|
||||
void Get(void* dest, unsigned long len);
|
||||
|
||||
template < typename T >
|
||||
|
|
|
@ -13,7 +13,7 @@ public:
|
|||
CMemoryInStream(const void* ptr, unsigned long len);
|
||||
CMemoryInStream(const void* ptr, unsigned long len, EOwnerShip ownership);
|
||||
virtual ~CMemoryInStream() override {}
|
||||
virtual uint Read(void* dest, uint len) override;
|
||||
virtual size_t Read(void* dest, size_t len) override;
|
||||
};
|
||||
|
||||
#endif // _CMEMORYINSTREAM
|
||||
|
|
|
@ -10,14 +10,17 @@ public:
|
|||
kOS_NotOwned,
|
||||
};
|
||||
|
||||
CMemoryStreamOut(void* buffer, size_t len, EOwnerShip ownerShip = kOS_NotOwned, int blockLen = 4096);
|
||||
CMemoryStreamOut(void* buffer, size_t len, EOwnerShip ownerShip = kOS_NotOwned,
|
||||
int blockLen = 4096);
|
||||
virtual ~CMemoryStreamOut();
|
||||
|
||||
void Write(const void* ptr, size_t len);
|
||||
|
||||
private:
|
||||
u8* x7c_ptr;
|
||||
u32 x80_len;
|
||||
u32 x84_position;
|
||||
bool x88_owned;
|
||||
void* mOutPtr;
|
||||
size_t mOutLength;
|
||||
size_t mCurrentPosition;
|
||||
bool mBufferOwned;
|
||||
};
|
||||
|
||||
#endif // _CMEMORYSTREAMOUT
|
||||
|
|
|
@ -11,15 +11,15 @@ void coutput_stream_helper(const T& t, COutputStream& out);
|
|||
|
||||
class COutputStream {
|
||||
void DoPut(const void* ptr, size_t len);
|
||||
void Flush();
|
||||
void DoFlush();
|
||||
|
||||
public:
|
||||
COutputStream(int len);
|
||||
virtual ~COutputStream();
|
||||
virtual void Write(const void* ptr, u32 len);
|
||||
virtual void Write(const void* ptr, size_t len) = 0;
|
||||
void WriteBits(uint val, uint bitCount);
|
||||
|
||||
void Flush();
|
||||
void FlushShiftRegister();
|
||||
void Put(const void* ptr, size_t len) {
|
||||
FlushShiftRegister();
|
||||
|
|
|
@ -6,17 +6,20 @@
|
|||
#include "Kyoto/Streams/CInputStream.hpp"
|
||||
|
||||
#include "rstl/auto_ptr.hpp"
|
||||
#include "rstl/single_ptr.hpp"
|
||||
|
||||
#include "zlib/zlib.h"
|
||||
|
||||
class CZipInputStream : public CInputStream {
|
||||
public:
|
||||
CZipInputStream(rstl::auto_ptr< CInputStream > in);
|
||||
~CZipInputStream() override;
|
||||
uint Read(void* dest, uint len) override;
|
||||
size_t Read(void* dest, size_t len) override;
|
||||
|
||||
private:
|
||||
uchar* x24_compBuf;
|
||||
rstl::auto_ptr< CInputStream > x28_stream;
|
||||
unkptr x30_zstream;
|
||||
rstl::single_ptr<uchar> mCompBuf;
|
||||
rstl::auto_ptr< CInputStream > mStream;
|
||||
rstl::single_ptr<z_stream_s> mZStream;
|
||||
};
|
||||
|
||||
#endif // _CZIPINPUTSTREAM
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
(zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
|
||||
*/
|
||||
|
||||
#ifndef _ZLIB_H
|
||||
#define _ZLIB_H
|
||||
#ifndef _ZLIB
|
||||
#define _ZLIB
|
||||
|
||||
#include "zconf.h"
|
||||
|
||||
|
@ -890,4 +890,4 @@ ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* _ZLIB_H */
|
||||
#endif // _ZLIB
|
|
@ -558,10 +558,10 @@ KYOTO_1 :=\
|
|||
$(BUILD_DIR)/asm/Kyoto/rstl/RstlExtras.o\
|
||||
$(BUILD_DIR)/src/Kyoto/Streams/CInputStream.o\
|
||||
$(BUILD_DIR)/src/Kyoto/Streams/CMemoryInStream.o\
|
||||
$(BUILD_DIR)/asm/Kyoto/Streams/CMemoryStreamOut.o\
|
||||
$(BUILD_DIR)/asm/Kyoto/Streams/COutputStream.o\
|
||||
$(BUILD_DIR)/asm/Kyoto/Streams/CZipInputStream.o\
|
||||
$(BUILD_DIR)/asm/Kyoto/Streams/CZipSupport.o\
|
||||
$(BUILD_DIR)/src/Kyoto/Streams/CMemoryStreamOut.o\
|
||||
$(BUILD_DIR)/src/Kyoto/Streams/COutputStream.o\
|
||||
$(BUILD_DIR)/src/Kyoto/Streams/CZipInputStream.o\
|
||||
$(BUILD_DIR)/src/Kyoto/Streams/CZipSupport.o\
|
||||
$(BUILD_DIR)/asm/Kyoto/CSimplePool.o\
|
||||
$(BUILD_DIR)/asm/Kyoto/CToken.o\
|
||||
$(BUILD_DIR)/src/Kyoto/IObj.o\
|
||||
|
|
|
@ -65,7 +65,7 @@ void CInputStream::Get(void* dest, unsigned long len) {
|
|||
x18_readPosition += readCount;
|
||||
}
|
||||
|
||||
uint CInputStream::ReadBytes(void* dest, unsigned long len) {
|
||||
size_t CInputStream::ReadBytes(void* dest, size_t len) {
|
||||
if (len == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -6,4 +6,4 @@ CMemoryInStream::CMemoryInStream(const void* ptr, unsigned long len, EOwnerShip
|
|||
CMemoryInStream::CMemoryInStream(const void* ptr, unsigned long len)
|
||||
: CInputStream(ptr, len, false) {}
|
||||
|
||||
uint CMemoryInStream::Read(void* dest, uint len) { return 0; }
|
||||
size_t CMemoryInStream::Read(void* dest, size_t len) { return 0; }
|
||||
|
|
|
@ -75,32 +75,18 @@ void COutputStream::WriteBits(uint value, uint bitCount) {
|
|||
|
||||
uint registerOffset = mShiftRegisterOffset;
|
||||
if (registerOffset >= bitCount) {
|
||||
registerOffset -= bitCount;
|
||||
uint mask = 0xffffffff;
|
||||
uint shiftRegister = mShiftRegister;
|
||||
if (bitCount != 32) {
|
||||
mask = (1 << bitCount) - 1;
|
||||
}
|
||||
mShiftRegister = shiftRegister | ((value & mask) << registerOffset);
|
||||
int off = registerOffset - bitCount;
|
||||
mShiftRegister |= ((value & (bitCount != 32 ? (1 << bitCount) - 1 : 0xffffffff)) << off);
|
||||
mShiftRegisterOffset -= bitCount;
|
||||
} else {
|
||||
uint shiftAmt = bitCount - registerOffset;
|
||||
uint shiftRegister = mShiftRegister;
|
||||
uint mask = 0xffffffff;
|
||||
if (registerOffset != 0x20) {
|
||||
mask = (1 << registerOffset) - 1;
|
||||
}
|
||||
uint shiftA = value >> shiftAmt;
|
||||
|
||||
shiftRegister |= (value >> shiftAmt);
|
||||
shiftRegister &= mask;
|
||||
mShiftRegister = shiftRegister;
|
||||
mShiftRegister |= (shiftA & (registerOffset != 0x20 ? (1 << registerOffset) - 1 : 0xffffffff));
|
||||
mShiftRegisterOffset = 0;
|
||||
FlushShiftRegister();
|
||||
uint mask2 = 0xffffffff;
|
||||
if (shiftAmt != 32) {
|
||||
mask2 = (1 << shiftAmt) - 1;
|
||||
}
|
||||
mShiftRegister = (value & mask2) << (32 - shiftAmt);
|
||||
int shift = (32 - shiftAmt);
|
||||
mShiftRegister = (value & (shiftAmt != 32 ? (1 << shiftAmt) - 1 : 0xffffffff)) << shift;
|
||||
mShiftRegisterOffset -= shiftAmt;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
/* @(#) $Id$ */
|
||||
|
||||
#include "zlib.h"
|
||||
#include "zlib/zlib.h"
|
||||
|
||||
#define BASE 65521L /* largest prime smaller than 65536 */
|
||||
#define NMAX 5552
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
#include "zutil.h"
|
||||
#include "infblock.h"
|
||||
#include "inftrees.h"
|
||||
#include "infcodes.h"
|
||||
#include "infutil.h"
|
||||
#include "zlib/zutil.h"
|
||||
#include "zlib/infblock.h"
|
||||
#include "zlib/inftrees.h"
|
||||
#include "zlib/infcodes.h"
|
||||
#include "zlib/infutil.h"
|
||||
|
||||
struct inflate_codes_state {int dummy;}; /* for buggy compilers */
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
#include "zutil.h"
|
||||
#include "inftrees.h"
|
||||
#include "infblock.h"
|
||||
#include "infcodes.h"
|
||||
#include "infutil.h"
|
||||
#include "inffast.h"
|
||||
#include "zlib/zutil.h"
|
||||
#include "zlib/inftrees.h"
|
||||
#include "zlib/infblock.h"
|
||||
#include "zlib/infcodes.h"
|
||||
#include "zlib/infutil.h"
|
||||
#include "zlib/inffast.h"
|
||||
|
||||
/* simplify the use of the inflate_huft type with some defines */
|
||||
#define exop word.what.Exop
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
#include "zutil.h"
|
||||
#include "inftrees.h"
|
||||
#include "infblock.h"
|
||||
#include "infcodes.h"
|
||||
#include "infutil.h"
|
||||
#include "inffast.h"
|
||||
#include "zlib/zutil.h"
|
||||
#include "zlib/inftrees.h"
|
||||
#include "zlib/infblock.h"
|
||||
#include "zlib/infcodes.h"
|
||||
#include "zlib/infutil.h"
|
||||
#include "zlib/inffast.h"
|
||||
|
||||
struct inflate_codes_state {int dummy;}; /* for buggy compilers */
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
#include "zutil.h"
|
||||
#include "infblock.h"
|
||||
#include "zlib/zutil.h"
|
||||
#include "zlib/infblock.h"
|
||||
|
||||
struct inflate_blocks_state {int dummy;}; /* for buggy compilers */
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
#include "zutil.h"
|
||||
#include "inftrees.h"
|
||||
#include "zlib/zutil.h"
|
||||
#include "zlib/inftrees.h"
|
||||
|
||||
#if !defined(BUILDFIXED) && !defined(STDC)
|
||||
# define BUILDFIXED /* non ANSI compilers may not accept inffixed.h */
|
||||
|
@ -392,7 +392,7 @@ local uInt fixed_bd;
|
|||
local inflate_huft *fixed_tl;
|
||||
local inflate_huft *fixed_td;
|
||||
#else
|
||||
#include "inffixed.h"
|
||||
#include "zlib/inffixed.h"
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
#include "zutil.h"
|
||||
#include "infblock.h"
|
||||
#include "inftrees.h"
|
||||
#include "infcodes.h"
|
||||
#include "infutil.h"
|
||||
#include "zlib/zutil.h"
|
||||
#include "zlib/infblock.h"
|
||||
#include "zlib/inftrees.h"
|
||||
#include "zlib/infcodes.h"
|
||||
#include "zlib/infutil.h"
|
||||
|
||||
struct inflate_codes_state {int dummy;}; /* for buggy compilers */
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
/* @(#) $Id$ */
|
||||
|
||||
#include "zutil.h"
|
||||
#include "zlib/zutil.h"
|
||||
|
||||
struct internal_state {int dummy;}; /* for buggy compilers */
|
||||
|
||||
|
|
Loading…
Reference in New Issue