Annotation of hatari/src/xbios.c, revision 1.1.1.18

1.1       root        1: /*
1.1.1.3   root        2:   Hatari - xbios.c
                      3: 
1.1.1.14  root        4:   This file is distributed under the GNU General Public License, version 2
                      5:   or at your option any later version. Read the file gpl.txt for details.
1.1       root        6: 
1.1.1.17  root        7:   XBios Handler (Trap #14) -  http://toshyp.atari.org/en/004014.html
1.1       root        8: 
1.1.1.17  root        9:   Intercept and direct XBios calls to allow saving screenshots in host format
1.1.1.15  root       10:   and to help with tracing/debugging.
1.1       root       11: */
1.1.1.10  root       12: const char XBios_fileid[] = "Hatari xbios.c : " __DATE__ " " __TIME__;
1.1       root       13: 
                     14: #include "main.h"
1.1.1.3   root       15: #include "configuration.h"
1.1.1.10  root       16: #include "control.h"
1.1       root       17: #include "floppy.h"
1.1.1.4   root       18: #include "log.h"
1.1       root       19: #include "m68000.h"
                     20: #include "rs232.h"
1.1.1.3   root       21: #include "screenSnapShot.h"
1.1       root       22: #include "stMemory.h"
1.1.1.17  root       23: #include "debugui.h"
1.1.1.3   root       24: #include "xbios.h"
                     25: 
1.1       root       26: 
1.1.1.13  root       27: #define HATARI_CONTROL_OPCODE 255
1.1.1.4   root       28: 
1.1.1.17  root       29: /* whether to enable XBios(11/20/255) */
1.1.1.15  root       30: static bool bXBiosCommands;
                     31: 
1.1.1.17  root       32: 
1.1.1.18! root       33: void XBios_EnableCommands(bool enable)
1.1.1.15  root       34: {
1.1.1.18! root       35:        bXBiosCommands = enable;
1.1.1.15  root       36: }
1.1.1.4   root       37: 
1.1.1.17  root       38: 
                     39: /**
                     40:  * XBIOS Dbmsg
                     41:  * Call 11
                     42:  *
                     43:  * Atari debugger API:
                     44:  * http://dev-docs.atariforge.org/files/Atari_Debugger_1-24-1990.pdf
                     45:  * http://toshyp.atari.org/en/004012.html#Dbmsg
                     46:  */
                     47: static bool XBios_Dbmsg(Uint32 Params)
                     48: {
                     49:        /* Read details from stack */
                     50:        const Uint16 reserved = STMemory_ReadWord(Params);
                     51:        const Uint16 msgnum = STMemory_ReadWord(Params+SIZE_WORD);
                     52:        const Uint32 addr = STMemory_ReadLong(Params+SIZE_WORD+SIZE_WORD);
                     53: 
                     54:        LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x0B Dbmsg(%d, 0x%04X, 0x%x) at PC 0x%X\n",
                     55:                  reserved, msgnum, addr, M68000_GetPC());
                     56: 
                     57:        if (reserved != 5 || !bXBiosCommands)
                     58:                return false;
                     59: 
                     60:        fprintf(stderr, "Dbmsg: 0x%04X, 0x%x\n", msgnum, addr);
                     61: 
                     62:        /* debugger message? */
                     63:        if (msgnum >= 0xF000 && msgnum <= 0xF100)
                     64:        {
                     65:                const char *txt = (const char *)STMemory_STAddrToPointer(addr);
                     66:                char buffer[256];
                     67: 
                     68:                /* between non-halting message and debugger command IDs,
                     69:                 * are halting messages with message length encoded in ID
                     70:                 */
                     71:                if (msgnum > 0xF000 && msgnum < 0xF100)
                     72:                {
                     73:                        const int len = (msgnum & 0xFF);
                     74:                        memcpy(buffer, txt, len);
                     75:                        buffer[len] = '\0';
                     76:                        txt = buffer;
                     77:                }
                     78:                fprintf(stderr, "-> \"%s\"\n", txt);
                     79:        }
                     80: 
                     81:        /* not just a message? */
                     82:        if (msgnum != 0xF000)
                     83:        {
1.1.1.18! root       84:                fprintf(stderr, "-> HALT\n");
1.1.1.17  root       85:                DebugUI(REASON_PROGRAM);
                     86:        }
                     87: 
                     88:        /* return value != function opcode, to indicate it's implemented */
                     89:        Regs[REG_D0] = 0;
                     90:        return true;
                     91: }
                     92: 
                     93: 
                     94: /**
                     95:  * XBIOS Scrdmp
                     96:  * Call 20
                     97:  */
                     98: static bool XBios_Scrdmp(Uint32 Params)
                     99: {
                    100:        LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x14 Scrdmp() at PC 0x%X\n" , M68000_GetPC());
                    101: 
                    102:        if (!bXBiosCommands)
                    103:                return false;
                    104: 
                    105:        ScreenSnapShot_SaveScreen();
                    106: 
                    107:        /* Scrdmp() doesn't have return value, but return something else than
                    108:         * function number to indicate this XBios opcode was implemented
                    109:         */
                    110:        Regs[REG_D0] = 0;
                    111:        return true;
                    112: }
                    113: 
                    114: 
                    115: /**
                    116:  * XBIOS remote control interface for Hatari
                    117:  * Call 255
                    118:  */
                    119: static bool XBios_HatariControl(Uint32 Params)
