-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathMemory.java
More file actions
78 lines (57 loc) · 2.5 KB
/
Memory.java
File metadata and controls
78 lines (57 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/**
* Java Grinder
* Author: Michael Kohn
* Email: mike@mikekohn.net
* Web: https://www.mikekohn.net/
* License: GPLv3
*
* Copyright 2014-2022 by Michael Kohn
*
*/
package net.mikekohn.java_grinder;
public class Memory
{
private Memory() { }
/** Initialize a heap. Currently only needed with Amiga. */
public static void initHeap(int size) { }
/** Read a single byte from an address */
public static byte read8(int address) { return 0; }
/** Write a single byte to an address */
public static void write8(int address, byte value) { }
/** Read a 2 byte value from an address */
public static short read16(int address) { return 0; }
/** Write a 2 byte value to an address */
public static void write16(int address, short value) { }
/** Allocate a byte array on the stack. Automatically free()'d when
the current method ends. */
public static byte[] allocStackBytes(int length) { return null; }
/** Allocate a short array on the stack. Automatically free()'d when
the current method ends. */
public static short[] allocStackShorts(int length) { return null; }
/** Allocate a int array on the stack. Automatically free()'d when
the current method ends. */
public static int[] allocStackInts(int length) { return null; }
/** Load a file from disk (at assembler time) and return a reference
to it as an array of ints. Not endian safe. */
public static int[] preloadIntArray(String filename) { return null; }
/** Load a file from disk (at assembler time) and return a reference
to it as an array of ints. */
public static short[] preloadShortArray(String filename) { return null; }
/** Load a file from disk (at assembler time) and return a reference
to it as an array of ints. */
public static byte[] preloadByteArray(String filename) { return null; }
/** Clear an array of bytes. */
public static void clearArray(byte[] array) { }
/** Clear an array of short. */
public static void clearArray(short[] array) { }
/** Clear an array of int. */
public static void clearArray(int[] array) { }
/** Return the address of a byte[] as an int. */
public static int addressOf(byte[] array) { return 0; }
/** Return the address of a short[] as an int. */
public static int addressOf(short[] array) { return 0; }
/** Return the address of a char[] as an int. */
public static int addressOf(char[] array) { return 0; }
/** Return the address of a int[] as an int. */
public static int addressOf(int[] array) { return 0; }
}