2023-11-26 12:11:49 -05:00
|
|
|
//
|
|
|
|
// Created by william on 10/15/23.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "../include/mapper.h"
|
2024-01-06 14:27:09 -05:00
|
|
|
#include "../include/system.h"
|
2023-11-26 12:11:49 -05:00
|
|
|
|
|
|
|
#ifndef NESEMULATOR_MEMORY_H
|
|
|
|
#define NESEMULATOR_MEMORY_H
|
|
|
|
|
2024-01-06 14:27:09 -05:00
|
|
|
/**
|
|
|
|
* Gets a byte from a system's memory.
|
|
|
|
*
|
|
|
|
* @param addr The address to get
|
|
|
|
* @return The value of the byte at the given address.
|
|
|
|
*/
|
2024-05-06 20:23:44 -04:00
|
|
|
byte mem_get_byte(address addr);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a pointer to a byte in the memory.
|
|
|
|
* Should not be used by the CPU, because the PPU will not be triggered if reading some addresses.
|
|
|
|
*
|
|
|
|
* @param addr The address to get a pointer to
|
|
|
|
* @return A pointer to the byte in memory
|
|
|
|
*/
|
|
|
|
byte* mem_get_ptr(address addr);
|
2024-01-06 14:27:09 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a word from a system's memory.
|
|
|
|
*
|
|
|
|
* @param addr The address to get
|
|
|
|
* @return The value of the word at the given address.
|
|
|
|
*/
|
2024-05-06 20:23:44 -04:00
|
|
|
word mem_get_word(address addr);
|
2024-01-06 14:27:09 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets a byte in a system's memory.
|
|
|
|
*
|
|
|
|
* @param addr The address to set
|
|
|
|
* @param value The value to set
|
|
|
|
*/
|
2024-05-06 20:23:44 -04:00
|
|
|
void mem_set_byte(address addr, byte value);
|
2023-11-26 12:11:49 -05:00
|
|
|
|
|
|
|
#endif //NESEMULATOR_MEMORY_H
|