Hello community, here is the log from the commit of package bstone for openSUSE:Factory checked in at 2019-07-16 08:41:12 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/bstone (Old) and /work/SRC/openSUSE:Factory/.bstone.new.1887 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "bstone" Tue Jul 16 08:41:12 2019 rev:2 rq:715340 version:1.1.13 Changes: -------- --- /work/SRC/openSUSE:Factory/bstone/bstone.changes 2019-07-11 13:08:13.867001389 +0200 +++ /work/SRC/openSUSE:Factory/.bstone.new.1887/bstone.changes 2019-07-16 08:41:20.463036574 +0200 @@ -1,0 +2,7 @@ +Sun Jul 14 16:22:16 UTC 2019 - Martin Hauke <[email protected]> + +- Update to version 1.1.13 + * [AOG] Allow to warp to level beyond the 10th one. + * Critical error if switch connected to non-activable object. + +------------------------------------------------------------------- Old: ---- bstone-1.1.12.tar.gz New: ---- bstone-1.1.13.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ bstone.spec ++++++ --- /var/tmp/diff_new_pack.hkgo8F/_old 2019-07-16 08:41:21.115036792 +0200 +++ /var/tmp/diff_new_pack.hkgo8F/_new 2019-07-16 08:41:21.115036792 +0200 @@ -1,6 +1,7 @@ # # spec file for package bstone # +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2019, Martin Hauke <[email protected]> # # All modifications and additions to the file contributed by third parties @@ -12,11 +13,12 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # + Name: bstone -Version: 1.1.12 +Version: 1.1.13 Release: 0 Summary: A source port of Blake Stone License: GPL-2.0-or-later ++++++ bstone-1.1.12.tar.gz -> bstone-1.1.13.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/.gitattributes new/bstone-1.1.13/.gitattributes --- old/bstone-1.1.12/.gitattributes 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/.gitattributes 2019-07-14 18:17:38.000000000 +0200 @@ -1 +1,3 @@ * text=auto + +README.md merge=ours diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/CHANGELOG.md new/bstone-1.1.13/CHANGELOG.md --- old/bstone-1.1.12/CHANGELOG.md 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/CHANGELOG.md 2019-07-14 18:17:38.000000000 +0200 @@ -1,5 +1,11 @@ # BStone changelog +## [1.1.13] - 2019-07-11 +### Fixed +- [AOG] Allow to warp to level beyond the 10th one. +- Critical error if switch connected to non-activable object. + + ## [1.1.12] - 2019-02-09 ### Fixed - [CMake] Dependency on TestBigEndian. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/README-PSVITA.md new/bstone-1.1.13/README-PSVITA.md --- old/bstone-1.1.12/README-PSVITA.md 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/README-PSVITA.md 2019-07-14 18:17:38.000000000 +0200 @@ -1,27 +1,79 @@ bstone-vita =========== -Vita port of BStone. Allowing you to play Blake Stone natively on that handheld. +Vita port of BStone. Allowing you to play Blake Stone games natively on that handheld. Installing and Running ====================== -Place the game assets at the root of ux0:/data/bstone/ and install the .vpk +Install the `.vpk`. +Then, in the root of `ux0:/data/bstone/`, place the game assets, which consist, depending on the intended version, of the following files: -The full versions of Blake Stone: Aliens of Gold and Blake Stone: Planet Strike can both currently be obatined from the 3D Realms website in addition to Steam and GOG (in every case for much less than $29.95!) +| Shareware | Registered | Planet Strike | +|--------------|--------------|---------------| +| AUDIOHED.BS1 | AUDIOHED.BS6 | AUDIOHED.VSI | +| AUDIOT.BS1 | AUDIOT.BS6 | AUDIOT.VSI | +| | EANIM.BS6 | EANIM.VSI | +| | GANIM.BS6 | | +| IANIM.BS1 | IANIM.BS6 | IANIM.VSI | +| MAPHEAD.BS1 | MAPHEAD.BS6 | MAPHEAD.VSI | +| MAPTEMP.BS1 | MAPTEMP.BS6 | MAPTEMP.VSI | +| SANIM.BS1 | SANIM.BS6 | | +| VGADICT.BS1 | VGADICT.BS6 | VGADICT.VSI | +| VGAGRAPH.BS1 | VGAGRAPH.BS6 | VGAGRAPH.VSI | +| VGAHEAD.BS1 | VGAHEAD.BS6 | VGAHEAD.VSI | +| VSWAP.BS1 | VSWAP.BS6 | VSWAP.VSI | -Planet Strike crashes frequently (a little less often without sound), so is not recommended at this point in time. Number keys, right quote, equals, and dash are hardcoded to the touch screen for easy weapon switching, elevator use, etc. Joystick sensitivity (and hence maximum speed) is subject to change in future versions, feedback welcome (if really needed, you can edit the config file to change it) +The full versions of Blake Stone: Aliens of Gold and Blake Stone: Planet Strike each can currently be obatined from the 3D Realms website, and additionally from Steam and GOG. -Compiling -========= +Any combination of these three may coexist in the directory. Press the main "start" region to launch the game. Game version will be chosen in the following order of preference: Registered, Shareware, Planet Strike. Press the "Planet Strike" region to start Planet Strike regardless of the presence of other versions. + +## Important note +As of version 0.2, leaving music enabled may lead to intermittent crashing while playing. Set the "Background Music" option in the "Game Settings" menu to "None" in order to prevent this. As with other homebrew on the Vita, pressing the home button or going into sleep mode can lead to unwanted behavior upon returning to the still-running game. + +Playing the Game +================ + +## Controls + +L - use/open + +R - fire/accept + +× - about face + +○ - map or status window toggle + +△ - fire/accept + +□ - use/open -Install vitasdk and cmake, enter into the ./vita/ directory, and type +↑ - move forward -cmake . +↓ - move backward -followed by +← - turn left -cmake --build . +→ - turn right + +left stick - straight ahead and side-to-side motion + +right stick - turn + +Select - map or status window toggle + +Start - Menu/back + +Number keys are hard mapped to a column on the right side of the front touchscreen corresponding to the locations of the elevator buttons on the AOG level select screen. Useful for weapon selection in addition to operating the elevator. The left and right halves of the region occupied by the bottom HUD bar are mapped to "-", and "=", repectively, for controlling the map zoom level in Planet Strike. + +Compiling +========= + +Install vitasdk and cmake, enter into the `vita/` subdirectory, and type + +``` +cmake . && cmake --build . +``` Credits ======= @@ -32,4 +84,6 @@ The control functions were based on those written by fgsfdsfgs for the vita port of Chocolate Doom +Rinnegatamante for help with Live Area code + The makers of vitasdk & Henkaku for making this possible in the first place diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/3d_act2.cpp new/bstone-1.1.13/src/3d_act2.cpp --- old/bstone-1.1.12/src/3d_act2.cpp 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/src/3d_act2.cpp 2019-07-14 18:17:38.000000000 +0200 @@ -2825,23 +2825,28 @@ auto actor = ::actorat[barrier->coord.tilex][barrier->coord.tiley]; - if (!actor) + if (actor != nullptr) { - ::Quit("A barrier switch was not connect to any barriers."); - } + switch (actor->obclass) + { + case arc_barrierobj: + case post_barrierobj: + break; + default: + ::Quit("A barrier switch was not connect to any barriers."); + break; + } - switch (actor->obclass) + static_cast<void>(::CheckActor(actor, num)); + } + else { - case arc_barrierobj: - case post_barrierobj: - break; - - default: +// BBi Custom maps may have switches connected to non-activable objects. +#if 0 ::Quit("A barrier switch was not connect to any barriers."); - break; +#endif // 0 } - static_cast<void>(::CheckActor(actor, num)); } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/3d_agent.cpp new/bstone-1.1.13/src/3d_agent.cpp --- old/bstone-1.1.12/src/3d_agent.cpp 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/src/3d_agent.cpp 2019-07-14 18:17:38.000000000 +0200 @@ -2006,10 +2006,17 @@ status_message += std::to_string(gamestate.tokens); status_message.resize(default_msg_length, ' '); - if (gamestuff.level[gamestate.mapon + 1].locked) + const auto& assets_info = AssetsInfo{}; + + auto is_level_locked = true; + + if (::gamestate.mapon < (assets_info.get_levels_per_episode() - 1)) { - const auto& assets_info = AssetsInfo{}; + is_level_locked = ::gamestuff.level[::gamestate.mapon + 1].locked; + } + if (is_level_locked) + { switch (gamestate.mapon) { case 19: @@ -3710,7 +3717,9 @@ auto last_unlocked_map = 0; - for (int i = 1; i < MAPS_WITH_STATS; ++i) + const auto stats_levels_per_episode = assets_info.get_stats_levels_per_episode(); + + for (int i = 1; i < stats_levels_per_episode; ++i) { if (!::gamestuff.level[i].locked) { @@ -3972,7 +3981,7 @@ rt_code = -1; // ABORT LoadLocationText(static_cast<std::int16_t>( - gamestate.mapon + MAPS_PER_EPISODE * gamestate.episode)); + gamestate.mapon + (assets_info.get_levels_per_episode() * gamestate.episode))); break; } else if (Keyboard[ScanCode::sc_return] || buttonstate[bt_attack]) @@ -4327,7 +4336,10 @@ // by += 7; stats->overall_floor = floor; - for (loop = 0; loop < MAPS_WITH_STATS; loop++) + + const auto stats_levels_per_episode = assets_info.get_stats_levels_per_episode(); + + for (loop = 0; loop < stats_levels_per_episode; loop++) { total += 300; mission += gamestuff.level[loop].stats.overall_floor; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/3d_debug.cpp new/bstone-1.1.13/src/3d_debug.cpp --- old/bstone-1.1.12/src/3d_debug.cpp 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/src/3d_debug.cpp 2019-07-14 18:17:38.000000000 +0200 @@ -515,7 +515,10 @@ VW_UpdateScreen(); ::IN_Ack(); - for (auto i = 0; i < ::MAPS_WITH_STATS; ++i) + const auto& assets_info = AssetsInfo{}; + const auto stats_levels_per_episode = assets_info.get_stats_levels_per_episode(); + + for (auto i = 0; i < stats_levels_per_episode; ++i) { ::gamestuff.level[i].locked = false; } @@ -576,7 +579,7 @@ { const auto& assets_info = AssetsInfo{}; - const auto max_warp_level = (assets_info.is_aog() ? 10 : 23); + const auto max_warp_level = assets_info.get_levels_per_episode() - 1; const auto level = ::atoi(string); if (level > -1 && level <= max_warp_level) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/3d_def.h new/bstone-1.1.13/src/3d_def.h --- old/bstone-1.1.12/src/3d_def.h 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/src/3d_def.h 2019-07-14 18:17:38.000000000 +0200 @@ -27,6 +27,7 @@ #include <functional> +#include <string> #include <vector> #include "movie.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/3d_game.cpp new/bstone-1.1.13/src/3d_game.cpp --- old/bstone-1.1.12/src/3d_game.cpp 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/src/3d_game.cpp 2019-07-14 18:17:38.000000000 +0200 @@ -2408,9 +2408,11 @@ // // load the level // + const auto& assets_info = AssetsInfo{}; + CA_CacheMap(static_cast<std::int16_t>( - gamestate.mapon + MAPS_PER_EPISODE * gamestate.episode)); - mapon = static_cast<std::int16_t>(mapon - (gamestate.episode * MAPS_PER_EPISODE)); + gamestate.mapon + assets_info.get_levels_per_episode() * gamestate.episode)); + mapon = static_cast<std::int16_t>(mapon - (gamestate.episode * assets_info.get_levels_per_episode())); mapwidth = mapheaderseg[mapon]->width; mapheight = mapheaderseg[mapon]->height; @@ -2424,7 +2426,7 @@ fix_level_inplace(); LoadLocationText(static_cast<std::int16_t>( - gamestate.mapon + MAPS_PER_EPISODE * gamestate.episode)); + gamestate.mapon + (assets_info.get_levels_per_episode() * gamestate.episode))); // // copy the wall data to a data segment array @@ -2439,8 +2441,6 @@ ::wallheight.end(), 0); - const auto& assets_info = AssetsInfo{}; - map = mapsegs[0]; map2 = mapsegs[1]; for (y = 0; y < mapheight; y++) @@ -3000,8 +3000,7 @@ ::px = 13; } - if ((!assets_info.is_ps() && (gamestate.mapon % 10) == 0) || - (assets_info.is_ps() && gamestate.mapon > 19)) + if (assets_info.is_secret_level(::gamestate.mapon)) { ::ShPrint(" SECRET ", 0, false); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/3d_main.cpp new/bstone-1.1.13/src/3d_main.cpp --- old/bstone-1.1.12/src/3d_main.cpp 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/src/3d_main.cpp 2019-07-14 18:17:38.000000000 +0200 @@ -51,8 +51,7 @@ #include "bstone_text_writer.h" #ifdef __vita__ -#include <psp2/kernel/processmgr.h> -#include <psp2/power.h> +#include <vitasdk.h> #endif @@ -207,7 +206,7 @@ }; // dirangle // -// proejection variables +// projection variables // fixed focallength; int screenofs; @@ -8169,7 +8168,9 @@ ::startgame = true; - for (loop = 0; loop < MAPS_WITH_STATS; loop++) + const auto stats_levels_per_episode = assets_info.get_stats_levels_per_episode(); + + for (loop = 0; loop < stats_levels_per_episode; loop++) { ::gamestuff.old_levelinfo[loop].stats.overall_floor = 100; if (loop) @@ -9800,9 +9801,33 @@ scePowerSetBusClockFrequency(222); scePowerSetGpuClockFrequency(222); scePowerSetGpuXbarClockFrequency(166); + sceAppUtilInit(&(SceAppUtilInitParam){}, &(SceAppUtilBootParam){}); + SceAppUtilAppEventParam eventParam; + memset(&eventParam, 0, sizeof(SceAppUtilAppEventParam)); + sceAppUtilReceiveAppEvent(&eventParam); + + if (eventParam.type == 0x05){ + argc++; + const char* pargv[argc]; + for (int i = 0; i< argc - 1; i++) + { + pargv[i] = argv[i]; + } +#ifdef VITATEST + const char* newarg = "--cheats"; +#else + const char* newarg = "--ps"; +#endif + pargv[argc-1] = newarg; + ::g_args.initialize(argc, pargv); + } + else + { + ::g_args.initialize(argc, argv); + } +#else + ::g_args.initialize(argc, argv); #endif - - ::g_args.initialize(argc, argv); bstone::Log::initialize(); @@ -10204,8 +10229,11 @@ void fargametype::initialize() { - old_levelinfo.resize(MAPS_PER_EPISODE); - level.resize(MAPS_PER_EPISODE); + const auto& assets_info = AssetsInfo{}; + const auto level_count_per_episode = assets_info.get_levels_per_episode(); + + old_levelinfo.resize(level_count_per_episode); + level.resize(level_count_per_episode); } void fargametype::clear() @@ -10219,12 +10247,15 @@ void fargametype::archive( bstone::ArchiverPtr archiver) const { - for (int i = 0; i < MAPS_PER_EPISODE; ++i) + const auto& assets_info = AssetsInfo{}; + const auto levels_per_episode = assets_info.get_levels_per_episode(); + + for (int i = 0; i < levels_per_episode; ++i) { old_levelinfo[i].archive(archiver); } - for (int i = 0; i < MAPS_PER_EPISODE; ++i) + for (int i = 0; i < levels_per_episode; ++i) { level[i].archive(archiver); } @@ -10233,12 +10264,15 @@ void fargametype::unarchive( bstone::ArchiverPtr archiver) { - for (int i = 0; i < MAPS_PER_EPISODE; ++i) + const auto& assets_info = AssetsInfo{}; + const auto levels_per_episode = assets_info.get_levels_per_episode(); + + for (int i = 0; i < levels_per_episode; ++i) { old_levelinfo[i].unarchive(archiver); } - for (int i = 0; i < MAPS_PER_EPISODE; ++i) + for (int i = 0; i < levels_per_episode; ++i) { level[i].unarchive(archiver); } @@ -10422,12 +10456,7 @@ void sys_sleep_for( const int milliseconds) { -#ifdef __vita__ - sceKernelDelayThread(milliseconds); - // SDL_Delay(milliseconds); // todo: investigate this as alternative -#else ::SDL_Delay(milliseconds); -#endif } void sys_default_sleep_for() @@ -10437,8 +10466,12 @@ const std::string& get_version_string() { - static const std::string version = "1.1.12"; - return version; +#ifdef __vita__ + static const std::string version = "0.3"; +#else + static const std::string version = "1.1.13"; +#endif + return version; } const std::string& get_profile_dir() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/3d_play.cpp new/bstone-1.1.13/src/3d_play.cpp --- old/bstone-1.1.12/src/3d_play.cpp 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/src/3d_play.cpp 2019-07-14 18:17:38.000000000 +0200 @@ -1653,17 +1653,23 @@ if (!assets_info.is_ps()) { - musicchunk = songs[gamestate.mapon + gamestate.episode * MAPS_WITH_STATS]; + const auto level_count = assets_info.get_stats_levels_per_episode(); + const auto level_number = ::gamestate.mapon % level_count; + + musicchunk = ::songs[level_number + (::gamestate.episode * level_count)]; } else { - if (playstate == ex_victorious) + if (::playstate == ex_victorious) { musicchunk = FORTRESS_MUS; } else { - musicchunk = songs[gamestate.mapon + gamestate.episode * MAPS_PER_EPISODE]; + const auto level_count = assets_info.get_levels_per_episode(); + const auto map_number = ::gamestate.mapon % level_count; + + musicchunk = ::songs[map_number]; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/CMakeLists.txt new/bstone-1.1.13/src/CMakeLists.txt --- old/bstone-1.1.12/src/CMakeLists.txt 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/src/CMakeLists.txt 2019-07-14 18:17:38.000000000 +0200 @@ -125,10 +125,11 @@ # # Target link libraries. # -if (BSTONE_USE_STATIC_LINKING AND NOT WIN32) +if (BSTONE_USE_STATIC_LINKING AND (NOT WIN32 OR MINGW)) target_link_libraries( ${PROJECT_NAME} - -static + PRIVATE + -static ) endif () diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/bstone_memory_stream.cpp new/bstone-1.1.13/src/bstone_memory_stream.cpp --- old/bstone-1.1.12/src/bstone_memory_stream.cpp 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/src/bstone_memory_stream.cpp 2019-07-14 18:17:38.000000000 +0200 @@ -24,6 +24,7 @@ #include "bstone_memory_stream.h" #include <algorithm> +#include <memory> namespace bstone diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/id_ca.cpp new/bstone-1.1.13/src/id_ca.cpp --- old/bstone-1.1.12/src/id_ca.cpp 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/src/id_ca.cpp 2019-07-14 18:17:38.000000000 +0200 @@ -73,12 +73,6 @@ std::int16_t profilehandle, debughandle; -int NUM_EPISODES = 0; -int MAPS_PER_EPISODE = 0; -int MAPS_WITH_STATS = 0; - -int NUMMAPS = 0; - /* ============================================================================= @@ -1097,28 +1091,9 @@ { const auto& assets_info = AssetsInfo{}; - if (assets_info.is_aog_full()) - { - NUM_EPISODES = 6; - MAPS_PER_EPISODE = 15; - MAPS_WITH_STATS = 11; - } - else if (assets_info.is_aog_sw()) - { - NUM_EPISODES = 1; - MAPS_PER_EPISODE = 15; - MAPS_WITH_STATS = 11; - } - else if (assets_info.is_ps()) - { - NUM_EPISODES = 1; - MAPS_PER_EPISODE = 25; - MAPS_WITH_STATS = 20; - } - - NUMMAPS = NUM_EPISODES * MAPS_PER_EPISODE; + const auto total_level_count = assets_info.get_episode_count() * assets_info.get_levels_per_episode(); - mapheaderseg.resize(NUMMAPS); + mapheaderseg.resize(total_level_count); } bool ca_is_resource_exists( @@ -1313,6 +1288,10 @@ int AssetsInfo::gfx_header_offset_count_; std::string AssetsInfo::levels_hash_; bool AssetsInfo::are_modded_levels_; +int AssetsInfo::episode_count_; +int AssetsInfo::levels_per_episode_; +int AssetsInfo::stats_levels_per_episode_; +int AssetsInfo::total_levels_; AssetsVersion AssetsInfo::get_version() const @@ -1358,6 +1337,54 @@ gfx_header_offset_count_ = 0; break; } + + + { + if (is_aog_full()) + { + episode_count_ = 6; + } + else if (is_aog_sw() || is_ps()) + { + episode_count_ = 1; + } + else + { + ::Quit("No assets information."); + } + } + + { + if (is_aog()) + { + levels_per_episode_ = 15; + } + else if (is_ps()) + { + levels_per_episode_ = 24; + } + else + { + ::Quit("No assets information."); + } + } + + { + if (is_aog()) + { + stats_levels_per_episode_ = 11; + } + else if (is_ps()) + { + stats_levels_per_episode_ = 20; + } + else + { + ::Quit("No assets information."); + } + } + + total_levels_ = episode_count_ * levels_per_episode_; } const std::string& AssetsInfo::get_extension() const @@ -1501,6 +1528,45 @@ return version_ == AssetsVersion::ps; } +int AssetsInfo::get_episode_count() const +{ + return episode_count_; +} + +int AssetsInfo::get_levels_per_episode() const +{ + return levels_per_episode_; +} + +int AssetsInfo::get_stats_levels_per_episode() const +{ + return stats_levels_per_episode_; +} + +int AssetsInfo::get_total_levels() const +{ + return total_levels_; +} + +bool AssetsInfo::is_secret_level( + const int level_number) const +{ + if (is_aog()) + { + return level_number <= 0 || level_number >= 10; + } + else if (is_ps()) + { + return level_number > 19; + } + else + { + ::Quit("No assets information."); + + return false; + } +} + const std::string& Assets::get_audio_header_base_name() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/id_ca.h new/bstone-1.1.13/src/id_ca.h --- old/bstone-1.1.12/src/id_ca.h 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/src/id_ca.h 2019-07-14 18:17:38.000000000 +0200 @@ -31,12 +31,6 @@ #include "bstone_file_stream.h" -extern int NUM_EPISODES; -extern int MAPS_PER_EPISODE; -extern int MAPS_WITH_STATS; - -extern int NUMMAPS; - const int MAPPLANES = 2; @@ -166,23 +160,33 @@ bool is_ps() const; + int get_episode_count() const; + + int get_levels_per_episode() const; + + int get_stats_levels_per_episode() const; + + int get_total_levels() const; + + bool is_secret_level( + const int level_number) const; + private: static std::string empty_extension_; - static AssetsVersion version_; - static AssetsCRefString extension_; - static AssetsCRefStrings base_names_; - static AssetsBaseNameToHashMap base_name_to_hash_map_; - static std::string levels_hash_; - static int gfx_header_offset_count_; - static bool are_modded_levels_; + static int episode_count_; + static int levels_per_episode_; + static int stats_levels_per_episode_; + static int total_levels_; + static int min_secret_level_index_; + static int max_secret_level_index_; }; // AssetsInfo diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/id_in.h new/bstone-1.1.13/src/id_in.h --- old/bstone-1.1.12/src/id_in.h 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/src/id_in.h 2019-07-14 18:17:38.000000000 +0200 @@ -41,6 +41,13 @@ #include <cstdint> #include <bitset> +#ifdef __vita__ +#include "SDL.h" +void TranslateControllerEvent(SDL_Event *ev); +void TranslateTouchEvent(SDL_Event *ev); +void TranslateAnalogEvent(SDL_Event *ev); +#endif + #define MaxPlayers 4 #define MaxKbds 2 #define MaxJoys 2 @@ -390,12 +397,6 @@ extern std::uint16_t DemoOffset, DemoSize; // Function prototypes -#ifdef __vita__ -void TranslateControllerEvent(SDL_Event *ev); -void TranslateTouchEvent(SDL_Event *ev); -void TranslateAnalogEvent(SDL_Event *ev); -#endif - #define IN_KeyDown(code) (Keyboard[(code)]) #define IN_ClearKey(code) { Keyboard[code] = false; \ if (code == LastScan) { LastScan = ScanCode::sc_none; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/id_vl.cpp new/bstone-1.1.13/src/id_vl.cpp --- old/bstone-1.1.12/src/id_vl.cpp 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/src/id_vl.cpp 2019-07-14 18:17:38.000000000 +0200 @@ -672,7 +672,7 @@ ::filler_width /= 2 * ::vga_ref_height_4x3; #ifdef __vita__ - const auto upper_filler_height = (::screen_height * ref_top_bar_height) / ::vga_ref_height + 1; //todo: double check then just hardcode values + const auto upper_filler_height = (::screen_height * ref_top_bar_height) / ::vga_ref_height + 1; const auto lower_filler_height = (::screen_height * ref_bottom_bar_height) / ::vga_ref_height + 1; #else const auto upper_filler_height = (::screen_height * ref_top_bar_height) / ::vga_ref_height; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/jm_free.cpp new/bstone-1.1.13/src/jm_free.cpp --- old/bstone-1.1.12/src/jm_free.cpp 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/src/jm_free.cpp 2019-07-14 18:17:38.000000000 +0200 @@ -786,7 +786,11 @@ // // load all map header // - for (i = 0; i < NUMMAPS; ++i) + const auto& assets_info = AssetsInfo{}; + + const auto total_levels = assets_info.get_total_levels(); + + for (i = 0; i < total_levels; ++i) { pos = header.headeroffsets[i]; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/vita/CMakeLists.txt new/bstone-1.1.13/src/vita/CMakeLists.txt --- old/bstone-1.1.12/src/vita/CMakeLists.txt 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/src/vita/CMakeLists.txt 2019-07-14 18:17:38.000000000 +0200 @@ -12,17 +12,22 @@ project(${SHORT_NAME}) include("${VITASDK}/share/vita.cmake" REQUIRED) -set(VITA_APP_NAME "bstone-vita") +set(VITA_APP_NAME "bstone") set(VITA_TITLEID "BSTONE012") +set(VITA_VERSION "00.30") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") +set(BSTONE_FLAGS "-Wall -fpermissive -Ofast -flto -funroll-loops -fvariable-expansion-in-unroller") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +option(VITA_TEST "Vita debug mode" OFF) -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -finline-functions -funswitch-loops -ftree-vectorize -fipa-cp-clone -floop-unroll-and-jam -ftree-loop-vectorize -ftree-loop-distribution -ffast-math -fgcse-after-reload") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -finline-functions -funswitch-loops -ftree-vectorize -fipa-cp-clone -floop-unroll-and-jam -ftree-loop-vectorize -ftree-loop-distribution -ffast-math -fgcse-after-reload") +if(VITA_TEST) + add_definitions(-DVITATEST) +# set(BSTONE_FLAGS "-Wall -fpermissive -g -Og") + set(VITA_APP_NAME "bstone-t") +endif() + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11 ${BSTONE_FLAGS}") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 ${BSTONE_FLAGS}") include_directories( "../dosbox" @@ -33,8 +38,6 @@ ${CMAKE_CURRENT_BINARY_DIR} ) -set(BSTONE_PCH_BASE_NAME "bstone_precompiled") - set( BSTONE_HEADERS "../dosbox/adlib.h" @@ -74,6 +77,7 @@ "../bstone_opl2.h" "../bstone_ref_values.h" "../bstone_pcm_decoder.h" + "../bstone_precompiled.h" "../bstone_ps_fizzle_fx.h" "../bstone_scope_guard.h" "../bstone_sha1.h" @@ -99,7 +103,6 @@ "../jm_tp.h" "../jm_vl.h" "../movie.h" - "../${BSTONE_PCH_BASE_NAME}.h" ) set( @@ -122,7 +125,7 @@ "../bstone_adlib_decoder.cpp" "../bstone_adlib_music_decoder.cpp" "../bstone_adlib_sfx_decoder.cpp" - "../bstone_archiver.cpp" + "../bstone_archiver_impl.cpp" "../bstone_audio_decoder.cpp" "../bstone_audio_mixer.cpp" "../bstone_binary_reader.cpp" @@ -140,6 +143,7 @@ "../bstone_memory_stream.cpp" "../bstone_opl2.cpp" "../bstone_pcm_decoder.cpp" + "../bstone_precompiled.cpp" "../bstone_ps_fizzle_fx.cpp" "../bstone_sha1.cpp" "../bstone_sprite.cpp" @@ -167,7 +171,6 @@ "../markhack.cpp" "../movie.cpp" "../scale.cpp" - "../${BSTONE_PCH_BASE_NAME}.cpp" "../stub.cpp" "../vgapal.cpp" "vita_input.cpp" @@ -191,7 +194,8 @@ SceHid_stub m ScePower_stub -# pthread + SceAppUtil_stub + pthread ) vita_create_self(${SHORT_NAME}.self ${SHORT_NAME}) @@ -201,5 +205,6 @@ FILE sce_sys/icon0.png sce_sys/icon0.png FILE sce_sys/livearea/contents/bg.png sce_sys/livearea/contents/bg.png FILE sce_sys/livearea/contents/startup.png sce_sys/livearea/contents/startup.png + FILE sce_sys/livearea/contents/ps.png sce_sys/livearea/contents/ps.png FILE sce_sys/livearea/contents/template.xml sce_sys/livearea/contents/template.xml ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/vita/Issues.md new/bstone-1.1.13/src/vita/Issues.md --- old/bstone-1.1.12/src/vita/Issues.md 1970-01-01 01:00:00.000000000 +0100 +++ new/bstone-1.1.13/src/vita/Issues.md 2019-07-14 18:17:38.000000000 +0200 @@ -0,0 +1,43 @@ +## Issues: + +### High Priority + +* Make analog movement speed independent of framerate + +### Medium Priority + +* Crashes sporadically when music is enabled +* In-prompt buttons- use x,o + +### Low Priority + +* Make 4:3 mode work properly +* In-game control customization for Vita + +## Future Ideas: + +* Create prev/next weapon keys + +## Changes: + +### 0.3 +* Update source to upstream version 1.1.12 +* No fadein tearing +* In elevator, fade out from viewport instead of messagebox + +### 0.2 +* L is now "use"; -/= in the front +* Joystick sesitivity adjusted +* Performance improvement (>20%) +* HUD no longer drawn over in various circumstances +* Live Area assets tweaked, -ps shortcut added +* Heartbeat on by default + +### 0.1.1 +* Elevator button touch location in ui_stretch mode + +### 0.1 +* Merge in changes from mainline develop branch up to the current state + +### 0.0.1 +* Initial port to PS Vita Binary files old/bstone-1.1.12/src/vita/sce_sys/icon0.png and new/bstone-1.1.13/src/vita/sce_sys/icon0.png differ Binary files old/bstone-1.1.12/src/vita/sce_sys/livearea/contents/ps.png and new/bstone-1.1.13/src/vita/sce_sys/livearea/contents/ps.png differ Binary files old/bstone-1.1.12/src/vita/sce_sys/livearea/contents/startup.png and new/bstone-1.1.13/src/vita/sce_sys/livearea/contents/startup.png differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/vita/sce_sys/livearea/contents/template.xml new/bstone-1.1.13/src/vita/sce_sys/livearea/contents/template.xml --- old/bstone-1.1.12/src/vita/sce_sys/livearea/contents/template.xml 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/src/vita/sce_sys/livearea/contents/template.xml 2019-07-14 18:17:38.000000000 +0200 @@ -8,4 +8,14 @@ <gate> <startup-image>startup.png</startup-image> </gate> + + <frame id='frame7' multi='o' autoflip='3' > + <liveitem> + <target>psla:--ps</target> + <image>ps.png</image> + <text origin="background" align="right" y="-250" margin-right="14"> + <str size="14" shadow="on" color="#ffffff">0.3</str> + </text> + </liveitem> + </frame> </livearea> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/bstone-1.1.12/src/vita/vita_input.cpp new/bstone-1.1.13/src/vita/vita_input.cpp --- old/bstone-1.1.12/src/vita/vita_input.cpp 2019-02-09 17:16:45.000000000 +0100 +++ new/bstone-1.1.13/src/vita/vita_input.cpp 2019-07-14 18:17:38.000000000 +0200 @@ -24,13 +24,12 @@ extern int in_mouse_dx; extern int in_mouse_dy; extern int control2x; -extern int vid_is_ui_stretched; +extern bool vid_is_ui_stretched; void TranslateControllerEvent(SDL_Event *ev) { int btn; SDL_Event ev_new; - int in_prompt; static const struct { SDL_Keycode sym; @@ -38,10 +37,14 @@ } v_keymap[] = { { SDLK_y, SDL_SCANCODE_Y }, // Triangle - { SDLK_LALT, SDL_SCANCODE_LALT }, // Circle +#ifdef VITATEST + { SDLK_BACKSPACE, SDL_SCANCODE_BACKSPACE}, +#else + { SDLK_TAB, SDL_SCANCODE_TAB }, // Circle +#endif { SDLK_RETURN, SDL_SCANCODE_RETURN }, // Cross { SDLK_SPACE, SDL_SCANCODE_SPACE }, // Square - { SDLK_TAB, SDL_SCANCODE_TAB }, // L Trigger + { SDLK_SPACE, SDL_SCANCODE_SPACE }, // L Trigger { SDLK_y, SDL_SCANCODE_Y }, // R Trigger { SDLK_DOWN, SDL_SCANCODE_DOWN }, // D-Down { SDLK_LEFT, SDL_SCANCODE_LEFT }, // D-Left @@ -52,34 +55,12 @@ }; memset(&ev_new, 0, sizeof(SDL_Event)); - btn = ev->jbutton.button; - in_prompt = 0; // TODO-- for now just use "y" for fire button - if (in_prompt) - { - if (btn == 1 || btn == 10) - { - ev_new.key.keysym.sym = SDLK_n; - ev_new.key.keysym.scancode = SDL_SCANCODE_N; - } - else if (btn == 2 || btn == 11) - { - ev_new.key.keysym.sym = SDLK_y; - ev_new.key.keysym.scancode = SDL_SCANCODE_Y; - } - else - { - return; - } - } - else - { - if (btn < 0 || btn > 11) - return; - ev_new.key.keysym.sym = v_keymap[btn].sym; - ev_new.key.keysym.scancode = v_keymap[btn].scan; - } + if (btn < 0 || btn > 11) + return; + ev_new.key.keysym.sym = v_keymap[btn].sym; + ev_new.key.keysym.scancode = v_keymap[btn].scan; if (ev->type == SDL_JOYBUTTONDOWN) { @@ -111,14 +92,13 @@ w *= 0.75F ; // (4/3) / (16/9) fingerx += 0.166667F; // (1/6), compensates for 4:3 mode being centered on the vita's screen, as opposed to left flushed } + // front touch if (ev->tfinger.touchId == 0) { - // front touch - - if (fingerx > 660.0F / w && fingerx < 860.0F / w) + if (fingerx > 660.0F / w && fingerx < 860.0F / w) //column containing elevator buttons { - if (fingery > 50.0F / h && fingery <= 140.0F / h) + if (fingery > 50.0F / h && fingery <= 139.0F / h) //9,10 50-140 { if (fingerx < m/w ) @@ -133,7 +113,7 @@ } } //7,8 140-194 - if (fingery > 140.0F / h && fingery <= 194.0F / h) + if (fingery > 139.0F / h && fingery <= 194.0F / h) { if (fingerx < m/w ) { @@ -147,7 +127,7 @@ } } //5,6 194-249 - if (fingery > 194.0F / h && fingery <= 249.0F / h) + if (fingery > 194.0F / h && fingery <= 249.0F / h) { if (fingerx < m/w ) { @@ -161,7 +141,7 @@ } } //3,4 249-303 - if (fingery > 249.0F / h && fingery <= 303.0F / h) + if (fingery > 249.0F / h && fingery <= 304.0F / h) { if (fingerx < m/w ) { @@ -175,7 +155,7 @@ } } //1,2 303-410 - if (fingery > 303.0F / h && fingery <= 410.0F / h) + if (fingery > 304.0F / h && fingery <= 410.0F / h) { if (fingerx < m/w ) { @@ -189,27 +169,32 @@ } } } - else //outside of the column { - ev_new.key.keysym.sym = SDLK_BACKQUOTE; - ev_new.key.keysym.scancode = SDL_SCANCODE_GRAVE; +#ifdef VITATEST + ev_new.key.keysym.sym = SDLK_w; + ev_new.key.keysym.scancode = SDL_SCANCODE_W; +#endif + } + if (fingery > 410.0F / h) + { + if (fingerx > 480.0F / w) + { + ev_new.key.keysym.sym = SDLK_EQUALS; + ev_new.key.keysym.scancode = SDL_SCANCODE_EQUALS; + } + else + { + ev_new.key.keysym.sym = SDLK_MINUS; + ev_new.key.keysym.scancode = SDL_SCANCODE_MINUS; + } } + } else { // back touch - if (fingerx > 480.0F / w) - { - ev_new.key.keysym.sym = SDLK_EQUALS; - ev_new.key.keysym.scancode = SDL_SCANCODE_EQUALS; - } - else - { - ev_new.key.keysym.sym = SDLK_MINUS; - ev_new.key.keysym.scancode = SDL_SCANCODE_MINUS; - } } if (ev->type == SDL_FINGERDOWN) @@ -235,17 +220,17 @@ { delta = 0; } - // denominaors in the below expressiona estimated empirically - if (ev->jaxis.axis == 0) + // denominators in the below expressions estimated empirically + if (ev->jaxis.axis == 0) //side-to-side { - control2x = delta / 400; + control2x = delta / 360; } - else if (ev->jaxis.axis == 2) + else if (ev->jaxis.axis == 2) //turn { - in_mouse_dx = delta / 600 ; + in_mouse_dx = delta / 500 ; } - else if (ev->jaxis.axis == 1) + else if (ev->jaxis.axis == 1) //forward { - in_mouse_dy = delta / 1900 ; + in_mouse_dy = delta / 1860 ; //2100 slower than key /2050 faster /2070 a bit slower? } }
