Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Steins;Gate (Steam) #55

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ set(Impacto_Src

src/profile/games/darling/sysmesbox.cpp

src/profile/games/sghd/titlemenu.cpp

src/games/rne/tilebackground.cpp
src/games/rne/datedisplay.cpp
src/games/rne/systemmenu.cpp
Expand Down Expand Up @@ -204,6 +206,8 @@ set(Impacto_Src

src/games/darling/sysmesbox.cpp

src/games/sghd/titlemenu.cpp

src/hud/dialoguebox.cpp
src/hud/datedisplay.cpp
src/hud/saveicondisplay.cpp
Expand Down Expand Up @@ -252,6 +256,7 @@ set(Impacto_Src
src/ui/widgets/cclcc/sysmenubutton.cpp
src/ui/widgets/cclcc/tipsentrybutton.cpp
src/ui/widgets/cclcc/tipstabgroup.cpp
src/ui/widgets/sghd/titlebutton.cpp

src/stbi_impl.c

Expand Down Expand Up @@ -403,6 +408,8 @@ set(Impacto_Header

src/profile/games/dash/titlemenu.h

src/profile/games/sghd/titlemenu.h

src/profile/games/chlcc/dialoguebox.h
src/profile/games/chlcc/titlemenu.h
src/profile/games/chlcc/savemenu.h
Expand Down Expand Up @@ -459,6 +466,8 @@ set(Impacto_Header

src/games/dash/titlemenu.h

src/games/sghd/titlemenu.h

src/games/chlcc/dialoguebox.h
src/games/chlcc/titlemenu.h
src/games/chlcc/savemenu.h
Expand Down Expand Up @@ -555,6 +564,7 @@ set(Impacto_Header
src/ui/widgets/rne/sysmenubutton.h
src/ui/widgets/cc/titlebutton.h
src/ui/widgets/cclcc/titlebutton.h
src/ui/widgets/sghd/titlebutton.h

src/renderer/3d/camera.h
src/renderer/3d/model.h
Expand Down
45 changes: 45 additions & 0 deletions profiles/sghd/charset.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
-- WARNING, 0-INDEXED ARRAYS AHEAD

root.Charset = {
Flags = {}
};

for i = 0, (64 * 37) - 1 do root.Charset.Flags[i] = 0; end

local spaces = {[0]=0, 63};
for i = 0, #spaces do
root.Charset.Flags[spaces[i]] = root.Charset.Flags[spaces[i]] | CharacterTypeFlags.Space;
end

-- 、 。 . , ? ! 〜 ” ー ) 〕 ] } 〉 》 」 』 】☆ ★ ♪ 々 ぁ ぃ ぅ ぇ
-- ぉ っ ゃ ゅ ょ ァ ィ ゥ ェ ォ ッ ャ ュ ョ –
local wordEndingPuncts = {
[0]=0x00BE, 0x00BF, 0x00C1,
0x00C0, 0x00C4, 0x00C5,
0x00E4, 0x00CB, 0x00E5,
0x00CD, 0x00CF, 0x00D1,
0x00D3, 0x00D5, 0x00D7,
0x00D9, 0x00DB, 0x00DD,
0x01A5, 0x01A6, 0x00E6,
0x0187, 0x00E8, 0x00E9,
0x00EA, 0x00EB, 0x00EC,
0x00ED, 0x00EE, 0x00EF,
0x00F0, 0x00F2, 0x00F3,
0x00F4, 0x00F5, 0x00F6,
0x00F7, 0x00F8, 0x00F9,
0x00FA, 0x0113
};
for i = 0, #wordEndingPuncts do
root.Charset.Flags[wordEndingPuncts[i]] = root.Charset.Flags[wordEndingPuncts[i]] | CharacterTypeFlags.WordEndingPunct;
end

-- space(63) space(0) “ ( 〔 [ { 〈 《 「
local wordStartingPuncts = {
[0]=63, 0, 0x00CA,
0x00CC, 0x00CE, 0x00D0,
0x00D2, 0x00D4, 0x00D6,
0x00D8, 0x00DA, 0x00DC
};
for i = 0, #wordStartingPuncts do
root.Charset.Flags[wordStartingPuncts[i]] = root.Charset.Flags[wordStartingPuncts[i]] | CharacterTypeFlags.WordStartingPunct;
end
5 changes: 5 additions & 0 deletions profiles/sghd/config.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
root.Language = "English";
root.ResolutionWidth = 1920;
root.ResolutionHeight = 1080;
root.Fullscreen = false;
root.Subtitles = "off";
79 changes: 79 additions & 0 deletions profiles/sghd/dialogue.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
root.Sprites["ADVBox"] = {
Sheet = "Data01",
Bounds = { X = 767, Y = 806, Width = 1280, Height = 216 },
};

root.Sprites["DialogueWaitIcon"] = {
Sheet = "Data01",
Bounds = { X = 1, Y = 97, Width = 32, Height = 32 }
};

-- NOTE: Values taken from sgps3
-- TODO: Check and fix
root.Dialogue = {
REVBounds = { X = 0, Y = 0, Width = 960, Height = 400 },
REVNameFontSize = 24,
REVNameColor = 24,
REVNameOffset = 34,
NVLBounds = { X = 125, Y = 85, Width = 1024, Height = 400 },
ADVBounds = { X = 161, Y = 525, Width = 960, Height = 180 },
ADVBoxSprite = "ADVBox",
ADVBoxPos = { X = 0, Y = 504 },
FadeOutDuration = 0.33,
FadeInDuration = 0.33,
DialogueBoxCurrentType = DialogueBoxType.Plain,
NVLBoxMaxOpacity = 0.55,
ADVNameAlignment = TextAlignment.Left,
ADVNameFontSize = 22,
ADVNamePos = { X = 600, Y = 672 },
WaitIconCurrentType = WaitIconType.Rotate,
WaitIconSprite = "DialogueWaitIcon",
WaitIconOffset = { X = 4, Y = 4 },
WaitIconAnimationDuration = 3.2,
DialogueFont = "Default",
DefaultFontSize = 32,
RubyFontSize = 14,
RubyYOffset = -18,
ColorTable = {
{0xFFFFFF, 0x000000}, {0x5080FF, 0x000000},
{0xFF7080, 0x000000}, {0xFFA0F8, 0x000000},
{0x46FF80, 0x000000}, {0x90FFFF, 0x000000},
{0xFFFF70, 0x000000}, {0x80FFC0, 0x000000},
{0xFFB080, 0x000000}, {0xB080FF, 0x000000},
{0x000000, 0x808080}, {0x000000, 0x5080FF},
{0x000000, 0xFF7080}, {0x000000, 0xFFA0F8},
{0x000000, 0x268840}, {0x000000, 0x409999},
{0x000000, 0x888830}, {0x000000, 0x80FFC0},
{0x000000, 0xFFB080}, {0x000000, 0xB080FF},
{0xD0D0D0, 0x000000}, {0xD0D0FF, 0x000000},
{0xFFD0D0, 0x000000}, {0xFFD0FF, 0x000000},
{0xD0FFD0, 0x000000}, {0xD0FFFF, 0x000000},
{0xFFFFD0, 0x000000}, {0xE8FFD0, 0x000000},
{0xFFE8D0, 0x000000}, {0xD0E8FF, 0x000000},
{0xFFFFFF, 0x808080}, {0xFFFFFF, 0x5080FF},
{0xFFFFFF, 0xFF7080}, {0xFFFFFF, 0xFFA0F8},
{0xFFFFFF, 0x46FF80}, {0xFFFFFF, 0x90FFFF},
{0xFFFFFF, 0xFFFF70}, {0xFFFFFF, 0x80FFC0},
{0xFFFFFF, 0xFFB080}, {0xFFFFFF, 0xB080FF},
{0xFFEEEE, 0x000000}, {0xFFCCCC, 0x000000},
{0xFFAAAA, 0x000000}, {0xFF9999, 0x000000},
{0xFF8888, 0x000000}, {0xFFFF00, 0x000000},
{0xFEF000, 0x000000}, {0xFF7777, 0x000000},
{0xFF6666, 0x000000}, {0xFF5555, 0x000000},
{0xFF4444, 0x000000}, {0xFF3333, 0x000000},
{0xFF2222, 0x000000}, {0xFF0000, 0x000000},
{0xDD0000, 0x000000}, {0xBB0000, 0x000000},
{0xB00000, 0x000000}, {0xAA0000, 0x000000},
{0x950000, 0x000000}, {0x808080, 0x000000},
{0xAAAAAA, 0x000000}, {0xAAC1C9, 0x000000},
{0x000000, 0x000000}, {0x000000, 0x000000},
{0x000000, 0x000000}, {0x000000, 0x000000},
{0x000000, 0x000000}, {0xF80B0B, 0x000000},
{0xF8910B, 0x000000}, {0x33F12A, 0x000000}
},
MaxPageSize = 2000,
PageCount = 3,
ColorTagIsUint8 = true
};

include('sghd/nametag.lua');
56 changes: 56 additions & 0 deletions profiles/sghd/font.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
-- WARNING, 0-INDEXED ARRAYS AHEAD

root.Fonts = {
["Default"] = {
Type = FontType.Basic,
Sheet = "Font",
Columns = 64,
Rows = 14,
Widths = {},
DesignColWidth = 32,
LineSpacing = 22,
}
};

local westernWidths = {
[0]=0x20, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x0C, 0x11, 0x11, 0x0F, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x13, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x14, 0x10, 0x14, 0x14,
0x15, 0x14, 0x14, 0x14, 0x14, 0x14, 0x1A, 0x15, 0x17, 0x18, 0x15, 0x14,
0x19, 0x17, 0x0B, 0x14, 0x17, 0x15, 0x1E, 0x18, 0x1A, 0x16, 0x1B, 0x15,
0x14, 0x16, 0x17, 0x1A, 0x1F, 0x19, 0x1A, 0x14, 0x13, 0x14, 0x13, 0x15,
0x13, 0x11, 0x14, 0x14, 0x0A, 0x0C, 0x14, 0x0A, 0x1E, 0x14, 0x15, 0x14,
0x15, 0x0E, 0x12, 0x10, 0x14, 0x15, 0x1F, 0x15, 0x15, 0x11, 0x11, 0x11,
0x09, 0x09, 0x0A, 0x0A, 0x12, 0x0A, 0x0A, 0x09, 0x07, 0x07, 0x0E, 0x0E,
0x0B, 0x0B, 0x0C, 0x0C, 0x0C, 0x0C, 0x0B, 0x0B, 0x0E, 0x0D, 0x11, 0x10,
0x0C, 0x0E, 0x0C, 0x0E, 0x0A, 0x0C, 0x18, 0x17, 0x0A, 0x0A, 0x0E, 0x1E,
0x1C, 0x1C, 0x16, 0x1E, 0x19, 0x18, 0x14, 0x18, 0x1B, 0x1B, 0x1C, 0x1A,
0x18, 0x1B, 0x1A, 0x16, 0x18, 0x1C, 0x1C, 0x19, 0x1B, 0x1C, 0x16, 0x18,
0x19, 0x1A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
};

for i = 0, (64 * 14) - 1 do
if i <= #westernWidths then
root.Fonts["Default"].Widths[i] = westernWidths[i];
else
root.Fonts["Default"].Widths[i] = root.Fonts["Default"].DesignColWidth;
end
end
51 changes: 51 additions & 0 deletions profiles/sghd/game.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
root.ActiveRenderer = RendererType.OpenGL;

root.LayerCount = 100;
root.GameFeatures = GameFeature.Sc3VirtualMachine | GameFeature.Renderer2D | GameFeature.Input | GameFeature.Audio |
GameFeature.Video | GameFeature.DebugMenu;
-- NOTE: 1080p messes up rendering of "loading system data..." message,
-- but is probably correct because otherwise logo slideshow has wrong size.
-- Probably a scaling factor somewhere needs to be adjusted for the message.
root.DesignWidth = 1920;
root.DesignHeight = 1080;

root.WindowName = "STEINS;GATE";

root.CharaIsMvl = false;
root.LayFileBigEndian = true;
root.LayFileTexXMultiplier = 2048;
root.LayFileTexYMultiplier = 1024;
root.UseScreenCapEffects = false;

root.Vm = {
StartScript = 2, -- _STARTUP_WIN.SCX
StartScriptBuffer = 0,
GameInstructionSet = InstructionSet.SGHD,
UseReturnIds = true,
ScrWorkChaStructSize = 40,
ScrWorkBgStructSize = 40
};

include('common/scriptinput.lua');
include('common/scriptvars.lua');
include('sghd/config.lua');
include('sghd/scriptvars.lua');
include('sghd/savedata.lua');
include('sghd/tipssystem.lua');
include('sghd/vfs.lua');
include('sghd/sprites.lua');
include('common/animation.lua');
include('sghd/charset.lua');
include('sghd/font.lua');
include('sghd/dialogue.lua');
include('sghd/nametag.lua');
include('sghd/hud/saveicon.lua');
include('sghd/hud/loadingdisplay.lua');
include('sghd/hud/datedisplay.lua');
include('sghd/hud/titlemenu.lua');
include('sghd/hud/systemmenu.lua');
include('sghd/hud/backlogmenu.lua');
include('sghd/hud/sysmesboxdisplay.lua');
include('sghd/hud/selectiondisplay.lua');
include('sghd/hud/tipsmenu.lua');
include('sghd/hud/tipsnotification.lua');
Loading