mirror of
https://github.com/zeldaret/tp
synced 2026-08-21 14:37:49 -04:00
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>
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
#ifndef __JSUFILEINPUTSTREAM_H__
|
||||
#define __JSUFILEINPUTSTREAM_H__
|
||||
|
||||
#include "JSystem/JSupport/JSURandomInputStream/JSURandomInputStream.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class JSUFileInputStream {
|
||||
class JSUFileInputStream : public JSURandomInputStream {
|
||||
public:
|
||||
virtual ~JSUFileInputStream();
|
||||
};
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef __JSUINPUTSTREAM_H__
|
||||
#define __JSUINPUTSTREAM_H__
|
||||
|
||||
#include "JSystem/JSupport/JSUIosBase.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class JSUInputStream : public JSUIosBase {
|
||||
public:
|
||||
JSUInputStream();
|
||||
virtual ~JSUInputStream();
|
||||
|
||||
/* vt[3] */ virtual s32 getAvailable() const = 0;
|
||||
/* vt[4] */ virtual s32 skip(s32);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef __JSUIOSBASE_H__
|
||||
#define __JSUIOSBASE_H__
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
enum EIoState {
|
||||
IOS_STATE_1 = 1,
|
||||
};
|
||||
|
||||
class JSUIosBase {
|
||||
public:
|
||||
JSUIosBase() { mState = false; }
|
||||
|
||||
virtual ~JSUIosBase();
|
||||
|
||||
bool isGood() const { return mState == 0; }
|
||||
void clrState(EIoState state) { mState &= ~state; }
|
||||
void setState(EIoState state) { mState |= state; }
|
||||
|
||||
private:
|
||||
u8 mState;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
template <typename T>
|
||||
class JSUListIterator {
|
||||
public:
|
||||
JSUListIterator() : mLink() {}
|
||||
JSUListIterator() : mLink(NULL) {}
|
||||
JSUListIterator(JSULink<T>* link) : mLink(link) {}
|
||||
JSUListIterator(JSUList<T>* list) : mLink(list->getFirst()) {}
|
||||
|
||||
@@ -117,11 +117,8 @@ public:
|
||||
T* getObject() { return this->mLink->getObject(); }
|
||||
|
||||
bool operator==(JSULink<T> const* other) const { return this->mLink == other; }
|
||||
|
||||
bool operator!=(JSULink<T> const* other) const { return this->mLink != other; }
|
||||
|
||||
bool operator==(JSUListIterator<T> const& other) const { return this->mLink == other.mLink; }
|
||||
|
||||
bool operator!=(JSUListIterator<T> const& other) const { return this->mLink != other.other; }
|
||||
|
||||
JSUListIterator<T> operator++(int) {
|
||||
@@ -170,6 +167,7 @@ template <typename T>
|
||||
class JSUTree {
|
||||
public:
|
||||
JSUTree(T* owner) : mList(), mLink(owner) {}
|
||||
~JSUTree() {}
|
||||
|
||||
bool appendChild(JSUTree<T>* child) {
|
||||
JSU_TREE_LINK_IF_NOT_NULL(child);
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
#ifndef __JSURANDOMINPUTSTREAM_H__
|
||||
#define __JSURANDOMINPUTSTREAM_H__
|
||||
|
||||
#include "JSystem/JSupport/JSUInputStream.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class JSURandomInputStream {
|
||||
class JSURandomInputStream : public JSUInputStream {
|
||||
public:
|
||||
void getAvailable(void) const;
|
||||
JSURandomInputStream();
|
||||
virtual ~JSURandomInputStream();
|
||||
|
||||
/* vt[3] */ virtual s32 getAvailable() const; /* override */
|
||||
/* vt[4] */ virtual s32 skip(s32); /* override */
|
||||
/* vt[5] */ virtual s32 readData() = 0;
|
||||
/* vt[6] */ virtual s32 getLength() const = 0;
|
||||
/* vt[7] */ virtual s32 getPosition() const = 0;
|
||||
/* vt[7] */ virtual s32 seekPos() = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user