Added some gba-specific and nds-specific docs

This commit is contained in:
Bobby Youstra 2021-07-20 16:12:07 -07:00
parent de7801e886
commit ac457d3af0
No known key found for this signature in database
GPG Key ID: 46665F9BA88E45C5
11 changed files with 195 additions and 24 deletions

View File

@ -4,6 +4,7 @@ stages:
- test-NDS
- deploy-docs
- deploy-development
- deploy-release
image: insightgit/morpheus
@ -353,7 +354,31 @@ deploy_dev:
affine-test-gba, gba-library, nds-library]
script:
- chmod +x buildtools/generate_cd_release/generate_cd_release.sh
- buildtools/generate_cd_release/generate_cd_release.sh
- buildtools/generate_cd_release/generate_cd_release.sh dev
environment:
name: dev
url: https://insighted.itch.io/morpheus
rules:
- if: '$CI_COMMIT_BRANCH != "master"'
deploy_release:
stage: deploy-release
needs: [ pages, save-test-nds, tileset-test-nds, tileset-test-gba,
streaming-background-test-nds, streaming-background-test-gba,
flash-test-gba, sram-test-gba, serial-test-gba, maxmod-test-nds,
maxmod-test-gba, input-test-nds, input-test-gba, gfx-effects-test-nds,
gfx-effects-test-gba, extended-palette-test-nds, custom-font-nds,
custom-font-gba, animation-test-nds, animation-test-gba, affine-test-nds,
affine-test-gba, gba-library, nds-library ]
script:
- chmod +x buildtools/generate_cd_release/generate_cd_release.sh
- buildtools/generate_cd_release/generate_cd_release.sh release
environment:
name: dev
url: https://insighted.itch.io/morpheus
release:
name: 'Release $CI_COMMIT_TAG'
description: 'Morpheus release build'
tag_name: '$CI_COMMIT_TAG'
rules:
- if: '$CI_COMMIT_BRANCH == "master"'

View File

