SGDK
A free and open development kit for the Sega Mega Drive
Loading...
Searching...
No Matches
sram.h
Go to the documentation of this file.
1
23
24#ifndef _SRAM_H_
25#define _SRAM_H_
26
27
28#include "mapper.h"
29
30
31#define SRAM_CONTROL MAPPER_BASE
32#define SRAM_BASE 0x200001
33
34
39void SRAM_enable(void);
44void SRAM_enableRO(void);
49void SRAM_disable(void);
50
59u8 SRAM_readByte(u32 offset);
87void SRAM_writeByte(u32 offset, u8 val);
97void SRAM_writeWord(u32 offset, u16 val);
107void SRAM_writeLong(u32 offset, u32 val);
108
109
110#endif // _SRAM_H_
Mapper / bank switch methods.
u16 SRAM_readWord(u32 offset)
Read a word from the SRAM.
void SRAM_enableRO(void)
Enable SRAM in Read Only mode.
Definition sram.c:11
void SRAM_writeWord(u32 offset, u16 val)
Write a word to the SRAM.
u32 SRAM_readLong(u32 offset)
Read a long from the SRAM.
void SRAM_enable(void)
Enable SRAM in Read Write mode.
Definition sram.c:6
void SRAM_writeByte(u32 offset, u8 val)
Write a byte to the SRAM.
Definition sram.c:27
void SRAM_disable(void)
Disable SRAM.
Definition sram.c:16
u8 SRAM_readByte(u32 offset)
Read a byte from the SRAM.
Definition sram.c:22
void SRAM_writeLong(u32 offset, u32 val)
Write a long to the SRAM.
unsigned long u32
Definition types.h:105
unsigned short u16
Definition types.h:100
unsigned char u8
Definition types.h:95