uint8_t CheckIrq(void){
uint8_t irq;
+
+ if (gayle_int & (1<<7)){
irq = ide0->drive->intrq;
// if (irq==0)
-// printf("IDE IRQ: 0\n");
-
-return irq;
+// printf("IDE IRQ: %x\n",irq);
+ return irq;
+ };
+ return 0;
}
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));
+
return;
}
if (address == GIRQ){
// printf("Read Byte From GIRQ Space 0x%06x\n",gayle_irq);
+
+ uint8_t irq;
+ irq = ide0->drive->intrq;
+
+ if (irq == 1){
+ //printf("IDE IRQ: %x\n",irq);
return 0x80;//gayle_irq;
- }
+ }
+
+ return 0;
+ }
if (address == GCS){
printf("Read Byte From GCS Space 0x%06x\n",0x1234);
#define FASTBASE 0x07FFFFFF
-//#define FASTSIZE 0xFFFFFF
#define FASTSIZE 0xFFFFFFF
#define GAYLEBASE 0xD80000 //D7FFFF
#define GAYLESIZE 0x6FFFF
toggle = 0;
/*
- pthread_t id;
- int err;
-
+ pthread_t id;
+ int err;
//err = pthread_create(&id, NULL, &iplThread, NULL);
if (err != 0)
printf("\ncan't create IPL thread :[%s]", strerror(err));
else
printf("\n IPL Thread created successfully\n");
*/
+
m68k_pulse_reset();
while(42) {
- m68k_execute(50);
+ m68k_execute(6000);
//usleep(1);
//printf("IRQ:0x%06x\n",CheckIrq());
- if (CheckIrq() == 1)
- m68k_set_irq(2);
- else
- m68k_set_irq(0);
+
+ //if (CheckIrq() == 1)
+ // m68k_set_irq(2);
+ //else
+ // m68k_set_irq(0);
+
+
+ if (GET_GPIO(1) == 0){
+ srdata = read_reg();
+ m68k_set_irq((srdata >> 13)&0xff);
+ } else {
+ m68k_set_irq(0);
+ };
+
+/*
+
if (GET_GPIO(1) == 0 || CheckIrq() == 1){
srdata = read_reg();
// if (CheckIrq() == 1) srdata |= (1 << 14);
toggle = 0;
}
}
+*/
+
}