Beispiel #1
0
static void GBAVideoCacheWriteDISPCNT(struct mCacheSet* cache, uint16_t value) {
	mBitmapCacheSetGetPointer(&cache->bitmaps, 1)->buffer = GBARegisterDISPCNTGetFrameSelect(value);

	switch (GBARegisterDISPCNTGetMode(value)) {
	case 0:
	default:
		mMapCacheSetGetPointer(&cache->maps, 0)->mapParser = mapParser0;
		mMapCacheSetGetPointer(&cache->maps, 1)->mapParser = mapParser0;
		mMapCacheSetGetPointer(&cache->maps, 2)->mapParser = mapParser0;
		mMapCacheSetGetPointer(&cache->maps, 3)->mapParser = mapParser0;

		mMapCacheSetGetPointer(&cache->maps, 0)->tileCache = mTileCacheSetGetPointer(&cache->tiles,
			mMapCacheSystemInfoGetPaletteBPP(mMapCacheSetGetPointer(&cache->maps, 0)->sysConfig) == 3);
		mMapCacheSetGetPointer(&cache->maps, 1)->tileCache = mTileCacheSetGetPointer(&cache->tiles,
			mMapCacheSystemInfoGetPaletteBPP(mMapCacheSetGetPointer(&cache->maps, 1)->sysConfig) == 3);
		mMapCacheSetGetPointer(&cache->maps, 2)->tileCache = mTileCacheSetGetPointer(&cache->tiles,
			mMapCacheSystemInfoGetPaletteBPP(mMapCacheSetGetPointer(&cache->maps, 2)->sysConfig) == 3);
		mMapCacheSetGetPointer(&cache->maps, 3)->tileCache = mTileCacheSetGetPointer(&cache->tiles,
			mMapCacheSystemInfoGetPaletteBPP(mMapCacheSetGetPointer(&cache->maps, 3)->sysConfig) == 3);
		break;
	case 1:
	case 2:
		mMapCacheSetGetPointer(&cache->maps, 0)->mapParser = mapParser0;
		mMapCacheSetGetPointer(&cache->maps, 1)->mapParser = mapParser0;
		mMapCacheSetGetPointer(&cache->maps, 2)->mapParser = mapParser2;
		mMapCacheSetGetPointer(&cache->maps, 3)->mapParser = mapParser2;

		mMapCacheSetGetPointer(&cache->maps, 0)->tileCache = mTileCacheSetGetPointer(&cache->tiles,
			mMapCacheSystemInfoGetPaletteBPP(mMapCacheSetGetPointer(&cache->maps, 0)->sysConfig) == 3);
		mMapCacheSetGetPointer(&cache->maps, 1)->tileCache = mTileCacheSetGetPointer(&cache->tiles,
			mMapCacheSystemInfoGetPaletteBPP(mMapCacheSetGetPointer(&cache->maps, 1)->sysConfig) == 3);

		mMapCacheSetGetPointer(&cache->maps, 2)->tileCache = mTileCacheSetGetPointer(&cache->tiles, 1);
		mMapCacheSetGetPointer(&cache->maps, 3)->tileCache = mTileCacheSetGetPointer(&cache->tiles, 1);
		break;
	}

	mBitmapCacheSystemInfo bitConfig;
	switch (GBARegisterDISPCNTGetMode(value)) {
	case 3:
		bitConfig = mBitmapCacheSystemInfoSetEntryBPP(0, 4);
		bitConfig = mBitmapCacheSystemInfoClearUsesPalette(bitConfig);
		bitConfig = mBitmapCacheSystemInfoSetHeight(bitConfig, 160);
		bitConfig = mBitmapCacheSystemInfoSetWidth(bitConfig, 240);
		bitConfig = mBitmapCacheSystemInfoSetBuffers(bitConfig, 1);
		mBitmapCacheConfigureSystem(mBitmapCacheSetGetPointer(&cache->bitmaps, 0), bitConfig);
		mBitmapCacheSetGetPointer(&cache->bitmaps, 0)->buffer = 0;
		break;
	case 5:
		bitConfig = mBitmapCacheSystemInfoSetEntryBPP(0, 4);
		bitConfig = mBitmapCacheSystemInfoClearUsesPalette(bitConfig);
		bitConfig = mBitmapCacheSystemInfoSetHeight(bitConfig, 128);
		bitConfig = mBitmapCacheSystemInfoSetWidth(bitConfig, 160);
		bitConfig = mBitmapCacheSystemInfoSetBuffers(bitConfig, 2);
		mBitmapCacheConfigureSystem(mBitmapCacheSetGetPointer(&cache->bitmaps, 0), bitConfig);
		mBitmapCacheSetGetPointer(&cache->bitmaps, 0)->buffer = GBARegisterDISPCNTGetFrameSelect(value);
		break;
	}
}
Beispiel #2
0
static void GBAVideoCacheWriteDISPCNT(struct mCacheSet* cache, uint16_t value) {
	switch (GBARegisterDISPCNTGetMode(value)) {
	case 0:
	default:
		mMapCacheSetGetPointer(&cache->maps, 0)->mapParser = mapParser0;
		mMapCacheSetGetPointer(&cache->maps, 1)->mapParser = mapParser0;
		mMapCacheSetGetPointer(&cache->maps, 2)->mapParser = mapParser0;
		mMapCacheSetGetPointer(&cache->maps, 3)->mapParser = mapParser0;

		mMapCacheSetGetPointer(&cache->maps, 0)->tileCache = mTileCacheSetGetPointer(&cache->tiles,
			mMapCacheSystemInfoGetPaletteBPP(mMapCacheSetGetPointer(&cache->maps, 0)->sysConfig) == 3);
		mMapCacheSetGetPointer(&cache->maps, 1)->tileCache = mTileCacheSetGetPointer(&cache->tiles,
			mMapCacheSystemInfoGetPaletteBPP(mMapCacheSetGetPointer(&cache->maps, 1)->sysConfig) == 3);
		mMapCacheSetGetPointer(&cache->maps, 2)->tileCache = mTileCacheSetGetPointer(&cache->tiles,
			mMapCacheSystemInfoGetPaletteBPP(mMapCacheSetGetPointer(&cache->maps, 2)->sysConfig) == 3);
		mMapCacheSetGetPointer(&cache->maps, 3)->tileCache = mTileCacheSetGetPointer(&cache->tiles,
			mMapCacheSystemInfoGetPaletteBPP(mMapCacheSetGetPointer(&cache->maps, 3)->sysConfig) == 3);
		break;
	case 1:
	case 2:
		mMapCacheSetGetPointer(&cache->maps, 0)->mapParser = mapParser0;
		mMapCacheSetGetPointer(&cache->maps, 1)->mapParser = mapParser0;
		mMapCacheSetGetPointer(&cache->maps, 2)->mapParser = mapParser2;
		mMapCacheSetGetPointer(&cache->maps, 3)->mapParser = mapParser2;

		mMapCacheSetGetPointer(&cache->maps, 0)->tileCache = mTileCacheSetGetPointer(&cache->tiles,
			mMapCacheSystemInfoGetPaletteBPP(mMapCacheSetGetPointer(&cache->maps, 0)->sysConfig) == 3);
		mMapCacheSetGetPointer(&cache->maps, 1)->tileCache = mTileCacheSetGetPointer(&cache->tiles,
			mMapCacheSystemInfoGetPaletteBPP(mMapCacheSetGetPointer(&cache->maps, 1)->sysConfig) == 3);

		mMapCacheSetGetPointer(&cache->maps, 2)->tileCache = mTileCacheSetGetPointer(&cache->tiles, 1);
		mMapCacheSetGetPointer(&cache->maps, 3)->tileCache = mTileCacheSetGetPointer(&cache->tiles, 1);
		break;
	}
}