diff --git a/dmg_boot.bin b/dmg_boot.bin new file mode 100644 index 0000000..afa0ee4 Binary files /dev/null and b/dmg_boot.bin differ diff --git a/mem.cpp b/mem.cpp new file mode 100644 index 0000000..a45c48f --- /dev/null +++ b/mem.cpp @@ -0,0 +1,37 @@ +#include "mem.h" +#include + +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) + { + + } + +} diff --git a/mem.h b/mem.h index d539fdf..afc2000 100644 --- a/mem.h +++ b/mem.h @@ -3,7 +3,10 @@ namespace mem { + #define MAPPER_NONE 0 + + void init(const uint8_t* rom, const int size); void reset(); uint8_t readMem(uint16_t address); void writeMem(uint16_t address, uint8_t value); -} \ No newline at end of file +} diff --git a/tetris.gb b/tetris.gb new file mode 100644 index 0000000..fbcef42 Binary files /dev/null and b/tetris.gb differ