diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..6cc18834 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,10 @@ +# Automatically normalize line endings. +* text=auto + +# MSVC files have to be CRLF +*.vcproj text eol=crlf +*.sln text eol=crlf + +# Do not change external files +external/** -text +DoConfig/fltk/** -text \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 31623259..3fb2bf39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,78 +160,78 @@ add_executable(CSE2 ) set(RESOURCES - BITMAP/CREDIT01.bmp - BITMAP/CREDIT02.bmp - BITMAP/CREDIT03.bmp - BITMAP/CREDIT04.bmp - BITMAP/CREDIT05.bmp - BITMAP/CREDIT06.bmp - BITMAP/CREDIT07.bmp - BITMAP/CREDIT08.bmp - BITMAP/CREDIT09.bmp - BITMAP/CREDIT10.bmp - BITMAP/CREDIT11.bmp - BITMAP/CREDIT12.bmp - BITMAP/CREDIT14.bmp - BITMAP/CREDIT15.bmp - BITMAP/CREDIT16.bmp - BITMAP/CREDIT17.bmp - BITMAP/CREDIT18.bmp + BITMAP/Credit01.bmp + BITMAP/Credit02.bmp + BITMAP/Credit03.bmp + BITMAP/Credit04.bmp + BITMAP/Credit05.bmp + BITMAP/Credit06.bmp + BITMAP/Credit07.bmp + BITMAP/Credit08.bmp + BITMAP/Credit09.bmp + BITMAP/Credit10.bmp + BITMAP/Credit11.bmp + BITMAP/Credit12.bmp + BITMAP/Credit14.bmp + BITMAP/Credit15.bmp + BITMAP/Credit16.bmp + BITMAP/Credit17.bmp + BITMAP/Credit18.bmp CURSOR/CURSOR_IKA.bmp CURSOR/CURSOR_NORMAL.bmp - ORG/ACCESS.org - ORG/ANZEN.org - ORG/BALCONY.org - ORG/BALLOS.org - ORG/BDOWN.org - ORG/CEMETERY.org - ORG/CURLY.org - ORG/DR.org - ORG/ENDING.org - ORG/ESCAPE.org - ORG/FANFALE1.org - ORG/FANFALE2.org - ORG/FANFALE3.org - ORG/FIREEYE.org - ORG/GAMEOVER.org - ORG/GINSUKE.org - ORG/GRAND.org - ORG/GRAVITY.org - ORG/HELL.org - ORG/IRONH.org - ORG/JENKA.org - ORG/JENKA2.org - ORG/KODOU.org - ORG/LASTBT3.org - ORG/LASTBTL.org - ORG/LASTCAVE.org - ORG/MARINE.org - ORG/MAZE.org - ORG/MDOWN2.org - ORG/MURA.org - ORG/OSIDE.org - ORG/PLANT.org - ORG/QUIET.org - ORG/REQUIEM.org - ORG/TOROKO.org - ORG/VIVI.org - ORG/WANPAK2.org - ORG/WANPAKU.org - ORG/WEED.org - ORG/WHITE.org + ORG/Access.org + ORG/Anzen.org + ORG/Balcony.org + ORG/Ballos.org + ORG/BreakDown.org + ORG/Cemetery.org + ORG/Curly.org + ORG/Dr.org + ORG/Ending.org + ORG/Escape.org + ORG/Fanfale1.org + ORG/Fanfale2.org + ORG/Fanfale3.org + ORG/FireEye.org + ORG/Gameover.org + ORG/Ginsuke.org + ORG/Grand.org + ORG/Gravity.org + ORG/Hell.org + ORG/ironH.org + ORG/Jenka.org + ORG/Jenka2.org + ORG/Kodou.org + ORG/LastBtl3.org + ORG/LastBtl.org + ORG/LastCave.org + ORG/Marine.org + ORG/Maze.org + ORG/MDown2.org + ORG/Mura.org + ORG/Oside.org + ORG/Plant.org + ORG/quiet.org + ORG/Requiem.org + ORG/Toroko.org + ORG/Vivi.org + ORG/Wanpak2.org + ORG/Wanpaku.org + ORG/Weed.org + ORG/White.org ORG/XXXX.org - ORG/ZONBIE.org - WAVE/WAVE100 + ORG/Zonbie.org + WAVE/Wave.dat ) # Handle options if(JAPANESE) set(BUILD_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build_jp") - list(APPEND RESOURCES "BITMAP/PIXEL_JP.bmp") + list(APPEND RESOURCES "BITMAP/pixel_jp.bmp") target_compile_definitions(CSE2 PRIVATE JAPANESE) else() set(BUILD_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build_en") - list(APPEND RESOURCES "BITMAP/PIXEL.bmp") + list(APPEND RESOURCES "BITMAP/pixel.bmp") endif() if(FIX_BUGS) diff --git a/Makefile b/Makefile index 4e97c289..bd5345f2 100644 --- a/Makefile +++ b/Makefile @@ -1,243 +1,243 @@ -ifeq ($(RELEASE), 1) - CXXFLAGS = -O3 -flto - LDFLAGS = -s - FILENAME_DEF = release -else - CXXFLAGS = -O0 -g - FILENAME_DEF = debug -endif - -ifeq ($(JAPANESE), 1) - BUILD_DIR = build_jp - - CXXFLAGS += -DJAPANESE - - ifeq ($(RELEASE), 1) - FILENAME_DEF = releasejp - else - FILENAME_DEF = debugjp - endif -else - BUILD_DIR = build_en -endif - -FILENAME ?= $(FILENAME_DEF) - -ifeq ($(FIX_BUGS), 1) - CXXFLAGS += -DFIX_BUGS -endif - -ifeq ($(WINDOWS), 1) - ifeq ($(CONSOLE), 1) - CXXFLAGS += -mconsole - endif - - CXXFLAGS += -DWINDOWS - LIBS += -lkernel32 -endif - -ifeq ($(RASPBERRY_PI), 1) - CXXFLAGS += -DRASPBERRY_PI -endif - -CXXFLAGS += -std=c++98 `pkg-config sdl2 --cflags` `pkg-config freetype2 --cflags` -MMD -MP -MF $@.d - -ifeq ($(STATIC), 1) - LDFLAGS += -static - LIBS += `pkg-config sdl2 --libs --static` `pkg-config freetype2 --libs --static` -lfreetype -else - LIBS += `pkg-config sdl2 --libs` `pkg-config freetype2 --libs` -endif - -# For an accurate result to the original's code, compile in alphabetical order -SOURCES = \ - ArmsItem \ - Back \ - Boss \ - BossAlmo1 \ - BossAlmo2 \ - BossBallos \ - BossFrog \ - BossIronH \ - BossLife \ - BossOhm \ - BossPress \ - BossTwinD \ - BossX \ - BulHit \ - Bullet \ - Caret \ - Config \ - Draw \ - Ending \ - Escape \ - Fade \ - File \ - Flags \ - Flash \ - Font \ - Frame \ - Game \ - Generic \ - GenericLoad \ - Input \ - KeyControl \ - Main \ - Map \ - MapName \ - MiniMap \ - MyChar \ - MycHit \ - MycParam \ - NpcAct000 \ - NpcAct020 \ - NpcAct040 \ - NpcAct060 \ - NpcAct080 \ - NpcAct100 \ - NpcAct120 \ - NpcAct140 \ - NpcAct160 \ - NpcAct180 \ - NpcAct200 \ - NpcAct220 \ - NpcAct240 \ - NpcAct260 \ - NpcAct280 \ - NpcAct300 \ - NpcAct320 \ - NpcAct340 \ - NpChar \ - NpcHit \ - NpcTbl \ - Organya \ - PixTone \ - Profile \ - Resource \ - SelStage \ - Shoot \ - Sound \ - Stage \ - Star \ - TextScr \ - Triangle \ - ValueView - -RESOURCES = \ - BITMAP/CREDIT01.bmp \ - BITMAP/CREDIT02.bmp \ - BITMAP/CREDIT03.bmp \ - BITMAP/CREDIT04.bmp \ - BITMAP/CREDIT05.bmp \ - BITMAP/CREDIT06.bmp \ - BITMAP/CREDIT07.bmp \ - BITMAP/CREDIT08.bmp \ - BITMAP/CREDIT09.bmp \ - BITMAP/CREDIT10.bmp \ - BITMAP/CREDIT11.bmp \ - BITMAP/CREDIT12.bmp \ - BITMAP/CREDIT14.bmp \ - BITMAP/CREDIT15.bmp \ - BITMAP/CREDIT16.bmp \ - BITMAP/CREDIT17.bmp \ - BITMAP/CREDIT18.bmp \ - CURSOR/CURSOR_IKA.bmp \ - CURSOR/CURSOR_NORMAL.bmp \ - ORG/ACCESS.org \ - ORG/ANZEN.org \ - ORG/BALCONY.org \ - ORG/BALLOS.org \ - ORG/BDOWN.org \ - ORG/CEMETERY.org \ - ORG/CURLY.org \ - ORG/DR.org \ - ORG/ENDING.org \ - ORG/ESCAPE.org \ - ORG/FANFALE1.org \ - ORG/FANFALE2.org \ - ORG/FANFALE3.org \ - ORG/FIREEYE.org \ - ORG/GAMEOVER.org \ - ORG/GINSUKE.org \ - ORG/GRAND.org \ - ORG/GRAVITY.org \ - ORG/HELL.org \ - ORG/IRONH.org \ - ORG/JENKA.org \ - ORG/JENKA2.org \ - ORG/KODOU.org \ - ORG/LASTBT3.org \ - ORG/LASTBTL.org \ - ORG/LASTCAVE.org \ - ORG/MARINE.org \ - ORG/MAZE.org \ - ORG/MDOWN2.org \ - ORG/MURA.org \ - ORG/OSIDE.org \ - ORG/PLANT.org \ - ORG/QUIET.org \ - ORG/REQUIEM.org \ - ORG/TOROKO.org \ - ORG/VIVI.org \ - ORG/WANPAK2.org \ - ORG/WANPAKU.org \ - ORG/WEED.org \ - ORG/WHITE.org \ - ORG/XXXX.org \ - ORG/ZONBIE.org \ - WAVE/WAVE100 - -ifeq ($(JAPANESE), 1) - RESOURCES += BITMAP/PIXEL_JP.bmp -else - RESOURCES += BITMAP/PIXEL.bmp -endif - -ifneq ($(WINDOWS), 1) - RESOURCES += ICON/ICON_MINI.bmp -endif - -OBJECTS = $(addprefix obj/$(FILENAME)/, $(addsuffix .o, $(SOURCES))) -DEPENDENCIES = $(addprefix obj/$(FILENAME)/, $(addsuffix .o.d, $(SOURCES))) - -ifeq ($(WINDOWS), 1) - OBJECTS += obj/$(FILENAME)/win_icon.o -endif - -all: $(BUILD_DIR)/$(FILENAME) - -$(BUILD_DIR)/$(FILENAME): $(OBJECTS) - @mkdir -p $(@D) - @echo Linking - @$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS) - @echo Finished compiling: $@ - -obj/$(FILENAME)/%.o: src/%.cpp - @mkdir -p $(@D) - @echo Compiling $< - @$(CXX) $(CXXFLAGS) $< -o $@ -c - -obj/$(FILENAME)/Resource.o: src/Resource.cpp $(addprefix src/Resource/, $(addsuffix .h, $(RESOURCES))) - @mkdir -p $(@D) - @echo Compiling $< - @$(CXX) $(CXXFLAGS) $< -o $@ -c - -src/Resource/%.h: res/% obj/bin2h - @mkdir -p $(@D) - @echo Converting $< - @obj/bin2h $< $@ - -obj/bin2h: src/misc/bin2h.c - @mkdir -p $(@D) - @echo Compiling $^ - @$(CC) -O3 -s -std=c90 $^ -o $@ - -include $(wildcard $(DEPENDENCIES)) - -obj/$(FILENAME)/win_icon.o: res/ICON/ICON.rc res/ICON/0.ico res/ICON/ICON_MINI.ico - @mkdir -p $(@D) - @windres $< $@ - -# TODO -clean: - @rm -rf obj +ifeq ($(RELEASE), 1) + CXXFLAGS = -O3 -flto + LDFLAGS = -s + FILENAME_DEF = release +else + CXXFLAGS = -O0 -g + FILENAME_DEF = debug +endif + +ifeq ($(JAPANESE), 1) + BUILD_DIR = build_jp + + CXXFLAGS += -DJAPANESE + + ifeq ($(RELEASE), 1) + FILENAME_DEF = releasejp + else + FILENAME_DEF = debugjp + endif +else + BUILD_DIR = build_en +endif + +FILENAME ?= $(FILENAME_DEF) + +ifeq ($(FIX_BUGS), 1) + CXXFLAGS += -DFIX_BUGS +endif + +ifeq ($(WINDOWS), 1) + ifeq ($(CONSOLE), 1) + CXXFLAGS += -mconsole + endif + + CXXFLAGS += -DWINDOWS + LIBS += -lkernel32 +endif + +ifeq ($(RASPBERRY_PI), 1) + CXXFLAGS += -DRASPBERRY_PI +endif + +CXXFLAGS += -std=c++98 `pkg-config sdl2 --cflags` `pkg-config freetype2 --cflags` -MMD -MP -MF $@.d + +ifeq ($(STATIC), 1) + LDFLAGS += -static + LIBS += `pkg-config sdl2 --libs --static` `pkg-config freetype2 --libs --static` -lfreetype +else + LIBS += `pkg-config sdl2 --libs` `pkg-config freetype2 --libs` +endif + +# For an accurate result to the original's code, compile in alphabetical order +SOURCES = \ + ArmsItem \ + Back \ + Boss \ + BossAlmo1 \ + BossAlmo2 \ + BossBallos \ + BossFrog \ + BossIronH \ + BossLife \ + BossOhm \ + BossPress \ + BossTwinD \ + BossX \ + BulHit \ + Bullet \ + Caret \ + Config \ + Draw \ + Ending \ + Escape \ + Fade \ + File \ + Flags \ + Flash \ + Font \ + Frame \ + Game \ + Generic \ + GenericLoad \ + Input \ + KeyControl \ + Main \ + Map \ + MapName \ + MiniMap \ + MyChar \ + MycHit \ + MycParam \ + NpcAct000 \ + NpcAct020 \ + NpcAct040 \ + NpcAct060 \ + NpcAct080 \ + NpcAct100 \ + NpcAct120 \ + NpcAct140 \ + NpcAct160 \ + NpcAct180 \ + NpcAct200 \ + NpcAct220 \ + NpcAct240 \ + NpcAct260 \ + NpcAct280 \ + NpcAct300 \ + NpcAct320 \ + NpcAct340 \ + NpChar \ + NpcHit \ + NpcTbl \ + Organya \ + PixTone \ + Profile \ + Resource \ + SelStage \ + Shoot \ + Sound \ + Stage \ + Star \ + TextScr \ + Triangle \ + ValueView + +RESOURCES = \ + BITMAP/Credit01.bmp \ + BITMAP/Credit02.bmp \ + BITMAP/Credit03.bmp \ + BITMAP/Credit04.bmp \ + BITMAP/Credit05.bmp \ + BITMAP/Credit06.bmp \ + BITMAP/Credit07.bmp \ + BITMAP/Credit08.bmp \ + BITMAP/Credit09.bmp \ + BITMAP/Credit10.bmp \ + BITMAP/Credit11.bmp \ + BITMAP/Credit12.bmp \ + BITMAP/Credit14.bmp \ + BITMAP/Credit15.bmp \ + BITMAP/Credit16.bmp \ + BITMAP/Credit17.bmp \ + BITMAP/Credit18.bmp \ + CURSOR/CURSOR_IKA.bmp \ + CURSOR/CURSOR_NORMAL.bmp \ + ORG/Access.org \ + ORG/Anzen.org \ + ORG/Balcony.org \ + ORG/Ballos.org \ + ORG/BreakDown.org \ + ORG/Cemetery.org \ + ORG/Curly.org \ + ORG/Dr.org \ + ORG/Ending.org \ + ORG/Escape.org \ + ORG/Fanfale1.org \ + ORG/Fanfale2.org \ + ORG/Fanfale3.org \ + ORG/FireEye.org \ + ORG/Gameover.org \ + ORG/Ginsuke.org \ + ORG/Grand.org \ + ORG/Gravity.org \ + ORG/Hell.org \ + ORG/ironH.org \ + ORG/Jenka.org \ + ORG/Jenka2.org \ + ORG/Kodou.org \ + ORG/LastBtl3.org \ + ORG/LastBtl.org \ + ORG/LastCave.org \ + ORG/Marine.org \ + ORG/Maze.org \ + ORG/MDown2.org \ + ORG/Mura.org \ + ORG/Oside.org \ + ORG/Plant.org \ + ORG/quiet.org \ + ORG/Requiem.org \ + ORG/Toroko.org \ + ORG/Vivi.org \ + ORG/Wanpak2.org \ + ORG/Wanpaku.org \ + ORG/Weed.org \ + ORG/White.org \ + ORG/XXXX.org \ + ORG/Zonbie.org \ + WAVE/Wave.dat \ + +ifeq ($(JAPANESE), 1) + RESOURCES += BITMAP/pixel_jp.bmp +else + RESOURCES += BITMAP/pixel.bmp +endif + +ifneq ($(WINDOWS), 1) + RESOURCES += ICON/ICON_MINI.bmp +endif + +OBJECTS = $(addprefix obj/$(FILENAME)/, $(addsuffix .o, $(SOURCES))) +DEPENDENCIES = $(addprefix obj/$(FILENAME)/, $(addsuffix .o.d, $(SOURCES))) + +ifeq ($(WINDOWS), 1) + OBJECTS += obj/$(FILENAME)/win_icon.o +endif + +all: $(BUILD_DIR)/$(FILENAME) + +$(BUILD_DIR)/$(FILENAME): $(OBJECTS) + @mkdir -p $(@D) + @echo Linking + @$(CXX) $(CXXFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS) + @echo Finished compiling: $@ + +obj/$(FILENAME)/%.o: src/%.cpp + @mkdir -p $(@D) + @echo Compiling $< + @$(CXX) $(CXXFLAGS) $< -o $@ -c + +obj/$(FILENAME)/Resource.o: src/Resource.cpp $(addprefix src/Resource/, $(addsuffix .h, $(RESOURCES))) + @mkdir -p $(@D) + @echo Compiling $< + @$(CXX) $(CXXFLAGS) $< -o $@ -c + +src/Resource/%.h: res/% obj/bin2h + @mkdir -p $(@D) + @echo Converting $< + @obj/bin2h $< $@ + +obj/bin2h: src/misc/bin2h.c + @mkdir -p $(@D) + @echo Compiling $^ + @$(CC) -O3 -s -std=c90 $^ -o $@ + +include $(wildcard $(DEPENDENCIES)) + +obj/$(FILENAME)/win_icon.o: res/ICON/ICON.rc res/ICON/0.ico res/ICON/ICON_MINI.ico + @mkdir -p $(@D) + @windres $< $@ + +# TODO +clean: + @rm -rf obj diff --git a/res/BITMAP/CREDIT01.bmp b/res/BITMAP/Credit01.bmp similarity index 100% rename from res/BITMAP/CREDIT01.bmp rename to res/BITMAP/Credit01.bmp diff --git a/res/BITMAP/CREDIT02.bmp b/res/BITMAP/Credit02.bmp similarity index 100% rename from res/BITMAP/CREDIT02.bmp rename to res/BITMAP/Credit02.bmp diff --git a/res/BITMAP/CREDIT03.bmp b/res/BITMAP/Credit03.bmp similarity index 100% rename from res/BITMAP/CREDIT03.bmp rename to res/BITMAP/Credit03.bmp diff --git a/res/BITMAP/CREDIT04.bmp b/res/BITMAP/Credit04.bmp similarity index 100% rename from res/BITMAP/CREDIT04.bmp rename to res/BITMAP/Credit04.bmp diff --git a/res/BITMAP/CREDIT05.bmp b/res/BITMAP/Credit05.bmp similarity index 100% rename from res/BITMAP/CREDIT05.bmp rename to res/BITMAP/Credit05.bmp diff --git a/res/BITMAP/CREDIT06.bmp b/res/BITMAP/Credit06.bmp similarity index 100% rename from res/BITMAP/CREDIT06.bmp rename to res/BITMAP/Credit06.bmp diff --git a/res/BITMAP/CREDIT07.bmp b/res/BITMAP/Credit07.bmp similarity index 100% rename from res/BITMAP/CREDIT07.bmp rename to res/BITMAP/Credit07.bmp diff --git a/res/BITMAP/CREDIT08.bmp b/res/BITMAP/Credit08.bmp similarity index 100% rename from res/BITMAP/CREDIT08.bmp rename to res/BITMAP/Credit08.bmp diff --git a/res/BITMAP/CREDIT09.bmp b/res/BITMAP/Credit09.bmp similarity index 100% rename from res/BITMAP/CREDIT09.bmp rename to res/BITMAP/Credit09.bmp diff --git a/res/BITMAP/CREDIT10.bmp b/res/BITMAP/Credit10.bmp similarity index 100% rename from res/BITMAP/CREDIT10.bmp rename to res/BITMAP/Credit10.bmp diff --git a/res/BITMAP/CREDIT11.bmp b/res/BITMAP/Credit11.bmp similarity index 100% rename from res/BITMAP/CREDIT11.bmp rename to res/BITMAP/Credit11.bmp diff --git a/res/BITMAP/CREDIT12.bmp b/res/BITMAP/Credit12.bmp similarity index 100% rename from res/BITMAP/CREDIT12.bmp rename to res/BITMAP/Credit12.bmp diff --git a/res/BITMAP/CREDIT14.bmp b/res/BITMAP/Credit14.bmp similarity index 100% rename from res/BITMAP/CREDIT14.bmp rename to res/BITMAP/Credit14.bmp diff --git a/res/BITMAP/CREDIT15.bmp b/res/BITMAP/Credit15.bmp similarity index 100% rename from res/BITMAP/CREDIT15.bmp rename to res/BITMAP/Credit15.bmp diff --git a/res/BITMAP/CREDIT16.bmp b/res/BITMAP/Credit16.bmp similarity index 100% rename from res/BITMAP/CREDIT16.bmp rename to res/BITMAP/Credit16.bmp diff --git a/res/BITMAP/CREDIT17.bmp b/res/BITMAP/Credit17.bmp similarity index 100% rename from res/BITMAP/CREDIT17.bmp rename to res/BITMAP/Credit17.bmp diff --git a/res/BITMAP/CREDIT18.bmp b/res/BITMAP/Credit18.bmp similarity index 100% rename from res/BITMAP/CREDIT18.bmp rename to res/BITMAP/Credit18.bmp diff --git a/res/BITMAP/PIXEL.bmp b/res/BITMAP/pixel.bmp similarity index 100% rename from res/BITMAP/PIXEL.bmp rename to res/BITMAP/pixel.bmp diff --git a/res/BITMAP/PIXEL_JP.bmp b/res/BITMAP/pixel_jp.bmp similarity index 100% rename from res/BITMAP/PIXEL_JP.bmp rename to res/BITMAP/pixel_jp.bmp diff --git a/res/ORG/ACCESS.org b/res/ORG/Access.org similarity index 100% rename from res/ORG/ACCESS.org rename to res/ORG/Access.org diff --git a/res/ORG/ANZEN.org b/res/ORG/Anzen.org similarity index 100% rename from res/ORG/ANZEN.org rename to res/ORG/Anzen.org diff --git a/res/ORG/BALCONY.org b/res/ORG/Balcony.org similarity index 100% rename from res/ORG/BALCONY.org rename to res/ORG/Balcony.org diff --git a/res/ORG/BALLOS.org b/res/ORG/Ballos.org similarity index 100% rename from res/ORG/BALLOS.org rename to res/ORG/Ballos.org diff --git a/res/ORG/BDOWN.org b/res/ORG/BreakDown.org similarity index 100% rename from res/ORG/BDOWN.org rename to res/ORG/BreakDown.org diff --git a/res/ORG/CEMETERY.org b/res/ORG/Cemetery.org similarity index 100% rename from res/ORG/CEMETERY.org rename to res/ORG/Cemetery.org diff --git a/res/ORG/CURLY.org b/res/ORG/Curly.org similarity index 100% rename from res/ORG/CURLY.org rename to res/ORG/Curly.org diff --git a/res/ORG/DR.org b/res/ORG/Dr.org similarity index 100% rename from res/ORG/DR.org rename to res/ORG/Dr.org diff --git a/res/ORG/ENDING.org b/res/ORG/Ending.org similarity index 100% rename from res/ORG/ENDING.org rename to res/ORG/Ending.org diff --git a/res/ORG/ESCAPE.org b/res/ORG/Escape.org similarity index 100% rename from res/ORG/ESCAPE.org rename to res/ORG/Escape.org diff --git a/res/ORG/FANFALE1.org b/res/ORG/Fanfale1.org similarity index 100% rename from res/ORG/FANFALE1.org rename to res/ORG/Fanfale1.org diff --git a/res/ORG/FANFALE2.org b/res/ORG/Fanfale2.org similarity index 100% rename from res/ORG/FANFALE2.org rename to res/ORG/Fanfale2.org diff --git a/res/ORG/FANFALE3.org b/res/ORG/Fanfale3.org similarity index 100% rename from res/ORG/FANFALE3.org rename to res/ORG/Fanfale3.org diff --git a/res/ORG/FIREEYE.org b/res/ORG/FireEye.org similarity index 100% rename from res/ORG/FIREEYE.org rename to res/ORG/FireEye.org diff --git a/res/ORG/GAMEOVER.org b/res/ORG/Gameover.org similarity index 100% rename from res/ORG/GAMEOVER.org rename to res/ORG/Gameover.org diff --git a/res/ORG/GINSUKE.org b/res/ORG/Ginsuke.org similarity index 100% rename from res/ORG/GINSUKE.org rename to res/ORG/Ginsuke.org diff --git a/res/ORG/GRAND.org b/res/ORG/Grand.org similarity index 100% rename from res/ORG/GRAND.org rename to res/ORG/Grand.org diff --git a/res/ORG/GRAVITY.org b/res/ORG/Gravity.org similarity index 100% rename from res/ORG/GRAVITY.org rename to res/ORG/Gravity.org diff --git a/res/ORG/HELL.org b/res/ORG/Hell.org similarity index 100% rename from res/ORG/HELL.org rename to res/ORG/Hell.org diff --git a/res/ORG/JENKA.org b/res/ORG/Jenka.org similarity index 100% rename from res/ORG/JENKA.org rename to res/ORG/Jenka.org diff --git a/res/ORG/JENKA2.org b/res/ORG/Jenka2.org similarity index 100% rename from res/ORG/JENKA2.org rename to res/ORG/Jenka2.org diff --git a/res/ORG/KODOU.org b/res/ORG/Kodou.org similarity index 100% rename from res/ORG/KODOU.org rename to res/ORG/Kodou.org diff --git a/res/ORG/LASTBTL.org b/res/ORG/LastBtl.org similarity index 100% rename from res/ORG/LASTBTL.org rename to res/ORG/LastBtl.org diff --git a/res/ORG/LASTBT3.org b/res/ORG/LastBtl3.org similarity index 100% rename from res/ORG/LASTBT3.org rename to res/ORG/LastBtl3.org diff --git a/res/ORG/LASTCAVE.org b/res/ORG/LastCave.org similarity index 100% rename from res/ORG/LASTCAVE.org rename to res/ORG/LastCave.org diff --git a/res/ORG/MDOWN2.org b/res/ORG/MDown2.org similarity index 100% rename from res/ORG/MDOWN2.org rename to res/ORG/MDown2.org diff --git a/res/ORG/MARINE.org b/res/ORG/Marine.org similarity index 100% rename from res/ORG/MARINE.org rename to res/ORG/Marine.org diff --git a/res/ORG/MAZE.org b/res/ORG/Maze.org similarity index 100% rename from res/ORG/MAZE.org rename to res/ORG/Maze.org diff --git a/res/ORG/MURA.org b/res/ORG/Mura.org similarity index 100% rename from res/ORG/MURA.org rename to res/ORG/Mura.org diff --git a/res/ORG/OSIDE.org b/res/ORG/Oside.org similarity index 100% rename from res/ORG/OSIDE.org rename to res/ORG/Oside.org diff --git a/res/ORG/PLANT.org b/res/ORG/Plant.org similarity index 100% rename from res/ORG/PLANT.org rename to res/ORG/Plant.org diff --git a/res/ORG/REQUIEM.org b/res/ORG/Requiem.org similarity index 100% rename from res/ORG/REQUIEM.org rename to res/ORG/Requiem.org diff --git a/res/ORG/TOROKO.org b/res/ORG/Toroko.org similarity index 100% rename from res/ORG/TOROKO.org rename to res/ORG/Toroko.org diff --git a/res/ORG/VIVI.org b/res/ORG/Vivi.org similarity index 100% rename from res/ORG/VIVI.org rename to res/ORG/Vivi.org diff --git a/res/ORG/WANPAK2.org b/res/ORG/Wanpak2.org similarity index 100% rename from res/ORG/WANPAK2.org rename to res/ORG/Wanpak2.org diff --git a/res/ORG/WANPAKU.org b/res/ORG/Wanpaku.org similarity index 100% rename from res/ORG/WANPAKU.org rename to res/ORG/Wanpaku.org diff --git a/res/ORG/WEED.org b/res/ORG/Weed.org similarity index 100% rename from res/ORG/WEED.org rename to res/ORG/Weed.org diff --git a/res/ORG/WHITE.org b/res/ORG/White.org similarity index 100% rename from res/ORG/WHITE.org rename to res/ORG/White.org diff --git a/res/ORG/ZONBIE.org b/res/ORG/Zonbie.org similarity index 100% rename from res/ORG/ZONBIE.org rename to res/ORG/Zonbie.org diff --git a/res/ORG/IRONH.org b/res/ORG/ironH.org similarity index 100% rename from res/ORG/IRONH.org rename to res/ORG/ironH.org diff --git a/res/ORG/QUIET.org b/res/ORG/quiet.org similarity index 100% rename from res/ORG/QUIET.org rename to res/ORG/quiet.org diff --git a/res/WAVE/WAVE100 b/res/WAVE/Wave.dat similarity index 100% rename from res/WAVE/WAVE100 rename to res/WAVE/Wave.dat diff --git a/src/CommonDefines.h b/src/CommonDefines.h index fe7da48e..9e4b95b3 100644 --- a/src/CommonDefines.h +++ b/src/CommonDefines.h @@ -1,6 +1,6 @@ -#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_HEIGHT 240 +#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_HEIGHT 240 diff --git a/src/Config.cpp b/src/Config.cpp index bb218de6..3d607fc1 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -1,72 +1,72 @@ -#include -#include -#include -#include - -#include "WindowsWrapper.h" - -#include "CommonDefines.h" -#include "Config.h" -#include "File.h" -#include "Tags.h" -#include "Types.h" - -bool LoadConfigData(CONFIG *conf) -{ - //Clear old config data - memset(conf, 0, sizeof(CONFIG)); - - //Get path - char path[PATH_LENGTH]; - sprintf(path, "%s/%s", gModulePath, "Config.dat"); - - //Open file - FILE *fp = fopen(path, "rb"); - if (fp == NULL) - return false; - - //Read data - //Read the version id and font name - fread(conf->proof, sizeof(conf->proof), 1, fp); - fread(conf->font_name, sizeof(conf->font_name), 1, fp); - - //Read control settings - conf->move_button_mode = File_ReadLE32(fp); - conf->attack_button_mode = File_ReadLE32(fp); - conf->ok_button_mode = File_ReadLE32(fp); - - //Read display mode (320x240, 640x480, 24-bit fullscreen, 32-bit fullscreen) TODO: add more things? - conf->display_mode = File_ReadLE32(fp); - - //Read joystick configuration (if enabled, and mappings) - conf->bJoystick = File_ReadLE32(fp); - for (int button = 0; button < 8; button++) - conf->joystick_button[button] = File_ReadLE32(fp); - - //Close file - fclose(fp); - - //Check if version is correct, return that it succeeded - if (!strcmp(conf->proof, "DOUKUTSU20041206")) - return true; - - //If not, return that it failed - return false; -} - -void DefaultConfigData(CONFIG *conf) -{ - //Claer old config data - memset(conf, 0, sizeof(CONFIG)); - - //Reset joystick settings (as these can't simply be set to 0) - conf->bJoystick = 1; - conf->joystick_button[0] = 2; - conf->joystick_button[1] = 1; - conf->joystick_button[2] = 5; - conf->joystick_button[3] = 6; - conf->joystick_button[4] = 3; - conf->joystick_button[5] = 4; - conf->joystick_button[6] = 6; - conf->joystick_button[7] = 3; -} +#include +#include +#include +#include + +#include "WindowsWrapper.h" + +#include "CommonDefines.h" +#include "Config.h" +#include "File.h" +#include "Tags.h" +#include "Types.h" + +bool LoadConfigData(CONFIG *conf) +{ + //Clear old config data + memset(conf, 0, sizeof(CONFIG)); + + //Get path + char path[PATH_LENGTH]; + sprintf(path, "%s/%s", gModulePath, "Config.dat"); + + //Open file + FILE *fp = fopen(path, "rb"); + if (fp == NULL) + return false; + + //Read data + //Read the version id and font name + fread(conf->proof, sizeof(conf->proof), 1, fp); + fread(conf->font_name, sizeof(conf->font_name), 1, fp); + + //Read control settings + conf->move_button_mode = File_ReadLE32(fp); + conf->attack_button_mode = File_ReadLE32(fp); + conf->ok_button_mode = File_ReadLE32(fp); + + //Read display mode (320x240, 640x480, 24-bit fullscreen, 32-bit fullscreen) TODO: add more things? + conf->display_mode = File_ReadLE32(fp); + + //Read joystick configuration (if enabled, and mappings) + conf->bJoystick = File_ReadLE32(fp); + for (int button = 0; button < 8; button++) + conf->joystick_button[button] = File_ReadLE32(fp); + + //Close file + fclose(fp); + + //Check if version is correct, return that it succeeded + if (!strcmp(conf->proof, "DOUKUTSU20041206")) + return true; + + //If not, return that it failed + return false; +} + +void DefaultConfigData(CONFIG *conf) +{ + //Claer old config data + memset(conf, 0, sizeof(CONFIG)); + + //Reset joystick settings (as these can't simply be set to 0) + conf->bJoystick = 1; + conf->joystick_button[0] = 2; + conf->joystick_button[1] = 1; + conf->joystick_button[2] = 5; + conf->joystick_button[3] = 6; + conf->joystick_button[4] = 3; + conf->joystick_button[5] = 4; + conf->joystick_button[6] = 6; + conf->joystick_button[7] = 3; +} diff --git a/src/Config.h b/src/Config.h index 6409e354..f7981004 100644 --- a/src/Config.h +++ b/src/Config.h @@ -1,18 +1,18 @@ -#pragma once - -#include - -struct CONFIG -{ - char proof[0x20]; - char font_name[0x40]; - int32_t move_button_mode; - int32_t attack_button_mode; - int32_t ok_button_mode; - int32_t display_mode; - int32_t bJoystick; - int32_t joystick_button[8]; -}; - -bool LoadConfigData(CONFIG *conf); -void DefaultConfigData(CONFIG *conf); +#pragma once + +#include + +struct CONFIG +{ + char proof[0x20]; + char font_name[0x40]; + int32_t move_button_mode; + int32_t attack_button_mode; + int32_t ok_button_mode; + int32_t display_mode; + int32_t bJoystick; + int32_t joystick_button[8]; +}; + +bool LoadConfigData(CONFIG *conf); +void DefaultConfigData(CONFIG *conf); diff --git a/src/Draw.cpp b/src/Draw.cpp index bc491684..1d5a7259 100644 --- a/src/Draw.cpp +++ b/src/Draw.cpp @@ -354,10 +354,13 @@ static BOOL LoadBitmap_File(const char *name, Surface_Ids surf_no, bool create_s static BOOL LoadBitmap_Resource(const char *res, Surface_Ids surf_no, bool create_surface) { - SDL_RWops *fp = FindResource(res); + size_t size; + const unsigned char *data = FindResource(res, "BITMAP", &size); - if (fp) + if (data) { + SDL_RWops *fp = SDL_RWFromConstMem(data, size); + printf("Loading surface from resource %s for surface id %d\n", res, surf_no); if (LoadBitmap(fp, surf_no, create_surface)) return TRUE; diff --git a/src/KeyControl.cpp b/src/KeyControl.cpp index aa67f578..664cdf77 100644 --- a/src/KeyControl.cpp +++ b/src/KeyControl.cpp @@ -1,24 +1,24 @@ -#include "KeyControl.h" - -int gKey; -int gKeyTrg; - -int gKeyJump = KEY_Z; -int gKeyShot = KEY_X; -int gKeyArms = KEY_ARMS; -int gKeyArmsRev = KEY_ARMSREV; -int gKeyItem = KEY_ITEM; -int gKeyMap = KEY_MAP; -int gKeyOk = KEY_Z; -int gKeyCancel = KEY_X; -int gKeyLeft = KEY_LEFT; -int gKeyUp = KEY_UP; -int gKeyRight = KEY_RIGHT; -int gKeyDown = KEY_DOWN; - -void GetTrg() -{ - static int key_old; - gKeyTrg = gKey & (gKey ^ key_old); - key_old = gKey; -} +#include "KeyControl.h" + +int gKey; +int gKeyTrg; + +int gKeyJump = KEY_Z; +int gKeyShot = KEY_X; +int gKeyArms = KEY_ARMS; +int gKeyArmsRev = KEY_ARMSREV; +int gKeyItem = KEY_ITEM; +int gKeyMap = KEY_MAP; +int gKeyOk = KEY_Z; +int gKeyCancel = KEY_X; +int gKeyLeft = KEY_LEFT; +int gKeyUp = KEY_UP; +int gKeyRight = KEY_RIGHT; +int gKeyDown = KEY_DOWN; + +void GetTrg() +{ + static int key_old; + gKeyTrg = gKey & (gKey ^ key_old); + key_old = gKey; +} diff --git a/src/KeyControl.h b/src/KeyControl.h index 475bed3f..79db8424 100644 --- a/src/KeyControl.h +++ b/src/KeyControl.h @@ -1,53 +1,53 @@ -#pragma once - -enum KEYBIND -{ - //The movement keys go in the order of left, right, up and down - KEY_LEFT = 0x00000001, - KEY_RIGHT = 0x00000002, - KEY_UP = 0x00000004, - KEY_DOWN = 0x00000008, - //Map key - KEY_MAP = 0x00000010, - //Okay and cancel / Jump and Shoot keys - KEY_X = 0x00000020, - KEY_Z = 0x00000040, - //Left and right weapon switch keys - KEY_ARMS = 0x00000080, - KEY_ARMSREV = 0x00000100, - //Unused? - KEY_SHIFT = 0x00000200, - //Function keys - KEY_F1 = 0x00000400, - KEY_F2 = 0x00000800, - //Inventory - KEY_ITEM = 0x00001000, - //Escape key - KEY_ESCAPE = 0x00008000, - //The alt movement keys go in the order of left, up, right and down - KEY_ALT_LEFT = 0x00010000, - KEY_ALT_DOWN = 0x00020000, - KEY_ALT_RIGHT = 0x00040000, - KEY_ALT_UP = 0x00180000, - //Alt up actually has 2 seperate keys, but they're kind of merged together (and also for some reason the second one is +/=) - KEY_L = 0x00080000, - KEY_PLUS = 0x00100000 -}; - -extern int gKey; -extern int gKeyTrg; - -extern int gKeyJump; -extern int gKeyShot; -extern int gKeyArms; -extern int gKeyArmsRev; -extern int gKeyItem; -extern int gKeyMap; -extern int gKeyOk; -extern int gKeyCancel; -extern int gKeyLeft; -extern int gKeyUp; -extern int gKeyRight; -extern int gKeyDown; - -void GetTrg(); +#pragma once + +enum KEYBIND +{ + //The movement keys go in the order of left, right, up and down + KEY_LEFT = 0x00000001, + KEY_RIGHT = 0x00000002, + KEY_UP = 0x00000004, + KEY_DOWN = 0x00000008, + //Map key + KEY_MAP = 0x00000010, + //Okay and cancel / Jump and Shoot keys + KEY_X = 0x00000020, + KEY_Z = 0x00000040, + //Left and right weapon switch keys + KEY_ARMS = 0x00000080, + KEY_ARMSREV = 0x00000100, + //Unused? + KEY_SHIFT = 0x00000200, + //Function keys + KEY_F1 = 0x00000400, + KEY_F2 = 0x00000800, + //Inventory + KEY_ITEM = 0x00001000, + //Escape key + KEY_ESCAPE = 0x00008000, + //The alt movement keys go in the order of left, up, right and down + KEY_ALT_LEFT = 0x00010000, + KEY_ALT_DOWN = 0x00020000, + KEY_ALT_RIGHT = 0x00040000, + KEY_ALT_UP = 0x00180000, + //Alt up actually has 2 seperate keys, but they're kind of merged together (and also for some reason the second one is +/=) + KEY_L = 0x00080000, + KEY_PLUS = 0x00100000 +}; + +extern int gKey; +extern int gKeyTrg; + +extern int gKeyJump; +extern int gKeyShot; +extern int gKeyArms; +extern int gKeyArmsRev; +extern int gKeyItem; +extern int gKeyMap; +extern int gKeyOk; +extern int gKeyCancel; +extern int gKeyLeft; +extern int gKeyUp; +extern int gKeyRight; +extern int gKeyDown; + +void GetTrg(); diff --git a/src/Main.cpp b/src/Main.cpp index 9b9f1255..c3d2c1ee 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -1,634 +1,639 @@ -#include "Main.h" - -#include -#include -#include -#include - -#include - -#include "WindowsWrapper.h" - -#include "CommonDefines.h" -#include "Config.h" -#include "Draw.h" -#include "Game.h" -#include "Generic.h" -#include "Input.h" -#include "KeyControl.h" -#include "MyChar.h" -#include "Organya.h" -#include "Profile.h" -#include "Resource.h" -#include "Sound.h" -#include "Triangle.h" -#include "Types.h" - -// These two are defined in Draw.cpp. This is a bit of a hack. -extern SDL_Window *gWindow; -extern SDL_Renderer *gRenderer; - -char gModulePath[PATH_LENGTH]; -char gDataPath[PATH_LENGTH]; - -int gJoystickButtonTable[8]; - -bool gbUseJoystick = false; -bool bFps = false; - -bool bActive = true; - -#ifdef JAPANESE -const char *lpWindowName = "洞窟物語エンジン2"; -#else -const char *lpWindowName = "Cave Story Engine 2 ~ Doukutsu Monogatari Enjin 2"; -#endif - -//A replication of MSVC's rand algorithm -static unsigned long int next = 1; - -int rep_rand() -{ - next = ((next) * 214013 + 2531011); - return ((next) >> 16) & 0x7FFF; -} - -void rep_srand(unsigned int seed) -{ - next = seed; -} - -//Framerate stuff -void PutFramePerSecound() -{ - if (bFps) - PutNumber4(WINDOW_WIDTH - 40, 8, GetFramePerSecound(), false); -} - -int GetFramePerSecound() -{ - unsigned int current_tick; - static bool need_new_base_tick = true; - static int frames_this_second; - static int current_frame; - static int base_tick; - - if (need_new_base_tick) - { - base_tick = SDL_GetTicks(); - need_new_base_tick = false; - } - - current_tick = SDL_GetTicks(); - ++current_frame; - - if ( base_tick + 1000 <= current_tick ) - { - base_tick += 1000; - frames_this_second = current_frame; - current_frame = 0; - } - - return frames_this_second; -} - -int main(int argc, char *argv[]) -{ - //Get executable's path - strcpy(gModulePath, SDL_GetBasePath()); - if (gModulePath[strlen(gModulePath) - 1] == '/' || gModulePath[strlen(gModulePath) - 1] == '\\') - gModulePath[strlen(gModulePath) - 1] = '\0'; //String cannot end in slash or stuff will probably break (original does this through a windows.h provided function) - - //Get path of the data folder - strcpy(gDataPath, gModulePath); - strcat(gDataPath, "/data"); - -#ifdef WINDOWS - // Set the window icons. See res/ICON/ICON.rc. - SDL_SetHint(SDL_HINT_WINDOWS_INTRESOURCE_ICON, "101"); - SDL_SetHint(SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL, "102"); -#endif - - //Initialize SDL - if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS | SDL_INIT_TIMER) >= 0) - { - //Load configuration - CONFIG config; - - if (!LoadConfigData(&config)) - DefaultConfigData(&config); - - //Apply keybinds - //Swap X and Z buttons - if (config.attack_button_mode) - { - if (config.attack_button_mode == 1) - { - gKeyJump = KEY_X; - gKeyShot = KEY_Z; - } - } - else - { - gKeyJump = KEY_Z; - gKeyShot = KEY_X; - } - - //Swap Okay and Cancel buttons - if (config.ok_button_mode) - { - if (config.ok_button_mode == 1) - { - gKeyOk = gKeyShot; - gKeyCancel = gKeyJump; - } - } - else - { - gKeyOk = gKeyJump; - gKeyCancel = gKeyShot; - } - - //Swap left and right weapon switch keys - if (CheckFileExists("s_reverse")) - { - gKeyArms = KEY_ARMSREV; - gKeyArmsRev = KEY_ARMS; - } - - //Alternate movement keys - if (config.move_button_mode) - { - if (config.move_button_mode == 1) - { - gKeyLeft = KEY_ALT_LEFT; - gKeyUp = KEY_ALT_UP; - gKeyRight = KEY_ALT_RIGHT; - gKeyDown = KEY_ALT_DOWN; - } - } - else - { - gKeyLeft = KEY_LEFT; - gKeyUp = KEY_UP; - gKeyRight = KEY_RIGHT; - gKeyDown = KEY_DOWN; - } - - //Set gamepad inputs - for (int i = 0; i < 8; i++) - { - switch (config.joystick_button[i]) - { - case 1: - gJoystickButtonTable[i] = gKeyJump; - break; - - case 2: - gJoystickButtonTable[i] = gKeyShot; - break; - - case 3: - gJoystickButtonTable[i] = gKeyArms; - break; - - case 6: - gJoystickButtonTable[i] = gKeyArmsRev; - break; - - case 4: - gJoystickButtonTable[i] = gKeyItem; - break; - - case 5: - gJoystickButtonTable[i] = gKeyMap; - break; - - default: - continue; - } - } - - RECT unused_rect = {0, 0, 320, 240}; - - //Load cursor - SDL_RWops *fp = FindResource("CURSOR_NORMAL"); - - if (fp) - { - SDL_Surface *cursor_surface = SDL_LoadBMP_RW(fp, 1); - SDL_SetColorKey(cursor_surface, SDL_TRUE, SDL_MapRGB(cursor_surface->format, 0xFF, 0, 0xFF)); // Pink regions are transparent - - SDL_Cursor *cursor = SDL_CreateColorCursor(cursor_surface, 0, 0); // Don't worry, the hotspots are accurate to the original files - - if (cursor) - SDL_SetCursor(cursor); - else - printf("Failed to load cursor\n"); - - SDL_FreeSurface(cursor_surface); - } - else - { - printf("Failed to load cursor\n"); - } - - //Get window dimensions and colour depth - int windowWidth; - int windowHeight; - int colourDepth; - - switch (config.display_mode) - { - case 1: - case 2: - //Set window dimensions - if (config.display_mode == 1) - { - windowWidth = WINDOW_WIDTH; - windowHeight = WINDOW_HEIGHT; - } - else - { - windowWidth = WINDOW_WIDTH * 2; - windowHeight = WINDOW_HEIGHT * 2; - } - - //Create window - gWindow = SDL_CreateWindow(lpWindowName, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, windowWidth, windowHeight, 0); - - if (gWindow) - { - if (config.display_mode == 1) - StartDirectDraw(0, 0); - else - StartDirectDraw(1, 0); - break; - } - - break; - - case 0: - case 3: - case 4: - //Set window dimensions - windowWidth = WINDOW_WIDTH * 2; - windowHeight = WINDOW_HEIGHT * 2; - - //Create window - gWindow = SDL_CreateWindow(lpWindowName, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, windowWidth, windowHeight, 0); - - if (gWindow) - { - //Set colour depth - switch (config.display_mode) - { - case 0: - colourDepth = 16; - break; - case 3: - colourDepth = 24; - break; - case 4: - colourDepth = 32; - break; - } - - StartDirectDraw(2, colourDepth); - - fullscreen = true; - SDL_ShowCursor(0); - break; - } - break; - } - - //Create window - - - if (gWindow) - { - //Check debug things - if (CheckFileExists("fps")) - bFps = true; - -#ifndef WINDOWS - //Load icon - SDL_RWops *fp = FindResource("ICON_MINI"); - - if (fp) - { - SDL_Surface *iconSurf = SDL_LoadBMP_RW(fp, 1); - SDL_Surface *iconConverted = SDL_ConvertSurfaceFormat(iconSurf, SDL_PIXELFORMAT_RGB888, 0); - SDL_FreeSurface(iconSurf); - SDL_Surface *iconSurfUpscaled = SDL_CreateRGBSurfaceWithFormat(0, 256, 256, 0, SDL_PIXELFORMAT_RGB888); - SDL_LowerBlitScaled(iconConverted, NULL, iconSurfUpscaled, NULL); - SDL_FreeSurface(iconConverted); - SDL_SetWindowIcon(gWindow, iconSurfUpscaled); - SDL_FreeSurface(iconSurfUpscaled); - } - else - { - printf("Failed to load icon\n"); - } -#endif - - //Set rects - RECT loading_rect = {0, 0, 64, 8}; - RECT clip_rect = {0, 0, windowWidth, windowHeight}; - - //Load the "LOADING" text - MakeSurface_File("Loading", SURFACE_ID_LOADING); - - //Draw loading screen - CortBox(&clip_rect, 0x000000); - PutBitmap3(&clip_rect, (WINDOW_WIDTH - 64) / 2, (WINDOW_HEIGHT - 8) / 2, &loading_rect, SURFACE_ID_LOADING); - - //Draw to screen - if (Flip_SystemTask()) - { - //Initialize sound - InitDirectSound(); - - //Initialize joystick - if (config.bJoystick && InitDirectInput()) - { - ResetJoystickStatus(); - gbUseJoystick = true; - } - - //Initialize stuff - InitTextObject(config.font_name); - InitTriangleTable(); - - //Run game code - Game(); - - //End stuff - EndDirectSound(); - EndTextObject(); - EndDirectDraw(); - } - } - } - else - { - SDL_Quit(); - return -1; - } - - SDL_Quit(); - return 0; -} - -void InactiveWindow() -{ - if (bActive) - { - bActive = false; - StopOrganyaMusic(); - SleepNoise(); - } - - PlaySoundObject(7, 0); -} - -void ActiveWindow() -{ - if (!bActive) - { - bActive = true; - StopOrganyaMusic(); - PlayOrganyaMusic(); - ResetNoise(); - } - - PlaySoundObject(7, -1); -} - -void JoystickProc() -{ - JOYSTICK_STATUS status; - - if (GetJoystickStatus(&status)) - { - //Clear held buttons - gKey &= (KEY_ESCAPE | KEY_F2 | KEY_F1); - - //Set movement buttons - if (status.bLeft) - gKey |= gKeyLeft; - if (status.bRight) - gKey |= gKeyRight; - if (status.bUp) - gKey |= gKeyUp; - if (status.bDown) - gKey |= gKeyDown; - - //Set held buttons - for (int i = 0; i < 8; i++) - { - if (status.bButton[i]) - gKey |= gJoystickButtonTable[i]; - } - } -} - -#define DO_KEY_PRESS(key) \ - if (event.type == SDL_KEYDOWN) \ - gKey |= key; \ - else \ - gKey &= ~key; \ - break; - -bool SystemTask() -{ - //Handle window events - bool focusGained = true; - - while (SDL_PollEvent(NULL) || !focusGained) - { - SDL_Event event; - SDL_WaitEvent(&event); - - switch (event.type) - { - case SDL_QUIT: - return false; - break; - - case SDL_WINDOWEVENT: - switch (event.window.event) - { - case SDL_WINDOWEVENT_FOCUS_GAINED: - focusGained = true; - ActiveWindow(); - break; - - case SDL_WINDOWEVENT_FOCUS_LOST: - focusGained = false; - InactiveWindow(); - break; - - default: - break; - } - break; - - case SDL_DROPFILE: - LoadProfile(event.drop.file); - SDL_free(event.drop.file); - break; - - case SDL_KEYDOWN: - case SDL_KEYUP: - #ifdef FIX_BUGS - //BUG FIX: Pixel relied on key codes for input, but these differ based on keyboard layout. - //This would break the alternate movement keys on typical English keyboards, since the '=' key - //is in a completely different place to where it is on a Japanese keyboard. - //To solve this, we use scancodes instead, which are based on the physical location of keys, - //rather than their meaning. - switch (event.key.keysym.scancode) - { - case SDL_SCANCODE_ESCAPE: - DO_KEY_PRESS(KEY_ESCAPE) - - case SDL_SCANCODE_W: - DO_KEY_PRESS(KEY_MAP) - - case SDL_SCANCODE_LEFT: - DO_KEY_PRESS(KEY_LEFT) - - case SDL_SCANCODE_RIGHT: - DO_KEY_PRESS(KEY_RIGHT) - - case SDL_SCANCODE_UP: - DO_KEY_PRESS(KEY_UP) - - case SDL_SCANCODE_DOWN: - DO_KEY_PRESS(KEY_DOWN) - - case SDL_SCANCODE_X: - DO_KEY_PRESS(KEY_X) - - case SDL_SCANCODE_Z: - DO_KEY_PRESS(KEY_Z) - - case SDL_SCANCODE_S: - DO_KEY_PRESS(KEY_ARMS) - - case SDL_SCANCODE_A: - DO_KEY_PRESS(KEY_ARMSREV) - - case SDL_SCANCODE_RSHIFT: - case SDL_SCANCODE_LSHIFT: - DO_KEY_PRESS(KEY_SHIFT) - - case SDL_SCANCODE_F1: - DO_KEY_PRESS(KEY_F1) - - case SDL_SCANCODE_F2: - DO_KEY_PRESS(KEY_F2) - - case SDL_SCANCODE_Q: - DO_KEY_PRESS(KEY_ITEM) - - case SDL_SCANCODE_COMMA: - DO_KEY_PRESS(KEY_ALT_LEFT) - - case SDL_SCANCODE_PERIOD: - DO_KEY_PRESS(KEY_ALT_DOWN) - - case SDL_SCANCODE_SLASH: - DO_KEY_PRESS(KEY_ALT_RIGHT) - - case SDL_SCANCODE_L: - DO_KEY_PRESS(KEY_ALT_UP) - - case SDL_SCANCODE_SEMICOLON: - DO_KEY_PRESS(KEY_PLUS) - - case SDL_SCANCODE_F5: - gbUseJoystick = false; - break; - - default: - break; - } - break; - #else - switch (event.key.keysym.sym) - { - case SDLK_ESCAPE: - DO_KEY_PRESS(KEY_ESCAPE) - - case SDLK_w: - DO_KEY_PRESS(KEY_MAP) - - case SDLK_LEFT: - DO_KEY_PRESS(KEY_LEFT) - - case SDLK_RIGHT: - DO_KEY_PRESS(KEY_RIGHT) - - case SDLK_UP: - DO_KEY_PRESS(KEY_UP) - - case SDLK_DOWN: - DO_KEY_PRESS(KEY_DOWN) - - case SDLK_x: - DO_KEY_PRESS(KEY_X) - - case SDLK_z: - DO_KEY_PRESS(KEY_Z) - - case SDLK_s: - DO_KEY_PRESS(KEY_ARMS) - - case SDLK_a: - DO_KEY_PRESS(KEY_ARMSREV) - - case SDLK_RSHIFT: - case SDLK_LSHIFT: - DO_KEY_PRESS(KEY_SHIFT) - - case SDLK_F1: - DO_KEY_PRESS(KEY_F1) - - case SDLK_F2: - DO_KEY_PRESS(KEY_F2) - - case SDLK_q: - DO_KEY_PRESS(KEY_ITEM) - - case SDLK_COMMA: - DO_KEY_PRESS(KEY_ALT_LEFT) - - case SDLK_PERIOD: - DO_KEY_PRESS(KEY_ALT_DOWN) - - case SDLK_SLASH: - DO_KEY_PRESS(KEY_ALT_RIGHT) - - case SDLK_l: - DO_KEY_PRESS(KEY_ALT_UP) - - case SDLK_SEMICOLON: - DO_KEY_PRESS(KEY_PLUS) - - case SDLK_F5: - gbUseJoystick = false; - break; - } - break; - #endif - } - } - - //Run joystick code - if (gbUseJoystick) - JoystickProc(); - - return true; -} +#include "Main.h" + +#include +#include +#include +#include + +#include + +#include "WindowsWrapper.h" + +#include "CommonDefines.h" +#include "Config.h" +#include "Draw.h" +#include "Game.h" +#include "Generic.h" +#include "Input.h" +#include "KeyControl.h" +#include "MyChar.h" +#include "Organya.h" +#include "Profile.h" +#include "Resource.h" +#include "Sound.h" +#include "Triangle.h" +#include "Types.h" + +// These two are defined in Draw.cpp. This is a bit of a hack. +extern SDL_Window *gWindow; +extern SDL_Renderer *gRenderer; + +char gModulePath[PATH_LENGTH]; +char gDataPath[PATH_LENGTH]; + +int gJoystickButtonTable[8]; + +bool gbUseJoystick = false; +bool bFps = false; + +bool bActive = true; + +#ifdef JAPANESE +const char *lpWindowName = "洞窟物語エンジン2"; +#else +const char *lpWindowName = "Cave Story Engine 2 ~ Doukutsu Monogatari Enjin 2"; +#endif + +//A replication of MSVC's rand algorithm +static unsigned long int next = 1; + +int rep_rand() +{ + next = ((next) * 214013 + 2531011); + return ((next) >> 16) & 0x7FFF; +} + +void rep_srand(unsigned int seed) +{ + next = seed; +} + +//Framerate stuff +void PutFramePerSecound() +{ + if (bFps) + PutNumber4(WINDOW_WIDTH - 40, 8, GetFramePerSecound(), false); +} + +int GetFramePerSecound() +{ + unsigned int current_tick; + static bool need_new_base_tick = true; + static int frames_this_second; + static int current_frame; + static int base_tick; + + if (need_new_base_tick) + { + base_tick = SDL_GetTicks(); + need_new_base_tick = false; + } + + current_tick = SDL_GetTicks(); + ++current_frame; + + if ( base_tick + 1000 <= current_tick ) + { + base_tick += 1000; + frames_this_second = current_frame; + current_frame = 0; + } + + return frames_this_second; +} + +int main(int argc, char *argv[]) +{ + //Get executable's path + strcpy(gModulePath, SDL_GetBasePath()); + if (gModulePath[strlen(gModulePath) - 1] == '/' || gModulePath[strlen(gModulePath) - 1] == '\\') + gModulePath[strlen(gModulePath) - 1] = '\0'; //String cannot end in slash or stuff will probably break (original does this through a windows.h provided function) + + //Get path of the data folder + strcpy(gDataPath, gModulePath); + strcat(gDataPath, "/data"); + +#ifdef WINDOWS + // Set the window icons. See res/ICON/ICON.rc. + SDL_SetHint(SDL_HINT_WINDOWS_INTRESOURCE_ICON, "101"); + SDL_SetHint(SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL, "102"); +#endif + + //Initialize SDL + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS | SDL_INIT_TIMER) >= 0) + { + //Load configuration + CONFIG config; + + if (!LoadConfigData(&config)) + DefaultConfigData(&config); + + //Apply keybinds + //Swap X and Z buttons + if (config.attack_button_mode) + { + if (config.attack_button_mode == 1) + { + gKeyJump = KEY_X; + gKeyShot = KEY_Z; + } + } + else + { + gKeyJump = KEY_Z; + gKeyShot = KEY_X; + } + + //Swap Okay and Cancel buttons + if (config.ok_button_mode) + { + if (config.ok_button_mode == 1) + { + gKeyOk = gKeyShot; + gKeyCancel = gKeyJump; + } + } + else + { + gKeyOk = gKeyJump; + gKeyCancel = gKeyShot; + } + + //Swap left and right weapon switch keys + if (CheckFileExists("s_reverse")) + { + gKeyArms = KEY_ARMSREV; + gKeyArmsRev = KEY_ARMS; + } + + //Alternate movement keys + if (config.move_button_mode) + { + if (config.move_button_mode == 1) + { + gKeyLeft = KEY_ALT_LEFT; + gKeyUp = KEY_ALT_UP; + gKeyRight = KEY_ALT_RIGHT; + gKeyDown = KEY_ALT_DOWN; + } + } + else + { + gKeyLeft = KEY_LEFT; + gKeyUp = KEY_UP; + gKeyRight = KEY_RIGHT; + gKeyDown = KEY_DOWN; + } + + //Set gamepad inputs + for (int i = 0; i < 8; i++) + { + switch (config.joystick_button[i]) + { + case 1: + gJoystickButtonTable[i] = gKeyJump; + break; + + case 2: + gJoystickButtonTable[i] = gKeyShot; + break; + + case 3: + gJoystickButtonTable[i] = gKeyArms; + break; + + case 6: + gJoystickButtonTable[i] = gKeyArmsRev; + break; + + case 4: + gJoystickButtonTable[i] = gKeyItem; + break; + + case 5: + gJoystickButtonTable[i] = gKeyMap; + break; + + default: + continue; + } + } + + RECT unused_rect = {0, 0, 320, 240}; + + //Load cursor + size_t size; + const unsigned char *data = FindResource("CURSOR_NORMAL", "CURSOR", &size); + + if (data) + { + SDL_RWops *fp = SDL_RWFromConstMem(data, size); + + SDL_Surface *cursor_surface = SDL_LoadBMP_RW(fp, 1); + SDL_SetColorKey(cursor_surface, SDL_TRUE, SDL_MapRGB(cursor_surface->format, 0xFF, 0, 0xFF)); // Pink regions are transparent + + SDL_Cursor *cursor = SDL_CreateColorCursor(cursor_surface, 0, 0); // Don't worry, the hotspots are accurate to the original files + + if (cursor) + SDL_SetCursor(cursor); + else + printf("Failed to load cursor\n"); + + SDL_FreeSurface(cursor_surface); + } + else + { + printf("Failed to load cursor\n"); + } + + //Get window dimensions and colour depth + int windowWidth; + int windowHeight; + int colourDepth; + + switch (config.display_mode) + { + case 1: + case 2: + //Set window dimensions + if (config.display_mode == 1) + { + windowWidth = WINDOW_WIDTH; + windowHeight = WINDOW_HEIGHT; + } + else + { + windowWidth = WINDOW_WIDTH * 2; + windowHeight = WINDOW_HEIGHT * 2; + } + + //Create window + gWindow = SDL_CreateWindow(lpWindowName, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, windowWidth, windowHeight, 0); + + if (gWindow) + { + if (config.display_mode == 1) + StartDirectDraw(0, 0); + else + StartDirectDraw(1, 0); + break; + } + + break; + + case 0: + case 3: + case 4: + //Set window dimensions + windowWidth = WINDOW_WIDTH * 2; + windowHeight = WINDOW_HEIGHT * 2; + + //Create window + gWindow = SDL_CreateWindow(lpWindowName, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, windowWidth, windowHeight, 0); + + if (gWindow) + { + //Set colour depth + switch (config.display_mode) + { + case 0: + colourDepth = 16; + break; + case 3: + colourDepth = 24; + break; + case 4: + colourDepth = 32; + break; + } + + StartDirectDraw(2, colourDepth); + + fullscreen = true; + SDL_ShowCursor(0); + break; + } + break; + } + + //Create window + + + if (gWindow) + { + //Check debug things + if (CheckFileExists("fps")) + bFps = true; + +#ifndef WINDOWS + //Load icon + size_t size; + const unsigned char *data = FindResource("ICON_MINI", "ICON", &size); + + if (data) + { + SDL_RWops *fp = SDL_RWFromConstMem(data, size); + SDL_Surface *iconSurf = SDL_LoadBMP_RW(fp, 1); + SDL_Surface *iconConverted = SDL_ConvertSurfaceFormat(iconSurf, SDL_PIXELFORMAT_RGB888, 0); + SDL_FreeSurface(iconSurf); + SDL_Surface *iconSurfUpscaled = SDL_CreateRGBSurfaceWithFormat(0, 256, 256, 0, SDL_PIXELFORMAT_RGB888); + SDL_LowerBlitScaled(iconConverted, NULL, iconSurfUpscaled, NULL); + SDL_FreeSurface(iconConverted); + SDL_SetWindowIcon(gWindow, iconSurfUpscaled); + SDL_FreeSurface(iconSurfUpscaled); + } + else + { + printf("Failed to load icon\n"); + } +#endif + + //Set rects + RECT loading_rect = {0, 0, 64, 8}; + RECT clip_rect = {0, 0, windowWidth, windowHeight}; + + //Load the "LOADING" text + MakeSurface_File("Loading", SURFACE_ID_LOADING); + + //Draw loading screen + CortBox(&clip_rect, 0x000000); + PutBitmap3(&clip_rect, (WINDOW_WIDTH - 64) / 2, (WINDOW_HEIGHT - 8) / 2, &loading_rect, SURFACE_ID_LOADING); + + //Draw to screen + if (Flip_SystemTask()) + { + //Initialize sound + InitDirectSound(); + + //Initialize joystick + if (config.bJoystick && InitDirectInput()) + { + ResetJoystickStatus(); + gbUseJoystick = true; + } + + //Initialize stuff + InitTextObject(config.font_name); + InitTriangleTable(); + + //Run game code + Game(); + + //End stuff + EndDirectSound(); + EndTextObject(); + EndDirectDraw(); + } + } + } + else + { + SDL_Quit(); + return -1; + } + + SDL_Quit(); + return 0; +} + +void InactiveWindow() +{ + if (bActive) + { + bActive = false; + StopOrganyaMusic(); + SleepNoise(); + } + + PlaySoundObject(7, 0); +} + +void ActiveWindow() +{ + if (!bActive) + { + bActive = true; + StopOrganyaMusic(); + PlayOrganyaMusic(); + ResetNoise(); + } + + PlaySoundObject(7, -1); +} + +void JoystickProc() +{ + JOYSTICK_STATUS status; + + if (GetJoystickStatus(&status)) + { + //Clear held buttons + gKey &= (KEY_ESCAPE | KEY_F2 | KEY_F1); + + //Set movement buttons + if (status.bLeft) + gKey |= gKeyLeft; + if (status.bRight) + gKey |= gKeyRight; + if (status.bUp) + gKey |= gKeyUp; + if (status.bDown) + gKey |= gKeyDown; + + //Set held buttons + for (int i = 0; i < 8; i++) + { + if (status.bButton[i]) + gKey |= gJoystickButtonTable[i]; + } + } +} + +#define DO_KEY_PRESS(key) \ + if (event.type == SDL_KEYDOWN) \ + gKey |= key; \ + else \ + gKey &= ~key; \ + break; + +bool SystemTask() +{ + //Handle window events + bool focusGained = true; + + while (SDL_PollEvent(NULL) || !focusGained) + { + SDL_Event event; + SDL_WaitEvent(&event); + + switch (event.type) + { + case SDL_QUIT: + return false; + break; + + case SDL_WINDOWEVENT: + switch (event.window.event) + { + case SDL_WINDOWEVENT_FOCUS_GAINED: + focusGained = true; + ActiveWindow(); + break; + + case SDL_WINDOWEVENT_FOCUS_LOST: + focusGained = false; + InactiveWindow(); + break; + + default: + break; + } + break; + + case SDL_DROPFILE: + LoadProfile(event.drop.file); + SDL_free(event.drop.file); + break; + + case SDL_KEYDOWN: + case SDL_KEYUP: + #ifdef FIX_BUGS + //BUG FIX: Pixel relied on key codes for input, but these differ based on keyboard layout. + //This would break the alternate movement keys on typical English keyboards, since the '=' key + //is in a completely different place to where it is on a Japanese keyboard. + //To solve this, we use scancodes instead, which are based on the physical location of keys, + //rather than their meaning. + switch (event.key.keysym.scancode) + { + case SDL_SCANCODE_ESCAPE: + DO_KEY_PRESS(KEY_ESCAPE) + + case SDL_SCANCODE_W: + DO_KEY_PRESS(KEY_MAP) + + case SDL_SCANCODE_LEFT: + DO_KEY_PRESS(KEY_LEFT) + + case SDL_SCANCODE_RIGHT: + DO_KEY_PRESS(KEY_RIGHT) + + case SDL_SCANCODE_UP: + DO_KEY_PRESS(KEY_UP) + + case SDL_SCANCODE_DOWN: + DO_KEY_PRESS(KEY_DOWN) + + case SDL_SCANCODE_X: + DO_KEY_PRESS(KEY_X) + + case SDL_SCANCODE_Z: + DO_KEY_PRESS(KEY_Z) + + case SDL_SCANCODE_S: + DO_KEY_PRESS(KEY_ARMS) + + case SDL_SCANCODE_A: + DO_KEY_PRESS(KEY_ARMSREV) + + case SDL_SCANCODE_RSHIFT: + case SDL_SCANCODE_LSHIFT: + DO_KEY_PRESS(KEY_SHIFT) + + case SDL_SCANCODE_F1: + DO_KEY_PRESS(KEY_F1) + + case SDL_SCANCODE_F2: + DO_KEY_PRESS(KEY_F2) + + case SDL_SCANCODE_Q: + DO_KEY_PRESS(KEY_ITEM) + + case SDL_SCANCODE_COMMA: + DO_KEY_PRESS(KEY_ALT_LEFT) + + case SDL_SCANCODE_PERIOD: + DO_KEY_PRESS(KEY_ALT_DOWN) + + case SDL_SCANCODE_SLASH: + DO_KEY_PRESS(KEY_ALT_RIGHT) + + case SDL_SCANCODE_L: + DO_KEY_PRESS(KEY_ALT_UP) + + case SDL_SCANCODE_SEMICOLON: + DO_KEY_PRESS(KEY_PLUS) + + case SDL_SCANCODE_F5: + gbUseJoystick = false; + break; + + default: + break; + } + break; + #else + switch (event.key.keysym.sym) + { + case SDLK_ESCAPE: + DO_KEY_PRESS(KEY_ESCAPE) + + case SDLK_w: + DO_KEY_PRESS(KEY_MAP) + + case SDLK_LEFT: + DO_KEY_PRESS(KEY_LEFT) + + case SDLK_RIGHT: + DO_KEY_PRESS(KEY_RIGHT) + + case SDLK_UP: + DO_KEY_PRESS(KEY_UP) + + case SDLK_DOWN: + DO_KEY_PRESS(KEY_DOWN) + + case SDLK_x: + DO_KEY_PRESS(KEY_X) + + case SDLK_z: + DO_KEY_PRESS(KEY_Z) + + case SDLK_s: + DO_KEY_PRESS(KEY_ARMS) + + case SDLK_a: + DO_KEY_PRESS(KEY_ARMSREV) + + case SDLK_RSHIFT: + case SDLK_LSHIFT: + DO_KEY_PRESS(KEY_SHIFT) + + case SDLK_F1: + DO_KEY_PRESS(KEY_F1) + + case SDLK_F2: + DO_KEY_PRESS(KEY_F2) + + case SDLK_q: + DO_KEY_PRESS(KEY_ITEM) + + case SDLK_COMMA: + DO_KEY_PRESS(KEY_ALT_LEFT) + + case SDLK_PERIOD: + DO_KEY_PRESS(KEY_ALT_DOWN) + + case SDLK_SLASH: + DO_KEY_PRESS(KEY_ALT_RIGHT) + + case SDLK_l: + DO_KEY_PRESS(KEY_ALT_UP) + + case SDLK_SEMICOLON: + DO_KEY_PRESS(KEY_PLUS) + + case SDLK_F5: + gbUseJoystick = false; + break; + } + break; + #endif + } + } + + //Run joystick code + if (gbUseJoystick) + JoystickProc(); + + return true; +} diff --git a/src/Organya.cpp b/src/Organya.cpp index c54f693a..28d4a76b 100644 --- a/src/Organya.cpp +++ b/src/Organya.cpp @@ -261,19 +261,16 @@ void ReleaseOrganyaObject(int8_t track) //Handling WAVE100 int8_t wave_data[100][0x100]; -bool InitWaveData100() +BOOL InitWaveData100() { - SDL_RWops *fp = FindResource("WAVE100"); - if (fp == NULL) - { - printf("Failed to open WAVE100\n"); - return false; - } + const unsigned char *data = FindResource("WAVE100", "WAVE", NULL); - fp->read(fp, wave_data, 1, 100 * 0x100); + if (data == NULL) + return FALSE; - SDL_RWclose(fp); - return true; + memcpy(wave_data, data, 100 * 0x100); + + return TRUE; } //Create org wave @@ -409,6 +406,9 @@ void SetPlayPointer(int32_t x) play_p = x; } +#define READ_LE16(pointer) pointer[0] | (pointer[1] << 8); pointer += 2; +#define READ_LE32(pointer) pointer[0] | (pointer[1] << 8) | (pointer[2] << 16) | (pointer[3] << 24); pointer += 4; + //Load organya file void LoadOrganya(const char *name) { @@ -426,19 +426,14 @@ void LoadOrganya(const char *name) //Open file printf("Loading org %s\n", name); - SDL_RWops *fp = FindResource(name); - - if (!fp) - { - printf("Failed to open %s\n", name); - return; - } + const unsigned char *p = FindResource(name, "ORG", NULL); //Version Check uint8_t ver = 0; char pass_check[6]; - SDL_RWread(fp, &pass_check[0], sizeof(char), 6); + memcpy(pass_check, p, 6); + p += 6; if (!memcmp(pass_check, "Org-01", 6))ver = 1; if (!memcmp(pass_check, "Org-02", 6))ver = 2; @@ -446,23 +441,23 @@ void LoadOrganya(const char *name) if (!ver) { - printf("Failed to open.org, invalid version %s", pass_check); + printf("Failed to open .org, invalid version %s", pass_check); return; } //Set song information - info.wait = SDL_ReadLE16(fp); - info.line = SDL_ReadU8(fp); - info.dot = SDL_ReadU8(fp); - info.repeat_x = SDL_ReadLE32(fp); - info.end_x = SDL_ReadLE32(fp); + info.wait = READ_LE16(p); + info.line = *p++; + info.dot = *p++; + info.repeat_x = READ_LE32(p); + info.end_x = READ_LE32(p); for (int i = 0; i < 16; i++) { - info.tdata[i].freq = SDL_ReadLE16(fp); - info.tdata[i].wave_no = SDL_ReadU8(fp); - const int8_t pipi = SDL_ReadU8(fp); + info.tdata[i].freq = READ_LE16(p); + info.tdata[i].wave_no = *p++; + const int8_t pipi = *p++; info.tdata[i].pipi = ver == 1 ? 0 : pipi; - info.tdata[i].note_num = SDL_ReadLE16(fp); + info.tdata[i].note_num = READ_LE16(p); } //Load notes @@ -495,37 +490,35 @@ void LoadOrganya(const char *name) //Set note properties np = info.tdata[j].note_p; //X position for (int i = 0; i < info.tdata[j].note_num; i++) { - np->x = SDL_ReadLE32(fp); + np->x = READ_LE32(p); np++; } np = info.tdata[j].note_p; //Y position for (int i = 0; i < info.tdata[j].note_num; i++) { - np->y = SDL_ReadU8(fp); + np->y = *p++; np++; } np = info.tdata[j].note_p; //Length for (int i = 0; i < info.tdata[j].note_num; i++) { - np->length = SDL_ReadU8(fp); + np->length = *p++; np++; } np = info.tdata[j].note_p; //Volume for (int i = 0; i < info.tdata[j].note_num; i++) { - np->volume = SDL_ReadU8(fp); + np->volume = *p++; np++; } np = info.tdata[j].note_p; //Pan for (int i = 0; i < info.tdata[j].note_num; i++) { - np->pan = SDL_ReadU8(fp); + np->pan = *p++; np++; } } - SDL_RWclose(fp); - //Create waves for (int j = 0; j < 8; j++) MakeOrganyaWave(j, info.tdata[j].wave_no, info.tdata[j].pipi); diff --git a/src/Resource.cpp b/src/Resource.cpp index f549abe1..9d2ab633 100644 --- a/src/Resource.cpp +++ b/src/Resource.cpp @@ -1,77 +1,72 @@ #include "Resource.h" -#include -#include +#include #include -#include - -#include "WindowsWrapper.h" - -#include "Resource/ORG/ACCESS.org.h" -#include "Resource/ORG/ANZEN.org.h" -#include "Resource/ORG/BALCONY.org.h" -#include "Resource/ORG/BALLOS.org.h" -#include "Resource/ORG/BDOWN.org.h" -#include "Resource/ORG/CEMETERY.org.h" -#include "Resource/ORG/CURLY.org.h" -#include "Resource/ORG/DR.org.h" -#include "Resource/ORG/ENDING.org.h" -#include "Resource/ORG/ESCAPE.org.h" -#include "Resource/ORG/FANFALE1.org.h" -#include "Resource/ORG/FANFALE2.org.h" -#include "Resource/ORG/FANFALE3.org.h" -#include "Resource/ORG/FIREEYE.org.h" -#include "Resource/ORG/GAMEOVER.org.h" -#include "Resource/ORG/GINSUKE.org.h" -#include "Resource/ORG/GRAND.org.h" -#include "Resource/ORG/GRAVITY.org.h" -#include "Resource/ORG/HELL.org.h" -#include "Resource/ORG/IRONH.org.h" -#include "Resource/ORG/JENKA.org.h" -#include "Resource/ORG/JENKA2.org.h" -#include "Resource/ORG/KODOU.org.h" -#include "Resource/ORG/LASTBT3.org.h" -#include "Resource/ORG/LASTBTL.org.h" -#include "Resource/ORG/LASTCAVE.org.h" -#include "Resource/ORG/MARINE.org.h" -#include "Resource/ORG/MAZE.org.h" -#include "Resource/ORG/MDOWN2.org.h" -#include "Resource/ORG/MURA.org.h" -#include "Resource/ORG/OSIDE.org.h" -#include "Resource/ORG/PLANT.org.h" -#include "Resource/ORG/QUIET.org.h" -#include "Resource/ORG/REQUIEM.org.h" -#include "Resource/ORG/TOROKO.org.h" -#include "Resource/ORG/VIVI.org.h" -#include "Resource/ORG/WANPAK2.org.h" -#include "Resource/ORG/WANPAKU.org.h" -#include "Resource/ORG/WEED.org.h" -#include "Resource/ORG/WHITE.org.h" +#include "Resource/ORG/Access.org.h" +#include "Resource/ORG/Anzen.org.h" +#include "Resource/ORG/Balcony.org.h" +#include "Resource/ORG/Ballos.org.h" +#include "Resource/ORG/BreakDown.org.h" +#include "Resource/ORG/Cemetery.org.h" +#include "Resource/ORG/Curly.org.h" +#include "Resource/ORG/Dr.org.h" +#include "Resource/ORG/Ending.org.h" +#include "Resource/ORG/Escape.org.h" +#include "Resource/ORG/Fanfale1.org.h" +#include "Resource/ORG/Fanfale2.org.h" +#include "Resource/ORG/Fanfale3.org.h" +#include "Resource/ORG/FireEye.org.h" +#include "Resource/ORG/Gameover.org.h" +#include "Resource/ORG/Ginsuke.org.h" +#include "Resource/ORG/Grand.org.h" +#include "Resource/ORG/Gravity.org.h" +#include "Resource/ORG/Hell.org.h" +#include "Resource/ORG/ironH.org.h" +#include "Resource/ORG/Jenka.org.h" +#include "Resource/ORG/Jenka2.org.h" +#include "Resource/ORG/Kodou.org.h" +#include "Resource/ORG/LastBtl3.org.h" +#include "Resource/ORG/LastBtl.org.h" +#include "Resource/ORG/LastCave.org.h" +#include "Resource/ORG/Marine.org.h" +#include "Resource/ORG/Maze.org.h" +#include "Resource/ORG/MDown2.org.h" +#include "Resource/ORG/Mura.org.h" +#include "Resource/ORG/Oside.org.h" +#include "Resource/ORG/Plant.org.h" +#include "Resource/ORG/quiet.org.h" +#include "Resource/ORG/Requiem.org.h" +#include "Resource/ORG/Toroko.org.h" +#include "Resource/ORG/Vivi.org.h" +#include "Resource/ORG/Wanpak2.org.h" +#include "Resource/ORG/Wanpaku.org.h" +#include "Resource/ORG/Weed.org.h" +#include "Resource/ORG/White.org.h" #include "Resource/ORG/XXXX.org.h" -#include "Resource/ORG/ZONBIE.org.h" -#include "Resource/WAVE/WAVE100.h" -#include "Resource/BITMAP/CREDIT01.bmp.h" -#include "Resource/BITMAP/CREDIT02.bmp.h" -#include "Resource/BITMAP/CREDIT03.bmp.h" -#include "Resource/BITMAP/CREDIT04.bmp.h" -#include "Resource/BITMAP/CREDIT05.bmp.h" -#include "Resource/BITMAP/CREDIT06.bmp.h" -#include "Resource/BITMAP/CREDIT07.bmp.h" -#include "Resource/BITMAP/CREDIT08.bmp.h" -#include "Resource/BITMAP/CREDIT09.bmp.h" -#include "Resource/BITMAP/CREDIT10.bmp.h" -#include "Resource/BITMAP/CREDIT11.bmp.h" -#include "Resource/BITMAP/CREDIT12.bmp.h" -#include "Resource/BITMAP/CREDIT14.bmp.h" -#include "Resource/BITMAP/CREDIT15.bmp.h" -#include "Resource/BITMAP/CREDIT16.bmp.h" -#include "Resource/BITMAP/CREDIT17.bmp.h" -#include "Resource/BITMAP/CREDIT18.bmp.h" +#include "Resource/ORG/Zonbie.org.h" +#include "Resource/WAVE/Wave.dat.h" +#include "Resource/BITMAP/Credit01.bmp.h" +#include "Resource/BITMAP/Credit02.bmp.h" +#include "Resource/BITMAP/Credit03.bmp.h" +#include "Resource/BITMAP/Credit04.bmp.h" +#include "Resource/BITMAP/Credit05.bmp.h" +#include "Resource/BITMAP/Credit06.bmp.h" +#include "Resource/BITMAP/Credit07.bmp.h" +#include "Resource/BITMAP/Credit08.bmp.h" +#include "Resource/BITMAP/Credit09.bmp.h" +#include "Resource/BITMAP/Credit10.bmp.h" +#include "Resource/BITMAP/Credit11.bmp.h" +#include "Resource/BITMAP/Credit12.bmp.h" +#include "Resource/BITMAP/Credit14.bmp.h" +#include "Resource/BITMAP/Credit15.bmp.h" +#include "Resource/BITMAP/Credit16.bmp.h" +#include "Resource/BITMAP/Credit17.bmp.h" +#include "Resource/BITMAP/Credit18.bmp.h" #ifdef JAPANESE -#include "Resource/BITMAP/PIXEL_JP.bmp.h" +#include "Resource/BITMAP/pixel_jp.bmp.h" #else -#include "Resource/BITMAP/PIXEL.bmp.h" +#include "Resource/BITMAP/pixel.bmp.h" #endif #ifndef WINDOWS #include "Resource/ICON/ICON_MINI.bmp.h" @@ -79,362 +74,102 @@ #include "Resource/CURSOR/CURSOR_IKA.bmp.h" #include "Resource/CURSOR/CURSOR_NORMAL.bmp.h" -const unsigned char* GetResource(const char *name, size_t *size) +static const struct { - //ORG - if (!strcmp(name, "ACCESS")) - { - *size = sizeof(rACCESS); - return rACCESS; - } - if (!strcmp(name, "ANZEN")) - { - *size = sizeof(rANZEN); - return rANZEN; - } - if (!strcmp(name, "BALCONY")) - { - *size = sizeof(rBALCONY); - return rBALCONY; - } - if (!strcmp(name, "BALLOS")) - { - *size = sizeof(rBALLOS); - return rBALLOS; - } - if (!strcmp(name, "BDOWN")) - { - *size = sizeof(rBDOWN); - return rBDOWN; - } - if (!strcmp(name, "CEMETERY")) - { - *size = sizeof(rCEMETERY); - return rCEMETERY; - } - if (!strcmp(name, "CURLY")) - { - *size = sizeof(rCURLY); - return rCURLY; - } - if (!strcmp(name, "DR")) - { - *size = sizeof(rDR); - return rDR; - } - if (!strcmp(name, "ENDING")) - { - *size = sizeof(rENDING); - return rENDING; - } - if (!strcmp(name, "ESCAPE")) - { - *size = sizeof(rESCAPE); - return rESCAPE; - } - if (!strcmp(name, "FANFALE1")) - { - *size = sizeof(rFANFALE1); - return rFANFALE1; - } - if (!strcmp(name, "FANFALE2")) - { - *size = sizeof(rFANFALE2); - return rFANFALE2; - } - if (!strcmp(name, "FANFALE3")) - { - *size = sizeof(rFANFALE3); - return rFANFALE3; - } - if (!strcmp(name, "FIREEYE")) - { - *size = sizeof(rFIREEYE); - return rFIREEYE; - } - if (!strcmp(name, "GAMEOVER")) - { - *size = sizeof(rGAMEOVER); - return rGAMEOVER; - } - if (!strcmp(name, "GINSUKE")) - { - *size = sizeof(rGINSUKE); - return rGINSUKE; - } - if (!strcmp(name, "GRAND")) - { - *size = sizeof(rGRAND); - return rGRAND; - } - if (!strcmp(name, "GRAVITY")) - { - *size = sizeof(rGRAVITY); - return rGRAVITY; - } - if (!strcmp(name, "HELL")) - { - *size = sizeof(rHELL); - return rHELL; - } - if (!strcmp(name, "IRONH")) - { - *size = sizeof(rIRONH); - return rIRONH; - } - if (!strcmp(name, "JENKA")) - { - *size = sizeof(rJENKA); - return rJENKA; - } - if (!strcmp(name, "JENKA2")) - { - *size = sizeof(rJENKA2); - return rJENKA2; - } - if (!strcmp(name, "KODOU")) - { - *size = sizeof(rKODOU); - return rKODOU; - } - if (!strcmp(name, "LASTBT3")) - { - *size = sizeof(rLASTBT3); - return rLASTBT3; - } - if (!strcmp(name, "LASTBTL")) - { - *size = sizeof(rLASTBTL); - return rLASTBTL; - } - if (!strcmp(name, "LASTCAVE")) - { - *size = sizeof(rLASTCAVE); - return rLASTCAVE; - } - if (!strcmp(name, "MARINE")) - { - *size = sizeof(rMARINE); - return rMARINE; - } - if (!strcmp(name, "MAZE")) - { - *size = sizeof(rMAZE); - return rMAZE; - } - if (!strcmp(name, "MDOWN2")) - { - *size = sizeof(rMDOWN2); - return rMDOWN2; - } - if (!strcmp(name, "MURA")) - { - *size = sizeof(rMURA); - return rMURA; - } - if (!strcmp(name, "OSIDE")) - { - *size = sizeof(rOSIDE); - return rOSIDE; - } - if (!strcmp(name, "PLANT")) - { - *size = sizeof(rPLANT); - return rPLANT; - } - if (!strcmp(name, "QUIET")) - { - *size = sizeof(rQUIET); - return rQUIET; - } - if (!strcmp(name, "REQUIEM")) - { - *size = sizeof(rREQUIEM); - return rREQUIEM; - } - if (!strcmp(name, "TOROKO")) - { - *size = sizeof(rTOROKO); - return rTOROKO; - } - if (!strcmp(name, "VIVI")) - { - *size = sizeof(rVIVI); - return rVIVI; - } - if (!strcmp(name, "WANPAK2")) - { - *size = sizeof(rWANPAK2); - return rWANPAK2; - } - if (!strcmp(name, "WANPAKU")) - { - *size = sizeof(rWANPAKU); - return rWANPAKU; - } - if (!strcmp(name, "WEED")) - { - *size = sizeof(rWEED); - return rWEED; - } - if (!strcmp(name, "WHITE")) - { - *size = sizeof(rWHITE); - return rWHITE; - } - if (!strcmp(name, "XXXX")) - { - *size = sizeof(rXXXX); - return rXXXX; - } - if (!strcmp(name, "ZONBIE")) - { - *size = sizeof(rZONBIE); - return rZONBIE; - } - - //WAVE - if (!strcmp(name, "WAVE100")) - { - *size = sizeof(rWAVE100); - return rWAVE100; - } - - //Bitmap - if (!strcmp(name, "CREDIT01")) - { - *size = sizeof(rCREDIT01); - return rCREDIT01; - } - if (!strcmp(name, "CREDIT02")) - { - *size = sizeof(rCREDIT02); - return rCREDIT02; - } - if (!strcmp(name, "CREDIT03")) - { - *size = sizeof(rCREDIT03); - return rCREDIT03; - } - if (!strcmp(name, "CREDIT04")) - { - *size = sizeof(rCREDIT04); - return rCREDIT04; - } - if (!strcmp(name, "CREDIT05")) - { - *size = sizeof(rCREDIT05); - return rCREDIT05; - } - if (!strcmp(name, "CREDIT06")) - { - *size = sizeof(rCREDIT06); - return rCREDIT06; - } - if (!strcmp(name, "CREDIT07")) - { - *size = sizeof(rCREDIT07); - return rCREDIT07; - } - if (!strcmp(name, "CREDIT08")) - { - *size = sizeof(rCREDIT08); - return rCREDIT08; - } - if (!strcmp(name, "CREDIT09")) - { - *size = sizeof(rCREDIT09); - return rCREDIT09; - } - if (!strcmp(name, "CREDIT10")) - { - *size = sizeof(rCREDIT10); - return rCREDIT10; - } - if (!strcmp(name, "CREDIT11")) - { - *size = sizeof(rCREDIT11); - return rCREDIT11; - } - if (!strcmp(name, "CREDIT12")) - { - *size = sizeof(rCREDIT12); - return rCREDIT12; - } - if (!strcmp(name, "CREDIT14")) - { - *size = sizeof(rCREDIT14); - return rCREDIT14; - } - if (!strcmp(name, "CREDIT15")) - { - *size = sizeof(rCREDIT15); - return rCREDIT15; - } - if (!strcmp(name, "CREDIT16")) - { - *size = sizeof(rCREDIT16); - return rCREDIT16; - } - if (!strcmp(name, "CREDIT17")) - { - *size = sizeof(rCREDIT17); - return rCREDIT17; - } - if (!strcmp(name, "CREDIT18")) - { - *size = sizeof(rCREDIT18); - return rCREDIT18; - } - if (!strcmp(name, "PIXEL")) - { + const char *type; + const char *name; + const unsigned char *data; + size_t size; +} resources[] = { + {"ORG", "ACCESS", rAccess, sizeof(rAccess)}, + {"ORG", "ANZEN", rAnzen, sizeof(rAnzen)}, + {"ORG", "BALCONY", rBalcony, sizeof(rBalcony)}, + {"ORG", "BALLOS", rBallos, sizeof(rBallos)}, + {"ORG", "BDOWN", rBreakDown, sizeof(rBreakDown)}, + {"ORG", "CEMETERY", rCemetery, sizeof(rCemetery)}, + {"ORG", "CURLY", rCurly, sizeof(rCurly)}, + {"ORG", "DR", rDr, sizeof(rDr)}, + {"ORG", "ENDING", rEnding, sizeof(rEnding)}, + {"ORG", "ESCAPE", rEscape, sizeof(rEscape)}, + {"ORG", "FANFALE1", rFanfale1, sizeof(rFanfale1)}, + {"ORG", "FANFALE2", rFanfale2, sizeof(rFanfale2)}, + {"ORG", "FANFALE3", rFanfale3, sizeof(rFanfale3)}, + {"ORG", "FIREEYE", rFireEye, sizeof(rFireEye)}, + {"ORG", "GAMEOVER", rGameover, sizeof(rGameover)}, + {"ORG", "GINSUKE", rGinsuke, sizeof(rGinsuke)}, + {"ORG", "GRAND", rGrand, sizeof(rGrand)}, + {"ORG", "GRAVITY", rGravity, sizeof(rGravity)}, + {"ORG", "HELL", rHell, sizeof(rHell)}, + {"ORG", "IRONH", rironH, sizeof(rironH)}, + {"ORG", "JENKA", rJenka, sizeof(rJenka)}, + {"ORG", "JENKA2", rJenka2, sizeof(rJenka2)}, + {"ORG", "KODOU", rKodou, sizeof(rKodou)}, + {"ORG", "LASTBT3", rLastBtl3, sizeof(rLastBtl3)}, + {"ORG", "LASTBTL", rLastBtl, sizeof(rLastBtl)}, + {"ORG", "LASTCAVE", rLastCave, sizeof(rLastCave)}, + {"ORG", "MARINE", rMarine, sizeof(rMarine)}, + {"ORG", "MAZE", rMaze, sizeof(rMaze)}, + {"ORG", "MDOWN2", rMDown2, sizeof(rMDown2)}, + {"ORG", "MURA", rMura, sizeof(rMura)}, + {"ORG", "OSIDE", rOside, sizeof(rOside)}, + {"ORG", "PLANT", rPlant, sizeof(rPlant)}, + {"ORG", "QUIET", rquiet, sizeof(rquiet)}, + {"ORG", "REQUIEM", rRequiem, sizeof(rRequiem)}, + {"ORG", "TOROKO", rToroko, sizeof(rToroko)}, + {"ORG", "VIVI", rVivi, sizeof(rVivi)}, + {"ORG", "WANPAK2", rWanpak2, sizeof(rWanpak2)}, + {"ORG", "WANPAKU", rWanpaku, sizeof(rWanpaku)}, + {"ORG", "WEED", rWeed, sizeof(rWeed)}, + {"ORG", "WHITE", rWhite, sizeof(rWhite)}, + {"ORG", "XXXX", rXXXX, sizeof(rXXXX)}, + {"ORG", "ZONBIE", rZonbie, sizeof(rZonbie)}, + + {"WAVE", "WAVE100", rWave, sizeof(rWave)}, + + {"BITMAP", "CREDIT01", rCredit01, sizeof(rCredit01)}, + {"BITMAP", "CREDIT02", rCredit02, sizeof(rCredit02)}, + {"BITMAP", "CREDIT03", rCredit03, sizeof(rCredit03)}, + {"BITMAP", "CREDIT04", rCredit04, sizeof(rCredit04)}, + {"BITMAP", "CREDIT05", rCredit05, sizeof(rCredit05)}, + {"BITMAP", "CREDIT06", rCredit06, sizeof(rCredit06)}, + {"BITMAP", "CREDIT07", rCredit07, sizeof(rCredit07)}, + {"BITMAP", "CREDIT08", rCredit08, sizeof(rCredit08)}, + {"BITMAP", "CREDIT09", rCredit09, sizeof(rCredit09)}, + {"BITMAP", "CREDIT10", rCredit10, sizeof(rCredit10)}, + {"BITMAP", "CREDIT11", rCredit11, sizeof(rCredit11)}, + {"BITMAP", "CREDIT12", rCredit12, sizeof(rCredit12)}, + {"BITMAP", "CREDIT14", rCredit14, sizeof(rCredit14)}, + {"BITMAP", "CREDIT15", rCredit15, sizeof(rCredit15)}, + {"BITMAP", "CREDIT16", rCredit16, sizeof(rCredit16)}, + {"BITMAP", "CREDIT17", rCredit17, sizeof(rCredit17)}, + {"BITMAP", "CREDIT18", rCredit18, sizeof(rCredit18)}, #ifdef JAPANESE - *size = sizeof(rPIXEL_JP); - return rPIXEL_JP; + {"BITMAP", "PIXEL", rpixel_jp, sizeof(rpixel_jp)}, #else - *size = sizeof(rPIXEL); - return rPIXEL; -#endif - } - -#ifndef WINDOWS - //ICON - if (!strcmp(name, "ICON_MINI")) - { - *size = sizeof(rICON_MINI); - return rICON_MINI; - } + {"BITMAP", "PIXEL", rpixel, sizeof(rpixel)}, #endif - //CURSOR - if (!strcmp(name, "CURSOR_NORMAL")) +#ifndef WINDOWS + {"ICON", "ICON_MINI", rICON_MINI, sizeof(rICON_MINI)}, +#endif + + {"CURSOR", "CURSOR_NORMAL", rCURSOR_NORMAL, sizeof(rCURSOR_NORMAL)}, + {"CURSOR", "CURSOR_IKA", rCURSOR_IKA, sizeof(rCURSOR_IKA)}, + +}; + +const unsigned char* FindResource(const char *name, const char *type, size_t *size) +{ + for (unsigned int i = 0; i < sizeof(resources) / sizeof(resources[0]); ++i) { - *size = sizeof(rCURSOR_NORMAL); - return rCURSOR_NORMAL; - } - if (!strcmp(name, "CURSOR_IKA")) - { - *size = sizeof(rCURSOR_IKA); - return rCURSOR_IKA; + if (!strcmp(name, resources[i].name) && !strcmp(type, resources[i].type)) + { + if (size) + *size = resources[i].size; + + return resources[i].data; + } } + return NULL; } - -SDL_RWops* FindResource(const char *name) -{ - size_t resSize; - const unsigned char* resource = GetResource(name, &resSize); - - if (!resource) - return NULL; - - SDL_RWops *fp = SDL_RWFromConstMem(resource, (int)resSize); - - if (!fp) - { - printf("Couldn't open resource %s\nSDL Error: %s\n", name, SDL_GetError()); - return NULL; - } - - return fp; -} diff --git a/src/Resource.h b/src/Resource.h index 89d552e6..9f477df6 100644 --- a/src/Resource.h +++ b/src/Resource.h @@ -1,5 +1,5 @@ #pragma once -#include +#include -SDL_RWops* FindResource(const char *name); +const unsigned char* FindResource(const char *name, const char *type, size_t *size); diff --git a/src/Resource/BITMAP/CREDIT01.bmp.h b/src/Resource/BITMAP/Credit01.bmp.h similarity index 99% rename from src/Resource/BITMAP/CREDIT01.bmp.h rename to src/Resource/BITMAP/Credit01.bmp.h index df0b2707..bf78180d 100644 --- a/src/Resource/BITMAP/CREDIT01.bmp.h +++ b/src/Resource/BITMAP/Credit01.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCREDIT01[0x4B76] = { +const unsigned char rCredit01[0x4B76] = { 0x42, 0x4D, 0x76, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, diff --git a/src/Resource/BITMAP/CREDIT02.bmp.h b/src/Resource/BITMAP/Credit02.bmp.h similarity index 99% rename from src/Resource/BITMAP/CREDIT02.bmp.h rename to src/Resource/BITMAP/Credit02.bmp.h index 157dc1db..aaae90ea 100644 --- a/src/Resource/BITMAP/CREDIT02.bmp.h +++ b/src/Resource/BITMAP/Credit02.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCREDIT02[0x4B76] = { +const unsigned char rCredit02[0x4B76] = { 0x42, 0x4D, 0x76, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, diff --git a/src/Resource/BITMAP/CREDIT03.bmp.h b/src/Resource/BITMAP/Credit03.bmp.h similarity index 99% rename from src/Resource/BITMAP/CREDIT03.bmp.h rename to src/Resource/BITMAP/Credit03.bmp.h index 3ad69c51..2ff4b50a 100644 --- a/src/Resource/BITMAP/CREDIT03.bmp.h +++ b/src/Resource/BITMAP/Credit03.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCREDIT03[0x4B76] = { +const unsigned char rCredit03[0x4B76] = { 0x42, 0x4D, 0x76, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, diff --git a/src/Resource/BITMAP/CREDIT04.bmp.h b/src/Resource/BITMAP/Credit04.bmp.h similarity index 99% rename from src/Resource/BITMAP/CREDIT04.bmp.h rename to src/Resource/BITMAP/Credit04.bmp.h index 3c2644dd..7f67db6b 100644 --- a/src/Resource/BITMAP/CREDIT04.bmp.h +++ b/src/Resource/BITMAP/Credit04.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCREDIT04[0x4B76] = { +const unsigned char rCredit04[0x4B76] = { 0x42, 0x4D, 0x76, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, diff --git a/src/Resource/BITMAP/CREDIT05.bmp.h b/src/Resource/BITMAP/Credit05.bmp.h similarity index 99% rename from src/Resource/BITMAP/CREDIT05.bmp.h rename to src/Resource/BITMAP/Credit05.bmp.h index f1bd576f..ffef4ea6 100644 --- a/src/Resource/BITMAP/CREDIT05.bmp.h +++ b/src/Resource/BITMAP/Credit05.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCREDIT05[0x4B76] = { +const unsigned char rCredit05[0x4B76] = { 0x42, 0x4D, 0x76, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, diff --git a/src/Resource/BITMAP/CREDIT06.bmp.h b/src/Resource/BITMAP/Credit06.bmp.h similarity index 99% rename from src/Resource/BITMAP/CREDIT06.bmp.h rename to src/Resource/BITMAP/Credit06.bmp.h index 8fa753aa..1f7f98ad 100644 --- a/src/Resource/BITMAP/CREDIT06.bmp.h +++ b/src/Resource/BITMAP/Credit06.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCREDIT06[0x4B76] = { +const unsigned char rCredit06[0x4B76] = { 0x42, 0x4D, 0x76, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, diff --git a/src/Resource/BITMAP/CREDIT07.bmp.h b/src/Resource/BITMAP/Credit07.bmp.h similarity index 99% rename from src/Resource/BITMAP/CREDIT07.bmp.h rename to src/Resource/BITMAP/Credit07.bmp.h index 13b20deb..f9c1d4c7 100644 --- a/src/Resource/BITMAP/CREDIT07.bmp.h +++ b/src/Resource/BITMAP/Credit07.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCREDIT07[0x4B76] = { +const unsigned char rCredit07[0x4B76] = { 0x42, 0x4D, 0x76, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, diff --git a/src/Resource/BITMAP/CREDIT08.bmp.h b/src/Resource/BITMAP/Credit08.bmp.h similarity index 99% rename from src/Resource/BITMAP/CREDIT08.bmp.h rename to src/Resource/BITMAP/Credit08.bmp.h index b8e17854..8da2d002 100644 --- a/src/Resource/BITMAP/CREDIT08.bmp.h +++ b/src/Resource/BITMAP/Credit08.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCREDIT08[0x4B76] = { +const unsigned char rCredit08[0x4B76] = { 0x42, 0x4D, 0x76, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, diff --git a/src/Resource/BITMAP/CREDIT09.bmp.h b/src/Resource/BITMAP/Credit09.bmp.h similarity index 99% rename from src/Resource/BITMAP/CREDIT09.bmp.h rename to src/Resource/BITMAP/Credit09.bmp.h index b61d8a34..35254432 100644 --- a/src/Resource/BITMAP/CREDIT09.bmp.h +++ b/src/Resource/BITMAP/Credit09.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCREDIT09[0x4B76] = { +const unsigned char rCredit09[0x4B76] = { 0x42, 0x4D, 0x76, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, diff --git a/src/Resource/BITMAP/CREDIT10.bmp.h b/src/Resource/BITMAP/Credit10.bmp.h similarity index 99% rename from src/Resource/BITMAP/CREDIT10.bmp.h rename to src/Resource/BITMAP/Credit10.bmp.h index cd1869db..1bab2d6f 100644 --- a/src/Resource/BITMAP/CREDIT10.bmp.h +++ b/src/Resource/BITMAP/Credit10.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCREDIT10[0x4B76] = { +const unsigned char rCredit10[0x4B76] = { 0x42, 0x4D, 0x76, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, diff --git a/src/Resource/BITMAP/CREDIT11.bmp.h b/src/Resource/BITMAP/Credit11.bmp.h similarity index 99% rename from src/Resource/BITMAP/CREDIT11.bmp.h rename to src/Resource/BITMAP/Credit11.bmp.h index 44118c9e..058e182e 100644 --- a/src/Resource/BITMAP/CREDIT11.bmp.h +++ b/src/Resource/BITMAP/Credit11.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCREDIT11[0x4B76] = { +const unsigned char rCredit11[0x4B76] = { 0x42, 0x4D, 0x76, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, diff --git a/src/Resource/BITMAP/CREDIT12.bmp.h b/src/Resource/BITMAP/Credit12.bmp.h similarity index 99% rename from src/Resource/BITMAP/CREDIT12.bmp.h rename to src/Resource/BITMAP/Credit12.bmp.h index 60b6d47d..0ce1e64e 100644 --- a/src/Resource/BITMAP/CREDIT12.bmp.h +++ b/src/Resource/BITMAP/Credit12.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCREDIT12[0x4B76] = { +const unsigned char rCredit12[0x4B76] = { 0x42, 0x4D, 0x76, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, diff --git a/src/Resource/BITMAP/CREDIT14.bmp.h b/src/Resource/BITMAP/Credit14.bmp.h similarity index 99% rename from src/Resource/BITMAP/CREDIT14.bmp.h rename to src/Resource/BITMAP/Credit14.bmp.h index 98437ff3..beff4387 100644 --- a/src/Resource/BITMAP/CREDIT14.bmp.h +++ b/src/Resource/BITMAP/Credit14.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCREDIT14[0x4B76] = { +const unsigned char rCredit14[0x4B76] = { 0x42, 0x4D, 0x76, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, diff --git a/src/Resource/BITMAP/CREDIT15.bmp.h b/src/Resource/BITMAP/Credit15.bmp.h similarity index 99% rename from src/Resource/BITMAP/CREDIT15.bmp.h rename to src/Resource/BITMAP/Credit15.bmp.h index 9d2ee429..4e2fd619 100644 --- a/src/Resource/BITMAP/CREDIT15.bmp.h +++ b/src/Resource/BITMAP/Credit15.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCREDIT15[0x4B76] = { +const unsigned char rCredit15[0x4B76] = { 0x42, 0x4D, 0x76, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, diff --git a/src/Resource/BITMAP/CREDIT16.bmp.h b/src/Resource/BITMAP/Credit16.bmp.h similarity index 99% rename from src/Resource/BITMAP/CREDIT16.bmp.h rename to src/Resource/BITMAP/Credit16.bmp.h index 94e230c4..50a65d7d 100644 --- a/src/Resource/BITMAP/CREDIT16.bmp.h +++ b/src/Resource/BITMAP/Credit16.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCREDIT16[0x4B76] = { +const unsigned char rCredit16[0x4B76] = { 0x42, 0x4D, 0x76, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, diff --git a/src/Resource/BITMAP/CREDIT17.bmp.h b/src/Resource/BITMAP/Credit17.bmp.h similarity index 99% rename from src/Resource/BITMAP/CREDIT17.bmp.h rename to src/Resource/BITMAP/Credit17.bmp.h index 240de9be..fc82ddbe 100644 --- a/src/Resource/BITMAP/CREDIT17.bmp.h +++ b/src/Resource/BITMAP/Credit17.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCREDIT17[0x4B76] = { +const unsigned char rCredit17[0x4B76] = { 0x42, 0x4D, 0x76, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, diff --git a/src/Resource/BITMAP/CREDIT18.bmp.h b/src/Resource/BITMAP/Credit18.bmp.h similarity index 99% rename from src/Resource/BITMAP/CREDIT18.bmp.h rename to src/Resource/BITMAP/Credit18.bmp.h index ed79d08f..cdc2a4d1 100644 --- a/src/Resource/BITMAP/CREDIT18.bmp.h +++ b/src/Resource/BITMAP/Credit18.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCREDIT18[0x4B76] = { +const unsigned char rCredit18[0x4B76] = { 0x42, 0x4D, 0x76, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, diff --git a/src/Resource/BITMAP/PIXEL_JP.bmp.h b/src/Resource/BITMAP/PIXEL_JP.bmp.h deleted file mode 100644 index 37e57279..00000000 --- a/src/Resource/BITMAP/PIXEL_JP.bmp.h +++ /dev/null @@ -1,92 +0,0 @@ -#pragma once - -const unsigned char rPIXEL_JP[0x576] = { - 0x42, 0x4D, 0x76, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, - 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0xE2, 0xF3, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x01, 0x00, - 0x10, 0x01, 0x10, 0x11, 0x00, 0x00, 0x11, 0x11, 0x10, 0x11, 0x11, 0x11, 0x11, 0x11, 0x10, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x11, 0x11, 0x00, 0x11, 0x10, 0x00, 0x11, 0x10, 0x00, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, - 0x01, 0x00, 0x01, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, - 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x10, 0x01, 0x11, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x01, 0x11, - 0x11, 0x00, 0x10, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x10, 0x01, 0x01, 0x00, 0x10, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x10, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x11, 0x11, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, - 0x10, 0x00, 0x10, 0x01, 0x11, 0x11, 0x11, 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x01, 0x11, - 0x11, 0x00, 0x10, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x01, 0x11, 0x11, 0x11, 0x01, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x11, 0x11, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x10, 0x01, 0x00, 0x10, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x10, 0x00, 0x01, - 0x11, 0x10, 0x00, 0x10, 0x01, 0x01, 0x00, 0x10, 0x00, 0x10, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x10, - 0x11, 0x11, 0x10, 0x01, 0x11, 0x11, 0x11, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x01, 0x00, 0x10, 0x10, 0x00, 0x10, 0x01, 0x11, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, - 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x01, 0x10, 0x00, 0x01, 0x11, 0x11, 0x11, 0x11, 0x00, 0x01, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x01, - 0x11, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x10, - 0x11, 0x11, 0x10, 0x01, 0x01, 0x00, 0x10, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10, 0x01, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x11, 0x10, 0x00, 0x11, 0x10, 0x00, 0x11, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x11, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, - 0x10, 0x00, 0x10, 0x10, 0x00, 0x10, 0x11, 0x00, 0x10, 0x11, 0x11, 0x11, 0x11, 0x11, 0x10, 0x01, - 0x11, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x11, 0x10, - 0x11, 0x11, 0x10, 0x01, 0x11, 0x11, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; diff --git a/src/Resource/BITMAP/PIXEL.bmp.h b/src/Resource/BITMAP/pixel.bmp.h similarity index 99% rename from src/Resource/BITMAP/PIXEL.bmp.h rename to src/Resource/BITMAP/pixel.bmp.h index b53c6146..43f38e7f 100644 --- a/src/Resource/BITMAP/PIXEL.bmp.h +++ b/src/Resource/BITMAP/pixel.bmp.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rPIXEL[0x576] = { +const unsigned char rpixel[0x576] = { 0x42, 0x4D, 0x76, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0xA0, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0xC2, 0x1E, 0x00, 0x00, 0xC2, 0x1E, 0x00, 0x00, 0x00, 0x00, diff --git a/src/Resource/ICON/ICON_MINI.bmp.h b/src/Resource/ICON/ICON_MINI.bmp.h deleted file mode 100644 index 0fa84f4d..00000000 --- a/src/Resource/ICON/ICON_MINI.bmp.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -const unsigned char rICON_MINI[0x11A] = { - 0x42, 0x4D, 0x1A, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0x00, 0x00, 0x00, 0x6C, 0x00, - 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x23, 0x2E, 0x00, 0x00, 0x23, 0x2E, 0x00, 0x00, 0x08, 0x00, - 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x42, 0x47, 0x52, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xC0, 0xC0, - 0xC0, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x33, 0x33, 0x33, 0x00, 0x00, 0x03, - 0x33, 0x33, 0x33, 0x33, 0x33, 0x22, 0x23, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x32, 0x22, 0x33, - 0x33, 0x33, 0x33, 0x33, 0x33, 0x77, 0x22, 0x73, 0x33, 0x33, 0x33, 0x33, 0x33, 0x70, 0x00, 0x33, - 0x33, 0x33, 0x33, 0x33, 0x33, 0x70, 0x00, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x37, 0x05, 0x33, - 0x33, 0x33, 0x33, 0x33, 0x00, 0x00, 0x50, 0x00, 0x33, 0x33, 0x33, 0x30, 0x77, 0x77, 0x77, 0x77, - 0x03, 0x33, 0x33, 0x40, 0x71, 0x77, 0x77, 0x71, 0x74, 0x33, 0x33, 0x40, 0x71, 0x77, 0x77, 0x71, - 0x54, 0x33, 0x34, 0x30, 0x51, 0x77, 0x77, 0x51, 0x53, 0x33, 0x36, 0x32, 0x00, 0x00, 0x55, 0x55, - 0x23, 0x33, 0x33, 0x32, 0x22, 0x22, 0x22, 0x22, 0x22, 0x23, 0x33, 0x33, 0x27, 0x77, 0x77, 0x77, - 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33 -}; diff --git a/src/Resource/ORG/ACCESS.org.h b/src/Resource/ORG/Access.org.h similarity index 99% rename from src/Resource/ORG/ACCESS.org.h rename to src/Resource/ORG/Access.org.h index 5a00699f..1ff0625c 100644 --- a/src/Resource/ORG/ACCESS.org.h +++ b/src/Resource/ORG/Access.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rACCESS[0x472] = { +const unsigned char rAccess[0x472] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x64, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x46, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x46, 0x00, 0x31, 0x00, 0xE8, 0x03, 0x20, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, diff --git a/src/Resource/ORG/ANZEN.org.h b/src/Resource/ORG/Anzen.org.h similarity index 99% rename from src/Resource/ORG/ANZEN.org.h rename to src/Resource/ORG/Anzen.org.h index 2190b0c5..7147021c 100644 --- a/src/Resource/ORG/ANZEN.org.h +++ b/src/Resource/ORG/Anzen.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rANZEN[0x23EA] = { +const unsigned char rAnzen[0x23EA] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x6E, 0x00, 0x04, 0x03, 0x30, 0x00, 0x00, 0x00, 0xA0, 0x02, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x3C, 0x00, 0xC9, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x7D, 0x00, 0xE8, 0x03, 0x2E, 0x00, 0x7A, 0x00, 0xE8, 0x03, 0x0A, 0x00, 0xFB, 0x00, diff --git a/src/Resource/ORG/BALCONY.org.h b/src/Resource/ORG/Balcony.org.h similarity index 99% rename from src/Resource/ORG/BALCONY.org.h rename to src/Resource/ORG/Balcony.org.h index d6a2a643..58fcebec 100644 --- a/src/Resource/ORG/BALCONY.org.h +++ b/src/Resource/ORG/Balcony.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rBALCONY[0xC0A] = { +const unsigned char rBalcony[0xC0A] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0xA0, 0x00, 0x04, 0x04, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x3C, 0x00, 0xE0, 0x00, 0xE8, 0x03, 0x2F, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x20, 0x00, 0xE8, 0x03, 0x42, 0x00, 0x00, 0x00, diff --git a/src/Resource/ORG/BALLOS.org.h b/src/Resource/ORG/Ballos.org.h similarity index 99% rename from src/Resource/ORG/BALLOS.org.h rename to src/Resource/ORG/Ballos.org.h index 4619a683..de781c90 100644 --- a/src/Resource/ORG/BALLOS.org.h +++ b/src/Resource/ORG/Ballos.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rBALLOS[0xDF2] = { +const unsigned char rBallos[0xDF2] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x6E, 0x00, 0x04, 0x04, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x21, 0x00, 0x00, 0x01, 0xE8, 0x03, 0x00, 0x00, 0x10, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x08, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, diff --git a/src/Resource/ORG/BDOWN.org.h b/src/Resource/ORG/BreakDown.org.h similarity index 99% rename from src/Resource/ORG/BDOWN.org.h rename to src/Resource/ORG/BreakDown.org.h index 835382e6..6824c33b 100644 --- a/src/Resource/ORG/BDOWN.org.h +++ b/src/Resource/ORG/BreakDown.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rBDOWN[0xA0A] = { +const unsigned char rBreakDown[0xA0A] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x6E, 0x00, 0x04, 0x04, 0xC0, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x42, 0x00, 0xA0, 0x00, 0xE8, 0x03, 0x3F, 0x00, 0x2D, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x26, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x40, 0x00, diff --git a/src/Resource/ORG/CEMETERY.org.h b/src/Resource/ORG/Cemetery.org.h similarity index 99% rename from src/Resource/ORG/CEMETERY.org.h rename to src/Resource/ORG/Cemetery.org.h index 90c1fce9..9df216b8 100644 --- a/src/Resource/ORG/CEMETERY.org.h +++ b/src/Resource/ORG/Cemetery.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCEMETERY[0x11E2] = { +const unsigned char rCemetery[0x11E2] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0xB4, 0x00, 0x04, 0x03, 0x30, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x0A, 0x00, 0x76, 0x00, 0xE8, 0x03, 0x3C, 0x00, 0x30, 0x00, 0xE8, 0x03, 0x02, 0x00, 0x16, 0x00, 0x20, 0x03, 0x00, 0x00, 0x77, 0x00, diff --git a/src/Resource/ORG/CURLY.org.h b/src/Resource/ORG/Curly.org.h similarity index 99% rename from src/Resource/ORG/CURLY.org.h rename to src/Resource/ORG/Curly.org.h index 7db59483..2239108f 100644 --- a/src/Resource/ORG/CURLY.org.h +++ b/src/Resource/ORG/Curly.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rCURLY[0x648A] = { +const unsigned char rCurly[0x648A] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x5C, 0x00, 0x04, 0x06, 0x60, 0x00, 0x00, 0x00, 0xB8, 0x05, 0x00, 0x00, 0xE8, 0x03, 0x01, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x42, 0x00, 0x51, 0x02, 0xE8, 0x03, 0x5C, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x3F, 0x00, 0x4A, 0x01, 0xE8, 0x03, 0x2F, 0x00, 0xD9, 0x01, diff --git a/src/Resource/ORG/DR.org.h b/src/Resource/ORG/Dr.org.h similarity index 99% rename from src/Resource/ORG/DR.org.h rename to src/Resource/ORG/Dr.org.h index 2081f1f1..38b6bce3 100644 --- a/src/Resource/ORG/DR.org.h +++ b/src/Resource/ORG/Dr.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rDR[0x872] = { +const unsigned char rDr[0x872] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0xA0, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x28, 0x00, 0x58, 0x02, 0x5C, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, diff --git a/src/Resource/ORG/ENDING.org.h b/src/Resource/ORG/Ending.org.h similarity index 99% rename from src/Resource/ORG/ENDING.org.h rename to src/Resource/ORG/Ending.org.h index 9714370d..ac58b432 100644 --- a/src/Resource/ORG/ENDING.org.h +++ b/src/Resource/ORG/Ending.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rENDING[0x45EA] = { +const unsigned char rEnding[0x45EA] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x46, 0x00, 0x04, 0x06, 0x60, 0x00, 0x00, 0x00, 0xE0, 0x04, 0x00, 0x00, 0xE8, 0x03, 0x2F, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x2F, 0x00, 0x83, 0x01, 0xE8, 0x03, 0x07, 0x00, 0xA2, 0x01, 0xE8, 0x03, 0x32, 0x00, 0xF5, 0x00, 0xE8, 0x03, 0x2F, 0x00, 0x82, 0x01, diff --git a/src/Resource/ORG/ESCAPE.org.h b/src/Resource/ORG/Escape.org.h similarity index 99% rename from src/Resource/ORG/ESCAPE.org.h rename to src/Resource/ORG/Escape.org.h index cfc3f777..7531f516 100644 --- a/src/Resource/ORG/ESCAPE.org.h +++ b/src/Resource/ORG/Escape.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rESCAPE[0x1DC2] = { +const unsigned char rEscape[0x1DC2] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x5A, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x42, 0x00, 0x39, 0x00, 0xE8, 0x03, 0x42, 0x00, 0x65, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x00, 0x01, 0xE8, 0x03, 0x2F, 0x00, 0x40, 0x00, diff --git a/src/Resource/ORG/FANFALE1.org.h b/src/Resource/ORG/Fanfale1.org.h similarity index 99% rename from src/Resource/ORG/FANFALE1.org.h rename to src/Resource/ORG/Fanfale1.org.h index 7638ff66..2af39e05 100644 --- a/src/Resource/ORG/FANFALE1.org.h +++ b/src/Resource/ORG/Fanfale1.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rFANFALE1[0x392] = { +const unsigned char rFanfale1[0x392] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x64, 0x00, 0x04, 0x04, 0x30, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x2F, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x2F, 0x00, 0x0E, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x0A, 0x00, 0xE8, 0x03, 0x3C, 0x00, 0x1B, 0x00, 0xE8, 0x03, 0x2F, 0x00, 0x00, 0x00, diff --git a/src/Resource/ORG/FANFALE2.org.h b/src/Resource/ORG/Fanfale2.org.h similarity index 99% rename from src/Resource/ORG/FANFALE2.org.h rename to src/Resource/ORG/Fanfale2.org.h index 6c9e9bc8..b16ef811 100644 --- a/src/Resource/ORG/FANFALE2.org.h +++ b/src/Resource/ORG/Fanfale2.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rFANFALE2[0x39A] = { +const unsigned char rFanfale2[0x39A] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x80, 0x00, 0x04, 0x04, 0x30, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x1B, 0x00, 0xE8, 0x03, 0x07, 0x00, 0x05, 0x00, 0x84, 0x03, 0x2F, 0x00, 0x05, 0x00, 0xE8, 0x03, 0x33, 0x00, 0x21, 0x00, 0xE8, 0x03, 0x33, 0x00, 0x1F, 0x00, diff --git a/src/Resource/ORG/FANFALE3.org.h b/src/Resource/ORG/Fanfale3.org.h similarity index 99% rename from src/Resource/ORG/FANFALE3.org.h rename to src/Resource/ORG/Fanfale3.org.h index a857bd0c..c619280d 100644 --- a/src/Resource/ORG/FANFALE3.org.h +++ b/src/Resource/ORG/Fanfale3.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rFANFALE3[0x432] = { +const unsigned char rFanfale3[0x432] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x64, 0x00, 0x04, 0x04, 0x30, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x02, 0x00, 0x15, 0x00, 0xE8, 0x03, 0x2C, 0x00, 0x0D, 0x00, 0xE8, 0x03, 0x02, 0x00, 0x0D, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x0D, 0x00, diff --git a/src/Resource/ORG/FIREEYE.org.h b/src/Resource/ORG/FireEye.org.h similarity index 99% rename from src/Resource/ORG/FIREEYE.org.h rename to src/Resource/ORG/FireEye.org.h index 4c639cf5..3f0e828d 100644 --- a/src/Resource/ORG/FIREEYE.org.h +++ b/src/Resource/ORG/FireEye.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rFIREEYE[0x536A] = { +const unsigned char rFireEye[0x536A] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x50, 0x00, 0x04, 0x04, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x66, 0x01, 0x84, 0x03, 0x59, 0x00, 0x66, 0x01, 0xE8, 0x03, 0x06, 0x00, 0x20, 0x01, 0xE8, 0x03, 0x06, 0x00, 0x20, 0x01, diff --git a/src/Resource/ORG/GAMEOVER.org.h b/src/Resource/ORG/Gameover.org.h similarity index 99% rename from src/Resource/ORG/GAMEOVER.org.h rename to src/Resource/ORG/Gameover.org.h index e87fa3d0..e5a8ac44 100644 --- a/src/Resource/ORG/GAMEOVER.org.h +++ b/src/Resource/ORG/Gameover.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rGAMEOVER[0x472] = { +const unsigned char rGameover[0x472] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x80, 0x00, 0x04, 0x06, 0x90, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x42, 0x00, 0x10, 0x00, 0xE8, 0x03, 0x42, 0x00, 0x0F, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x2D, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, diff --git a/src/Resource/ORG/GINSUKE.org.h b/src/Resource/ORG/Ginsuke.org.h similarity index 99% rename from src/Resource/ORG/GINSUKE.org.h rename to src/Resource/ORG/Ginsuke.org.h index b2882b02..9ba56fb0 100644 --- a/src/Resource/ORG/GINSUKE.org.h +++ b/src/Resource/ORG/Ginsuke.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rGINSUKE[0x1752] = { +const unsigned char rGinsuke[0x1752] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x64, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x80, 0x00, 0xE8, 0x03, 0x2F, 0x00, 0x25, 0x00, 0xE8, 0x03, 0x21, 0x00, 0x42, 0x00, 0xE8, 0x03, 0x62, 0x00, 0x60, 0x00, diff --git a/src/Resource/ORG/GRAND.org.h b/src/Resource/ORG/Grand.org.h similarity index 99% rename from src/Resource/ORG/GRAND.org.h rename to src/Resource/ORG/Grand.org.h index af8c9187..ee635948 100644 --- a/src/Resource/ORG/GRAND.org.h +++ b/src/Resource/ORG/Grand.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rGRAND[0x349A] = { +const unsigned char rGrand[0x349A] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x8C, 0x00, 0x04, 0x04, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x20, 0x00, 0xE8, 0x03, 0x04, 0x00, 0xE0, 0x01, 0xC0, 0x03, 0x01, 0x00, 0x20, 0x00, 0xE8, 0x03, 0x2F, 0x00, 0x4C, 0x00, diff --git a/src/Resource/ORG/GRAVITY.org.h b/src/Resource/ORG/Gravity.org.h similarity index 99% rename from src/Resource/ORG/GRAVITY.org.h rename to src/Resource/ORG/Gravity.org.h index 67623eb0..0da358e7 100644 --- a/src/Resource/ORG/GRAVITY.org.h +++ b/src/Resource/ORG/Gravity.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rGRAVITY[0x5062] = { +const unsigned char rGravity[0x5062] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x56, 0x00, 0x04, 0x04, 0x60, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x2F, 0x00, 0xAC, 0x01, 0xE8, 0x03, 0x2F, 0x00, 0x96, 0x01, 0xE8, 0x03, 0x5C, 0x00, 0x1F, 0x01, 0xE8, 0x03, 0x62, 0x00, 0x87, 0x00, diff --git a/src/Resource/ORG/HELL.org.h b/src/Resource/ORG/Hell.org.h similarity index 99% rename from src/Resource/ORG/HELL.org.h rename to src/Resource/ORG/Hell.org.h index 9f5fdbc4..e6cdb2e1 100644 --- a/src/Resource/ORG/HELL.org.h +++ b/src/Resource/ORG/Hell.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rHELL[0x47D2] = { +const unsigned char rHell[0x47D2] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x5A, 0x00, 0x04, 0x04, 0x80, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x42, 0x01, 0xE8, 0x03, 0x27, 0x00, 0x2E, 0x01, 0xE8, 0x03, 0x2F, 0x00, 0x82, 0x01, 0xE8, 0x03, 0x26, 0x00, 0x10, 0x01, diff --git a/src/Resource/ORG/JENKA.org.h b/src/Resource/ORG/Jenka.org.h similarity index 99% rename from src/Resource/ORG/JENKA.org.h rename to src/Resource/ORG/Jenka.org.h index 6eb8ed5f..fb6ba3f6 100644 --- a/src/Resource/ORG/JENKA.org.h +++ b/src/Resource/ORG/Jenka.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rJENKA[0x2072] = { +const unsigned char rJenka[0x2072] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x80, 0x00, 0x04, 0x03, 0x30, 0x00, 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x0B, 0x00, 0xA2, 0x00, 0x84, 0x03, 0x0B, 0x00, 0xA2, 0x00, 0xE8, 0x03, 0x07, 0x00, 0x7F, 0x00, 0x20, 0x03, 0x2F, 0x00, 0x80, 0x00, diff --git a/src/Resource/ORG/JENKA2.org.h b/src/Resource/ORG/Jenka2.org.h similarity index 99% rename from src/Resource/ORG/JENKA2.org.h rename to src/Resource/ORG/Jenka2.org.h index 108fb5b3..e8a38683 100644 --- a/src/Resource/ORG/JENKA2.org.h +++ b/src/Resource/ORG/Jenka2.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rJENKA2[0x2ED2] = { +const unsigned char rJenka2[0x2ED2] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x6E, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0xA0, 0x01, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x17, 0x00, 0x00, 0x01, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x62, 0x00, 0x0A, 0x01, 0xE8, 0x03, 0x5C, 0x00, 0xB5, 0x00, diff --git a/src/Resource/ORG/KODOU.org.h b/src/Resource/ORG/Kodou.org.h similarity index 99% rename from src/Resource/ORG/KODOU.org.h rename to src/Resource/ORG/Kodou.org.h index ec77f595..6ab157a7 100644 --- a/src/Resource/ORG/KODOU.org.h +++ b/src/Resource/ORG/Kodou.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rKODOU[0x28B2] = { +const unsigned char rKodou[0x28B2] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x78, 0x00, 0x04, 0x04, 0x80, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x02, 0x00, 0xC1, 0x00, 0xE8, 0x03, 0x2C, 0x00, 0xF7, 0x00, 0x58, 0x02, 0x05, 0x00, 0xC1, 0x00, 0x58, 0x02, 0x00, 0x00, 0xF5, 0x00, diff --git a/src/Resource/ORG/LASTBTL.org.h b/src/Resource/ORG/LastBtl.org.h similarity index 99% rename from src/Resource/ORG/LASTBTL.org.h rename to src/Resource/ORG/LastBtl.org.h index 42473929..9b64397f 100644 --- a/src/Resource/ORG/LASTBTL.org.h +++ b/src/Resource/ORG/LastBtl.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rLASTBTL[0xAD2] = { +const unsigned char rLastBtl[0xAD2] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x64, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x2F, 0x00, 0x40, 0x00, 0x20, 0x03, 0x2F, 0x00, 0x40, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x20, 0x00, 0x84, 0x03, 0x00, 0x00, 0x20, 0x00, diff --git a/src/Resource/ORG/LASTBT3.org.h b/src/Resource/ORG/LastBtl3.org.h similarity index 99% rename from src/Resource/ORG/LASTBT3.org.h rename to src/Resource/ORG/LastBtl3.org.h index fcceef42..88f82c39 100644 --- a/src/Resource/ORG/LASTBT3.org.h +++ b/src/Resource/ORG/LastBtl3.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rLASTBT3[0x5282] = { +const unsigned char rLastBtl3[0x5282] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x4F, 0x00, 0x04, 0x04, 0x10, 0x00, 0x00, 0x00, 0xF0, 0x02, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x06, 0x02, 0xE8, 0x03, 0x61, 0x00, 0xD0, 0x00, 0xE8, 0x03, 0x2F, 0x00, 0x35, 0x01, 0xE8, 0x03, 0x0B, 0x00, 0xD1, 0x01, diff --git a/src/Resource/ORG/LASTCAVE.org.h b/src/Resource/ORG/LastCave.org.h similarity index 99% rename from src/Resource/ORG/LASTCAVE.org.h rename to src/Resource/ORG/LastCave.org.h index 79347015..640bd97c 100644 --- a/src/Resource/ORG/LASTCAVE.org.h +++ b/src/Resource/ORG/LastCave.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rLASTCAVE[0x46CA] = { +const unsigned char rLastCave[0x46CA] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x74, 0x00, 0x04, 0x04, 0x80, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0xFA, 0x01, 0x20, 0x03, 0x2F, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x5F, 0x00, 0x1D, 0x02, 0xE8, 0x03, 0x3C, 0x00, 0x00, 0x00, diff --git a/src/Resource/ORG/MDOWN2.org.h b/src/Resource/ORG/MDown2.org.h similarity index 99% rename from src/Resource/ORG/MDOWN2.org.h rename to src/Resource/ORG/MDown2.org.h index 706b72f4..3e5ecba8 100644 --- a/src/Resource/ORG/MDOWN2.org.h +++ b/src/Resource/ORG/MDown2.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rMDOWN2[0x5252] = { +const unsigned char rMDown2[0x5252] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x69, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0xE8, 0x03, 0x0B, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x2F, 0x00, 0x8D, 0x01, 0xE8, 0x03, 0x2F, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x19, 0x00, 0x74, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x56, 0x01, diff --git a/src/Resource/ORG/MARINE.org.h b/src/Resource/ORG/Marine.org.h similarity index 99% rename from src/Resource/ORG/MARINE.org.h rename to src/Resource/ORG/Marine.org.h index 6d4e205e..f4fe8790 100644 --- a/src/Resource/ORG/MARINE.org.h +++ b/src/Resource/ORG/Marine.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rMARINE[0x4242] = { +const unsigned char rMarine[0x4242] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x80, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0xE8, 0x03, 0x42, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x19, 0x00, 0x60, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x80, 0x01, 0xE8, 0x03, 0x5A, 0x00, 0xB1, 0x00, 0xE8, 0x03, 0x3F, 0x00, 0x19, 0x01, diff --git a/src/Resource/ORG/MAZE.org.h b/src/Resource/ORG/Maze.org.h similarity index 99% rename from src/Resource/ORG/MAZE.org.h rename to src/Resource/ORG/Maze.org.h index 08190223..df583b39 100644 --- a/src/Resource/ORG/MAZE.org.h +++ b/src/Resource/ORG/Maze.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rMAZE[0x39C2] = { +const unsigned char rMaze[0x39C2] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x50, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x02, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x30, 0x01, 0xE8, 0x03, 0x5C, 0x00, 0xA0, 0x00, 0xE8, 0x03, 0x24, 0x00, 0xE1, 0x00, 0xE8, 0x03, 0x24, 0x00, 0xE0, 0x00, diff --git a/src/Resource/ORG/MURA.org.h b/src/Resource/ORG/Mura.org.h similarity index 99% rename from src/Resource/ORG/MURA.org.h rename to src/Resource/ORG/Mura.org.h index ae54cf94..6b933d1a 100644 --- a/src/Resource/ORG/MURA.org.h +++ b/src/Resource/ORG/Mura.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rMURA[0x298A] = { +const unsigned char rMura[0x298A] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x8C, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x01, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x0B, 0x00, 0x32, 0x01, 0xE8, 0x03, 0x0C, 0x00, 0xBD, 0x00, 0xE8, 0x03, 0x42, 0x00, 0x67, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0xBE, 0x01, diff --git a/src/Resource/ORG/OSIDE.org.h b/src/Resource/ORG/Oside.org.h similarity index 99% rename from src/Resource/ORG/OSIDE.org.h rename to src/Resource/ORG/Oside.org.h index 8ec04988..97a7caf0 100644 --- a/src/Resource/ORG/OSIDE.org.h +++ b/src/Resource/ORG/Oside.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rOSIDE[0x6422] = { +const unsigned char rOside[0x6422] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x78, 0x00, 0x04, 0x04, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x0B, 0x00, 0x30, 0x02, 0xE8, 0x03, 0x0B, 0x00, 0xFD, 0x00, 0xE8, 0x03, 0x0B, 0x00, 0x73, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x00, 0x02, diff --git a/src/Resource/ORG/PLANT.org.h b/src/Resource/ORG/Plant.org.h similarity index 99% rename from src/Resource/ORG/PLANT.org.h rename to src/Resource/ORG/Plant.org.h index ddf99cb4..f9d11483 100644 --- a/src/Resource/ORG/PLANT.org.h +++ b/src/Resource/ORG/Plant.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rPLANT[0x2C72] = { +const unsigned char rPlant[0x2C72] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x8C, 0x00, 0x03, 0x04, 0xC0, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x4E, 0x00, 0x80, 0x01, 0xE8, 0x03, 0x5C, 0x00, 0x7A, 0x01, 0xE8, 0x03, 0x2F, 0x00, 0x51, 0x00, 0xE8, 0x03, 0x2F, 0x00, 0x25, 0x00, diff --git a/src/Resource/ORG/REQUIEM.org.h b/src/Resource/ORG/Requiem.org.h similarity index 99% rename from src/Resource/ORG/REQUIEM.org.h rename to src/Resource/ORG/Requiem.org.h index e2d7f4da..9453675a 100644 --- a/src/Resource/ORG/REQUIEM.org.h +++ b/src/Resource/ORG/Requiem.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rREQUIEM[0x25FA] = { +const unsigned char rRequiem[0x25FA] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x8C, 0x00, 0x04, 0x04, 0x10, 0x00, 0x00, 0x00, 0xB0, 0x01, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x2B, 0x00, 0xAD, 0x00, 0xE8, 0x03, 0x42, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x07, 0x00, 0xCC, 0x00, 0x20, 0x03, 0x07, 0x00, 0xCC, 0x00, diff --git a/src/Resource/ORG/TOROKO.org.h b/src/Resource/ORG/Toroko.org.h similarity index 99% rename from src/Resource/ORG/TOROKO.org.h rename to src/Resource/ORG/Toroko.org.h index 47e975dc..f4b63baf 100644 --- a/src/Resource/ORG/TOROKO.org.h +++ b/src/Resource/ORG/Toroko.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rTOROKO[0x4832] = { +const unsigned char rToroko[0x4832] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0xAA, 0x00, 0x04, 0x03, 0x1C, 0x02, 0x00, 0x00, 0x28, 0x02, 0x00, 0x00, 0xE8, 0x03, 0x3D, 0x00, 0x55, 0x01, 0xE8, 0x03, 0x3D, 0x00, 0x53, 0x01, 0xE8, 0x03, 0x3D, 0x00, 0x07, 0x01, 0xE8, 0x03, 0x06, 0x00, 0x0D, 0x01, 0xE8, 0x03, 0x31, 0x00, 0x8A, 0x00, diff --git a/src/Resource/ORG/VIVI.org.h b/src/Resource/ORG/Vivi.org.h similarity index 99% rename from src/Resource/ORG/VIVI.org.h rename to src/Resource/ORG/Vivi.org.h index fb5e66fa..aaf8ee1b 100644 --- a/src/Resource/ORG/VIVI.org.h +++ b/src/Resource/ORG/Vivi.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rVIVI[0x28DA] = { +const unsigned char rVivi[0x28DA] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0xA0, 0x00, 0x04, 0x04, 0x40, 0x00, 0x00, 0x00, 0xC0, 0x01, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x5F, 0x00, 0x38, 0x00, 0xE8, 0x03, 0x2E, 0x00, 0x64, 0x01, 0xE8, 0x03, 0x2F, 0x00, 0xA1, 0x00, 0xE8, 0x03, 0x5B, 0x00, 0xC0, 0x00, diff --git a/src/Resource/ORG/WANPAK2.org.h b/src/Resource/ORG/Wanpak2.org.h similarity index 99% rename from src/Resource/ORG/WANPAK2.org.h rename to src/Resource/ORG/Wanpak2.org.h index c29d81fe..dff999ce 100644 --- a/src/Resource/ORG/WANPAK2.org.h +++ b/src/Resource/ORG/Wanpak2.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rWANPAK2[0x3E7A] = { +const unsigned char rWanpak2[0x3E7A] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x5E, 0x00, 0x04, 0x04, 0xC0, 0x00, 0x00, 0x00, 0xC0, 0x02, 0x00, 0x00, 0xE8, 0x03, 0x1A, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x2F, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0xE6, 0x00, 0x20, 0x03, 0x63, 0x00, 0x33, 0x00, 0xE8, 0x03, 0x3C, 0x00, 0x61, 0x01, diff --git a/src/Resource/ORG/WANPAKU.org.h b/src/Resource/ORG/Wanpaku.org.h similarity index 99% rename from src/Resource/ORG/WANPAKU.org.h rename to src/Resource/ORG/Wanpaku.org.h index fe7a9a69..d26e3776 100644 --- a/src/Resource/ORG/WANPAKU.org.h +++ b/src/Resource/ORG/Wanpaku.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rWANPAKU[0x4CAA] = { +const unsigned char rWanpaku[0x4CAA] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x5E, 0x00, 0x04, 0x04, 0x80, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x00, 0xE8, 0x03, 0x1A, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x1A, 0x00, 0xBA, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0xD6, 0x01, 0xE8, 0x03, 0x1A, 0x00, 0x9B, 0x00, 0xE8, 0x03, 0x38, 0x00, 0xEE, 0x00, diff --git a/src/Resource/ORG/WEED.org.h b/src/Resource/ORG/Weed.org.h similarity index 99% rename from src/Resource/ORG/WEED.org.h rename to src/Resource/ORG/Weed.org.h index 44cfe031..9e22690d 100644 --- a/src/Resource/ORG/WEED.org.h +++ b/src/Resource/ORG/Weed.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rWEED[0x5C9A] = { +const unsigned char rWeed[0x5C9A] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x5A, 0x00, 0x04, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x2F, 0x00, 0x58, 0x01, 0xE8, 0x03, 0x5C, 0x00, 0xC7, 0x01, 0xE8, 0x03, 0x39, 0x00, 0x54, 0x01, 0xE8, 0x03, 0x39, 0x00, 0x3A, 0x01, diff --git a/src/Resource/ORG/WHITE.org.h b/src/Resource/ORG/White.org.h similarity index 99% rename from src/Resource/ORG/WHITE.org.h rename to src/Resource/ORG/White.org.h index 226d0278..5e3d9aa4 100644 --- a/src/Resource/ORG/WHITE.org.h +++ b/src/Resource/ORG/White.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rWHITE[0x5CA2] = { +const unsigned char rWhite[0x5CA2] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x64, 0x00, 0x04, 0x06, 0x18, 0x00, 0x00, 0x00, 0xD8, 0x03, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x75, 0x00, 0xE8, 0x03, 0x07, 0x00, 0xFD, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0xF3, 0x01, 0xE8, 0x03, 0x06, 0x00, 0x37, 0x01, diff --git a/src/Resource/ORG/ZONBIE.org.h b/src/Resource/ORG/Zonbie.org.h similarity index 99% rename from src/Resource/ORG/ZONBIE.org.h rename to src/Resource/ORG/Zonbie.org.h index 3700876a..5c76f41c 100644 --- a/src/Resource/ORG/ZONBIE.org.h +++ b/src/Resource/ORG/Zonbie.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rZONBIE[0x14E2] = { +const unsigned char rZonbie[0x14E2] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x64, 0x00, 0x04, 0x04, 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x3C, 0x00, 0x60, 0x00, 0xE8, 0x03, 0x62, 0x00, 0x30, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0x54, 0x00, 0xE8, 0x03, 0x62, 0x00, 0xA0, 0x00, diff --git a/src/Resource/ORG/IRONH.org.h b/src/Resource/ORG/ironH.org.h similarity index 99% rename from src/Resource/ORG/IRONH.org.h rename to src/Resource/ORG/ironH.org.h index 197cc28c..5ab42350 100644 --- a/src/Resource/ORG/IRONH.org.h +++ b/src/Resource/ORG/ironH.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rIRONH[0x348A] = { +const unsigned char rironH[0x348A] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0x80, 0x00, 0x04, 0x03, 0x30, 0x00, 0x00, 0x00, 0x50, 0x01, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x62, 0x00, 0xDB, 0x00, 0xE8, 0x03, 0x62, 0x00, 0xDA, 0x00, 0xE8, 0x03, 0x5C, 0x00, 0xD4, 0x00, 0x20, 0x03, 0x63, 0x00, 0xDC, 0x00, diff --git a/src/Resource/ORG/QUIET.org.h b/src/Resource/ORG/quiet.org.h similarity index 99% rename from src/Resource/ORG/QUIET.org.h rename to src/Resource/ORG/quiet.org.h index c85048a9..3021da2b 100644 --- a/src/Resource/ORG/QUIET.org.h +++ b/src/Resource/ORG/quiet.org.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rQUIET[0x12A2] = { +const unsigned char rquiet[0x12A2] = { 0x4F, 0x72, 0x67, 0x2D, 0x30, 0x32, 0xC8, 0x00, 0x04, 0x04, 0x80, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x03, 0x00, 0x00, 0xD0, 0x00, 0x58, 0x02, 0x00, 0x00, 0x85, 0x00, 0xE8, 0x03, 0x07, 0x00, 0x8D, 0x00, 0xE8, 0x03, 0x00, 0x00, 0x00, 0x00, diff --git a/src/Resource/WAVE/WAVE100.h b/src/Resource/WAVE/Wave.dat.h similarity index 99% rename from src/Resource/WAVE/WAVE100.h rename to src/Resource/WAVE/Wave.dat.h index 207376ab..bc128f5f 100644 --- a/src/Resource/WAVE/WAVE100.h +++ b/src/Resource/WAVE/Wave.dat.h @@ -1,6 +1,6 @@ #pragma once -const unsigned char rWAVE100[0x6400] = { +const unsigned char rWave[0x6400] = { 0x00, 0xFE, 0xFC, 0xFB, 0xF9, 0xF8, 0xF5, 0xF3, 0xF0, 0xED, 0xEB, 0xE9, 0xE8, 0xE6, 0xE4, 0xE3, 0xE1, 0xE0, 0xDE, 0xDC, 0xDC, 0xDB, 0xDA, 0xD9, 0xD8, 0xD8, 0xD6, 0xD6, 0xD5, 0xD4, 0xD3, 0xD3, 0xD2, 0xD1, 0xD0, 0xD0, 0xD0, 0xCF, 0xCE, 0xCE, 0xCD, 0xCC, 0xCC, 0xCC, 0xCB, 0xCB, 0xCA, 0xCA, diff --git a/src/Sound.cpp b/src/Sound.cpp index b03a404e..2b4dfa37 100644 --- a/src/Sound.cpp +++ b/src/Sound.cpp @@ -20,7 +20,7 @@ #define STREAM_SIZE (FREQUENCY / 200) #endif -#define clamp(x, y, z) ((x > z) ? z : (x < y) ? y : x) +#define clamp(x, y, z) (((x) > (z)) ? (z) : ((x) < (y)) ? (y) : (x)) //Audio device SDL_AudioDeviceID audioDevice; diff --git a/src/Stage.cpp b/src/Stage.cpp index e69574ee..8fcf392b 100644 --- a/src/Stage.cpp +++ b/src/Stage.cpp @@ -234,7 +234,11 @@ const char *gMusicTable[42] = "ACCESS", "IRONH", "GRAND", +#ifdef NONPORTABLE + "Curly", // The vanilla game used the original filename instead of the internal 8.3 one +#else "CURLY", +#endif "OSIDE", "REQUIEM", "WANPAK2", diff --git a/src/Types.h b/src/Types.h index bf91c76d..30e91197 100644 --- a/src/Types.h +++ b/src/Types.h @@ -1,3 +1,3 @@ -#pragma once - -//This was originally some sort of POSIX standard thing? leftover from the linux port +#pragma once + +//This was originally some sort of POSIX standard thing? leftover from the linux port diff --git a/src/WindowsWrapper.h b/src/WindowsWrapper.h index 87b43c13..d00898e9 100644 --- a/src/WindowsWrapper.h +++ b/src/WindowsWrapper.h @@ -1,32 +1,32 @@ -#pragma once - -int rep_rand(); -void rep_srand(unsigned int seed); - -typedef int BOOL; - -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - -struct RECT -{ - union - { - int left; - int front; - }; - int top; - union - { - int right; - int back; - }; - int bottom; -}; - -bool SystemTask(); +#pragma once + +int rep_rand(); +void rep_srand(unsigned int seed); + +typedef int BOOL; + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +struct RECT +{ + union + { + int left; + int front; + }; + int top; + union + { + int right; + int back; + }; + int bottom; +}; + +bool SystemTask();