• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ slotMapPage函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: write

static void write(RomMapperPAC* rm, UInt16 address, UInt8 value) 
{
    int update = 0;

    address &= 0x3fff;

    switch (address) {
    case 0x1ffe:
        rm->sram[0x1ffe] = value;
        rm->sramEnabled = rm->sram[0x1ffe] == 0x4d && rm->sram[0x1fff] == 0x69;
        update = 1;
        break;
    case 0x1fff:
        rm->sram[0x1fff] = value;
        rm->sramEnabled = rm->sram[0x1ffe] == 0x4d && rm->sram[0x1fff] == 0x69;
        update = 1;
        break;
	default:
		if (rm->sramEnabled && address < 0x1ffe) {
            rm->sram[address] = value;
		}
        break;
    }

    if (update) {
        if (rm->sramEnabled) {
            slotMapPage(rm->slot, rm->sslot, rm->startPage, rm->sram, 1, 0);
        }
        else {
            slotMapPage(rm->slot, rm->sslot, rm->startPage, NULL, 0, 0);
        }
    }
}
开发者ID:Chegwin,项目名称:GBA4iOS-2.0-Beta-4,代码行数:33,代码来源:romMapperPAC.c


示例2: romMapperPlayBallCreate

int romMapperPlayBallCreate(char* filename, UInt8* romData, 
                          int size, int slot, int sslot, int startPage) 
{
    DeviceCallbacks callbacks = { (DeviceCallback)destroy, NULL, NULL, NULL };
    RomMapperPlayBall* rm;

    rm = malloc(sizeof(RomMapperPlayBall));

    if (size > 0x8000) {
        size = 0x8000;
    }

    rm->deviceHandle = deviceManagerRegister(ROM_PLAYBALL, &callbacks, rm);
    slotRegister(slot, sslot, startPage, 4, NULL, NULL, NULL, (SlotEject)destroy, rm);

    rm->romData = malloc(0x8000);
    memset(rm->romData + size, 0xff, 0x8000 - size);
    memcpy(rm->romData, romData, size);
    rm->size = size;
    rm->slot  = slot;
    rm->sslot = sslot;
    rm->startPage  = startPage;

    slotMapPage(rm->slot, rm->sslot, rm->startPage,     rm->romData + 0x0000, 1, 0);
    slotMapPage(rm->slot, rm->sslot, rm->startPage + 1, rm->romData + 0x2000, 1, 0);
    slotMapPage(rm->slot, rm->sslot, rm->startPage + 2, rm->romData + 0x4000, 1, 0);
    slotMapPage(rm->slot, rm->sslot, rm->startPage + 3, rm->romData + 0x6000, 0, 0);

    return 1;
}
开发者ID:imclab,项目名称:CocoaMSX,代码行数:30,代码来源:romMapperPlayBall.c


示例3: romMapperBasicCreate

int romMapperBasicCreate(char* filename, UInt8* romData, 
                         int size, int slot, int sslot, int startPage) 
{
    DeviceCallbacks callbacks = { destroy, NULL, NULL, NULL };
    RomMapperBasic* rm;

    if (size > 0x8000) {
        return 0;
    }

    rm = malloc(sizeof(RomMapperBasic));

    rm->romData = malloc(0x8000);
    memset(rm->romData, 0xff, 0x8000);
    memcpy(rm->romData, romData, size);

    rm->size = size;
    rm->slot  = slot;
    rm->sslot = sslot;
    rm->startPage  = startPage;

    rm->deviceHandle = deviceManagerRegister(ROM_BASIC, &callbacks, rm);
    slotRegister(slot, sslot, startPage, 4, NULL, NULL, NULL, destroy, rm);

    slotMapPage(slot, sslot, startPage + 0, rm->romData + 0x0000, 1, 0);
    slotMapPage(slot, sslot, startPage + 1, rm->romData + 0x2000, 1, 0);
    slotMapPage(slot, sslot, startPage + 2, rm->romData + 0x4000, 1, 0);
    slotMapPage(slot, sslot, startPage + 3, rm->romData + 0x6000, 1, 0);

    return 1;
}
开发者ID:imclab,项目名称:CocoaMSX,代码行数:31,代码来源:romMapperBasic.c


示例4: romMapperKorean126Create