1.1.1.7   root      120: {
1.1.1.17  root      121:        const char *pText;
                    122:        pText = (const char *)STMemory_STAddrToPointer(STMemory_ReadLong(Params));
                    123:        LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x%02X HatariControl(%s) at PC 0x%X\n",
                    124:                  HATARI_CONTROL_OPCODE, pText, M68000_GetPC());
                    125: 
                    126:        if (!bXBiosCommands)
                    127:                return false;
                    128: 
                    129:        Control_ProcessBuffer(pText);
                    130: 
                    131:        /* return value != function opcode, to indicate it's implemented */
                    132:        Regs[REG_D0] = 0;
                    133:        return true;
                    134: }
1.1       root      135: 
1.1.1.2   root      136: 
1.1.1.13  root      137: #if ENABLE_TRACING
1.1.1.17  root      138: 
1.1.1.7   root      139: /**
                    140:  * XBIOS Floppy Read
                    141:  * Call 8
                    142:  */
1.1.1.8   root      143: static bool XBios_Floprd(Uint32 Params)
1.1       root      144: {
1.1.1.12  root      145:        Uint32 pBuffer;
1.1.1.7   root      146:        Uint16 Dev,Sector,Side,Track,Count;
1.1       root      147: 
1.1.1.7   root      148:        /* Read details from stack */
1.1.1.13  root      149:        pBuffer = STMemory_ReadLong(Params);
                    150:        Dev = STMemory_ReadWord(Params+SIZE_LONG+SIZE_LONG); /* skip reserved long */
                    151:        Sector = STMemory_ReadWord(Params+SIZE_LONG+SIZE_LONG+SIZE_WORD);
                    152:        Track = STMemory_ReadWord(Params+SIZE_LONG+SIZE_LONG+SIZE_WORD+SIZE_WORD);
                    153:        Side = STMemory_ReadWord(Params+SIZE_LONG+SIZE_LONG+SIZE_WORD+SIZE_WORD+SIZE_WORD);
                    154:        Count = STMemory_ReadWord(Params+SIZE_LONG+SIZE_LONG+SIZE_WORD+SIZE_WORD+SIZE_WORD+SIZE_WORD);
                    155: 
                    156:        LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x08 Floprd(0x%x, %d, %d, %d, %d, %d) at PC 0x%X for: %s\n",
1.1.1.16  root      157:                  pBuffer, Dev, Sector, Track, Side, Count, M68000_GetPC(),
                    158:                  Dev < MAX_FLOPPYDRIVES ? EmulationDrives[Dev].sFileName : "n/a");
1.1.1.10  root      159:        return false;
1.1       root      160: }
                    161: 
1.1.1.2   root      162: 
1.1.1.7   root      163: /**
                    164:  * XBIOS Floppy Write
                    165:  * Call 9
                    166:  */
