|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zmpp.base.MemorySection
public class MemorySection
A MemorySection object wraps a reference to a MemoryAccess object, a length and a start to support subsections within memory. All access functions will be relative to the initialized start offset within the global memory.
Constructor Summary | |
---|---|
MemorySection(MemoryAccess memaccess,
int start,
int length)
|
Method Summary | |
---|---|
int |
getLength()
Returns the length of this object in bytes. |
byte |
readByte(int address)
Returns the signed 8 bit value at specified address. |
short |
readShort(int address)
Returns the signed 16 bit word at the specified address. |
long |
readUnsigned32(int address)
Reads the unsigned 32 bit word at the specified address. |
short |
readUnsignedByte(int address)
Returns the unsigned 8 bit value at the specified address. |
int |
readUnsignedShort(int address)
Reads the unsigned 16 bit word at the specified address. |
void |
writeByte(int address,
byte value)
Writes a byte value to the specified address. |
void |
writeShort(int address,
short value)
Writes a short value to the memory. |
void |
writeUnsigned32(int address,
long value)
Writes an unsigned 32 bit value to the specified address. |
void |
writeUnsignedByte(int address,
short value)
Writes an unsigned byte value to the specified address. |
void |
writeUnsignedShort(int address,
int value)
Writes an unsigned 16 bit value to the specified address. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MemorySection(MemoryAccess memaccess, int start, int length)
Method Detail |
---|
public int getLength()
public void writeUnsignedShort(int address, int value)
writeUnsignedShort
in interface MemoryAccess
address
- the address to write tovalue
- the value to writepublic void writeShort(int address, short value)
writeShort
in interface MemoryAccess
address
- the addressvalue
- the valuepublic void writeUnsignedByte(int address, short value)
writeUnsignedByte
in interface MemoryAccess
address
- the address to write tovalue
- the value to writepublic void writeByte(int address, byte value)
writeByte
in interface MemoryAccess
address
- the addressvalue
- the valuepublic void writeUnsigned32(int address, long value)
writeUnsigned32
in interface MemoryAccess
address
- the address to write tovalue
- the value to writepublic long readUnsigned32(int address)
readUnsigned32
in interface MemoryReadAccess
address
- the address
public int readUnsignedShort(int address)
readUnsignedShort
in interface MemoryReadAccess
address
- the address
public short readShort(int address)
readShort
in interface MemoryReadAccess
address
- the address
public short readUnsignedByte(int address)
readUnsignedByte
in interface MemoryReadAccess
address
- the address
public byte readByte(int address)
readByte
in interface MemoryReadAccess
address
- the byte address
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |