当前位置: 首页>>代码示例>>C++>>正文


C++ sim_debug函数代码示例

本文整理汇总了C++中sim_debug函数的典型用法代码示例。如果您正苦于以下问题:C++ sim_debug函数的具体用法?C++ sim_debug怎么用?C++ sim_debug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sim_debug函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: mba_wrbufW

int32 mba_wrbufW (uint32 mb, int32 bc, uint16 *buf)
{
int32 i, j, ba, mbc, pbc;
uint32 pa, dat;

if (mb >= MBA_NUM)                                      /* valid MBA? */
    return 0;
ba = mba_va[mb];                                        /* get virt addr */
mbc = (MBABC_WR + 1) - mba_bc[mb];                      /* get Mbus bc */
if (bc > mbc)                                           /* use smaller */
    bc = mbc;
for (i = 0; i < bc; i = i + pbc) {                      /* loop by pages */
    if (!mba_map_addr (ba + i, &pa, mb))                /* page inv? */
        break;
    if (!ADDR_IS_MEM (pa)) {                            /* NXM? */
        mba_upd_sr (MBASR_RTMO, 0, mb);
        break;
        }
    pbc = VA_PAGSIZE - VA_GETOFF (pa);                  /* left in page */
    if (pbc > (bc - i))                                 /* limit to rem xfr */
        pbc = bc - i;
    sim_debug (MBA_DEB_XFR, &mba_dev[mb], "mba_wrbufW(pa=0x%X, bc=0x%X)\n", pa, pbc);
    if ((pa | pbc) & 1) {                               /* aligned word? */
        for (j = 0; j < pbc; pa++, j++) {               /* no, bytes */
            if ((i + j) & 1) {
                WriteB (pa, (*buf >> 8) & BMASK);
                buf++;
                }
            else WriteB (pa, *buf & BMASK);
            }
        }
开发者ID:dsphinx,项目名称:simh,代码行数:31,代码来源:vax7x0_mba.c

示例2: ports_cio_svc

t_stat ports_cio_svc(UNIT *uptr)
{
    sim_debug(TRACE_DBG, &ports_dev,
              "[ports_cio_svc] IRQ for board %d device %d\n",
              ports_int_cid, ports_int_subdev);

    if (cio[ports_int_cid].ivec > 0) {
        cio[ports_int_cid].intr = TRUE;
    }

    switch (cio[ports_int_cid].op) {
    case PPC_CONN:
        cio[ports_int_cid].op = PPC_ASYNC;
        ports_ldsc[LN(ports_int_cid, ports_int_subdev)].rcve = 1;
        sim_activate(&ports_unit[2], DELAY_ASYNC);
        break;
    case PPC_ASYNC:
        ports_update_conn(LN(ports_int_cid, ports_int_subdev));
        break;
    default:
        break;
    }

    return SCPE_OK;
}
开发者ID:jguillaumes,项目名称:simh,代码行数:25,代码来源:3b2_ports.c

示例3: EPROM_reset

t_stat EPROM_reset (DEVICE *dptr, int32 size)
{
//    sim_debug (DEBUG_flow, &EPROM_dev, "   EPROM_reset: base=0000 size=%04X\n", size);
    if ((EPROM_unit.flags & UNIT_ATT) == 0) { /* if unattached */
        EPROM_unit.capac = size;           /* set EPROM size to 0 */
        sim_debug (DEBUG_flow, &EPROM_dev, "Done1\n");
//        sim_printf("   EPROM: Available [%04X-%04XH]\n", 
//            0, EPROM_unit.capac - 1);
        return SCPE_OK;
        }
    if ((EPROM_unit.flags & UNIT_ATT) == 0) {
        sim_printf("EPROM: No file attached\n");
    }
    sim_debug (DEBUG_flow, &EPROM_dev, "Done2\n");
    return SCPE_OK;
}
开发者ID:B-Rich,项目名称:simh,代码行数:16,代码来源:ieprom.c

示例4: vid_key

void vid_key (SDL_KeyboardEvent *event)
{
    SIM_KEY_EVENT ev;

    if (vid_mouse_captured) {
        static Uint8 *KeyStates = NULL;
        static int numkeys;

        if (!KeyStates)
            KeyStates = SDL_GetKeyState(&numkeys);
        if ((event->state == SDL_PRESSED) && KeyStates[SDLK_RSHIFT] && (KeyStates[SDLK_LCTRL] || KeyStates[SDLK_RCTRL])) {
            sim_debug (SIM_VID_DBG_KEY, vid_dev, "vid_key() - Cursor Release\n");
            SDL_WM_GrabInput (SDL_GRAB_OFF);                /* relese cursor */
            SDL_ShowCursor (SDL_ENABLE);                    /* show cursor */
            vid_mouse_captured = FALSE;
            return;
        }
    }
    if (!sim_is_running)
        return;
    if (SDL_SemWait (vid_key_events.sem) == 0) {
        sim_debug (SIM_VID_DBG_KEY, vid_dev, "Keyboard Event: State: %d, Keysym: %d\n", event->state, event->keysym);
        if (vid_key_events.count < MAX_EVENTS) {
            if (event->state == SDL_PRESSED) {
                if (!vid_key_state[event->keysym.sym]) {    /* Key was not down before */
                    vid_key_state[event->keysym.sym] = TRUE;
                    ev.key = vid_map_key (event->keysym.sym);
                    ev.state = SIM_KEYPRESS_DOWN;
                }
                else {
                    ev.key = vid_map_key (event->keysym.sym);
                    ev.state = SIM_KEYPRESS_REPEAT;
                }
            }
            else {
                vid_key_state[event->keysym.sym] = FALSE;
                ev.key = vid_map_key (event->keysym.sym);
                ev.state = SIM_KEYPRESS_UP;
            }
            vid_key_events.events[vid_key_events.tail++] = ev;
            vid_key_events.count++;
            if (vid_key_events.tail == MAX_EVENTS)
                vid_key_events.tail = 0;
        }
        SDL_SemPost (vid_key_events.sem);
    }
}
开发者ID:charlesUnixPro,项目名称:dps8m,代码行数:47,代码来源:sim_video.c

示例5: csts_rd

int32 csts_rd (void)
{
int32 data;

sim_debug (TDDEB_ORD, &td_dev, "csts_rd()\n");
td_rd_o_csr ((CTLR *)td_unit.ctlr, &data);
return data;
}
开发者ID:ST3ALth,项目名称:simh,代码行数:8,代码来源:vax750_stddev.c

示例6: vid_key

void vid_key (SDL_KeyboardEvent *event)
{
SIM_KEY_EVENT ev;

if (vid_mouse_captured) {
    static const Uint8 *KeyStates = NULL;
    static int numkeys;

    if (!KeyStates)
        KeyStates = SDL_GetKeyboardState(&numkeys);
    if ((event->state == SDL_PRESSED) && KeyStates[SDL_SCANCODE_RSHIFT] && (KeyStates[SDL_SCANCODE_LCTRL] || KeyStates[SDL_SCANCODE_RCTRL])) {
        sim_debug (SIM_VID_DBG_KEY, vid_dev, "vid_key() - Cursor Release\n");
        SDL_SetRelativeMouseMode(SDL_FALSE);            /* release cursor, show cursor */
        vid_mouse_captured = FALSE;
        return;
        }
    }
if (!sim_is_running)
    return;
if (SDL_SemWait (vid_key_events.sem) == 0) {
    sim_debug (SIM_VID_DBG_KEY, vid_dev, "Keyboard Event: State: %d, Keysym(scancode,sym): (%d,%d)\n", event->state, event->keysym.scancode, event->keysym.sym);
    if (vid_key_events.count < MAX_EVENTS) {
        if (event->state == SDL_PRESSED) {
            if (!vid_key_state[event->keysym.scancode]) {    /* Key was not down before */
                vid_key_state[event->keysym.scancode] = TRUE;
                ev.key = vid_map_key (event->keysym.sym);
                ev.state = SIM_KEYPRESS_DOWN;
                }
            else {
                ev.key = vid_map_key (event->keysym.sym);
                ev.state = SIM_KEYPRESS_REPEAT;
                }
            }
        else {
            vid_key_state[event->keysym.scancode] = FALSE;
            ev.key = vid_map_key (event->keysym.sym);
            ev.state = SIM_KEYPRESS_UP;
            }
        vid_key_events.events[vid_key_events.tail++] = ev;
        vid_key_events.count++;
        if (vid_key_events.tail == MAX_EVENTS)
            vid_key_events.tail = 0;
        }
    SDL_SemPost (vid_key_events.sem);
    }
}
开发者ID:vonwenm,项目名称:simh,代码行数:46,代码来源:sim_video.c

示例7: mt_cmd

/* Start off a mag tape command */
t_stat
mt_cmd(uint16 cmd, uint16 dev, uint8 chan, uint16 *wc)
{
    UNIT        *uptr;
    int         unit = dev >> 1;

    /* Make sure valid drive number */
    if (unit > NUM_DEVS_MT || unit < 0)
        return SCPE_NODEV;

    uptr = &mt_unit[unit];
    /* If unit disabled return error */
    if (uptr->flags & UNIT_DIS)
        return SCPE_NODEV;

    if ((uptr->flags & UNIT_ATT) == 0)
        return SCPE_UNATT;

    /* Not there until loading done */
    if ((uptr->u5 & MT_LOADED))
        return SCPE_UNATT;

    /* Check if drive is ready to recieve a command */
    if ((uptr->u5 & MT_BSY) != 0)
        return SCPE_BUSY;

    /* Determine actual command */
    uptr->u5 &= ~(MT_RDY|MT_CHAN|MT_CMD|MT_BIN);
    uptr->u5 |= chan;
    if (cmd & URCSTA_BINARY)
        uptr->u5 |= MT_BIN;
    if (cmd & URCSTA_READ) {
        if ((cmd & URCSTA_WC) && *wc == 0)
           uptr->u5 |= MT_FSR;
        else
           uptr->u5 |= MT_RD;
    } else {
        /* Erase gap not supported on sim, treat as
           write of null record */
        if ((cmd & URCSTA_WC) && *wc == 0)
           uptr->u5 |= MT_INT;
        else
           uptr->u5 |= MT_WR;
    }

    *wc = 0;    /* So no overide occurs */

    /* Convert command to correct type */ 
    if (cmd & URCSTA_DIRECT)
        uptr->u5 |= MT_BACK;
    uptr->u6 = 0;
    CLR_BUF(uptr);
    sim_debug(DEBUG_CMD, &mt_dev, "Command %d %o %o\n", unit, uptr->u5, cmd);
    if ((uptr->u5 & MT_IDLE) == 0) {
       sim_activate(uptr,50000);
    }
    return SCPE_OK;
}
开发者ID:ChristineTham,项目名称:simh,代码行数:59,代码来源:b5500_mt.c

示例8: activate_timer

static int activate_timer (void)
{
    uint32 t;
    sim_debug (DBG_DEBUG, & clk_dev, "clk_svc: TR has %d time units left\n", t);
    sim_debug (DBG_DEBUG, & clk_dev, "activate_timer: TR is %lld %#llo.\n", rTR, rTR);
    if (bit_is_neg(rTR, 27)) {
        if ((t = sim_is_active(&TR_clk_unit[0])) != 0)
            sim_debug (DBG_DEBUG, & clk_dev, "activate_timer: TR cancelled with %d time units left.\n", t);
        else
            sim_debug (DBG_DEBUG, & clk_dev, "activate_timer: TR loaded with negative value, but it was alread stopped.\n", t);
        sim_cancel(&TR_clk_unit[0]);
        return 0;
    }
    if ((t = sim_is_active(&TR_clk_unit[0])) != 0) {
        sim_debug (DBG_DEBUG, & clk_dev, "activate_timer: TR was still running with %d time units left.\n", t);
        sim_cancel(&TR_clk_unit[0]);   // BUG: do we need to cancel?
    }
    
#ifdef USE_IDLE
    if (! sim_is_active (& TR_clk_unit [0]))
      sim_activate (& TR_clk_unit[ 0], sim_rtcn_init(CLK_TR_HZ, TR_CLK));
#else
    (void) sim_rtcn_init(CLK_TR_HZ, TR_CLK);
    sim_activate(&TR_clk_unit[0], rTR);
#endif
    if ((t = sim_is_active(&TR_clk_unit[0])) == 0)
        sim_debug (DBG_DEBUG, & TR_clk_unit, "activate_timer: TR is not running\n", t);
    else
        sim_debug (DBG_DEBUG, & TR_clk_unit, "activate_timer: TR is now running with %d time units left.\n", t);
    return 0;
}
开发者ID:charlesUnixPro,项目名称:dps8m,代码行数:31,代码来源:dps8_clk.c

示例9: sim_slirp_select

int sim_slirp_select (SLIRP *slirp, int ms_timeout)
{
int select_ret = 0;
uint32 slirp_timeout = ms_timeout;
struct timeval timeout;
fd_set rfds, wfds, xfds;
fd_set save_rfds, save_wfds, save_xfds;
int nfds;

/* Populate the GPollFDs from slirp */
g_array_set_size (slirp->gpollfds, 1);  /* Leave the doorbell chime alone */
slirp_pollfds_fill(slirp->gpollfds, &slirp_timeout);
timeout.tv_sec  = slirp_timeout / 1000;
timeout.tv_usec = (slirp_timeout % 1000) * 1000;

FD_ZERO(&rfds);
FD_ZERO(&wfds);
FD_ZERO(&xfds);
/* Extract the GPollFDs interest */
nfds = pollfds_fill (slirp->gpollfds, &rfds, &wfds, &xfds);
save_rfds = rfds;
save_wfds = wfds;
save_xfds = xfds;
select_ret = select(nfds + 1, &rfds, &wfds, &xfds, &timeout);
if (select_ret) {
    int i;
    /* Update the GPollFDs results */
    pollfds_poll (slirp->gpollfds, nfds, &rfds, &wfds, &xfds);
    if (FD_ISSET (slirp->db_chime, &rfds)) {
        char buf[32];
        /* consume the doorbell wakeup ring */
        recv (slirp->db_chime, buf, sizeof (buf), 0);
        }
    sim_debug (slirp->dbit, slirp->dptr, "Select returned %d\r\n", select_ret);
    for (i=0; i<nfds+1; i++) {
        if (FD_ISSET(i, &rfds) || FD_ISSET(i, &save_rfds))
            sim_debug (slirp->dbit, slirp->dptr, "%d: save_rfd=%d, rfd=%d\r\n", i, FD_ISSET(i, &save_rfds), FD_ISSET(i, &rfds));
        if (FD_ISSET(i, &wfds) || FD_ISSET(i, &save_wfds))
            sim_debug (slirp->dbit, slirp->dptr, "%d: save_wfd=%d, wfd=%d\r\n", i, FD_ISSET(i, &save_wfds), FD_ISSET(i, &wfds));
        if (FD_ISSET(i, &xfds) || FD_ISSET(i, &save_xfds))
            sim_debug (slirp->dbit, slirp->dptr, "%d: save_xfd=%d, xfd=%d\r\n", i, FD_ISSET(i, &save_xfds), FD_ISSET(i, &xfds));
            }
    }
return select_ret + 1;  /* Force dispatch even on timeout */
}
开发者ID:ST3ALth,项目名称:simh,代码行数:45,代码来源:sim_slirp.c

示例10: check_events

void check_events (void)
{
    events.any = events.int_pending || events.low_group || events.group7;
    if (events.any)
      {
        sim_debug(DBG_NOTIFY, & cpu_dev, "CU: check_events: event(s) found (%d,%d,%d).\n", events.int_pending, events.low_group, events.group7);
      }
    return;
}
开发者ID:charlesUnixPro,项目名称:old-dps8m,代码行数:9,代码来源:dps8_faults.c

示例11: adcs6_banksel

/* 64FDC Bank Select (Write Disables boot ROM) */
static int32 adcs6_banksel(const int32 port, const int32 io, const int32 data)
{
    int32 result;
    if(io) {    /* Write */
        switch(port) {
        case 0x15:
            adcs6_info->s100_addr_u = data & 0xFF;
            sim_debug(VERBOSE_MSG, &adcs6_dev, "ADCS6: " ADDRESS_FORMAT
                      " WR S100 A[23:16]=0x%02x\n", PCX, data);
            break;
        case 0x16:
            sim_debug(VERBOSE_MSG, &adcs6_dev, "ADCS6: " ADDRESS_FORMAT
                      " WR MCTRL0: 0x%02x\n", PCX, data);
            adcs6_info->rom_disabled = (data & 0x20) ? TRUE : FALSE; /* Unmap Boot ROM */
            break;
        case 0x17:
            sim_debug(VERBOSE_MSG, &adcs6_dev, "ADCS6: " ADDRESS_FORMAT
                      " WR MCTRL1: 0x%02x\n", PCX, data);
            break;
        case 0x18:
        case 0x19:
        case 0x1A:
        case 0x1B:
            sim_debug(VERBOSE_MSG, &adcs6_dev, "ADCS6: " ADDRESS_FORMAT
                      " WR BAUD RATE=0x%02x\n", PCX, data);
            break;
        default:
            sim_debug(ERROR_MSG, &adcs6_dev, "ADCS6: " ADDRESS_FORMAT
                      " WR Unhandled Port: 0x%02x=0x%02x\n", PCX, port, data);
            break;
        }
        result = 0;
    } else {    /* Read */
        result = 0xFF;
        switch(port) {
        case 0x15:
            /* These are the Jumpers at J7.
             * Bit 7=0 = double-sided disk, bit 7=1 = single sided.
             * Bit 6=0 = use on-board RAM, Bit 6=1 = use S-100 RAM cards.
             * Bit 5:0 = "Baud Rate"
             */
            result = dipswitch;
            sim_debug(VERBOSE_MSG, &adcs6_dev, "ADCS6: " ADDRESS_FORMAT
                      " RD BAUD RATE=0x%02x\n", PCX, result);
            break;
        case 0x16:
        case 0x17:
        case 0x18:
        case 0x19:
        case 0x1A:
        case 0x1B:
        default:
            sim_debug(ERROR_MSG, &adcs6_dev, "ADCS6: " ADDRESS_FORMAT
                      " RD attempt from write-only 0x%02x=0x%02x\n", PCX, port, result);
            break;
        }
    }
    return result;
}
开发者ID:hstriepe,项目名称:simh,代码行数:60,代码来源:s100_adcs6.c

示例12: erprnt

/*************************************************************************
*
*	erprnt
*
*
*  Prints the object name and current virtual time to stderr
*  Assumes that gl_hdr_ind is correct. Internally used by error procedures.
*
*************************************************************************/
FUNCTION void  erprnt()

{
   char strng[STRSIZ];

   sprintVTime(strng, emq_current_ptr->rlvt);
   fprintf(stderr,"current time: %s\n",strng);
   fprintf(stderr,"obj name: %s\n",obj_hdr[gl_hdr_ind].name);
   sim_debug("continue ?");
}
开发者ID:ivan-gimenez,项目名称:timewarp,代码行数:19,代码来源:twsp3.c

示例13: tmr_svc

t_stat tmr_svc (UNIT *uptr)
{
sim_debug (TMR_DB_TICK, &tmr_dev, "tmr_svc()\n");
tmxr_poll = tmr_poll * TMXR_MULT;                   /* set mux poll */
if (tmr_iccs & TMR_CSR_DON)                         /* done? set err */
    tmr_iccs = tmr_iccs | TMR_CSR_ERR;
else
    tmr_iccs = tmr_iccs | TMR_CSR_DON;              /* set done */
if (tmr_iccs & TMR_CSR_RUN)                         /* run? */
    tmr_sched (tmr_nicr);                           /* reactivate */
if (tmr_iccs & TMR_CSR_IE) {                        /* ie? set int req */
    tmr_int = 1;
    sim_debug (TMR_DB_INT, &tmr_dev, "tmr_svc() - INT=1\n");
    }
else
    tmr_int = 0;
AIO_SET_INTERRUPT_LATENCY(tmr_poll*clk_tps);            /* set interrrupt latency */
return SCPE_OK;
}
开发者ID:markpizz,项目名称:simh-tlhackque,代码行数:19,代码来源:vax780_stddev.c

示例14: EPROM_get_mbyte

int32 EPROM_get_mbyte(uint32 addr)
{
    int32 val;

    if (i8255_unit.u5 & 0x01) {         /* EPROM enabled */
        sim_debug (DEBUG_read, &EPROM_dev, "EPROM_get_mbyte: addr=%04X\n", addr);
        if (addr < EPROM_unit.capac) {
            SET_XACK(1);                /* good memory address */
            sim_debug (DEBUG_xack, &EPROM_dev, "EPROM_get_mbyte: Set XACK for %04X\n", addr); 
            val = *((uint8 *)EPROM_unit.filebuf + addr);
            sim_debug (DEBUG_read, &EPROM_dev, " val=%04X\n", val);
            return (val & 0xFF);
        }
        sim_debug (DEBUG_read, &EPROM_dev, " Out of range\n");
        return 0xFF;
    }
    sim_debug (DEBUG_read, &EPROM_dev, " EPROM Disabled\n");
    return 0xFF;
}
开发者ID:B-Rich,项目名称:simh,代码行数:19,代码来源:ieprom.c

示例15: tmr_sched

void tmr_sched (uint32 nicr)
{
uint32 usecs = (nicr) ? (~nicr + 1) : 0xFFFFFFFF;

clk_tps = (int32)((1000000.0 / usecs) + 0.5);

sim_debug (TMR_DB_SCHED, &tmr_dev, "tmr_sched(nicr=0x%08X-usecs=0x%08X) - tps=%d\n", nicr, usecs, clk_tps);
tmr_poll = sim_rtcn_calb (clk_tps, TMR_CLK);
sim_activate_after (&tmr_unit, usecs);
}
开发者ID:markpizz,项目名称:simh-tlhackque,代码行数:10,代码来源:vax780_stddev.c


注:本文中的sim_debug函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。