diff --git a/README.md b/README.md index 5321dc0..18a67c8 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ It is complex example of usage [MUI C++ wrapper classes](https://github.com/tdol - [MUI5](https://github.com/amiga-mui/muidev) - [Identify.library](https://github.com/shred/identify) (download [IdentifyUsr.lha](http://aminet.net/util/libs/IdentifyUsr.lha)) - optional [OpenURL.library](https://github.com/jens-maus/libopenurl) (download [OpenURL.lha](http://aminet.net/comm/www/OpenURL-7.18.lha)) + - optional [Picasso96](http://wiki.icomp.de/wiki/P96) ## WIP interface diff --git a/app/appversion.txt b/app/appversion.txt index 8e76af6..b63b950 100644 --- a/app/appversion.txt +++ b/app/appversion.txt @@ -1 +1 @@ -export APP_VERSION = 0.1.4 +export APP_VERSION = 0.1.5 diff --git a/app/src/App.cpp b/app/src/App.cpp index c342893..6e1b63d 100644 --- a/app/src/App.cpp +++ b/app/src/App.cpp @@ -6,6 +6,7 @@ #include "App.hpp" +#include "Components/Application.hpp" #include "MUI/Context/ApplicationContext.hpp" #include "MUI/Core/CustomClassManager.hpp" @@ -25,11 +26,13 @@ void AppCore::Run() // special class, on destructor Dispose all custom classes MUI::CustomClassesLifeTimeScope customClassesLifeTimeScope; + Components::Application muiApplication; + // application scope // do MUI_DisposeObject(..) on destructor - MUI::ApplicationScope application(mApplication); + MUI::ApplicationScope application(muiApplication); - mApplication.RegisterEvents(); + muiApplication.RegisterEvents(); auto appWindow = MUI::ApplicationContext::instance().getAppWindow(); @@ -38,7 +41,7 @@ void AppCore::Run() // main application loop ULONG signals = 0; - while (DoMethod(mApplication.muiObject(), MUIM_Application_NewInput, &signals) != MUIV_Application_ReturnID_Quit) + while (DoMethod(muiApplication.muiObject(), MUIM_Application_NewInput, &signals) != MUIV_Application_ReturnID_Quit) { if (signals) { diff --git a/app/src/App.hpp b/app/src/App.hpp index 3d8d114..e85daf1 100644 --- a/app/src/App.hpp +++ b/app/src/App.hpp @@ -9,7 +9,6 @@ #include "AOS/Identify/IdentifyBaseScope.hpp" #include "AOS/OpenURL/OpenURLBaseScope.hpp" #include "AOS/Picasso96/Picasso96BaseScope.hpp" -#include "Components/Application.hpp" #include "Core/Singleton.hpp" #include "MUI/Core/MuiMasterBaseScope.hpp" @@ -26,8 +25,6 @@ class AppCore OpenURLBaseScope openUrlBaseScope; Picasso96BaseScope picasso96BaseScope; - Components::Application mApplication; - AppCore(); public: diff --git a/app/src/AppContext.cpp b/app/src/AppContext.cpp index 63876f1..94c1197 100644 --- a/app/src/AppContext.cpp +++ b/app/src/AppContext.cpp @@ -30,3 +30,8 @@ OpenURLBaseScope &AppContextCore::getOpenURLBase() const { return App::instance().openUrlBaseScope; } + +Picasso96BaseScope &AppContextCore::getPicasso96Base() const +{ + return App::instance().picasso96BaseScope; +} diff --git a/app/src/AppContext.hpp b/app/src/AppContext.hpp index c8a83e1..b50f948 100644 --- a/app/src/AppContext.hpp +++ b/app/src/AppContext.hpp @@ -7,6 +7,7 @@ #pragma once #include "AOS/OpenURL/OpenURLBaseScope.hpp" +#include "AOS/Picasso96/Picasso96BaseScope.hpp" #include "Core/Singleton.hpp" class AppContextCore @@ -18,6 +19,7 @@ class AppContextCore public: OpenURLBaseScope &getOpenURLBase() const; + Picasso96BaseScope &getPicasso96Base() const; }; /// @brief main AppContext (singleton) object diff --git a/app/src/Components/Tabs/GraphicsTab.cpp b/app/src/Components/Tabs/GraphicsTab.cpp index 418548d..f7364de 100644 --- a/app/src/Components/Tabs/GraphicsTab.cpp +++ b/app/src/Components/Tabs/GraphicsTab.cpp @@ -8,6 +8,7 @@ #include "AOS/Identify/Library.hpp" #include "AOS/Picasso96/Library.hpp" +#include "AppContext.hpp" #include "MUI/Core/MakeObject.hpp" namespace Components @@ -54,14 +55,20 @@ namespace Components } } + if (!AppContext::instance().getPicasso96Base().isOpen()) + { + mPicasso96Boards.AddTail(LabelText("none")); + return; + } + auto picassoBoards = AOS::Picasso96::Library::GetBoards(); if (picassoBoards.empty()) mPicasso96Boards.AddTail(LabelText("none")); else { mPicasso96Boards.AddTail(MUI::TextBuilder().tagContents("Name").object()); - mPicasso96Boards.AddTail(MUI::TextBuilder().tagContents("Video RAM").object()); - mPicasso96Boards.AddTail(MUI::TextBuilder().tagContents("Video RAM Clock").object()); + mPicasso96Boards.AddTail(MUI::TextBuilder().tagContents("Video Memory Size").object()); + mPicasso96Boards.AddTail(MUI::TextBuilder().tagContents("Video Memory Clock").object()); for (auto &picassoBoard : picassoBoards) { diff --git a/app/src/Main.cpp b/app/src/Main.cpp index 035c313..31aab3b 100644 --- a/app/src/Main.cpp +++ b/app/src/Main.cpp @@ -8,6 +8,7 @@ #include "App.hpp" +#include #include using namespace std;