summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurice <maurice.henke@protonmail.com>2021-04-11 19:24:00 +0200
committerMaurice <maurice.henke@protonmail.com>2021-04-11 19:24:00 +0200
commitc165bb407d08b9afee4aa75146ad0f3ab58b2793 (patch)
tree6b3ae75a7393affe6ee36db21263820bbce4cbec
parent1546e73ac1a28c646ada74cb2e92c2cfa24ae6d5 (diff)
Added CARDDetach handler
-rw-r--r--include/tp/JFWSystem.h3
-rw-r--r--source/tools.cpp13
2 files changed, 11 insertions, 5 deletions
diff --git a/include/tp/JFWSystem.h b/include/tp/JFWSystem.h
index 7c091c9..121d258 100644
--- a/include/tp/JFWSystem.h
+++ b/include/tp/JFWSystem.h
@@ -8,6 +8,9 @@
#ifndef TP_JFWSYSTEM_H
#define TP_JFWSYSTEM_H
+// Dedicated console line used to print messages wtihout relying on the Console Class from libtp
+#define JFW_DEBUG_LINE 24
+
#include <cstdint>
namespace libtp::tp::jfw_system
diff --git a/source/tools.cpp b/source/tools.cpp
index 7ab8bb4..c864a40 100644
--- a/source/tools.cpp
+++ b/source/tools.cpp
@@ -8,6 +8,7 @@
#include "display/console.h"
#include "gc/card.h"
#include "memory.h"
+#include "tp/JFWSystem.h"
#include "tp/d_com_inf_game.h"
#include "tp/d_stage.h"
#include "tp/dzx.h"
@@ -86,11 +87,13 @@ namespace libtp::tools
if ( result == CARD_RESULT_READY )
{
// level = 1;
- result = CARDMount( chan,
- workArea,
- CARDCallback {
- // TODO: Handler for cardDetach
- } );
+ result = CARDMount( chan, workArea, []( int32_t chan, int32_t result ) {
+ // S
+ tp::jfw_system::ConsoleLine* line = &tp::jfw_system::systemConsole->consoleLine[JFW_DEBUG_LINE];
+
+ line->showLine = true;
+ sprintf( line->line, "ReadGCI::CARDERR; Chan: %" PRId32 " Result: %" PRId32, chan, result );
+ } );
if ( result == CARD_RESULT_READY )
{