int romMapperKorean126Create(const char* filename, UInt8* romData,
                             int size, int slot, int sslot, int startPage) 
{
    DeviceCallbacks callbacks = { destroy, NULL, saveState, loadState };
    RomMapperKorean126* rm;
    int i;

    if (size < 0x8000) {
        return 0;
    }

    rm = malloc(sizeof(RomMapperKorean126));

    rm->deviceHandle = deviceManagerRegister(ROM_KOREAN126, &callbacks, rm);
    slotRegister(slot, sslot, startPage, 4, NULL, NULL, write, destroy, rm);

    rm->romData = malloc(size);
    memcpy(rm->romData, romData, size);
    rm->size = size;
    rm->slot  = slot;
    rm->sslot = sslot;
    rm->startPage  = startPage;

    rm->romMapper[0] = 0;
    rm->romMapper[2] = 0;

    for (i = 0; i < 4; i += 2) {   
        slotMapPage(rm->slot, rm->sslot, rm->startPage + i,     rm->romData + rm->romMapper[i] * 0x2000, 1, 0);
        slotMapPage(rm->slot, rm->sslot, rm->startPage + i + 1, rm->romData + rm->romMapper[i] * 0x2000 + 0x2000, 1, 0);
    }

    return 1;
}
开发者ID:Chegwin,项目名称:GBA4iOS-2.0-Beta-4,代码行数:33,代码来源:romMapperKorean126.c


示例5: romMapperOpcodeSaveRamCreate

int romMapperOpcodeSaveRamCreate(int slot, int sslot, int startPage) 
{
    DeviceCallbacks callbacks = { destroy, reset, saveState, loadState };
    DebugCallbacks dbgCallbacks = { getDebugInfo, NULL, NULL, NULL };
    
    RomMapperOpcodeSaveRam* rm = malloc(sizeof(RomMapperOpcodeSaveRam));
    
    rm->slot      = slot;
    rm->sslot     = sslot;
    rm->startPage = startPage;
    
    memset(rm->saveRam, 0xff, sizeof(rm->saveRam));
    
    slotRegister(rm->slot, rm->sslot, rm->startPage, 4, NULL, NULL, write, destroy, rm);

    rm->deviceHandle = deviceManagerRegister(ROM_OPCODESAVE, &callbacks, rm);
    rm->debugHandle = debugDeviceRegister(DBGTYPE_RAM, "SAVERAM", &dbgCallbacks, rm);

    slotMapPage(rm->slot, rm->sslot, rm->startPage + 0, rm->saveRam + 0x0000, 1, 1);
    slotMapPage(rm->slot, rm->sslot, rm->startPage + 1, rm->saveRam + 0x2000, 1, 1);
    slotMapPage(rm->slot, rm->sslot, rm->startPage + 2, rm->saveRam + 0x4000, 1, 1);
    slotMapPage(rm->slot, rm->sslot, rm->startPage + 3, rm->saveRam + 0x6000, 1, 1);

    strcpy(rm->saveRamFilename, sramCreateFilename("SaveRam"));

    sramLoad(rm->saveRamFilename, rm->saveRam, sizeof(rm->saveRam), NULL, 0);

    reset(rm);

    return 1;
}
开发者ID:Chegwin,项目名称:GBA4iOS-2.0-Beta-4,代码行数:31,代码来源:romMapperOpcodeSaveRam.c


示例6: setDram

static void setDram(RomMapperDram* rm, int enable)
{
    if (enable) {
        if (rm->slot == 0 && rm->sslot == 0) {
//            int endPage = MIN(4, rm->startPage + rm->pages);
            int page;
            for (page = rm->startPage; page < 4; page++) {
                slotMapPage(rm->slot, rm->sslot, page, boardGetRamPage(page - 8), 1, 0);
            }
        }
        else if (rm->slot == 3 && rm->sslot == 1) {
//            int endPage = MIN(4, rm->startPage + rm->pages);
            int page;
            for (page = rm->startPage; page < 4; page++) {
                slotMapPage(rm->slot, rm->sslot, page, boardGetRamPage(page - 4), 1, 0);
            }
        }
    }
    else {
//        int endPage = MIN(4, rm->startPage + rm->pages);
        int page;
        for (page = rm->startPage; page < 4; page++) {
            slotMapPage(rm->slot, rm->sslot, page, rm->romData + 0x2000 * (page - rm->startPage), 1, 0);
        }
    }
}
开发者ID:imclab,项目名称:CocoaMSX,代码行数:26,代码来源:romMapperDRAM.c


