void pcmcia_cardreset(struct CardResource *CardResource) { volatile struct GayleIO *gio = (struct GayleIO*)GAYLE_BASE; UBYTE x, rb, intena; Disable(); rb = CardResource->resetberr; CardResource->resetberr = GAYLE_IRQ_CARD_RESET_MASK; intena = gio->intena; gio->intena = 0; gio->intreq = GAYLE_IRQ_IDE | GAYLE_IRQ_CARD_RESET_MASK; Enable(); waitframe(10); Disable(); CardResource->resetberr = rb; x = GAYLE_IRQ_IDE | CardResource->resetberr; gio->intreq = x; Enable(); waitframe(10); gio->intena = intena; CARDDEBUG(bug("PCMCIA card reset %02x\n", x)); }
void delay_200ms(void) { unsigned char n; for (n=0;n<10;++n) { waitframe(); } }
unsigned int dotest(void) { static unsigned int res; asm("sei"); asm("jsr _savezpage"); asm("ldy #$35"); asm("sty $01"); if (dtvturbo) { dtvturboon(); } if (screenoff) { asm("ldy #$0b"); asm("sty $d011"); waitframe(); } if (c128turbo) { asm("ldy #$01"); asm("sty $d030"); } if (cpu_type == CPU_65816) { // scpumode asm("sty $d07e"); if (scpumode == 0) { asm("sty $d077"); // V1 default (no optimization) asm("ldy #%%11000001"); asm("sty $d0b3"); // V2 default (optimize zp and stack) } else if (scpumode == 1) { asm("sty $d077"); // V1 (no optimization) asm("ldy #%%11000000"); asm("sty $d0b3"); // V2 (no optimization) } else { asm("sty $d076"); // V1 (BASIC optimization) asm("ldy #%%10000100"); asm("sty $d0b3"); // V2 (Full optimization) } asm("sty $d07f"); } asm("ldy #$7f"); asm("sty $dc0d"); asm("bit $dc0d"); asm("ldy #0"); asm("sty $dc0e"); asm("ldy #$ff"); asm("sty $dc05"); asm("sty $dc04"); // asm("ldy #%%00011001"); asm("lda #$21"); asm("ldy #$19"); asm("sty $dc0e"); asm("jsr $e000"); asm("jsr $e000"); asm("ldy #0"); asm("sty $dc0e"); res = *(unsigned int*)0xdc04; // asm("ldx $dc05"); // asm("lda $dc04"); if (dtvturbo) { dtvturbooff(); } if (c128turbo) { asm("ldy #$00"); asm("sty $d030"); } if (cpu_type == CPU_65816) { // scpumode asm("sty $d07e"); asm("sty $d077"); // V1 default (no optimization) asm("ldy #%%11000001"); asm("sty $d0b3"); // V2 default (optimize zp and stack) asm("sty $d07f"); } asm("ldy #$1b"); asm("sty $d011"); asm("ldy #$36"); asm("sty $01"); asm("ldy #$40"); asm("sty $dc05"); asm("ldy #$25"); asm("sty $dc04"); asm("ldy #$11"); asm("sty $dc0e"); asm("ldy #$81"); asm("sty $dc0d"); asm("bit $dc0d"); asm("jsr _loadzpage"); asm("cli"); return res; }