1.1.1.8   root      167: static bool XBios_Flopwr(Uint32 Params)
1.1       root      168: {
1.1.1.12  root      169:        Uint32 pBuffer;
1.1.1.7   root      170:        Uint16 Dev,Sector,Side,Track,Count;
1.1       root      171: 
1.1.1.7   root      172:        /* Read details from stack */
1.1.1.13  root      173:        pBuffer = STMemory_ReadLong(Params);
                    174:        Dev = STMemory_ReadWord(Params+SIZE_LONG+SIZE_LONG); /* skip reserved long */
                    175:        Sector = STMemory_ReadWord(Params+SIZE_LONG+SIZE_LONG+SIZE_WORD);
                    176:        Track = STMemory_ReadWord(Params+SIZE_LONG+SIZE_LONG+SIZE_WORD+SIZE_WORD);
                    177:        Side = STMemory_ReadWord(Params+SIZE_LONG+SIZE_LONG+SIZE_WORD+SIZE_WORD+SIZE_WORD);
                    178:        Count = STMemory_ReadWord(Params+SIZE_LONG+SIZE_LONG+SIZE_WORD+SIZE_WORD+SIZE_WORD+SIZE_WORD);
                    179: 
                    180:        LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x09 Flopwr(0x%x, %d, %d, %d, %d, %d) at PC 0x%X for: %s\n",
1.1.1.16  root      181:                  pBuffer, Dev, Sector, Track, Side, Count, M68000_GetPC(),
                    182:                  Dev < MAX_FLOPPYDRIVES ? EmulationDrives[Dev].sFileName : "n/a");
1.1.1.13  root      183:        return false;
                    184: }
1.1       root      185: 
                    186: 
1.1.1.13  root      187: /**
1.1.1.7   root      188:  * XBIOS RsConf
                    189:  * Call 15
                    190:  */
1.1.1.8   root      191: static bool XBios_Rsconf(Uint32 Params)
1.1       root      192: {
1.1.1.17  root      193:        Sint16 Baud, Ctrl, Ucr, Rsr, Tsr, Scr;
1.1       root      194: 
1.1.1.13  root      195:        Baud = STMemory_ReadWord(Params);
                    196:        Ctrl = STMemory_ReadWord(Params+SIZE_WORD);
                    197:        Ucr = STMemory_ReadWord(Params+SIZE_WORD+SIZE_WORD);
                    198:        Rsr = STMemory_ReadWord(Params+SIZE_WORD+SIZE_WORD+SIZE_WORD);
                    199:        Tsr = STMemory_ReadWord(Params+SIZE_WORD+SIZE_WORD+SIZE_WORD+SIZE_WORD);
                    200:        Scr = STMemory_ReadWord(Params+SIZE_WORD+SIZE_WORD+SIZE_WORD+SIZE_WORD+SIZE_WORD);
1.1.1.15  root      201:        LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x0F Rsconf(%d, %d, %d, %d, %d, %d) at PC 0x%X\n",
1.1.1.17  root      202:                   Baud, Ctrl, Ucr, Rsr, Tsr, Scr, M68000_GetPC());
                    203:        return false;
1.1.1.10  root      204: }
                    205: 
                    206: 
                    207: /**
1.1.1.17  root      208:  * XBIOS Devconnect
                    209:  * Call 139
1.1.1.10  root      210:  */
1.1.1.17  root      211: static bool XBios_Devconnect(Uint32 Params)
1.1.1.10  root      212: {
1.1.1.17  root      213:        Uint16 src,dst,clk,prescale,protocol;
1.1.1.15  root      214: 
1.1.1.17  root      215:        /* Read details from stack */
                    216:        src = STMemory_ReadWord(Params);
                    217:        dst = STMemory_ReadWord(Params+SIZE_WORD);
                    218:        clk = STMemory_ReadWord(Params+SIZE_WORD+SIZE_WORD);
                    219:        prescale = STMemory_ReadWord(Params+SIZE_WORD+SIZE_WORD+SIZE_WORD);
                    220:        protocol = STMemory_ReadWord(Params+SIZE_WORD+SIZE_WORD+SIZE_WORD+SIZE_WORD);
1.1.1.15  root      221: 
1.1.1.17  root      222:        LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x8B Devconnect(%hd, 0x%hx, %hd, %hd, %hd) at PC 0x%X\n",
                    223:                  src, dst, clk, prescale, protocol ,
                    224:                  M68000_GetPC() );
                    225:        return false;
1.1       root      226: }
                    227: 