示例7: loadState

static void loadState(RomMapperKonami5* rm)
{
    SaveState* state = saveStateOpenForRead("mapperKonami5");
    char tag[16];
    int i;

    for (i = 0; i < 4; i++) {
        sprintf(tag, "romMapper%d", i);
        rm->romMapper[i] = saveStateGet(state, tag, 0);
    }
    
    rm->sccEnable = saveStateGet(state, "sccEnable", 0);

    saveStateClose(state);

    sccLoadState(rm->scc);

    for (i = 0; i < 4; i++) {   
        slotMapPage(rm->slot, rm->sslot, rm->startPage + i, rm->romData + rm->romMapper[i] * 0x2000, 1, 0);
    }
    
    if (rm->sccEnable) {
        slotMapPage(rm->slot, rm->sslot, rm->startPage + 2, rm->romData + rm->romMapper[2] * 0x2000, 0, 0);
    }
    else {
        slotMapPage(rm->slot, rm->sslot, rm->startPage + 2, rm->romData + rm->romMapper[2] * 0x2000, 1, 0);
    }
}
开发者ID:Chegwin,项目名称:GBA4iOS-2.0-Beta-4,代码行数:28,代码来源:romMapperKonami5.c


示例8: write

static void write(RomMapperMsxDos2* rm, UInt16 address, UInt8 value) 
{
    int bank;

    address += 0x4000;

    if (address < 0x4000 && address >= 0xC000) {
        return;
    }

    bank = (address & 0x8000) >> 14;

    if (rm->romMapper[bank] != value) {
        UInt8* bankData;

        if (value > rm->size / 0x4000) {
            value %= rm->size / 0x4000;
        }

        bankData = rm->romData + ((int)value << 14);
        
        rm->romMapper[bank] = value;

        slotMapPage(rm->slot, rm->sslot, rm->startPage + bank,     bankData, 1, 0);
        slotMapPage(rm->slot, rm->sslot, rm->startPage + bank + 1, bankData + 0x2000, 1, 0);
    }
}
开发者ID:Chegwin,项目名称:GBA4iOS-2.0-Beta-4,代码行数:27,代码来源:romMapperMsxDos2.c


示例9: romMapperPACCreate

int romMapperPACCreate(const char* filename, UInt8* romData,
                         int size, int slot, int sslot, int startPage) 
{
    DeviceCallbacks callbacks = { destroy, NULL, saveState, loadState };
    RomMapperPAC* rm;

    rm = malloc(sizeof(RomMapperPAC));

    rm->deviceHandle = deviceManagerRegister(ROM_PAC, &callbacks, rm);
    slotRegister(slot, sslot, startPage, 2, read, read, write, destroy, rm);

    memset(rm->sram, 0xff, 0x2000);
    rm->slot  = slot;
    rm->sslot = sslot;
    rm->startPage  = startPage;
    rm->sramEnabled = 0;
    strcpy(rm->sramFilename, sramCreateFilename(filename));

    sramLoad(rm->sramFilename, rm->sram, 0x1ffe, pacHeader, strlen(pacHeader));

    slotMapPage(rm->slot, rm->sslot, rm->startPage,     NULL, 0, 0);
    slotMapPage(rm->slot, rm->sslot, rm->startPage + 1, NULL, 0, 0);

    return 1;
}
开发者ID:Chegwin,项目名称:GBA4iOS-2.0-Beta-4,代码行数:25,代码来源:romMapperPAC.c


示例10: write

