resonance 1.0.1
Loading...
Searching...
No Matches
Rnd::ToolStream Class Reference

Stream over a refilling transport. More...

#include <toolstream.h>

Inheritance diagram for Rnd::ToolStream:
Collaboration diagram for Rnd::ToolStream:

Public Member Functions

 ToolStream ()
 Construct an empty stream over a 0x4000-byte buffer from the untagged heap.
void Connect ()
 Report to the debug console where the transport should deliver.
virtual ~ToolStream ()
virtual Stream & Read (void *pDest, int nSize)
virtual Stream & Write (const void *pSrc, int nSize)
virtual Stream & Flush ()
virtual Stream & Seek (int nOffset, int nWhence)
virtual int Tell ()
virtual int Eof ()
virtual int Fail ()
Public Member Functions inherited from Rnd::Stream
virtual Stream & ReadLE (void *pDest, int nSize)
 Move nSize bytes into pDest, correcting the byte order for the host.
virtual Stream & WriteLE (const void *pSrc, int nSize)
 Move nSize bytes out of pSrc, correcting the byte order for the file.
virtual ~Stream ()
 Close the stream.
Stream & ReadString (HxStr &name)
 Read a NUL-terminated name and append it to a string.

Detailed Description

Stream over a refilling transport.

Its RTTI descriptor is at 0x008eefe8. It has single inheritance from Rnd::Stream at offset 0. Its vtable is at 0x00826118.

The stream reads a source that arrives in instalments. Read() spins on Eof() until data is present, copies what the buffer already holds, then calls Flush() to refill and spins again, repeating until the request is satisfied. Eof() compares mArrived with mConsumed, and the destructor releases mBuffer.

Flush() resets mCursor and copies mArrived into mConsumed, which makes Eof() true again. The pair is a delivery counter the transport advances and the snapshot of it taken at the last refill. The constructor's highest store is +0x14, so the object is 0x18 bytes.

The stream is read-only in the shipped build. Write() reports "Can't write to a PS ToolStream" and stops the machine, and both Tell() and Fail() always report 0.

Constructor & Destructor Documentation

◆ ToolStream()

Rnd::ToolStream::ToolStream ( )

Construct an empty stream over a 0x4000-byte buffer from the untagged heap.

Ghidra address:
NTSC-U/C: 0x00510238
Ghidra address:
PAL: 0x0054f820

◆ ~ToolStream()

virtual Rnd::ToolStream::~ToolStream ( )
virtual
Ghidra address:
NTSC-U/C: 0x00510288
Ghidra address:
PAL: 0x0054f870

Member Function Documentation

◆ Connect()

void Rnd::ToolStream::Connect ( )

Report to the debug console where the transport should deliver.

Prints "ToolStream connect:" followed by the addresses of mFill, mArrived, and mConsumed and of the buffer, so the host tool can write into them. No call site survives in the shipped program, and the name is inferred from the text.

Ghidra address:
NTSC-U/C: 0x00510480
Ghidra address:
PAL: 0x0054fa68

◆ Read()

virtual Stream & Rnd::ToolStream::Read ( void * pDest,
int nSize )
virtual
Ghidra address:
NTSC-U/C: 0x00510308
Ghidra address:
PAL: 0x0054f8f0

Implements Rnd::Stream.

◆ Write()

virtual Stream & Rnd::ToolStream::Write ( const void * pSrc,
int nSize )
virtual
Ghidra address:
NTSC-U/C: 0x00510400
Ghidra address:
PAL: 0x0054f9e8

Implements Rnd::Stream.

◆ Flush()

virtual Stream & Rnd::ToolStream::Flush ( )
virtual
Ghidra address:
NTSC-U/C: 0x00510468
Ghidra address:
PAL: 0x0054fa50

Implements Rnd::Stream.

◆ Seek()

virtual Stream & Rnd::ToolStream::Seek ( int nOffset,
int nWhence )
virtual
Ghidra address:
NTSC-U/C: 0x0050fde0
Ghidra address:
PAL: 0x0054f3c8

Implements Rnd::Stream.

◆ Tell()

virtual int Rnd::ToolStream::Tell ( )
virtual
Ghidra address:
NTSC-U/C: 0x0050fde8
Ghidra address:
PAL: 0x0054f3d0

Implements Rnd::Stream.

◆ Eof()

virtual int Rnd::ToolStream::Eof ( )
virtual
Ghidra address:
NTSC-U/C: 0x005102f0
Ghidra address:
PAL: 0x0054f8d8

Implements Rnd::Stream.

◆ Fail()

virtual int Rnd::ToolStream::Fail ( )
virtual
Ghidra address:
NTSC-U/C: 0x005102e8
Ghidra address:
PAL: 0x0054f8d0

Implements Rnd::Stream.


The documentation for this class was generated from the following file: