|
|
1.1 root 1: /*
2: Hatari - stMemory.h
3:
4: This file is distributed under the GNU Public License, version 2 or at
5: your option any later version. Read the file gpl.txt for details.
6: */
7:
8: #ifndef HATARI_STMEMORY_H
9: #define HATARI_STMEMORY_H
10:
11: #include "main.h"
12: #include "sysdeps.h"
13: #include "maccess.h"
14: #include "memory.h"
15:
16: extern Uint32 NEXTRamEnd;
17:
1.1.1.3 root 18: extern Uint8 NEXTRam[128*1024*1024];
1.1 root 19: extern Uint8 NEXTRom[0x20000];
20: extern Uint8 NEXTIo[0x20000];
21:
22: /* Offset NEXT address to PC pointer: */
23: // # define NEXTRAM_ADDR(Var) ((unsigned long)NEXTRam+((Uint32)(Var) & 0x03ffffff))
24:
25: /**
1.1.1.4 ! root 26: * Write 32-bit word into NeXT memory space.
1.1 root 27: * NOTE - value will be convert to 68000 endian
28: */
29: static inline void NEXTMemory_WriteLong(Uint32 Address, Uint32 Var)
30: {
31: put_long(Address, Var);
32: }
33:
34:
35: /**
1.1.1.4 ! root 36: * Write 16-bit word into NeXT memory space.
1.1 root 37: * NOTE - value will be convert to 68000 endian.
38: */
39: static inline void NEXTMemory_WriteWord(Uint32 Address, Uint16 Var)
40: {
41: put_word(Address, Var);
42: }
43:
44: /**
1.1.1.4 ! root 45: * Write 8-bit byte into NeXT memory space.
1.1 root 46: */
47: static inline void NEXTMemory_WriteByte(Uint32 Address, Uint8 Var)
48: {
49: put_byte(Address, Var);
50: }
51:
52:
53: /**
1.1.1.4 ! root 54: * Read 32-bit word from NeXT memory space.
1.1 root 55: * NOTE - value will be converted to PC endian.
56: */
57: static inline Uint32 NEXTMemory_ReadLong(Uint32 Address)
58: {
59: return get_long(Address);
60: }
61:
62:
63: /**
1.1.1.4 ! root 64: * Read 16-bit word from NeXT memory space.
1.1 root 65: * NOTE - value will be converted to PC endian.
66: */
67: static inline Uint16 NEXTMemory_ReadWord(Uint32 Address)
68: {
69: return get_word(Address);
70: }
71:
72:
73: /**
1.1.1.4 ! root 74: * Read 8-bit byte from NeXT memory space
1.1 root 75: */
76: static inline Uint8 NEXTMemory_ReadByte(Uint32 Address)
77: {
78: return get_byte(Address);
79: }
80:
81: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.