static void write(RomMapperSCCplus* rm, UInt16 address, UInt8 value) 
{
    int bank;

    address += 0x4000;

    if (address < 0x4000 && address >= 0xc000) {       
        return;
    }

    if ((address | 1) == 0xbfff) {
        rm->modeRegister = value;
        rm->isRamSegment[0] = (value & 0x10) | (value & 0x01);
        rm->isRamSegment[1] = (value & 0x10) | (value & 0x02);
        rm->isRamSegment[2] = (value & 0x10) | ((value & 0x24) == 0x24);
		rm->isRamSegment[3] = (value & 0x10);
        
        updateEnable(rm);

        return;
    }

    bank = (address - 0x4000) >> 13;

    if (rm->isRamSegment[bank]) {
        if (rm->isMapped[bank]) {
        	rm->romData[0x2000 * (rm->romMapper[bank] & rm->mapperMask) + (address & 0x1fff)] = value;
        }
        return;
    }

    if ((address & 0x1800) == 0x1000) {
        rm->romMapper[bank] = value;
        value &= rm->mapperMask;
        rm->isMapped[bank]  = (value >= 8 && rm->sccType != SCC_SNATCHER) || 
                                (value < 8  && rm->sccType != SCC_SDSNATCHER);

        if (rm->isMapped[bank]) {
            slotMapPage(rm->slot, rm->sslot, rm->startPage + bank, rm->romData + 0x2000 * value, 1, 0);
        }
        else {
            slotMapPage(rm->slot, rm->sslot, rm->startPage + bank, rm->romData + 0x20000, 1, 0);
        }

        updateEnable(rm);

        return;
    }

    if (rm->sccMode == SCC_COMPATIBLE && address >= 0x9800 && address < 0xa000) {
        sccWrite(rm->scc, address & 0xff, value);
    }
    else if (rm->sccMode == SCC_PLUS && address >= 0xb800 && address < 0xc000) {
        sccWrite(rm->scc, address & 0xff, value);
    }
}
开发者ID:Chegwin,项目名称:GBA4iOS-2.0-Beta-4,代码行数:56,代码来源:romMapperSCCplus.c


示例11: writeIo

static void writeIo(RomMapperMegaRAM* rm, UInt16 ioPort, UInt8 value)
{
    if (rm->writeEnabled) {
        int i;
        for (i = 0; i < 4; i++) {
            slotMapPage(rm->slot, rm->sslot, rm->startPage + i, rm->ramData + rm->romMapper[i] * 0x2000, 1, 0);
            slotMapPage(rm->slot, rm->sslot, rm->startPage + i + 4, rm->ramData + rm->romMapper[i] * 0x2000, 1, 0);
        }
    }
    rm->writeEnabled = 0;
}
开发者ID:imclab,项目名称:CocoaMSX,代码行数:11,代码来源:romMapperMegaRAM.c


示例12: loadState

static void loadState(RomMapperCvMegaCart* rm)
{
    SaveState* state = saveStateOpenForRead("mapperCvMegaCart");
    UInt8* bankData;

    rm->romMapper = saveStateGet(state, "romMapper", 0);

    saveStateClose(state);

    bankData = rm->romData + (rm->romMapper << 14);
    slotMapPage(rm->slot, rm->sslot, rm->startPage + 2, bankData, 1, 0);
    slotMapPage(rm->slot, rm->sslot, rm->startPage + 3, bankData + 0x2000, 0, 0);
}
开发者ID:imclab,项目名称:CocoaMSX,代码行数:13,代码来源:romMapperCvMegaCart.c


示例13: readIo

static UInt8 readIo(RomMapperMegaRAM* rm, UInt16 ioPort)
{
    if (!rm->writeEnabled) {
        int i;
        for (i = 0; i < 4; i++) {
            slotMapPage(rm->slot, rm->sslot, rm->startPage + i, rm->ramData + rm->romMapper[i] * 0x2000, 1, 1);
            slotMapPage(rm->slot, rm->sslot, rm->startPage + i + 4, rm->ramData + rm->romMapper[i] * 0x2000, 1, 1);
        }
    }
    rm->writeEnabled = 1;

    return 0xff;
}
开发者ID:imclab,项目名称:CocoaMSX,代码行数:13,代码来源:romMapperMegaRAM.c


示例14: reset

static void reset(RomMapperTC8566AF* rm)
{
    int i;

    tc8566afReset(rm->fdc);

    rm->romMapper[0] = 0;
    rm->romMapper[2] = 0;

    for (i = 0; i < 4; i += 2) {   
        slotMapPage(rm->slot, rm->sslot, rm->startPage + i,     rm->romData + rm->romMapper[i] * 0x2000, 0, 0);
        slotMapPage(rm->slot, rm->sslot, rm->startPage + i + 1, rm->romData + rm->romMapper[i] * 0x2000 + 0x2000, 0, 0);
    }
}
开发者ID:imclab,项目名称:CocoaMSX,代码行数:14,代码来源:romMapperTC8566AF.c


示例15: romMapperFmDasCreate

