nesemu/cpu/ram.c

22 lines
393 B
C
Raw Normal View History

2023-11-26 12:11:49 -05:00
//
// Created by william on 30/09/23.
//
#include "ram.h"
#include "../include/cpu.h"
byte ram[MEM_RAM_AMOUNT];
void ram_set_byte(address addr, byte byte) {
ram[addr] = byte;
}
byte ram_get_byte(address addr) {
return ram[addr];
}
word ram_get_word(address addr) {
word word = ram_get_byte(addr);
word += ram_get_byte(addr + 1) << 8; // Little endian
return word;
}