1.1.1.2   root      228: 
1.1.1.11  root      229: /**
                    230:  * Map XBIOS call opcode to XBIOS function name
1.1.1.14  root      231:  *
                    232:  * Mapping is based on TOSHYP information:
                    233:  *     http://toshyp.atari.org/en/004014.html
1.1.1.11  root      234:  */
                    235: static const char* XBios_Call2Name(Uint16 opcode)
                    236: {
                    237:        static const char* names[] = {
                    238:                "Initmous",
                    239:                "Ssbrk",
                    240:                "Physbase",
                    241:                "Logbase",
                    242:                "Getrez",
                    243:                "Setscreen",
                    244:                "Setpalette",
                    245:                "Setcolor",
                    246:                "Floprd",
                    247:                "Flopwr",
                    248:                "Flopfmt",
                    249:                "Dbmsg",
                    250:                "Midiws",
                    251:                "Mfpint",
                    252:                "Iorec",
                    253:                "Rsconf",
                    254:                "Keytbl",
                    255:                "Random",
                    256:                "Protobt",
                    257:                "Flopver",
                    258:                "Scrdmp",
                    259:                "Cursconf",
                    260:                "Settime",
                    261:                "Gettime",
                    262:                "Bioskeys",
                    263:                "Ikbdws",
                    264:                "Jdisint",
                    265:                "Jenabint",
                    266:                "Giaccess",
                    267:                "Offgibit",
                    268:                "Ongibit",
                    269:                "Xbtimer",
                    270:                "Dosound",
                    271:                "Setprt",
                    272:                "Kbdvbase",
                    273:                "Kbrate",
                    274:                "Prtblk",
                    275:                "Vsync",
                    276:                "Supexec",
                    277:                "Puntaes",
                    278:                NULL,   /* 40 */
                    279:                "Floprate",
                    280:                "DMAread",
                    281:                "DMAwrite",
                    282:                "Bconmap",
                    283:                NULL,   /* 45 */
                    284:                "NVMaccess",
1.1.1.17  root      285:                "Waketime", /* TOS 2.06 */
1.1.1.11  root      286:                "Metainit",
1.1.1.17  root      287:                NULL,   /* 49: rest of MetaDOS calls */
1.1.1.11  root      288:                NULL,
                    289:                NULL,
                    290:                NULL,
                    291:                NULL,
                    292:                NULL,
                    293:                NULL,
                    294:                NULL,
                    295:                NULL,
                    296:                NULL,
                    297:                NULL,
                    298:                NULL,
                    299:                NULL,
                    300:                NULL,
                    301:                NULL,   /* 63 */
                    302:                "Blitmode",
1.1.1.17  root      303:                NULL,   /* 65: CENTScreen */
1.1.1.11  root      304:                NULL,
                    305:                NULL,
                    306:                NULL,
                    307:                NULL,
                    308:                NULL,
                    309:                NULL,
                    310:                NULL,
                    311:                NULL,
                    312:                NULL,
                    313:                NULL,
                    314:                NULL,
                    315:                NULL,
                    316:                NULL,
                    317:                NULL,   /* 79 */
                    318:                "EsetShift",
                    319:                "EgetShift",
                    320:                "EsetBank",
                    321:                "EsetColor",
                    322:                "EsetPalette",
                    323:                "EgetPalette",
                    324:                "EsetGray",
                    325:                "EsetSmear",
                    326:                "VsetMode",
                    327:                "VgetMonitor",
                    328:                "VsetSync",
                    329:                "VgetSize",
1.1.1.14  root      330:                "VsetVars",     /* TOS4 internal */
1.1.1.11  root      331:                "VsetRGB",
                    332:                "VgetRGB",
1.1.1.14  root      333:                "VcheckMode",   /* TOS4 internal (ValidMode()) */
1.1.1.11  root      334:                "Dsp_DoBlock",
                    335:                "Dsp_BlkHandShake",
                    336:                "Dsp_BlkUnpacked",
                    337:                "Dsp_InStream",
                    338:                "Dsp_OutStream",
                    339:                "Dsp_IOStream",
                    340:                "Dsp_RemoveInterrupts",
                    341:                "Dsp_GetWordSize",
                    342:                "Dsp_Lock",
                    343:                "Dsp_Unlock",
                    344:                "Dsp_Available",
                    345:                "Dsp_Reserve",
                    346:                "Dsp_LoadProg",
                    347:                "Dsp_ExecProg",
                    348:                "Dsp_ExecBoot",
                    349:                "Dsp_LodToBinary",
                    350:                "Dsp_TriggerHC",
                    351:                "Dsp_RequestUniqueAbility",
                    352:                "Dsp_GetProgAbility",
                    353:                "Dsp_FlushSubroutines",
                    354:                "Dsp_LoadSubroutine",
                    355:                "Dsp_InqSubrAbility",
                    356:                "Dsp_RunSubroutine",
                    357:                "Dsp_Hf0",
                    358:                "Dsp_Hf1",
                    359:                "Dsp_Hf2",
                    360:                "Dsp_Hf3",
                    361:                "Dsp_BlkWords",
                    362:                "Dsp_BlkBytes",
                    363:                "Dsp_HStat",
                    364:                "Dsp_SetVectors",
                    365:                "Dsp_MultBlocks",
                    366:                "Locksnd",
                    367:                "Unlocksnd",
                    368:                "Soundcmd",
                    369:                "Setbuffer",
                    370:                "Setmode",
                    371:                "Settracks",
                    372:                "Setmontracks",
                    373:                "Setinterrupt",
                    374:                "Buffoper",
                    375:                "Dsptristate",
                    376:                "Gpio",
                    377:                "Devconnect",
                    378:                "Sndstatus",
                    379:                "Buffptr",
                    380:                NULL,   /* 142 */
                    381:                NULL,
                    382:                NULL,
                    383:                NULL,
                    384:                NULL,
                    385:                NULL,
                    386:                NULL,
1.1.1.14  root      387:                NULL,   /* 149 */
                    388:                "VsetMask",
                    389:                NULL,   /* 151 */
1.1.1.11  root      390:                NULL,
                    391:                NULL,
                    392:                NULL,
                    393:                NULL,
                    394:                NULL,
                    395:                NULL,
                    396:                NULL,
                    397:                NULL,
                    398:                NULL,
                    399:                NULL,
                    400:                NULL,
                    401:                NULL,
                    402:                NULL,   /* 164 */
                    403:                "WavePlay"
                    404:        };
1.1.1.17  root      405:        if (opcode < ARRAY_SIZE(names) && names[opcode]) {
1.1.1.11  root      406:                return names[opcode];
                    407:        }
                    408:        return "???";
                    409: }
