Ejemplo n.º 1
0
static void mon_register_set_val(int mem, int reg_id, WORD val)
{
    h6809_regs_t *reg_ptr;

    if (monitor_diskspace_dnr(mem) >= 0) {
        if (!check_drive_emu_level_ok(monitor_diskspace_dnr(mem) + 8)) {
            return;
        }
    }

    reg_ptr = mon_interfaces[mem]->h6809_cpu_regs;

    switch (reg_id) {
        case e_X:
            H6809_REGS_SET_X(reg_ptr, val);
            break;
        case e_Y:
            H6809_REGS_SET_Y(reg_ptr, val);
            break;
        case e_U:
            H6809_REGS_SET_U(reg_ptr, val);
            break;
        case e_SP:
            H6809_REGS_SET_S(reg_ptr, val);
            break;
        case e_PC:
            H6809_REGS_SET_PC(reg_ptr, val);
            break;
        case e_DP:
            H6809_REGS_SET_DP(reg_ptr, (BYTE)val);
            break;
        case e_FLAGS:
            H6809_REGS_SET_CC(reg_ptr, (BYTE)val);
            break;
        case e_A:
            H6809_REGS_SET_A(reg_ptr, (BYTE)val);
            break;
        case e_B:
            H6809_REGS_SET_B(reg_ptr, (BYTE)val);
            break;
        case e_D:
            H6809_REGS_SET_D(reg_ptr, val);
            break;
        default:
            log_error(LOG_ERR, "Unknown register!");
            return;
    }
    force_array[mem] = 1;
}
Ejemplo n.º 2
0
static void mon_register_set_val(int mem, int reg_id, WORD val)
{
    h6809_regs_t *reg_ptr;

    if (monitor_diskspace_dnr(mem) >= 0) {
        if (!check_drive_emu_level_ok(monitor_diskspace_dnr(mem) + 8)) {
            return;
        }
    }

    reg_ptr = mon_interfaces[mem]->h6809_cpu_regs;

    switch (reg_id) {
        case e_X:
            H6809_REGS_SET_X(reg_ptr, val);
            break;
        case e_Y:
            H6809_REGS_SET_Y(reg_ptr, val);
            break;
        case e_U:
            H6809_REGS_SET_U(reg_ptr, val);
            break;
        case e_SP:
            H6809_REGS_SET_S(reg_ptr, val);
            break;
        case e_PC:
            H6809_REGS_SET_PC(reg_ptr, val);
            break;
        case e_DP:
            H6809_REGS_SET_DP(reg_ptr, (BYTE)val);
            break;
        case e_FLAGS:
            H6809_REGS_SET_CC(reg_ptr, (BYTE)val);
            break;
        case e_A:
            H6809_REGS_SET_A(reg_ptr, (BYTE)val);
            break;
        case e_B:
            H6809_REGS_SET_B(reg_ptr, (BYTE)val);
            break;
        case e_D:
            H6809_REGS_SET_D(reg_ptr, val);
            break;
#if 0
        /* 6309 specific registers, for future support */
        case e_E:
            H6809_REGS_SET_E(reg_ptr, (BYTE)val);
            break;
        case e_F:
            H6809_REGS_SET_F(reg_ptr, (BYTE)val);
            break;
        case e_W:
            H6809_REGS_SET_W(reg_ptr, (WORD)val);
            break;
        case e_Q:
            H6809_REGS_SET_Q(reg_ptr, (DWORD)val);
            break;
        case e_V:
            H6809_REGS_SET_V(reg_ptr, (WORD)val);
            break;
        case e_MD:
            H6809_REGS_SET_MD(reg_ptr, (BYTE)val);
            break;
#endif
        default:
            log_error(LOG_ERR, "Unknown register!");
            return;
    }
    force_array[mem] = 1;
}