From 28fed460effbfa0310d2bd63fa994f9a3b7db275 Mon Sep 17 00:00:00 2001 From: cuckydev Date: Thu, 7 Feb 2019 20:20:27 -0500 Subject: [PATCH 1/2] credit --- build/Profile - Copy.dat | Bin 1540 -> 0 bytes src/Ending.cpp | 12 ++++++++---- src/Game.cpp | 4 ++-- src/TextScr.cpp | 18 ++++++++++++++++++ 4 files changed, 28 insertions(+), 6 deletions(-) delete mode 100644 build/Profile - Copy.dat diff --git a/build/Profile - Copy.dat b/build/Profile - Copy.dat deleted file mode 100644 index ba3c4778c42888fc4833ddc6e69fe4d8aa3fa50b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1540 zcmeH^y=nqc6olvc!x}AI$;M3;1wpitjo1ns5Ywbiy+t6UnAD2kOIZ3Gg0T1mK8lT% z7MYQ~y@DD92R`n(%VFo7xxGQqd2P3Y766}=CkC^IL5g*g)QQzgQhYBQWLT$3o_r;! zHY7{D1oa5rtsYqD|3&-Z0;lHFEb?)PJT+gA$hSluiRRK?Pvo4E_mF|g|A(hC_*K9+ zqW;I*yLPbJq!_1*)#2{!w?0#h;$0e%!4d((_7DQkm}un?V^o0}+z?&3aRr&RIlKdd k*i6~t0-snbmw7z0Ca0cyi_@% diff --git a/src/Ending.cpp b/src/Ending.cpp index 2be53f6b..d1eef0e9 100644 --- a/src/Ending.cpp +++ b/src/Ending.cpp @@ -40,14 +40,14 @@ void PutStripper() { //Draw text RECT rc = {0, 16 * s, 320, 16 * s + 16}; - PutBitmap3(&grcFull, Strip[s].x / 0x200, Strip[s].y / 0x200, &rc, SURFACE_ID_CREDIT_CAST); + PutBitmap3(&grcFull, (Strip[s].x + ((WINDOW_WIDTH - 320) << 8)) / 0x200, Strip[s].y / 0x200, &rc, SURFACE_ID_CREDIT_CAST); //Draw character rc.left = 24 * (Strip[s].cast % 13); rc.right = rc.left + 24; rc.top = 24 * (Strip[s].cast / 13); rc.bottom = rc.top + 24; - PutBitmap3(&grcFull, Strip[s].x / 0x200 - 24, Strip[s].y / 0x200 - 8, &rc, SURFACE_ID_CASTS); + PutBitmap3(&grcFull, (Strip[s].x + ((WINDOW_WIDTH - 320) << 8)) / 0x200 - 24, Strip[s].y / 0x200 - 8, &rc, SURFACE_ID_CASTS); } } } @@ -116,7 +116,8 @@ void ActionIllust() void PutIllust() { RECT rcIllust = {0, 0, 160, 240}; - PutBitmap3(&grcFull, Illust.x / 0x200, 0, &rcIllust, SURFACE_ID_CREDITS_IMAGE); + RECT rcClip = {(WINDOW_WIDTH - 320) / 2, 0, WINDOW_WIDTH, WINDOW_HEIGHT}; + PutBitmap3(&rcClip, (Illust.x + ((WINDOW_WIDTH - 320) << 8)) / 0x200, (WINDOW_HEIGHT - 240) / 2, &rcIllust, SURFACE_ID_CREDITS_IMAGE); } //Load illustration @@ -183,7 +184,10 @@ bool StartCreditScript() Illust.act_no = 0; //Modify cliprect - grcGame.left = 160; + grcGame.left = WINDOW_WIDTH / 2; + grcGame.right = ((WINDOW_WIDTH - 320) / 2) + 320; + grcGame.top = (WINDOW_HEIGHT - 240) / 2; + grcGame.bottom = ((WINDOW_HEIGHT - 240) / 2) + 240; //Reload casts if (!ReloadBitmap_File("casts", SURFACE_ID_CASTS)) diff --git a/src/Game.cpp b/src/Game.cpp index 69d2d55d..32fd6677 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -114,7 +114,7 @@ int ModeOpening() SetFadeMask(); //Reset cliprect and flags - grcGame.left = 0; + grcGame = {0, 0, WINDOW_WIDTH, WINDOW_HEIGHT}; g_GameFlags = 3; CutNoise(); @@ -290,7 +290,7 @@ int ModeTitle() } //Reset cliprect, flags, and give the player the nikumaru counter - grcGame.left = 0; + grcGame = {0, 0, WINDOW_WIDTH, WINDOW_HEIGHT}; g_GameFlags = 0; gMC.equip |= 0x100; diff --git a/src/TextScr.cpp b/src/TextScr.cpp index 434f276f..281a2f59 100644 --- a/src/TextScr.cpp +++ b/src/TextScr.cpp @@ -14,6 +14,7 @@ #include "Frame.h" #include "MycParam.h" #include "Flags.h" +#include "Ending.h" #include "Profile.h" #include "Map.h" #include "MiniMap.h" @@ -1204,6 +1205,23 @@ int TextScriptProc() SetNumberTextScript(z); gTS.p_read += 8; } + else if (IS_COMMAND('C','R','E')) + { + g_GameFlags |= 8; + StartCreditScript(); + gTS.p_read += 4; + } + else if (IS_COMMAND('S','I','L')) + { + z = GetTextScriptNo(gTS.p_read + 4); + SetCreditIllust(z); + gTS.p_read += 8; + } + else if (IS_COMMAND('C','I','L')) + { + CutCreditIllust(); + gTS.p_read += 4; + } else if (IS_COMMAND('E','S','C')) { return 2; From 4498e5d71adf77caa8d456fd1f9183a6ac37559a Mon Sep 17 00:00:00 2001 From: cuckydev Date: Thu, 7 Feb 2019 20:52:16 -0500 Subject: [PATCH 2/2] i tried --- src/CommonDefines.h | 2 +- src/Frame.cpp | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/CommonDefines.h b/src/CommonDefines.h index 2a135b90..996cbcf9 100644 --- a/src/CommonDefines.h +++ b/src/CommonDefines.h @@ -1,5 +1,5 @@ #pragma once #define PATH_LENGTH 260 //Pixel had the path size locked to 260 (dangerously low), if you tried to open the executable in a path with more than around 220 characters, it'd crash. -#define WINDOW_WIDTH 320 +#define WINDOW_WIDTH 426 #define WINDOW_HEIGHT 240 diff --git a/src/Frame.cpp b/src/Frame.cpp index bad365a3..6e879a61 100644 --- a/src/Frame.cpp +++ b/src/Frame.cpp @@ -22,24 +22,30 @@ void MoveFrame3() const int num_x = ((WINDOW_WIDTH + 0xF) >> 4) + 1; const int num_y = ((WINDOW_HEIGHT + 0xF) >> 4) + 1; - if (map_w >= num_x) + if (map_w >= num_x || g_GameFlags & 8) { if (gFrame.x <= -0x200) gFrame.x = 0; - if (gFrame.x > ((((map_w - 1) << 4) - WINDOW_WIDTH)) << 9) - gFrame.x = (((map_w - 1) << 4) - WINDOW_WIDTH) << 9; + if (gFrame.x > ((((map_w - 1) << 4) - ((g_GameFlags & 8) ? 320 : WINDOW_WIDTH))) << 9) + gFrame.x = (((map_w - 1) << 4) - ((g_GameFlags & 8) ? 320 : WINDOW_WIDTH)) << 9; + + if (g_GameFlags & 8) + gFrame.x -= ((WINDOW_WIDTH - 320) / 2) << 9; } else { gFrame.x = (((map_w - 1) << 4) - WINDOW_WIDTH) << 8; } - if (map_l >= num_y) + if (map_l >= num_y || g_GameFlags & 8) { if (gFrame.y <= -0x200) gFrame.y = 0; - if (gFrame.y > ((((map_l - 1) << 4) - WINDOW_HEIGHT)) << 9) - gFrame.y = (((map_l - 1) << 4) - WINDOW_HEIGHT) << 9; + if (gFrame.y > ((((map_l - 1) << 4) - ((g_GameFlags & 8) ? 240 : WINDOW_HEIGHT))) << 9) + gFrame.y = (((map_l - 1) << 4) - ((g_GameFlags & 8) ? 240 : WINDOW_HEIGHT)) << 9; + + if (g_GameFlags & 8) + gFrame.y += ((WINDOW_HEIGHT - 240) / 2) << 9; } else {