summaryrefslogtreecommitdiff
path: root/context.h
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2023-02-27 19:50:41 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2023-02-28 09:17:34 -0400
commit5df5d5e1c2acbcabace6936ee7b763f7995f9d0a (patch)
treec57a8ecebde4c4348b1ab5854fe4f4e89f6eda0c /context.h
parent91847f04a552098883541d2c4ab5d0a05120c8f5 (diff)
PSOV3Encryption: Add, and fully match `PSOV3Encryption`
Boy, that took way too long to match, mainly due to regalloc issues in `update_stream()`.
Diffstat (limited to 'context.h')
-rw-r--r--context.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/context.h b/context.h
index de848b6..142e060 100644
--- a/context.h
+++ b/context.h
@@ -829,3 +829,31 @@ private:
return this->task_flags & flags;
};
};
+
+// pso/PSOV3Encryption.h
+class PSOEncryption {
+public:
+ PSOEncryption();
+ virtual void update_stream() = 0;
+ virtual ~PSOEncryption();
+ virtual void encrypt(u32 seed) = 0;
+ virtual u32 next() = 0;
+};
+
+class PSOV3Encryption : public PSOEncryption {
+public:
+ PSOV3Encryption();
+ virtual void update_stream() override;
+ virtual ~PSOV3Encryption();
+ virtual void encrypt(u32 seed) override;
+ virtual u32 next() override;
+
+ PRIVATE_MEMBER_ACCESSORS_ARRAY(u32, buffer, 522);
+ PRIVATE_MEMBER_ACCESSORS(u32 *, buffer_start);
+ PRIVATE_MEMBER_ACCESSORS(u32 *, buffer_end);
+
+private:
+ TArray<u32, 522> m_buffer;
+ u32 *m_buffer_start;
+ u32 *m_buffer_end;
+};