DM: Add missing code related to palettes

This commit is contained in:
Bendegúz Nagy 2016-08-11 19:21:23 +02:00
parent 6113b75ca9
commit 5fb1b3e808
4 changed files with 11 additions and 11 deletions

View file

@ -279,8 +279,10 @@ void DMEngine::f463_initializeGame() {
void DMEngine::f448_initMemoryManager() {
warning(false, "STUB METHOD: f448_initMemoryManager");
_displayMan->f508_buildPaletteChangeCopperList(gK57_PalSwoosh, gK57_PalSwoosh);
for (uint16 i = 0; i < 16; ++i)
for (uint16 i = 0; i < 16; ++i) {
_displayMan->_g347_paletteTopAndBottomScreen[i] = g21_PalDungeonView[0][i];
_displayMan->_g346_paletteMiddleScreen[i] = g21_PalDungeonView[0][i];
}
}
void DMEngine::f462_startGame() {
@ -307,6 +309,7 @@ void DMEngine::f462_startGame() {
f3_processNewPartyMap(_dungeonMan->_g309_partyMapIndex);
if (!_g298_newGame) {
_displayMan->f436_STARTEND_FadeToPalette(_displayMan->_g347_paletteTopAndBottomScreen);
_displayMan->_g578_useByteBoxCoordinates = false;
f22_delay(1);
_displayMan->D24_fillScreenBox(boxScreenTop, k0_ColorBlack);

View file

@ -1201,10 +1201,10 @@ byte* DisplayMan::f114_getExplosionBitmap(uint16 explosionAspIndex, uint16 scale
void DisplayMan::updateScreen() {
// apply copper
warning(false, "Top of the screen color is offset as well"); // loop should start from 320 * 30
for (uint32 i = 0; i < 320 * 170; ++i)
for (uint32 i = 320 * 30; i < 320 * 170; ++i)
_g348_bitmapScreen[i] += 16;
_vm->_system->copyRectToScreen(_g348_bitmapScreen, _screenWidth, 0, 0, _screenWidth, _screenHeight);
for (uint32 i = 0; i < 320 * 170; ++i) // loop should start from 320 * 30
for (uint32 i = 320 * 30; i < 320 * 170; ++i) // loop should start from 320 * 30
_g348_bitmapScreen[i] -= 16;
_vm->_console->onFrame();
_vm->_system->updateScreen();
@ -3740,8 +3740,7 @@ void DisplayMan::f436_STARTEND_FadeToPalette(uint16* P0849_pui_Palette) {
}
void DisplayMan::f508_buildPaletteChangeCopperList(uint16* middleScreen, uint16* topAndBottom) {
// memcpy(_g347_paletteTopAndBottomScreen, topAndBottom, sizeof(uint16) * 16);
// memcpy(_g346_paletteMiddleScreen, middleScreen, sizeof(uint16) * 16);
_gK17_paletteFadeFrom = topAndBottom;
byte colorPalette[32 * 3];
for (int i = 0; i < 16; ++i) {
colorPalette[i * 3] = (topAndBottom[i] >> 8) * (256 / 16);

View file

@ -750,8 +750,8 @@ public:
void f493_addDerivedBitmap(int16 derivedBitmapIndex); // @ F0493_CACHE_AddDerivedBitmap
void f480_releaseBlock(uint16 index); // @ F0480_CACHE_ReleaseBlock
uint16 f431_getDarkenedColor(uint16 RGBcolor);
void f508_buildPaletteChangeCopperList(uint16* middleScreen, uint16* topAndBottom);
void f436_STARTEND_FadeToPalette(uint16 *P0849_pui_Palette); // @ F0436_STARTEND_FadeToPalette
void f508_buildPaletteChangeCopperList(uint16* middleScreen, uint16* topAndBottom); // @ F0508_AMIGA_BuildPaletteChangeCopperList
void f136_shadeScreenBox(Box* box, Color color) { warning(false, "STUB METHOD: f136_shadeScreenBox"); } // @ F0136_VIDEO_ShadeScreenBox
};

View file

@ -45,6 +45,7 @@ namespace DM {
#define C10_DUNGEON_DM 10
LoadgameResponse DMEngine::f435_loadgame(int16 slot) {
bool L1366_B_FadePalette = true;
Common::String fileName;
Common::SaveFileManager *saveFileManager = nullptr;
Common::InSaveFile *file = nullptr;
@ -142,15 +143,12 @@ LoadgameResponse DMEngine::f435_loadgame(int16 slot) {
_timeline->f233_initTimeline();
_groupMan->f196_initActiveGroups();
warning(false, "Disabled code in f435_loadgame");
#if 0
if (L1366_B_FadePalette) {
_displayMan->f436_STARTEND_FadeToPalette(_displayMan->_g345_aui_BlankBuffer);
D26_WaitForVerticalBlank();
D18_FillScreenBlack();
f22_delay(1);
_displayMan->fillScreen(k0_ColorBlack);
_displayMan->f436_STARTEND_FadeToPalette(_displayMan->_g347_paletteTopAndBottomScreen);
}
#endif
} else {
_g528_saveFormat = dmSaveHeader._saveFormat;
_g527_platform = dmSaveHeader._platform;