private void WriteHook_SMP(uint addr, byte val) { if (MemoryCallbacks.HasWrites) { uint flags = (uint)MemoryCallbackFlags.AccessWrite; MemoryCallbacks.CallMemoryCallbacks(addr, val, flags, "SMP"); } }
public void ExecFetch(ushort addr) { if (MemoryCallbacks.HasExecutes) { uint flags = (uint)(MemoryCallbackFlags.CPUZero | MemoryCallbackFlags.AccessExecute); MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus"); } }
// TODO: move callbacks to cpu to avoid non-inlinable function call private void ExecFetch(ushort addr) { if (MemoryCallbacks.HasExecutes) { uint flags = (uint)MemoryCallbackFlags.AccessExecute; MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus"); } }
private void ReadHook_SMP(uint addr) { if (MemoryCallbacks.HasReads) { uint flags = (uint)MemoryCallbackFlags.AccessRead; MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "SMP"); } }
public byte ReadMemory(ushort addr) { uint flags = (uint)(MemoryCallbackFlags.AccessRead); MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus"); return(ReadMemoryMapper(addr)); }
public void WriteMemory(ushort addr, byte value) { WriteMemoryMapper(addr, value); uint flags = (uint)(MemoryCallbackFlags.AccessWrite); MemoryCallbacks.CallMemoryCallbacks(addr, value, flags, "System Bus"); }
private void ExecHook_SMP(uint addr) { if (MemoryCallbacks.HasExecutes) { uint flags = (uint)MemoryCallbackFlags.AccessExecute; MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "SMP"); } }
public void WriteMemoryWrapper(ushort addr, byte value) { if (MemoryCallbacks != null) { MemoryCallbacks.CallWrites(addr); } WriteMemory(addr, value); }
public byte ReadMemoryWrapper(ushort addr) { if (MemoryCallbacks != null) { MemoryCallbacks.CallReads(addr); } return(ReadMemory(addr)); }
private void WriteHook(uint addr, byte val) { uint flags = (uint)(MemoryCallbackFlags.AccessWrite); MemoryCallbacks.CallMemoryCallbacks(addr, val, flags, "System Bus"); // we RefreshMemoryCallbacks() after the trigger in case the trigger turns itself off at that point // EDIT: for now, theres some IPC re-entrancy problem // RefreshMemoryCallbacks(); }
public byte ReadMemory(ushort addr) { byte ret; if (addr >= 0x8000) { // easy optimization, since rom reads are so common, move this up (reordering the rest of these else ifs is not easy) ret = Board.ReadPrg(addr - 0x8000); } else if (addr < 0x0800) { ret = ram[addr]; } else if (addr < 0x2000) { ret = ram[addr & 0x7FF]; } else if (addr < 0x4000) { ret = Board.ReadReg2xxx(addr); } else if (addr < 0x4020) { ret = ReadReg(addr); // we're not rebasing the register just to keep register names canonical } else if (addr < 0x6000) { ret = Board.ReadExp(addr - 0x4000); } else { ret = Board.ReadWram(addr - 0x6000); } // handle cheats (currently cheats can only freeze read only areas) // there is no way to distinguish between a memory poke and a memory freeze if (num_cheats != 0) { for (int i = 0; i < num_cheats; i++) { if (cheat_indexes[i] == addr) { ret = cheat_active[addr]; } } } if (MemoryCallbacks.HasReads) { uint flags = (uint)(MemoryCallbackFlags.CPUZero | MemoryCallbackFlags.AccessRead); MemoryCallbacks.CallMemoryCallbacks(addr, ret, flags, "System Bus"); } DB = ret; return(ret); }
void InitCallbacks() { padcb = new LibVBANext.StandardCallback(() => InputCallbacks.Call()); fetchcb = new LibVBANext.AddressCallback((addr) => MemoryCallbacks.CallExecutes(addr)); readcb = new LibVBANext.AddressCallback((addr) => MemoryCallbacks.CallReads(addr)); writecb = new LibVBANext.AddressCallback((addr) => MemoryCallbacks.CallWrites(addr)); tracecb = new LibVBANext.TraceCallback((addr, opcode) => Tracer.Put(Trace(addr, opcode))); _inputCallbacks.ActiveChanged += SyncPadCallback; _memorycallbacks.ActiveChanged += SyncMemoryCallbacks; }
private void ExecHook(uint addr) { if (MemoryCallbacks.HasExecutes) { uint flags = (uint)MemoryCallbackFlags.AccessExecute; MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus"); // we RefreshMemoryCallbacks() after the trigger in case the trigger turns itself off at that point // EDIT: for now, theres some IPC re-entrancy problem // RefreshMemoryCallbacks(); } }
internal void WriteMemory(ushort addr, byte value) { if (addr != LastAddress) { DistinctAccessCount++; LastAddress = addr; } _mapper.WriteMemory((ushort)(addr & 0x1FFF), value); MemoryCallbacks.CallWrites(addr); }
private void WriteMemory(ushort addr, byte value) { if (addr != _lastAddress) { DistinctAccessCount++; _lastAddress = addr; } _mapper.WriteMemory((ushort)(addr & 0x1FFF), value); MemoryCallbacks.CallWrites(addr, "System Bus"); }
private void WriteMemory(ushort addr, byte value) { if (addr != _lastAddress) { DistinctAccessCount++; _lastAddress = addr; } _mapper.WriteMemory((ushort)(addr & 0x1FFF), value); var flags = (uint)(MemoryCallbackFlags.AccessWrite); MemoryCallbacks.CallMemoryCallbacks(addr, value, flags, "System Bus"); }
public void WriteMemory(ushort addr, byte value) { uint flags = (uint)(MemoryCallbackFlags.AccessWrite); MemoryCallbacks.CallMemoryCallbacks(addr, value, flags, "System Bus"); if (addr < 0x400) { } else { mapper.WriteMemory(addr, value); } }
public byte FetchMemoryWrapper(ushort addr) { if (MemoryCallbacks != null) { MemoryCallbacks.CallReads(addr); } if (FetchMemory != null) { return(FetchMemory(addr, false)); } return(ReadMemory(addr)); }
internal byte ReadMemory(ushort addr) { if (addr != LastAddress) { DistinctAccessCount++; LastAddress = addr; } _mapper.Bit13 = addr.Bit(13); var temp = _mapper.ReadMemory((ushort)(addr & 0x1FFF)); MemoryCallbacks.CallReads(addr); return(temp); }
public byte ReadMemory(ushort addr) { uint flags = (uint)(MemoryCallbackFlags.AccessRead); MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus"); if (addr < 0x400) { return(_bios[addr]); } else { return(mapper.ReadMemory((ushort)((addr - 0x400) | rom_bank))); } }
public byte ReadMemory(ushort addr) { if (MemoryCallbacks.HasReads) { uint flags = (uint)MemoryCallbackFlags.AccessRead; MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus"); } if (addr < 0x400) { return(_bios[addr]); } return(mapper.ReadMemory((ushort)((addr - 0x400) + bank_size * rom_bank))); }
public byte ReadMemory(ushort addr) { byte ret; if (addr >= 0x8000) { ret = Board.ReadPRG(addr - 0x8000); //easy optimization, since rom reads are so common, move this up (reordering the rest of these elseifs is not easy) } else if (addr < 0x0800) { ret = ram[addr]; } else if (addr < 0x2000) { ret = ram[addr & 0x7FF]; } else if (addr < 0x4000) { ret = Board.ReadReg2xxx(addr); } else if (addr < 0x4020) { ret = ReadReg(addr); //we're not rebasing the register just to keep register names canonical } else if (addr < 0x6000) { ret = Board.ReadEXP(addr - 0x4000); } else { ret = Board.ReadWRAM(addr - 0x6000); } //handle breakpoints and stuff. //the idea is that each core can implement its own watch class on an address which will track all the different kinds of monitors and breakpoints and etc. //but since freeze is a common case, it was implemented through its own mechanisms if (sysbus_watch[addr] != null) { sysbus_watch[addr].Sync(); ret = sysbus_watch[addr].ApplyGameGenie(ret); } MemoryCallbacks.CallReads(addr); DB = ret; return(ret); }
private byte ReadMemory(ushort addr) { if (addr != _lastAddress) { DistinctAccessCount++; _lastAddress = addr; } _mapper.Bit13 = addr.Bit(13); var temp = _mapper.ReadMemory((ushort)(addr & 0x1FFF)); _tia.BusState = temp; MemoryCallbacks.CallReads(addr); return(temp); }
private byte ReadMemory(ushort addr) { if (addr != _lastAddress) { DistinctAccessCount++; _lastAddress = addr; } _mapper.Bit13 = addr.Bit(13); var temp = _mapper.ReadMemory((ushort)(addr & 0x1FFF)); _tia.BusState = temp; var flags = (uint)(MemoryCallbackFlags.AccessRead); MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus"); return(temp); }
private void InitMemCallbacks() { ExecCallback = new LibGPGX.mem_cb(a => { uint flags = (uint)(MemoryCallbackFlags.AccessExecute); MemoryCallbacks.CallMemoryCallbacks(a, 0, flags, "M68K BUS"); }); ReadCallback = new LibGPGX.mem_cb(a => { uint flags = (uint)(MemoryCallbackFlags.AccessRead); MemoryCallbacks.CallMemoryCallbacks(a, 0, flags, "M68K BUS"); }); WriteCallback = new LibGPGX.mem_cb(a => { uint flags = (uint)(MemoryCallbackFlags.AccessWrite); MemoryCallbacks.CallMemoryCallbacks(a, 0, flags, "M68K BUS"); }); _memoryCallbacks.ActiveChanged += RefreshMemCallbacks; }
private void SetCallbacks() { _machine.Memory.ReadCallback = (addr) => { uint flags = (uint)(MemoryCallbackFlags.AccessRead); MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus"); }; _machine.Memory.WriteCallback = (addr) => { uint flags = (uint)(MemoryCallbackFlags.AccessWrite); MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus"); }; _machine.Memory.ExecuteCallback = (addr) => { uint flags = (uint)(MemoryCallbackFlags.AccessExecute); MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus"); }; _machine.Memory.InputCallback = InputCallbacks.Call; }
void InitCallbacks() { padcb = new LibVBANext.StandardCallback(() => InputCallbacks.Call()); fetchcb = new LibVBANext.AddressCallback((addr) => { uint flags = (uint)(MemoryCallbackFlags.AccessExecute); MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus"); }); readcb = new LibVBANext.AddressCallback((addr) => { uint flags = (uint)(MemoryCallbackFlags.AccessRead); MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus"); }); writecb = new LibVBANext.AddressCallback((addr) => { uint flags = (uint)(MemoryCallbackFlags.AccessWrite); MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus"); }); tracecb = new LibVBANext.TraceCallback((addr, opcode) => Tracer.Put(Trace(addr, opcode))); _inputCallbacks.ActiveChanged += SyncPadCallback; _memorycallbacks.ActiveChanged += SyncMemoryCallbacks; }
public void WriteMemory(ushort addr, byte value) { if (addr < 0x0800) { ram[addr] = value; } else if (addr < 0x2000) { ram[addr & 0x7FF] = value; } else if (addr < 0x4000) { Board.WriteReg2xxx(addr, value); } else if (addr < 0x4020) { WriteReg(addr, value); //we're not rebasing the register just to keep register names canonical } else if (addr < 0x6000) { Board.WriteExp(addr - 0x4000, value); } else if (addr < 0x8000) { Board.WriteWram(addr - 0x6000, value); } else { Board.WritePrg(addr - 0x8000, value); } if (MemoryCallbacks.HasWrites) { uint flags = (uint)(MemoryCallbackFlags.CPUZero | MemoryCallbackFlags.AccessWrite | MemoryCallbackFlags.SizeByte); MemoryCallbacks.CallMemoryCallbacks(addr, value, flags, "System Bus"); } }
public byte ReadMemory(ushort addr) { if (MemoryCallbacks.HasReads) { uint flags = (uint)MemoryCallbackFlags.AccessRead; MemoryCallbacks.CallMemoryCallbacks(addr, 0, flags, "System Bus"); } if (addr < 0x8000) { return(mapper.ReadMemory(addr)); } else if (addr < 0xC800) { return(0xFF); } else if (addr < 0xD000) { return(RAM[(addr - 0xC800) & 0x3FF]); } else if (addr < 0xD800) { return(Read_Registers(addr & 0xF)); } else if (addr < 0xE000) { return(0xFF); } else if (addr < 0xF000) { return(minestorm[addr - 0xE000]); } else { return(_bios[addr - 0xF000]); } }
private void ExecFetch(ushort addr) { MemoryCallbacks.CallExecutes(addr, "System Bus"); }