1.1.1.13  root      410: 
1.1.1.16  root      411: void XBios_Info(FILE *fp, Uint32 dummy)
1.1.1.13  root      412: {
                    413:        Uint16 opcode;
                    414:        for (opcode = 0; opcode < 168; ) {
1.1.1.16  root      415:                fprintf(fp, "%02x %-21s", opcode,
1.1.1.13  root      416:                        XBios_Call2Name(opcode));
                    417:                if (++opcode % 3 == 0) {
1.1.1.16  root      418:                        fputs("\n", fp);
1.1.1.13  root      419:                }
                    420:        }
                    421: }
1.1.1.17  root      422: 
1.1.1.13  root      423: #else /* !ENABLE_TRACING */
1.1.1.17  root      424: 
                    425: #define XBios_Floprd(params)     false
                    426: #define XBios_Flopwr(params)     false
                    427: #define XBios_Rsconf(params)     false
                    428: #define XBios_Devconnect(params) false
                    429: 
1.1.1.16  root      430: void XBios_Info(FILE *fp, Uint32 bShowOpcodes)
1.1.1.13  root      431: {
1.1.1.16  root      432:                fputs("Hatari isn't configured with ENABLE_TRACING\n", fp);
1.1.1.13  root      433: }
1.1.1.17  root      434: 
1.1.1.13  root      435: #endif /* !ENABLE_TRACING */
1.1.1.11  root      436: 
                    437: 
1.1.1.7   root      438: /**
                    439:  * Check if we need to re-direct XBios call to our own routines
                    440:  */
