- Comencem a implementar la memòria
- Afegim la boot rom, i el tetris pa anar probant
This commit is contained in:
37
mem.cpp
Normal file
37
mem.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#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)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user