void memorymap_registers_write(uint32 Addr, uint8 Value) { #ifdef DEBUG printf("Addr 0x%.2x, Value 0x%.2x\n", Addr, Value); #endif memorymap_regs[Addr&0x1fff] = Value; switch (Addr&0x1fff) { case 0x00: case 0x01: case 0x02: case 0x03: gpu_write(Addr, Value); break; case 0x22: io_write(Addr, Value); break; case 0x23: case 0x24: timer_write(Addr, Value); break; case 0x26: //fprintf(log_get(), "memorymap: writing 0x%.2x to rom bank register\n", Value); memorymap_lowerRomBank = memorymap_programRom + ((((uint32)Value) & 0x60) << 9); memorymap_upperRomBank = memorymap_programRom + (memorymap_programRomSize==0x10000?0xc000:0x4000); return; case 0x27: //fprintf(log_get(), "regs: writing 0x%.2x from 0x%.4x\n", Value, Addr); break; case 0x10: case 0x11: case 0x12: case 0x13: // ALEK case 0x14: case 0x15: case 0x16: case 0x17: // ALEK #ifndef NOAUDIO soundport_w(((Addr&0x4)>>2), Addr&3, Value); break; #endif //sound_write(Addr&7, Value); break; case 0x28: case 0x29: case 0x2a: #ifndef NOAUDIO svision_noise_w(Addr&0x07, Value); break; #endif //sound_noise_write(Addr&0x07, Value); break; case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: #ifdef GP2X if(currentConfig.enable_sound) sound_audio_dma(Addr&0x07, Value); break; #else svision_sounddma_w(Addr&0x07, Value); break; #endif break; } }
static WRITE8_HANDLER(svision_w) { int value; int delay; svision_reg[offset] = data; switch (offset) { case 2: case 3: break; case 0x26: /* bits 5,6 memory management for a000? */ logerror("%.6f svision write %04x %02x\n",timer_get_time(),offset,data); memory_set_bankptr(1, memory_region(REGION_USER1) + ((svision_reg[0x26] & 0xe0) << 9)); svision_irq(); break; case 0x23: /* delta hero irq routine write */ value = data; if (!data) value = 0x100; if (BANK & 0x10) delay = 16384; else delay = 256; timer_enable(svision.timer1, TRUE); timer_reset(svision.timer1, TIME_IN_CYCLES(value * delay, 0)); break; case 0x10: case 0x11: case 0x12: case 0x13: svision_soundport_w(svision_channel + 0, offset & 3, data); break; case 0x14: case 0x15: case 0x16: case 0x17: svision_soundport_w(svision_channel + 1, offset & 3, data); break; case 0x18: case 0x19: case 0x1a: case 0x1b: case 0x1c: svision_sounddma_w(offset - 0x18, data); break; case 0x28: case 0x29: case 0x2a: svision_noise_w(offset - 0x28, data); break; default: logerror("%.6f svision write %04x %02x\n", timer_get_time(), offset, data); break; } }