1.1.1.8   root      441: bool XBios(void)
1.1       root      442: {
1.1.1.7   root      443:        Uint32 Params;
                    444:        Uint16 XBiosCall;
1.1       root      445: 
1.1.1.7   root      446:        /* Find call */
                    447:        Params = Regs[REG_A7];
                    448:        XBiosCall = STMemory_ReadWord(Params);
1.1.1.13  root      449:        Params += SIZE_WORD;
1.1.1.11  root      450: 
1.1.1.7   root      451:        switch (XBiosCall)
                    452:        {
1.1.1.13  root      453:                /* commands with special handling */
                    454:        case 8:
1.1.1.7   root      455:                return XBios_Floprd(Params);
1.1.1.13  root      456:        case 9:
1.1.1.7   root      457:                return XBios_Flopwr(Params);
1.1.1.17  root      458:        case 11:
                    459:                return XBios_Dbmsg(Params);
1.1.1.13  root      460:        case 15:
1.1.1.7   root      461:                return XBios_Rsconf(Params);
1.1.1.13  root      462:        case 20:
1.1.1.7   root      463:                return XBios_Scrdmp(Params);
1.1.1.13  root      464:        case 139:
                    465:                return XBios_Devconnect(Params);
                    466:        case HATARI_CONTROL_OPCODE:
1.1.1.10  root      467:                return XBios_HatariControl(Params);
1.1.1.7   root      468: 
1.1.1.13  root      469:        case 2:         /* Physbase */
                    470:        case 3:         /* Logbase */
                    471:        case 4:         /* Getrez */
                    472:        case 17:        /* Random */
                    473:        case 23:        /* Gettime */
                    474:        case 24:        /* Bioskeys */
                    475:        case 34:        /* Kbdvbase */
                    476:        case 37:        /* Vsync */
                    477:        case 39:        /* Puntaes */
                    478:        case 81:        /* EgetShift */
                    479:        case 89:        /* VgetMonitor */
                    480:        case 103:       /* Dsp_GetWordSize */
                    481:        case 104:       /* Dsp_Lock */
                    482:        case 105:       /* Dsp_Unlock */
                    483:        case 113:       /* Dsp_RequestUniqueAbility */
                    484:        case 114:       /* Dsp_GetProgAbility */
                    485:        case 115:       /* Dsp_FlushSubroutines */
                    486:        case 121:       /* Dsp_Hf2 */
                    487:        case 122:       /* Dsp_Hf3 */
                    488:        case 125:       /* Dsp_Hstat */
                    489:        case 128:       /* Locksnd */
                    490:        case 129:       /* Unlocksnd */
                    491:                /* commands with no args */
1.1.1.15  root      492:                LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x%02hX %s() at PC 0x%X\n",
                    493:                          XBiosCall, XBios_Call2Name(XBiosCall),
                    494:                          M68000_GetPC());
1.1.1.13  root      495:                return false;
                    496:                
                    497:        case 1:         /* Ssbrk */
                    498:        case 14:        /* Iorec */
                    499:        case 26:        /* Jdisint */
                    500:        case 27:        /* Jenabint */
                    501:        case 29:        /* Offgibit */
                    502:        case 30:        /* Ongibit */
                    503:        case 33:        /* Setprt */
                    504:        case 44:        /* Bconmap */
                    505:        case 64:        /* Blitmode */
                    506:        case 80:        /* EsetShift */
                    507:        case 82:        /* EsetBank */
                    508:        case 86:        /* EsetGray */
                    509:        case 87:        /* EsetSmear */
                    510:        case 88:        /* VsetMode */
                    511:        case 90:        /* VsetSync */
                    512:        case 91:        /* VgetSize */
1.1.1.17  root      513:        case 95:        /* VcheckMode */
1.1.1.13  root      514:        case 102:       /* Dsp_RemoveInterrupts */
                    515:        case 112:       /* Dsp_TriggerHC */
                    516:        case 117:       /* Dsp_InqSubrAbility */
                    517:        case 118:       /* Dsp_RunSubroutine */
                    518:        case 119:       /* Dsp_Hf0 */
                    519:        case 120:       /* Dsp_Hf1 */
                    520:        case 132:       /* Setmode */
                    521:        case 134:       /* Setmontracks */
                    522:        case 136:       /* Buffoper */
                    523:        case 140:       /* Sndstatus */
                    524:                /* ones taking single word */
1.1.1.15  root      525:                LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x%02hX %s(0x%hX) at PC 0x%X\n",
1.1.1.13  root      526:                          XBiosCall, XBios_Call2Name(XBiosCall),
1.1.1.15  root      527:                          STMemory_ReadWord(Params),
                    528:                          M68000_GetPC());
1.1.1.13  root      529:                return false;
                    530: 
                    531:        case 6:         /* Setpalette */
                    532:        case 22:        /* Settime */
                    533:        case 32:        /* Dosound */
                    534:        case 36:        /* Ptrblt */
                    535:        case 38:        /* Supexec */
                    536:        case 48:        /* Metainit */
                    537:        case 141:       /* Buffptr */
                    538:                /* ones taking long or pointer */
