diff --git a/JabyEngine.code-workspace b/JabyEngine.code-workspace
index f65a95d6..df3cc0f8 100644
--- a/JabyEngine.code-workspace
+++ b/JabyEngine.code-workspace
@@ -1,7 +1,20 @@
{
"folders": [
{
+ "name": "JabyEngine",
"path": "."
+ },
+ {
+ "name": "PSYQ",
+ "path": "..\\..\\PSYQ\\Converted\\Include"
+ },
+ {
+ "name": "NEXTGPU",
+ "path": "..\\..\\..\\..\\PSX\\projects\\NEXTGPU"
+ },
+ {
+ "name": "CDPLAYER",
+ "path": "..\\..\\..\\..\\PSX\\projects\\CDPLAYER"
}
],
"tasks": {
@@ -120,6 +133,9 @@
"C_Cpp.default.compilerArgs": [
],
"C_Cpp.default.defines": [
- ]
+ ],
+ "files.associations": {
+ "CDDADEMO.C": "cpp"
+ }
}
}
diff --git a/Library/Code/iso/JabyEngineISODesc.xml b/Library/Code/iso/JabyEngineISODesc.xml
index 6ca9c2f9..01d4d46d 100644
--- a/Library/Code/iso/JabyEngineISODesc.xml
+++ b/Library/Code/iso/JabyEngineISODesc.xml
@@ -18,6 +18,6 @@
-
-
+
+ -->
diff --git a/Library/Code/src/JabyEngine.cpp b/Library/Code/src/JabyEngine.cpp
index 128eaa5a..94543f9c 100644
--- a/Library/Code/src/JabyEngine.cpp
+++ b/Library/Code/src/JabyEngine.cpp
@@ -1,8 +1,49 @@
#include "JabyEngine.h"
+#include
+#include
+#include
+#include
+#include
#include
-int main()
-{
- printf("Hello Planschi!\n");
+static CdlLOC TOC[100] = {0};
+
+static void setup() {
+ ResetCallback();
+ //ResetGraph(0);
+
+ CdInit();
+ CdSetDebug(0);
+
+ //SetDispMask(1);
+}
+
+static int fill_toc() {
+ u_char param[4] = {0};
+
+ param[0] = CdlModeRept|CdlModeDA; // report ON / CD-DA ON
+
+ CdControlB(CdlSetmode, param, 0);
+ return CdGetToc(TOC); // TOC
+}
+
+static void play_track(int track) {
+ for(int n = 0; n < 100; n++) {
+ const auto& cur_toc = TOC[n];
+ printf("Now playing %i.) %x:%x:%x\n", n, cur_toc.minute, cur_toc.second, cur_toc.sector);
+ }
+
+ CdControlB(CdlSetloc, reinterpret_cast(&TOC[track]), 0); // seek to start of track "track"
+ CdControlB(CdlPlay, 0, 0); // play track
+}
+
+int main() {
+ setup();
+ const int track_count = fill_toc();
+
+ printf("Hello Planschi!\nI found %i tracks\n", track_count);
+
+ play_track(2);
+ while(true);
return 0;
}
\ No newline at end of file