@ -11,20 +11,23 @@ chmod +x butler
# Creating release package directory structure
mkdir morpheus-release/
mkdir morpheus-release/cmake
mkdir morpheus-release/docs
mkdir morpheus-release/buildtools
mkdir morpheus-release/include
mkdir morpheus-release/lib
mkdir morpheus-release/tests
mkdir morpheus-release/tests/src
mkdir morpheus-release/tests/gba-bin
mkdir morpheus-release/tests/nds-bin
# Copy files and directories to release package
cp -R cmake/* morpheus-release/cmake
cp -R include/* morpheus-release/include
cp -R buildtools/* morpheus-release/buildtools
cp -R public/* morpheus-release/docs
cp -R tests/* morpheus-release/tests
cp -R tests/* morpheus-release/tests/src
cp -R lib/* morpheus-release/lib
cp build/*.nds morpheus-release/tests/nds-bin
cp build/*.gba morpheus-release/tests/gba-bin
@ -37,6 +40,6 @@ rm -rf morpheus-release/buildtools/generate_cd_release
rm -rf morpheus-release/buildtools/Dockerfile
# Push release package to itch.io
./butler push morpheus-release insighted/Morpheus:universal-dev
./butler push morpheus-release insighted/Morpheus:universal-"$1"
echo "Launch Successful!"

View File

@ -24,15 +24,26 @@ is needed. While the scripts have only been tested on Python 3.8 and Python
into trouble with 3.6 or 3.7, install one of the tested versions).
You can install Python from `The Python Software Foundation's website
<https://www.python.org/downloads/>`_ or through your preferred package
manager.
manager (sudo apt install python3 on Debian/Ubuntu).
----------------
Installing CMake
----------------
For building Morpheus projects, we strongly recommend that you use CMake
as it is the easiest and most cross-platform way to build your Morpheus
projects. You can install CMake from
`cmake.org <https://cmake.org/download/>`_ or through your preferred
package manager (sudo apt install cmake on Debian/Ubuntu).
-------------------
Installing Morpheus
-------------------
Now that the toolchain and Python 3 has been installed, we can
Now that the toolchain, CMake, and Python 3 has been installed, we can now
install Morpheus! Go
---------------------------
Creating your first project
---------------------------

View File

@ -325,10 +325,17 @@ namespace morpheus {
/// shouldn't be called be manually.
void activate_on_target_sprite_base();
protected:
/// \return The target SpriteBase to use when applying this
/// AnimationFrame's copyable attributes.
core::gfx::SpriteBase *get_target_sprite() const {
return m_target_sprite;
}
/// Activates a certain copyable AnimationFrame attribute on the
/// target SpriteBase in a platform-specific way upon this
/// AnimationFrame becoming fully active.
/// \param copy_option The AnimationFrameCopyOption for a
/// specific AnimationFrame attribute.
virtual void activate_on_target_sprite(AnimationFrameCopyOption copy_option) = 0;
private:
std::unordered_set<AnimationFrameCopyOption> m_animation_frame_copy_options;

View File

@ -12,6 +12,18 @@ namespace morpheus {
namespace audio {
class GbaMaxModMusic : public morpheus::core::audio::MaxModMusic {
public:
/// Constructs a GbaMaxModMusic object for MaxMod module
/// playback and optionally initializes the MaxMod library
/// with a sound bank and number of audio channels in the
/// range [0-4]. Note that you must initialize MaxMod once
/// using the second and third arguments for successful
/// playback.
/// \param sound_bank_ref_num Reference number for the module
/// this GbaMaxModMusic will play.
/// \param sound_bank The optional void pointer to the sound bank
/// that all future MaxMod API usages will use.
/// \param num_of_channels The optional number of audio channels
/// that all future MaxMod sfx/modules will play on.
GbaMaxModMusic(int sound_bank_ref_num, void *sound_bank = nullptr,
unsigned char num_of_channels = -1) :
morpheus::core::audio::MaxModMusic(sound_bank_ref_num) {
@ -20,10 +32,17 @@ namespace morpheus {
}
}
/// Destructs the GbaMaxModMusic object.
virtual ~GbaMaxModMusic() = default;
protected:
void load_music() override {}
};
/// \class morpheus::gba::audio::GbaMaxModMusic
/// The Game Boy Advance implementation of
/// morpheus::core::audio::MaxModMusic. For more about this class's
/// behavior, see the aforementioned parent class.
}
}
}

View File

@ -12,6 +12,18 @@ namespace morpheus {
namespace audio {
class GbaMaxModSfx : public core::audio::MaxModSfx {
public:
/// Constructs a GbaMaxModSfx object for MaxMod sound effect
/// (sfx) playback and optionally initializes the MaxMod library
/// with a sound bank and number of audio channels in the
/// range [0-4]. Note that you must initialize MaxMod once
/// using the second and third arguments for successful
/// playback.
/// \param sound_bank_ref_num Reference number for the sfx
/// this GbaMaxModSfx will play.
/// \param sound_bank The optional void pointer to the sound bank
/// that all future MaxMod API usages will use.
/// \param num_of_channels The optional number of audio channels
/// that all future MaxMod sfx/modules will play on.
GbaMaxModSfx(int sound_bank_ref_num, void *sound_bank = nullptr,
int num_of_channels = -1) :
morpheus::core::audio::MaxModSfx(sound_bank_ref_num) {
@ -20,10 +32,16 @@ namespace morpheus {
}
}
/// Destructs the GbaMaxModSfx object.
virtual ~GbaMaxModSfx() = default;
protected:
void load_effect() override {}
};
/// \class morpheus::gba::audio::GbaMaxModSfx
/// The Game Boy Advance implementation of
/// morpheus::core::audio::MaxModSfx. For more about this class's
/// behavior, see the aforementioned parent class.
}
}
}

View File

@ -13,20 +13,50 @@ namespace morpheus {
class Sprite;
enum class GbaAnimationFrameCopyOption {
TILE_ID = static_cast<int>(core::gfx::AnimationFrameCopyOption::LAST)
TILE_ID = static_cast<int>(core::gfx::AnimationFrameCopyOption::LAST) ///< GBA
///< tile
///< id
///< Sprite
///< attribute
};
/// \enum morpheus::gba::gfx::GbaAnimationFrameCopyOption
/// An enum class psuedo-inherited from
/// morpheus::core::gfx::AnimationFrameCopyOption that provides
/// copy options for GBA-specific Sprite attributes.
class GbaAnimationFrame : public core::gfx::AnimationFrame {
public:
/// Constructs a GbaAnimationFrame for a certain Sprite and
/// optionally copies attributes from a previous
/// GbaAnimationFrame.
/// \param target_sprite The Sprite for this GbaAnimationFrame
/// to act on.
/// \param from_animation_frame The optional previous
/// GbaAnimationFrame to copy the attributes from on to this
/// GbaAnimationFrame.
explicit GbaAnimationFrame(gba::gfx::Sprite *target_sprite,
GbaAnimationFrame *from_animation_frame = nullptr);
/// Destructs the GbaAnimationFrame object.
~GbaAnimationFrame() override = default;
/// \return The GBA-specific tile id attribute for this
/// GbaAnimationFrame.
unsigned int get_tile_id() const {
return m_tile_id;
}
/// Sets the GBA-specific tile id used by this GbaAnimationFrame
/// and that is applied to the Sprite if enable_copy is set
/// to true.
/// \param tile_id The GBA-specific tile id to apply
/// \param enable_copy Whether to enable copying this attribute
/// to the Sprite upon this AnimationFrame becoming active
/// \param smoothing_mode The
/// morpheus::core::gfx::AnimationSmoothingMode to smooth
/// the transition from this GbaAnimationFrame attribute to the
/// next GbaAnimationFrame attribute.
void set_tile_id(const unsigned int tile_id,
core::gfx::AnimationSmoothingMode smoothing_mode =
core::gfx::AnimationSmoothingMode::NONE,
@ -44,6 +74,12 @@ namespace morpheus {
private:
unsigned int m_tile_id;
};
/// \class morpheus::gba::gfx::GbaAnimationFrame
/// The Game Boy Advance implementation of
/// morpheus::core::gfx::AnimationFrame, with animation support for
/// GBA-specific tile ids. For more about this class's
/// behavior, see the aforementioned parent class.
}
}
}

View File

@ -12,6 +12,14 @@ namespace morpheus {
namespace audio {
class NdsMaxModMusic : public morpheus::core::audio::MaxModMusic {
public:
/// Constructs an NdsMaxModMusic object for MaxMod module
/// playback and optionally initializes the MaxMod library
/// with a sound bank. Note that you must initialize MaxMod
/// once using the second argument for successful playback.
/// \param sound_bank_ref_num Reference number for the module
/// this NdsMaxModMusic will play.
/// \param sound_bank The optional void pointer to the sound bank
/// that all future MaxMod API usages will use.
NdsMaxModMusic(int sound_bank_ref_num, void *sound_bank = nullptr) :
morpheus::core::audio::MaxModMusic(sound_bank_ref_num) {
if(sound_bank != nullptr) {
@ -19,6 +27,7 @@ namespace morpheus {
}
}
/// Destructs the NdsMaxModMusic object.
virtual ~NdsMaxModMusic() {
if(is_loaded()) {
mmUnload(get_sound_bank_ref_num());
@ -29,6 +38,11 @@ namespace morpheus {
mmLoad(get_sound_bank_ref_num());
}
};
/// \class morpheus::gba::audio::NdsMaxModMusic
/// The Nintendo DS implementation of
/// morpheus::core::audio::MaxModMusic. For more about this class's
/// behavior, see the aforementioned parent class.
}
}
}

View File

@ -12,12 +12,22 @@ namespace morpheus {
namespace audio {
class NdsMaxModSfx : public core::audio::MaxModSfx {
public:
/// Constructs an NdsMaxModSfx object for MaxMod sound
/// effect (sfx) playback and optionally initializes the
/// MaxMod library with a sound bank.
/// Note that you must initialize MaxMod
/// once using the second argument for successful playback.
/// \param sound_bank_ref_num Reference number for the sfx
/// this NdsMaxModSfx will play.
/// \param sound_bank The optional void pointer to the sound bank
/// that all future MaxMod API usages will use.
NdsMaxModSfx(int sound_bank_ref_num, void *sound_bank) : core::audio::MaxModSfx(sound_bank_ref_num) {
if(sound_bank != nullptr) {
mmInitDefaultMem(sound_bank);
}
}
/// Destructs the NdsMaxModSfx object.
virtual ~NdsMaxModSfx() {
mmUnloadEffect(get_sound_bank_ref_num());
}
@ -26,6 +36,11 @@ namespace morpheus {
mmLoadEffect(get_sound_bank_ref_num());
}
};
/// \class morpheus::gba::audio::NdsMaxModSfx
/// The Nintendo DS implementation of
/// morpheus::core::audio::MaxModSfx. For more about this class's
/// behavior, see the aforementioned parent class.
}
}
}

View File

@ -13,20 +13,52 @@ namespace morpheus {
class Sprite;
enum class NdsAnimationFrameCopyOption {
GFX_PTR = static_cast<int>(core::gfx::AnimationFrameCopyOption::LAST)
GFX_PTR = static_cast<int>(core::gfx::AnimationFrameCopyOption::LAST) ///< NDS
///< tile
///< graphics
///< pointer
///< Sprite
///< attribute
};
/// \enum morpheus::nds::gfx::NdsAnimationFrameCopyOption
/// An enum class psuedo-inherited from
/// morpheus::core::gfx::AnimationFrameCopyOption that provides
/// copy options for NDS-specific Sprite attributes.
class NdsAnimationFrame : public core::gfx::AnimationFrame {
public:
/// Constructs an NdsAnimationFrame for a certain Sprite and
/// optionally copies attributes from a previous
/// NdsAnimationFrame.
/// \param target_sprite The Sprite for this NdsAnimationFrame
/// to act on.
/// \param from_animation_frame The optional previous
/// NdsAnimationFrame to copy the attributes from on to this
/// NdsAnimationFrame.
explicit NdsAnimationFrame(nds::gfx::Sprite *target_sprite,
NdsAnimationFrame *from_animation_frame = nullptr);
/// Deconstructs the NdsAnimationFrame object.
virtual ~NdsAnimationFrame();
/// \return The NDS-specific tile graphics (gfx) pointer for
/// this NdsAnimationFrame.
uint16_t *get_gfx_pointer() const {
return m_gfx_pointer;
}
/// Sets the NDS-specific tile id used by this NdsAnimationFrame
/// and that is applied to the Sprite if enable_copy is set
/// to true.
/// \param tile_id The NDS-specific tile graphics pointer to
/// apply
/// \param enable_copy Whether to enable copying this attribute
/// to the Sprite upon this AnimationFrame becoming active
/// \param smoothing_mode The
/// morpheus::core::gfx::AnimationSmoothingMode to smooth
/// the transition from this NdsAnimationFrame attribute to the
/// next NdsAnimationFrame attribute.
void set_gfx_pointer(uint16_t *gfx_pointer,
core::gfx::AnimationSmoothingMode smoothing_mode =
core::gfx::AnimationSmoothingMode::NONE,
@ -44,6 +76,12 @@ namespace morpheus {
private:
uint16_t *m_gfx_pointer = nullptr;
};
/// \class morpheus::nds::gfx::NdsAnimationFrame
/// The Nintendo DS implementation of
/// morpheus::core::gfx::AnimationFrame, with animation support for
/// NDS-specific tile ids. For more about this class's
/// behavior, see the aforementioned parent class.
}
}
}

View File

@ -186,6 +186,8 @@ private:
int main() {
std::shared_ptr<morpheus::core::MainLoop> main_loop(morpheus::utils::construct_appropriate_main_loop());
// Initializes an Affine Background and Sprite (however the Background is currently unused as working
// affine background support is not present)
std::shared_ptr<morpheus::core::gfx::TiledBackgroundBase> base_background(morpheus::utils::
construct_appropriate_tiled_background_8bpp(true, 2, nullptr, nullptr, main_loop.get(),
1, 1));
@ -211,21 +213,6 @@ int main() {
morpheus::core::gfx::SpriteSize::SIZE_32X32);
#endif
/*base_background->load_from_array(region_map_affine_128Tiles, region_map_affine_128TilesLen,
region_map_affine_128Pal, region_map_affine_128PalLen,
region_map_affine_128Map, region_map_affine_128MapLen,
morpheus::core::gfx::TiledBackgroundSize::BG_AFFINE_128x128);*/
/*base_background->load_from_array(region_map_affineTiles, region_map_affineTilesLen,
region_map_affinePal, region_map_affinePalLen,
region_map_affineMap, region_map_affineMapLen,
morpheus::core::gfx::TiledBackgroundSize::BG_AFFINE_32x32);*/
/*base_background->load_from_array(region_map_affine2Tiles, region_map_affine2TilesLen,
region_map_affine2Pal, region_map_affine2PalLen,
region_map_affine2Map, region_map_affine2MapLen,
morpheus::core::gfx::TiledBackgroundSize::BG_AFFINE_32x32);*/
base_sprite->set_position(64, 64);
base_sprite->set_affine_index(1);
@ -238,7 +225,5 @@ int main() {
main_loop->add_sprite(base_sprite);
//info_text->print_at_pos("hello", morpheus::core::gfx::Vector2(32, 32));
main_loop->game_loop();
}