1.1.1.15  root      539:                LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x%02hX %s(0x%X) at PC 0x%X\n",
1.1.1.13  root      540:                          XBiosCall, XBios_Call2Name(XBiosCall),
1.1.1.15  root      541:                          STMemory_ReadLong(Params),
                    542:                          M68000_GetPC());
1.1.1.13  root      543:                return false;
                    544: 
                    545:        case 7:         /* Setcolor */
                    546:        case 21:        /* Cursconf */
                    547:        case 28:        /* Giaccess */
                    548:        case 35:        /* Kbrate */
                    549:        case 41:        /* Floprate */
                    550:        case 83:        /* EsetColor */
                    551:        case 130:       /* Soundcmd */
                    552:        case 133:       /* Settracks */
                    553:        case 137:       /* Dsptristate */
                    554:        case 135:       /* Setinterrupt */
                    555:        case 138:       /* Gpio */
                    556:                /* ones taking two words */
1.1.1.15  root      557:                LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x%02hX %s(0x%hX, 0x%hX) at PC 0x%X\n",
1.1.1.13  root      558:                          XBiosCall, XBios_Call2Name(XBiosCall),
                    559:                          STMemory_ReadWord(Params),
1.1.1.15  root      560:                          STMemory_ReadWord(Params+SIZE_WORD),
                    561:                          M68000_GetPC());
1.1.1.13  root      562:                return false;
                    563: 
                    564:        case 12:        /* Midiws */
                    565:        case 13:        /* Mfpint */
                    566:        case 25:        /* Ikbdws */
1.1.1.14  root      567:                /* ones taking word length/index and pointer */
1.1.1.15  root      568:                LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x%02hX %s(%hd, 0x%X) at PC 0x %X\n",
1.1.1.13  root      569:                          XBiosCall, XBios_Call2Name(XBiosCall),
                    570:                          STMemory_ReadWord(Params),
1.1.1.15  root      571:                          STMemory_ReadLong(Params+SIZE_WORD),
                    572:                          M68000_GetPC());
1.1.1.13  root      573:                return false;
                    574: 
                    575:        case 84:        /* EsetPalette */
                    576:        case 85:        /* EgetPalette */
                    577:        case 93:        /* VsetRGB */
                    578:        case 94:        /* VgetRGB */
                    579:                /* ones taking word, word and long/pointer */
1.1.1.15  root      580:                LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x%02hX %s(0x%hX, 0x%hX, 0x%X) at PC 0x%X\n",
1.1.1.13  root      581:                          XBiosCall, XBios_Call2Name(XBiosCall),
                    582:                          STMemory_ReadWord(Params),
                    583:                          STMemory_ReadWord(Params+SIZE_WORD),
1.1.1.15  root      584:                          STMemory_ReadLong(Params+SIZE_WORD+SIZE_WORD),
                    585:                          M68000_GetPC());
1.1.1.13  root      586:                return false;
                    587: 
                    588:        case 106:       /* Dsp_Available */
                    589:        case 107:       /* Dsp_Reserve */
                    590:        case 111:       /* Dsp_LodToBinary */
                    591:        case 126:       /* Dsp_SetVectors */
                    592:                /* ones taking two longs/pointers */
1.1.1.15  root      593:                LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x%02hX %s(0x%X, 0x%X) at PC 0x%X\n",
1.1.1.13  root      594:                          XBiosCall, XBios_Call2Name(XBiosCall),
                    595:                          STMemory_ReadLong(Params),
1.1.1.15  root      596:                          STMemory_ReadLong(Params+SIZE_LONG),
                    597:                          M68000_GetPC());
1.1.1.13  root      598:                return false;
                    599: 