int romMapperFmDasCreate(char* filename, UInt8* romData, 
                          int size, int slot, int sslot, int startPage) 
{
    DeviceCallbacks callbacks = { destroy, NULL, NULL, NULL };
    RomMapperFmDas* rm;

    if (size != 0x8000 || startPage != 0) {
        return 0;
    }

    rm = malloc(sizeof(RomMapperFmDas));

    rm->deviceHandle = deviceManagerRegister(ROM_FMDAS, &callbacks, rm);
    slotRegister(slot, sslot, startPage, 8, NULL, NULL, NULL, destroy, rm);

    rm->romData = malloc(0x8000);
    memcpy(rm->romData, romData, 0x8000);
    memset(rm->romData + 0x2000, 0xff, 0x2000);

    rm->slot  = slot;
    rm->sslot = sslot;
    rm->startPage  = startPage;

    slotMapPage(slot, sslot, 0, rm->romData + 0x0000, 1, 0);
    slotMapPage(slot, sslot, 1, rm->romData + 0x2000, 1, 1);
    slotMapPage(slot, sslot, 2, rm->romData + 0x4000, 1, 0);
    slotMapPage(slot, sslot, 3, rm->romData + 0x6000, 1, 0);
    slotMapPage(slot, sslot, 4, rm->romData + 0x0000, 1, 0);
    slotMapPage(slot, sslot, 5, rm->romData + 0x2000, 1, 1);
    slotMapPage(slot, sslot, 6, rm->romData + 0x4000, 1, 0);
    slotMapPage(slot, sslot, 7, rm->romData + 0x6000, 1, 0);

    return 1;
}
开发者ID:meesokim,项目名称:bluemsx-wii,代码行数:34,代码来源:romMapperFmDas.c


示例16: slotUpdate

static void slotUpdate(RomMapperOpcodeModule* rm)
{
    UInt8 slotSelect = rm->slotSelect;
    int i;

    slotMapPage(rm->slot, rm->sslot, 0, rm->biosRom + rm->biosLatch * 0x2000, 1, 0);
    slotMapPage(rm->slot, rm->sslot, 1, rm->ram + 0x0000, 1, 1);
    slotMapPage(rm->slot, rm->sslot, 2, rm->ram + 0x2000, 1, 1);
    slotMapPage(rm->slot, rm->sslot, 3, rm->ram + 0x4000, 1, 1);

    for (i = 0; i < 4; i++, slotSelect >>= 2) {
        switch (slotSelect & 3) {
        case SLOT_CARTRIDGE:
            slotMapPage(rm->slot, rm->sslot, 4 + i, rm->rom + 0x2000 * i, 1, 0);
            break;
        case SLOT_MEGARAM:
            slotMapPage(rm->slot, rm->sslot, 4 + i, rm->megaRam + 0x2000 * rm->megaRamLatch[i], 1, 1);
            break;
        case SLOT_SAVERAM:
            slotMapPage(rm->slot, rm->sslot, 4 + i, rm->saveRam + 0x2000 * i, 1, 0);
            break;
        case SLOT_EMPTY:
            slotMapPage(rm->slot, rm->sslot, 4 + i, NULL, 0, 0);
            break;
        }
    }
}
开发者ID:Chegwin,项目名称:GBA4iOS-2.0-Beta-4,代码行数:27,代码来源:romMapperOpcodeModule.c


示例17: write

static void write(RomMapperCrossBlaim* rm, UInt16 address, UInt8 value) 
{
    value&=3;

    if (rm->romMapper[2] != value) {
    	
    	rm->romMapper[2] = value;
    	
    	if (value&2) {
    		// ROM 1
    		// page 2 specified bank
    		UInt8* bankData = rm->romData + ((int)value << 14);
    		
	        slotMapPage(rm->slot, rm->sslot, 4, bankData,          1, 0);
        	slotMapPage(rm->slot, rm->sslot, 5, bankData + 0x2000, 1, 0);
    		
    		// page 0 and 3 unmapped
    		slotMapPage(rm->slot, rm->sslot, 0, NULL, 0, 0);
    		slotMapPage(rm->slot, rm->sslot, 1, NULL, 0, 0);
    		slotMapPage(rm->slot, rm->sslot, 6, NULL, 0, 0);
    		slotMapPage(rm->slot, rm->sslot, 7, NULL, 0, 0);
    	}
    	else {
    		int i;
    		
    		// ROM 0
    		// page 2 bank 1, page 0 and 3 mirrors of page 2
    		for (i=0;i<8;i+=2) {
    			if (i==2) continue;
    			slotMapPage(rm->slot, rm->sslot, i,   rm->romData+0x4000, 1, 0);
    			slotMapPage(rm->slot, rm->sslot, i+1, rm->romData+0x6000, 1, 0);
    		}
    	}
    }
}
开发者ID:imclab,项目名称:CocoaMSX,代码行数:35,代码来源:romMapperCrossBlaim.c


