Example #1
0
        private void Cpu_BeforeInstructionFetch(object sender, BeforeInstructionFetchEventArgs e)
        {
            if (cpu.Registers.PC == EXTBIO)
            {
                HandleExtbioCall();
            }

            if (cpu.Registers.PC == EntryPointAddress && slots.GetCurrentSlot(1) == slotNumber)
            {
                HandleEntryPointCall();
            }
        }
Example #2
0
        private void CpuOnBeforeInstructionFetch(object sender, BeforeInstructionFetchEventArgs e)
        {
            if (!hookedMethods.ContainsKey(regs.PC))
            {
                return;
            }

            if (segmentNumber == null &&
                (mappedRam = slotsSystem.GetSlotContents(slotsSystem.GetCurrentSlot(1)) as IMappedRam) != null &&
                ExtractString(0x4000, 14) == "FileSysDriver")
            {
                segmentNumber = mappedRam.GetBlockInBank(1);
            }

            if (segmentNumber != null &&
                mappedRam?.GetBlockInBank(1) == segmentNumber.Value &&
                slotsSystem.GetSlotContents(slotsSystem.GetCurrentSlot(1)) == mappedRam)
            {
                hookedMethods[regs.PC]();
                cpu.ExecuteRet();
            }
        }
        private void BeforeZ80InstructionFetch(ushort instructionAddress)
        {
            if (memory.GetCurrentSlot(1) != slotNumber)
            {
                return;
            }

            if (kernelRoutines.ContainsKey(z80.Registers.PC))
            {
                var routine = kernelRoutines[z80.Registers.PC];
                routine();
                z80.ExecuteRet();
            }
        }