1.1.1.18! root      600:        case 108:       /* Dsp_LoadProg */
        !           601:                /* ones taking long/pointer, word and long/pointer */
        !           602:                LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x%02hX %s(0x%X, 0x%hX, 0x%X) at PC 0x%X\n",
        !           603:                          XBiosCall, XBios_Call2Name(XBiosCall),
        !           604:                          STMemory_ReadLong(Params),
        !           605:                          STMemory_ReadWord(Params+SIZE_LONG),
        !           606:                          STMemory_ReadLong(Params+SIZE_LONG+SIZE_WORD),
        !           607:                          M68000_GetPC());
        !           608:                return false;
        !           609: 
        !           610:        case 96:        /* Dsp_DoBlock */
        !           611:        case 97:        /* Dsp_BlkHandShake */
        !           612:        case 98:        /* Dsp_BlkUnpacked */
        !           613:        case 99:        /* Dsp_InStream */
        !           614:        case 100:       /* Dsp_OutStream */
        !           615:        case 123:       /* Dsp_BlkWords */
        !           616:        case 124:       /* Dsp_BlkBytes */
        !           617:        case 127:       /* Dsp_MultBlocks */
        !           618:                /* ones taking four longs/pointers */
        !           619:                LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x%02hX %s(0x%X, 0x%X, 0x%X, 0x%X) at PC 0x%X\n",
        !           620:                          XBiosCall, XBios_Call2Name(XBiosCall),
        !           621:                          STMemory_ReadLong(Params),
        !           622:                          STMemory_ReadLong(Params+SIZE_LONG),
        !           623:                          STMemory_ReadLong(Params+SIZE_LONG+SIZE_LONG),
        !           624:                          STMemory_ReadLong(Params+SIZE_LONG+SIZE_LONG+SIZE_LONG),
        !           625:                          M68000_GetPC());
        !           626:                return false;
        !           627: 
        !           628:        case 101:       /* Dsp_IOStream */
        !           629:                /* ones taking six longs/pointers */
        !           630:                LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x%02hX %s(0x%X, 0x%X, 0x%X, 0x%X, 0x%X, 0x%X) at PC 0x%X\n",
        !           631:                          XBiosCall, XBios_Call2Name(XBiosCall),
        !           632:                          STMemory_ReadLong(Params),
        !           633:                          STMemory_ReadLong(Params+SIZE_LONG),
        !           634:                          STMemory_ReadLong(Params+SIZE_LONG+SIZE_LONG),
        !           635:                          STMemory_ReadLong(Params+SIZE_LONG+SIZE_LONG+SIZE_LONG),
        !           636:                          STMemory_ReadLong(Params+SIZE_LONG+SIZE_LONG+SIZE_LONG+SIZE_LONG),
        !           637:                          STMemory_ReadLong(Params+SIZE_LONG+SIZE_LONG+SIZE_LONG+SIZE_LONG+SIZE_LONG),
        !           638:                          M68000_GetPC());
        !           639:                return false;
        !           640: 
1.1.1.13  root      641:        case 5:         /* Setscreen */
1.1.1.14  root      642:                if (STMemory_ReadWord(Params+SIZE_LONG+SIZE_LONG) == 3) {
                    643:                        /* actually VSetscreen with extra parameter */
1.1.1.15  root      644:                        LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x%02hX VsetScreen(0x%X, 0x%X, 3, 0x%hX) at PC 0x%X\n",
1.1.1.14  root      645:                                  XBiosCall, STMemory_ReadLong(Params),
                    646:                                  STMemory_ReadLong(Params+SIZE_LONG),
1.1.1.15  root      647:                                  STMemory_ReadWord(Params+SIZE_LONG+SIZE_LONG+SIZE_WORD),
                    648:                                  M68000_GetPC());
1.1.1.18! root      649:                        return false;
1.1.1.14  root      650:                }
1.1.1.18! root      651:                /* fall through */
1.1.1.13  root      652:        case 109:       /* Dsp_ExecProg */
                    653:        case 110:       /* Dsp_ExecBoot */
                    654:        case 116:       /* Dsp_LoadSubroutine */
1.1.1.14  root      655:        case 150:       /* VsetMask */
1.1.1.13  root      656:                /* ones taking two longs/pointers and a word */
1.1.1.15  root      657:                LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x%02hX %s(0x%X, 0x%X, 0x%hX) at PC 0x%X\n",
1.1.1.13  root      658:                          XBiosCall, XBios_Call2Name(XBiosCall),
                    659:                          STMemory_ReadLong(Params),
                    660:                          STMemory_ReadLong(Params+SIZE_LONG),
1.1.1.15  root      661:                          STMemory_ReadWord(Params+SIZE_LONG+SIZE_LONG),
                    662:                          M68000_GetPC());
1.1.1.13  root      663:                return false;
                    664: 
                    665:        default:  /* rest of XBios calls */
                    666:                LOG_TRACE(TRACE_OS_XBIOS, "XBIOS 0x%02hX (%s)\n",
                    667:                          XBiosCall, XBios_Call2Name(XBiosCall));
1.1.1.10  root      668:                return false;
1.1.1.7   root      669:        }
1.1       root      670: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.