示例18: romMapperNationalFdcCreate

int romMapperNationalFdcCreate(const char* filename, UInt8* romData, 
                               int size, int slot, int sslot, int startPage) 
{
    DeviceCallbacks callbacks = { destroy, NULL, saveState, loadState };
    RomMapperNationalFdc* rm;
    int pages = 4;
    int i;

    if ((startPage + pages) > 8) {
        return 0;
    }

    rm = malloc(sizeof(RomMapperNationalFdc));

    rm->deviceHandle = deviceManagerRegister(ROM_NATIONALFDC, &callbacks, rm);
    slotRegister(slot, sslot, startPage, pages, read, peek, write, destroy, rm);

    rm->romData = malloc(size);
    memcpy(rm->romData, romData, size);
    
    rm->slot  = slot;
    rm->sslot = sslot;
    rm->startPage  = startPage;

    for (i = 0; i < pages; i++) {
        slotMapPage(slot, sslot, i + startPage, NULL, 0, 0);
    }

    rm->fdc = wd2793Create(FDC_TYPE_WD2793);

    reset(rm);

    return 1;
}
开发者ID:CocoaMSX,项目名称:CocoaMSX,代码行数:34,代码来源:romMapperNationalFdc.c


示例19: romMapperKonamiWordProCreate

int romMapperKonamiWordProCreate(char* filename, UInt8* romData, 
                          int size, int slot, int sslot, int startPage) 
{
    DeviceCallbacks callbacks = { destroy, reset, saveState, loadState };
    RomMapperKonamiWordPro* rm;
    int pages = 8;
    int i;

    if (size != 0x8000) {
        return 0;
    }

    rm = malloc(sizeof(RomMapperKonamiWordPro));

    if (pages == 8)
        startPage = 0;

    rm->deviceHandle = deviceManagerRegister(ROM_KONWORDPRO, &callbacks, rm);
    slotRegister(slot, sslot, startPage, pages, read, read, write, destroy, rm);

    rm->romData = calloc(1, size);
    memcpy(rm->romData, romData, size);
    rm->slot  = slot;
    rm->sslot = sslot;
    rm->startPage  = startPage;

    for (i = 0; i < pages; i++) {   
        slotMapPage(rm->slot, rm->sslot, rm->startPage + i, rm->romData + i * 0x2000, 0, 0);
    }

    reset(rm);
    return 1;
}
开发者ID:meesokim,项目名称:bluemsx-wii,代码行数:33,代码来源:romMapperKonamiWordPro.c


示例20: romMapperMajutsushiCreate

int romMapperMajutsushiCreate(const char* filename, UInt8* romData, 
                           int size, int slot, int sslot, int startPage) 
{
    DeviceCallbacks callbacks = { destroy, NULL, saveState, loadState };
    RomMapperMajutsushi* rm;
    int i;

    if (size < 0x8000) {
        return 0;
    }

    rm = malloc(sizeof(RomMapperMajutsushi));

    rm->deviceHandle = deviceManagerRegister(ROM_MAJUTSUSHI, &callbacks, rm);
    slotRegister(slot, sslot, startPage, 4, NULL, NULL, write, destroy, rm);

    rm->romData = malloc(size);
    memcpy(rm->romData, romData, size);
    rm->dac = dacCreate(boardGetMixer(), DAC_MONO);
    rm->size = size;
    rm->slot  = slot;
    rm->sslot = sslot;
    rm->startPage  = startPage;

    rm->romMapper[0] = 0;
    rm->romMapper[1] = 1;
    rm->romMapper[2] = 2;
    rm->romMapper[3] = 3;

    for (i = 0; i < 4; i++) {   
        slotMapPage(rm->slot, rm->sslot, rm->startPage + i, rm->romData + rm->romMapper[i] * 0x2000, 1, 0);
    }

    return 1;
}
开发者ID:CocoaMSX,项目名称:CocoaMSX,代码行数:35,代码来源:romMapperMajutsushi.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ slotOk函数代码示例发布时间:2022-05-30
下一篇:
C++ slotIntVal函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap