diff --git a/.gitignore b/.gitignore
index f25609d..d5dd13b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
build/
-libreshop-client.*
+*.dol
+*.elf # probably better for forks
libreshop/boot.dol
libreshop/config.json
libreshop.zip
diff --git a/Makefile b/Makefile
index 9b56d34..c15f2a9 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
-LIBS := -lwiiuse -lbte -lfat -logc -lm -lzip -lz -lbz2 -ljansson -lwinyl -lyuarel
+LIBS := -lwiiuse -lmad -lasnd -lbte -lfat -logc -lm -lzip -lz -lbz2 -ljansson -lwinyl -lyuarel
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
@@ -131,6 +131,15 @@ $(OFILES_SOURCES) : $(HFILES)
@echo $(notdir $<)
$(bin2o)
+#---------------------------------------------------------------------------------
+# This rule links in binary data with the .json extension
+#---------------------------------------------------------------------------------
+%.mp3.o %_mp3.h : %.mp3
+#---------------------------------------------------------------------------------
+ @echo $(notdir $<)
+ $(bin2o)
+
+
-include $(DEPENDS)
#---------------------------------------------------------------------------------
diff --git a/README.md b/README.md
index e22d012..710ffdb 100644
--- a/README.md
+++ b/README.md
@@ -5,10 +5,11 @@ Wii Homebrew downloader. Powered by Open Shop Channel
### Build instructions
Before building, install these dependencies:
```
-pacman -S ppc-zip ppc-jansson wii-winyl ppc-yuarel
+pacman -S ppc-zip ppc-jansson wii-winyl ppc-yuarel libmad --needed
```
You will need to add the [nez-wii](https://wii.nezbednik.eu.org) pacman repository.
+
```
./data/create_acknowledgements
make
diff --git a/data/create_acknowledgements b/data/create_acknowledgements
index c2e5a2c..6ea644a 100755
--- a/data/create_acknowledgements
+++ b/data/create_acknowledgements
@@ -21,7 +21,7 @@ EOF
# wrap it for the Wii
echo -n > acknowledgements.json
-echo "acknowledgements.json"
+echo "acknowledgements.json" # and i can assure you, that is not a json file.
echo "+-----------------------------------------------------------------------------+"
while IFS= read -r p; do
printf "|%-77s|\n" "${p}"
diff --git a/data/loop.mp3 b/data/loop.mp3
new file mode 100644
index 0000000..c8b045a
Binary files /dev/null and b/data/loop.mp3 differ
diff --git a/libreshop/icon.png b/libreshop/icon.png
deleted file mode 100644
index 062ff2d..0000000
Binary files a/libreshop/icon.png and /dev/null differ
diff --git a/libreshop/meta.xml b/libreshop/meta.xml
deleted file mode 100644
index f1a17bd..0000000
--- a/libreshop/meta.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
- LibreShop
- 0.2
- 20240428000000
- The LibreShop Team
- Download homebrew apps
- LibreShop is an app that lets you download Homebrew apps onto your Wii.
-
-By default, apps are downloaded from the Open Shop Channel apps repository.
-
-Controls:
-HOME - exit
-A - engage
-B - back
-Up, Down - move
-Left,Right - move by page
-
-On the repository screen, press 1 to open the settings.
-
-
diff --git a/source/main.c b/source/main.c
index 7f91cb8..ad20c7b 100644
--- a/source/main.c
+++ b/source/main.c
@@ -14,13 +14,22 @@
#include
#include
#include
+#include
+#include
+//can we also include my will to live
+#include
+#include
#include
+
+#include "loop_mp3.h" // when i feel like it i might make repos be able to have their own music
#include "debug.h"
#include "config.h"
#include "tui.h"
#include "default_config_json.h"
+static bool loading = true; // what is the point of this
+static lwp_t background_thread = LWP_THREAD_NULL; // uh..sure past me?
static void *xfb = NULL;
static GXRModeObj *rmode = NULL;
@@ -49,7 +58,22 @@ void logprint(int type, char *message) {
}
printf(" \x1b[37m%s", message);
}
-
+static void* loop_sound(void* arg) {
+ // i hate this code
+ while (1) {
+ if (loading) {
+ if (!MP3Player_IsPlaying()) {
+ MP3Player_PlayBuffer(loop_mp3, loop_mp3_size, NULL);
+ }
+ } else {
+ if (MP3Player_IsPlaying()) {
+ MP3Player_Stop();
+ }
+ }
+ usleep(10 * 1000); // make the cpu not commit suicide
+ }
+ return NULL;
+}
void home_exit(int message) {
if (message) logprint(0, "Press HOME (Start) to exit\n");
@@ -77,6 +101,8 @@ int main(int argc, char **argv) {
WPAD_Init();
PAD_Init();
+ ASND_Init();
+ MP3Player_Init();
rmode = VIDEO_GetPreferredMode(NULL);
@@ -99,6 +125,8 @@ int main(int argc, char **argv) {
printheader();
logprint(0, "Welcome to LibreShop!\n");
+
+ LWP_CreateThread(&background_thread,loop_sound,NULL,NULL,0,80); //create the thread so music actually plays
#ifdef DEBUG
logprint(2, "Warning! You are running a DEBUG build.\n");
#endif
@@ -106,6 +134,7 @@ int main(int argc, char **argv) {
printf("\n");
logprint(0, "Initializing network.\n");
+
ret = if_config(localip, netmask, gateway, TRUE, 20);
if (ret >= 0) {
diff --git a/source/mp3player.h b/source/mp3player.h
new file mode 100644
index 0000000..7f6c333
--- /dev/null
+++ b/source/mp3player.h
@@ -0,0 +1,23 @@
+#ifndef __MP3PLAYER_H__
+#define __MP3PLAYER_H__
+
+#include
+#include
+#include // try actually including the mp3player wintermute
+
+#ifdef __cplusplus
+ extern "C" {
+#endif /* __cplusplus */
+
+void MP3Player_Init(void);
+void MP3Player_Stop(void);
+bool MP3Player_IsPlaying(void);
+void MP3Player_Volume(u32 volume);
+s32 MP3Player_PlayBuffer(const void *buffer,s32 len,void (*filterfunc)(struct mad_stream *,struct mad_frame *));
+s32 MP3Player_PlayFile(void *cb_data,s32 (*reader)(void *,void *,s32),void (*filterfunc)(struct mad_stream *,struct mad_frame *));
+
+#ifdef __cplusplus
+ }
+#endif /* __cplusplus */
+
+#endif