diff --git a/Gayle.c b/Gayle.c index e051095..36c7de2 100644 --- a/Gayle.c +++ b/Gayle.c @@ -158,8 +158,7 @@ void writeGayleB(unsigned int address, unsigned int value) { if (address == GIRQ) { // printf("Write Byte to Gayle GIRQ 0x%06x (0x%06x)\n",address,value); - gayle_irq = - (gayle_irq & value) | (value & (GAYLE_IRQ_RESET | GAYLE_IRQ_BERR)); + gayle_irq = (gayle_irq & value) | (value & (GAYLE_IRQ_RESET | GAYLE_IRQ_BERR)); return; } @@ -247,6 +246,8 @@ uint8_t readGayleB(unsigned int address) { if (address == GIRQ) { // printf("Read Byte From GIRQ Space 0x%06x\n",gayle_irq); + return 0x80;//gayle_irq; +/* uint8_t irq; irq = ide0->drive->intrq; @@ -256,7 +257,8 @@ uint8_t readGayleB(unsigned int address) { } return 0; - } +*/ + } if (address == GCS) { printf("Read Byte From GCS Space 0x%06x\n", 0x1234); diff --git a/bitstream.svf b/bitstream.svf index 8103b7b..a37c83c 100644 --- a/bitstream.svf +++ b/bitstream.svf @@ -14,7 +14,7 @@ ! !Quartus II SVF converter 13.0 ! -!Device #1: EPM570 - output_files/max2.pof Sun Nov 22 11:45:08 2020 +!Device #1: EPM570 - output_files/max2.pof Mon Nov 23 16:52:29 2020 ! !NOTE "USERCODE" "0032528E"; ! diff --git a/emulator.c b/emulator.c index 35b6b9e..730927f 100644 --- a/emulator.c +++ b/emulator.c @@ -259,7 +259,7 @@ int main() { usleep(1500); m68k_init(); - m68k_set_cpu_type(M68K_CPU_TYPE_68030); + m68k_set_cpu_type(M68K_CPU_TYPE_68040); m68k_pulse_reset(); if (maprom == 1) { @@ -280,13 +280,18 @@ int main() { m68k_pulse_reset(); while (42) { - m68k_execute(3000); - if (GET_GPIO(1) == 0) { + m68k_execute(300); + + if (GET_GPIO(1) == 0){ srdata = read_reg(); m68k_set_irq((srdata >> 13) & 0xff); } else { - m68k_set_irq(0); +// if (CheckIrq() == 1) +// m68k_set_irq(2); +// else + m68k_set_irq(0); }; + } return 0; @@ -324,7 +329,7 @@ unsigned int m68k_read_memory_8(unsigned int address) { return read8((uint32_t)address); } - return 0; + return 1; } unsigned int m68k_read_memory_16(unsigned int address) { @@ -346,7 +351,7 @@ unsigned int m68k_read_memory_16(unsigned int address) { return (unsigned int)read16((uint32_t)address); } - return 0; + return 1; } unsigned int m68k_read_memory_32(unsigned int address) { @@ -370,7 +375,7 @@ unsigned int m68k_read_memory_32(unsigned int address) { return (a << 16) | b; } - return 0; + return 1; } void m68k_write_memory_8(unsigned int address, unsigned int value) { @@ -443,7 +448,8 @@ void write16(uint32_t address, uint32_t data) { uint32_t data_r = (~data & 0x0000ffff) << 8; // asm volatile ("dmb" ::: "memory"); - W16 *(gpio) = gpfsel0_o; + W16 + *(gpio) = gpfsel0_o; *(gpio + 1) = gpfsel1_o; *(gpio + 2) = gpfsel2_o; @@ -484,7 +490,8 @@ void write8(uint32_t address, uint32_t data) { uint32_t data_r = (~data & 0x0000ffff) << 8; // asm volatile ("dmb" ::: "memory"); - W8 *(gpio) = gpfsel0_o; + W8 + *(gpio) = gpfsel0_o; *(gpio + 1) = gpfsel1_o; *(gpio + 2) = gpfsel2_o; @@ -521,8 +528,7 @@ uint32_t read16(uint32_t address) { // asm volatile ("dmb" ::: "memory"); R16 - - *(gpio) = gpfsel0_o; + *(gpio) = gpfsel0_o; *(gpio + 1) = gpfsel1_o; *(gpio + 2) = gpfsel2_o; @@ -558,7 +564,8 @@ uint32_t read8(uint32_t address) { uint32_t addr_l_r = (~address >> 16) << 8; // asm volatile ("dmb" ::: "memory"); - R8 *(gpio) = gpfsel0_o; + R8 + *(gpio) = gpfsel0_o; *(gpio + 1) = gpfsel1_o; *(gpio + 2) = gpfsel2_o; @@ -587,10 +594,9 @@ uint32_t read8(uint32_t address) { val = (val >> 8) & 0xffff; if ((address & 1) == 0) - val = (val >> 8) & 0xff; // EVEN, A0=0,UDS + return (val >> 8) & 0xff; // EVEN, A0=0,UDS else - val = val & 0xff; // ODD , A0=1,LDS - return val; + return val & 0xff; // ODD , A0=1,LDS } /******************************************************/