MCPcopy Create free account
hub / github.com/BlitterStudio/amiberry / trap_multi

Function trap_multi

src/traps.cpp:1540–1627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1538}
1539
1540void trap_multi(TrapContext *ctx, struct trapmd *data, int items)
1541{
1542 if (trap_is_indirect_null(ctx)) {
1543 uae_u8 *p = ctx->host_trap_data + RTAREA_TRAP_DATA_EXTRA;
1544 for (int i = 0; i < items; i++) {
1545 struct trapmd *md = &data[i];
1546 put_word_host(p + 0, md->cmd);
1547 put_byte_host(p + 2, md->trapmd_index);
1548 put_byte_host(p + 3, md->parm_num);
1549 put_long_host(p + 4, md->params[0]);
1550 put_long_host(p + 8, md->params[1]);
1551 put_long_host(p + 12, md->params[2]);
1552 put_long_host(p + 16, md->params[3]);
1553 p += 5 * 4;
1554 }
1555 call_hardware_trap_back(ctx, TRAPCMD_MULTI, ctx->amiga_trap_data + RTAREA_TRAP_DATA_EXTRA, items, 0, 0);
1556 p = ctx->host_trap_data + RTAREA_TRAP_DATA_EXTRA;
1557 for (int i = 0; i < items; i++) {
1558 struct trapmd *md = &data[i];
1559 md->params[0] = get_long_host(p + 4);
1560 p += 5 * 4;
1561 }
1562 } else {
1563 uae_u32 v = 0;
1564 for (int i = 0; i < items; i++) {
1565 struct trapmd *md = &data[i];
1566 switch (md->cmd)
1567 {
1568 case TRAPCMD_PUT_LONG:
1569 trap_put_long(ctx, md->params[0], md->params[1]);
1570 break;
1571 case TRAPCMD_PUT_WORD:
1572 trap_put_word(ctx, md->params[0], md->params[1]);
1573 break;
1574 case TRAPCMD_PUT_BYTE:
1575 trap_put_byte(ctx, md->params[0], md->params[1]);
1576 break;
1577 case TRAPCMD_GET_LONG:
1578 v = md->params[0] = trap_get_long(ctx, md->params[0]);
1579 break;
1580 case TRAPCMD_GET_WORD:
1581 v = md->params[0] = trap_get_word(ctx, md->params[0]);
1582 break;
1583 case TRAPCMD_GET_BYTE:
1584 v = md->params[0] = trap_get_byte(ctx, md->params[0]);
1585 break;
1586 case TRAPCMD_PUT_BYTES:
1587 trap_put_bytes(ctx, md->haddr, md->params[0], md->params[1]);
1588 break;
1589 case TRAPCMD_GET_BYTES:
1590 trap_get_bytes(ctx, md->haddr, md->params[0], md->params[1]);
1591 break;
1592 case TRAPCMD_PUT_WORDS:
1593 trap_put_words(ctx, (uae_u16*)md->haddr, md->params[0], md->params[1]);
1594 break;
1595 case TRAPCMD_GET_WORDS:
1596 trap_get_words(ctx, (uae_u16*)md->haddr, md->params[0], md->params[1]);
1597 break;

Callers 8

make_lockFunction · 0.85
free_lockFunction · 0.85
filesys_iterationFunction · 0.85
filesys_handlerFunction · 0.85
CopyPatternStructureA2UFunction · 0.85
CopyBitMapStructureA2UFunction · 0.85
CopyTemplateStructureA2UFunction · 0.85

Calls 15

trap_is_indirect_nullFunction · 0.85
put_word_hostFunction · 0.85
put_byte_hostFunction · 0.85
put_long_hostFunction · 0.85
call_hardware_trap_backFunction · 0.85
get_long_hostFunction · 0.85
trap_put_longFunction · 0.85
trap_put_wordFunction · 0.85
trap_put_byteFunction · 0.85
trap_get_longFunction · 0.85
trap_get_wordFunction · 0.85
trap_get_byteFunction · 0.85

Tested by

no test coverage detected