Exemplo n.º 1
0
void iec_drive_reset(struct drive_context_s *drv)
{
    if (drv->drive->type == DRIVE_TYPE_1541
        || drv->drive->type == DRIVE_TYPE_1541II
        || drv->drive->type == DRIVE_TYPE_1570
        || drv->drive->type == DRIVE_TYPE_1571
        || drv->drive->type == DRIVE_TYPE_1571CR) {
        viacore_reset(drv->via1d1541);
    } else {
        viacore_disable(drv->via1d1541);
    }

    if (drv->drive->type == DRIVE_TYPE_1570
        || drv->drive->type == DRIVE_TYPE_1571
        || drv->drive->type == DRIVE_TYPE_1571CR) {
        ciacore_reset(drv->cia1571);
    } else {
        ciacore_disable(drv->cia1571);
    }

    if (drv->drive->type == DRIVE_TYPE_1581) {
        ciacore_reset(drv->cia1581);
        wd1770_reset(drv->wd1770);
    } else {
        ciacore_disable(drv->cia1581);
    }

    if (drv->drive->type == DRIVE_TYPE_2000
        || drv->drive->type == DRIVE_TYPE_4000) {
        viacore_reset(drv->via4000);
        pc8477_reset(drv->pc8477, drv->drive->type == DRIVE_TYPE_4000);
    } else {
        viacore_disable(drv->via4000);
    }
}
Exemplo n.º 2
0
Arquivo: main.c Projeto: hoglet67/b-em
void main_reset()
{
        m6502_reset();
        crtc_reset();
        video_reset();
        sysvia_reset();
        uservia_reset();
        serial_reset();
        acia_reset(&sysacia);
        wd1770_reset();
        i8271_reset();
        scsi_reset();
        vdfs_reset();
        sid_reset();
        music4000_reset();
        music5000_reset();
        sn_init();
        if (curtube != -1) tubes[curtube].reset();
        else               tube_exec = NULL;
        tube_reset();

        memset(ram, 0, 64 * 1024);
}
Exemplo n.º 3
0
void wd1770d_reset(drive_context_t *drv)
{
    wd1770_reset(drv->mynumber);
}
Exemplo n.º 4
0
Arquivo: main.c Projeto: hoglet67/b-em
void main_run()
{
    int c, d;

    if (key[KEY_PGUP]) {
        bemfreerun = 1;
        old_key_pgup = 1;
    }
    else if (old_key_pgup) {
        old_key_pgup = 0;
        if (!key[KEY_LSHIFT] && !key[KEY_RSHIFT])
            bemfreerun = 0;
    }

    if (bemfreerun == 2) {
        // A key was pressed while freerunning; disable freerun temporarily
        // until no key is pressed any more.
        if (!key_any_down())
            bemfreerun = 1;
    }

        if ((fcount > 0 || (bemfreerun == 1) || (motor && fasttape)))
        {
                if (autoboot) autoboot--;
                fcount--;
                framesrun++;
                if (bemfreerun || (motor && fasttape)) fcount=0;
                if (x65c02) m65c02_exec();
                else        m6502_exec();
                ddnoiseframes++;
                if (ddnoiseframes >= 5)
                {
                        ddnoiseframes = 0;
                        ddnoise_mix();
                }
                key_check();
                poll_joystick();
                for (c = 0; c < 2; c++)
                {
                        joybutton[c] = 0;
                        for (d = 0; d < joy[c].num_buttons; d++)
                        {
                                if (joy[c].button[d].b) joybutton[c] = 1;
                        }
                }
                if (savestate_wantload) savestate_doload();
                if (savestate_wantsave) savestate_dosave();
                if (key[KEY_F10] && (debug_core || debug_tube)) debug_step = 1;
                if (key[KEY_F12] && !resetting)
                {
                        m6502_reset();
                        video_reset();
                        i8271_reset();
                        wd1770_reset();
                        sid_reset();
                        music5000_reset();

                        if (curtube != -1) tubes[curtube].reset();
                        tube_reset();
                }
                resetting = key[KEY_F12];
        }
        else
        {
                framesrun = 0;
                rest(1);
        }
        if (key[KEY_PGDN] && !old_key_pgdn)
            bempause ^= 1;
        old_key_pgdn = key[KEY_PGDN];
        if (key[KEY_RIGHT] && !old_key_right && bempause)
            bemstep = 1;
        old_key_right = key[KEY_RIGHT];
        if (framesrun > 10) fcount = 0;
}