38 lines
650 B
C++
38 lines
650 B
C++
#include "mem.h"
|
|
#include <stdlib.h>
|
|
|
|
namespace mem
|
|
{
|
|
char *title = nullptr;
|
|
uint8_t *memory = nullptr;
|
|
uint8_t *mapper_type = nullptr;
|
|
uint8_t *rom_size = nullptr;
|
|
uint8_t *ram_size = nullptr;
|
|
|
|
void init(const uint8_t* rom, const int size)
|
|
{
|
|
if (memory) free(memory);
|
|
memory = (uint8_t*)malloc(size);
|
|
title = (char*)&memory[0x134];
|
|
mapper_type = &memory[0x147];
|
|
rom_size = &memory[0x148];
|
|
ram_size = &memory[0x149];
|
|
}
|
|
|
|
void reset()
|
|
{
|
|
|
|
}
|
|
|
|
uint8_t readMem(uint16_t address)
|
|
{
|
|
|
|
}
|
|
|
|
void writeMem(uint16_t address, uint8_t value)
|
|
{
|
|
|
|
}
|
|
|
|
}
|