Skip to content
Permalink
Browse files

NDS game runs again, without music

  • Loading branch information...
richelbilderbeek committed Dec 30, 2017
1 parent c1b0821 commit cf4bcc4b26bc3ab2a1a8decb5947b4edd1263751
Showing with 13 additions and 10 deletions.
  1. +1 −2 Classes/helper.cpp
  2. +1 −1 Classes/helper.h
  3. +4 −0 Nds/source/main.cpp
  4. +6 −6 Nds/source/ndsgamedialog.cpp
  5. +1 −1 Nds/source/ndsgamedialog.h
@@ -405,9 +405,8 @@ std::string Helper::Trim(const std::string& s) const
return s.substr(pos_begin,pos_end-pos_begin+1);
}

void Helper::Wait(const double n_secs) const noexcept
void Helper::Wait(const double n_secs, const bool verbose) const noexcept
{
const bool verbose{true};
if (verbose) { std::clog << __func__ << std::endl; }
#ifndef ARM9
const auto t = std::chrono::high_resolution_clock::now();
@@ -53,7 +53,7 @@ struct Helper
//From http://www.richelbilderbeek.nl/CppTrim.htm
std::string Trim(const std::string& s) const;

void Wait(const double n_secs) const noexcept;
void Wait(const double n_secs, const bool verbose = false) const noexcept;
};

#endif // HELPER_H
@@ -29,12 +29,16 @@ int main(int argc, char* argv[0])
std::clog << "Error: " << e.what() << '\n';
std::cerr << "Error: " << e.what() << '\n';
Helper().Cout(e.what());
for (int i=0; i!=1000; ++i) swiWaitForVBlank();
return 1;
}
catch (...)
{
fprintf(stderr, "Unknown error");
std::cout << "Unknown error\n";
std::clog << "Unknown error\n";
std::cerr << "Unknown error\n";
for (int i=0; i!=1000; ++i) swiWaitForVBlank();
return 1;
}
}
@@ -45,7 +45,7 @@ NdsGameDialog::NdsGameDialog(const int argc, char* argv[])
if (m_verbose)
{
h.CoutNl("Test waiting: wait 1 second");
h.Wait(1.0);
h.Wait(1.0, m_verbose);
}

if (m_verbose)
@@ -68,7 +68,7 @@ NdsGameDialog::NdsGameDialog(const int argc, char* argv[])

if (m_verbose) { Helper().CoutNl("Drawing Zandar Bone picture"); }

//ZanbarBoneBackground().Draw(VRAM_A,0,0);
ZanbarBoneBackground().Draw(VRAM_A,0,0);

if (m_verbose) { Helper().CoutNl("Done showing picture"); }
}
@@ -174,17 +174,17 @@ void NdsGameDialog::ShowText(const std::string& text)
if (keys_down) { wait_character_msec = 0.0; }

Helper().Cout(c);
Helper().Wait(wait_character_msec);
Helper().Wait(wait_character_msec, m_verbose);
}
}

void NdsGameDialog::Start()
{
if (m_verbose) { Helper().CoutNl("MOD_69008_EXPERIENCE"); }
if (m_verbose) { Helper().CoutNl(MOD_69008_EXPERIENCE); }
if (m_verbose) { Helper().CoutNl(std::to_string(MOD_69008_EXPERIENCE)); }
if (m_verbose) { Helper().CoutNl("Before disabled mmLoad"); }

//mmLoad(MOD_69008_EXPERIENCE);
//mmLoad(MOD_69008_EXPERIENCE); //Causes a freeze

if (m_verbose) { Helper().CoutNl("Before disabled mmStart"); }

@@ -209,7 +209,7 @@ void NdsGameDialog::Start()

void NdsGameDialog::ProcessEvents()
{
if (m_verbose) { Helper().CoutNl(__func__); }
if (m_verbose) { static int n = 0; Helper().Cout(std::to_string(n++)); Helper().CoutNl(__func__); }

scanKeys(); //Don't forget!
const int keys_down = keysDown();
@@ -41,7 +41,7 @@ struct NdsGameDialog final : public Observer

void UpdateStats();

static const bool m_verbose{true};
static const bool m_verbose{false};
};

#endif // NDSGAMEDIALOG_H

0 comments on commit cf4bcc4

Please sign in to comment.
You can’t perform that action at this time.