Esempio n. 1
0
void y8950GetDebugInfo(Y8950* y8950, DbgDevice* dbgDevice)
{
    DbgRegisterBank* regBank;

    // Add YM2413 registers
    int c = 1;
    int r;

    for (r = 0; r < sizeof(regsAvailAY8950); r++) {
        c += regsAvailAY8950[r];
    }

    regBank = dbgDeviceAddRegisterBank(dbgDevice, langDbgRegsAy8950(), c);
    
    c = 0;

    dbgRegisterBankAddRegister(regBank, c++, "SR", 8, (UInt8)OPLRead(y8950->opl, 0));

    for (r = 0; r < sizeof(regsAvailAY8950); r++) {
        if (regsAvailAY8950[r]) {
            dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, y8950->opl->regs[r]);
        }
    }

    dbgDeviceAddMemoryBlock(dbgDevice, langDbgMemAy8950(), 0, 0, 
                            y8950->opl->deltat->memory_size, 
                            (UInt8*)y8950->opl->deltat->memory);
}
Esempio n. 2
0
void moonsoundGetDebugInfo(Moonsound* moonsound, DbgDevice* dbgDevice)
{
    UInt32 systemTime = boardSystemTime();
    DbgRegisterBank* regBank;
    int r;

    // Add YMF262 registers
    int c = 1;
    for (r = 0; r < sizeof(regsAvailYMF262); r++) {
        c += regsAvailYMF262[r];
    }

    regBank = dbgDeviceAddRegisterBank(dbgDevice, langDbgRegsYmf262(), c);

    c = 0;
    dbgRegisterBankAddRegister(regBank, c++, "SR", 8, moonsound->ymf262->peekStatus());

    for (r = 0; r < sizeof(regsAvailYMF262); r++) {
        if (regsAvailYMF262[r]) {
            if (r <= 8) {
                dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf262->peekReg(r|0x100));
            }
            else {
                dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf262->peekReg(r));
            }
        }
    }

    // Add YMF278 registers
    c = 1 + 7 + 2 + 10 * 10;
    regBank = dbgDeviceAddRegisterBank(dbgDevice, langDbgRegsYmf278(), c);

    c = 0;
    dbgRegisterBankAddRegister(regBank, c++, "SR", 8, moonsound->ymf278->peekStatus(systemTime));
    
    r=0x00; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime));
    r=0x01; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime));
    r=0x02; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime));
    r=0x03; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime));
    r=0x04; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime));
    r=0x05; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime));
    r=0x06; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime));
    r=0xf8; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime));
    r=0xf9; dbgRegisterBankAddRegister(regBank, c++, regText(r), 8, moonsound->ymf278->peekRegOPL4(r, systemTime));

    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            int r = 8 + i * 24 + j;
            dbgRegisterBankAddRegister(regBank, c++, slotRegText(i,j), 8, moonsound->ymf278->peekRegOPL4(r, systemTime));
        }
    }

    dbgDeviceAddMemoryBlock(dbgDevice, langDbgMemYmf278(), 0, 0, 
                            moonsound->ymf278->getRamSize(), 
                            (UInt8*)moonsound->ymf278->getRam());
}
Esempio n. 3
0
void ForwardRules::buildDefaultRules(const char* domain,
                                     const char* hostname,
                                     const char* ipAddress,
                                     const char* fqhn,
                                     int localPort,
                                     TiXmlDocument& xmlDoc)
{
    // Note: fqhn == fully qualified host name



    UtlString hostnamePort(hostname ? hostname : "localhost");
    UtlString domainPort(domain ? domain : "");
    UtlString ipAddressPort(ipAddress ? ipAddress : "127.0.0.1");
    UtlString fqhnPort(fqhn ? fqhn : "localhost");

    if(localPort == 5060) localPort = PORT_NONE;
    if(portIsValid(localPort))
    {
        char portString[40];
        sprintf(portString,":%d", localPort);
        hostnamePort.append(portString);
        domainPort.append(portString);
        ipAddressPort.append(portString);
        fqhnPort.append(portString);
    }

    UtlString sdsAddress(fqhn);
    sdsAddress.append(":5090");
    UtlString statusAddress(fqhn);
    statusAddress.append(":5110");
    UtlString regAddress(fqhn);
    regAddress.append(":5070");
    UtlString configAddress("sipuaconfig");
    UtlString configFqhnAddress(configAddress);
    configFqhnAddress.append(".");
    configFqhnAddress.append(domain);

    TiXmlElement routes("routes");
    TiXmlElement route("route");
    route.SetAttribute("mappingType", "local");

    TiXmlElement routeFromDomain("routeFrom");
    TiXmlText domainText(domainPort.data());

    TiXmlElement routeFromFqhn("routeFrom");
    TiXmlText fqhnText(fqhnPort.data());

    TiXmlElement routeFromHost("routeFrom");
    TiXmlText hostText(hostnamePort.data());

    TiXmlElement routeFromIp("routeFrom");
    TiXmlText ipText(ipAddressPort.data());

    TiXmlElement methodMatch("methodMatch");

    TiXmlElement methodPattern("methodPattern");
    TiXmlText subscribe("SUBSCRIBE");

    TiXmlElement fieldMatchConfig("fieldMatch");
    fieldMatchConfig.SetAttribute("fieldName", "Event");

    TiXmlElement fieldPatternConfig("fieldPattern");
    TiXmlText configEvent("sip-config");

    TiXmlElement routeToSds("routeTo");
    TiXmlText sdsText(sdsAddress.data());

    TiXmlElement fieldMatchStatus("fieldMatch");
    fieldMatchStatus.SetAttribute("fieldName", "Event");

    TiXmlElement fieldPatternStatus("fieldPattern");
    TiXmlText mwiEvent("message-summary*");

    TiXmlElement routeToStatus("routeTo");
    TiXmlText statusText(statusAddress.data());

    TiXmlElement routeToReg("routeTo");
    TiXmlText regText(regAddress.data());

    TiXmlElement routeConfig("route");

    TiXmlElement routeFromFqhnConfig("routeFrom");
    TiXmlText fqhnConfigText(configFqhnAddress.data());

    TiXmlElement routeFromConfig("routeFrom");
    TiXmlText configText(configAddress.data());

    // Link everything up in reverse order as it TinyXml 
    // makes copies
    routeFromDomain.InsertEndChild(domainText);
    route.InsertEndChild(routeFromDomain);
    routeFromHost.InsertEndChild(hostText);
    route.InsertEndChild(routeFromHost);
    routeFromFqhn.InsertEndChild(fqhnText);
    route.InsertEndChild(routeFromFqhn);
    routeFromIp.InsertEndChild(ipText);
    route.InsertEndChild(routeFromIp);

    methodPattern.InsertEndChild(subscribe);
    methodMatch.InsertEndChild(methodPattern);

    fieldPatternStatus.InsertEndChild(mwiEvent);
    fieldMatchStatus.InsertEndChild(fieldPatternStatus);
    routeToStatus.InsertEndChild(statusText);
    fieldMatchStatus.InsertEndChild(routeToStatus);
    methodMatch.InsertEndChild(fieldMatchStatus);

    fieldPatternConfig.InsertEndChild(configEvent);
    fieldMatchConfig.InsertEndChild(fieldPatternConfig);
    routeToSds.InsertEndChild(sdsText);
    fieldMatchConfig.InsertEndChild(routeToSds);
    methodMatch.InsertEndChild(fieldMatchConfig);

    routeToReg.InsertEndChild(regText);
    methodMatch.InsertEndChild(routeToReg);
    route.InsertEndChild(methodMatch);

    route.InsertEndChild(routeToReg);

    routeFromFqhnConfig.InsertEndChild(fqhnConfigText);
    routeConfig.InsertEndChild(routeFromFqhnConfig);

    routeFromConfig.InsertEndChild(configText);
    routeConfig.InsertEndChild(routeFromConfig);

    routeConfig.InsertEndChild(routeToReg);

    routes.InsertEndChild(route);
    routes.InsertEndChild(routeConfig);

    xmlDoc.InsertEndChild(routes);

}