summaryrefslogtreecommitdiff
path: root/mappers
diff options
context:
space:
mode:
Diffstat (limited to 'mappers')
-rw-r--r--mappers/mapper.c10
-rw-r--r--mappers/mapper_002_2.c7
2 files changed, 7 insertions, 10 deletions
diff --git a/mappers/mapper.c b/mappers/mapper.c
index 0b5612b..84586e9 100644
--- a/mappers/mapper.c
+++ b/mappers/mapper.c
@@ -24,23 +24,23 @@ static void mapper_default_ciram_write(struct nes_state *state, uint32_t addr, u
// static void mapper_default_chr_write(struct nes_state *state, uint32_t addr, uint8_t value) { }
// static void mapper_default_tick(struct nes_state *state) { }
-__attribute__((naked)) void mapper_default_prg_rom_write(struct nes_state *state, uint32_t addr, uint8_t value) {
+__attribute__((naked)) static void mapper_default_prg_rom_write(struct nes_state *state, uint32_t addr, uint8_t value) {
__asm__ __volatile__("ret");
}
-__attribute__((naked)) uint8_t mapper_default_prg_ram_read(struct nes_state *state, uint32_t addr) {
+__attribute__((naked)) static uint8_t mapper_default_prg_ram_read(struct nes_state *state, uint32_t addr) {
__asm__ __volatile__("xor %%al, %%al\n\t" "ret" : : : "al");
}
-__attribute__((naked)) void mapper_default_prg_ram_write(struct nes_state *state, uint32_t addr, uint8_t value) {
+__attribute__((naked)) static void mapper_default_prg_ram_write(struct nes_state *state, uint32_t addr, uint8_t value) {
__asm__ __volatile__("ret");
}
-__attribute__((naked)) void mapper_default_chr_write(struct nes_state *state, uint32_t addr, uint8_t value) {
+__attribute__((naked)) static void mapper_default_chr_write(struct nes_state *state, uint32_t addr, uint8_t value) {
__asm__ __volatile__("ret");
}
-__attribute__((naked)) void mapper_default_tick(struct nes_state *state) {
+__attribute__((naked)) static void mapper_default_tick(struct nes_state *state) {
__asm__ __volatile__("ret");
}
diff --git a/mappers/mapper_002_2.c b/mappers/mapper_002_2.c
index d3df77d..b65ce33 100644
--- a/mappers/mapper_002_2.c
+++ b/mappers/mapper_002_2.c
@@ -4,13 +4,10 @@ __attribute__((section(".mapper_002_2")))
static uint8_t mapper_002_2_prg_rom_read(struct nes_state *state, uint32_t addr) {
struct mapper_002_2 *mapper = &state->mapper_data.m002_2;
- if(addr < 0xc000) {
- return mapper->prg_bank0[addr & 0x3fff];
-
- } else {
+ if(addr >= 0xc000) {
return mapper->prg_bank1[addr & 0x3fff];
}
- return 0;
+ return mapper->prg_bank0[addr & 0x3fff];
}
__attribute__((section(".mapper_002_2")))