Skip to content
This repository has been archived by the owner on Dec 10, 2022. It is now read-only.

Commit

Permalink
Clean up code, added helpful info to README
Browse files Browse the repository at this point in the history
  • Loading branch information
Babkock committed Aug 23, 2019
1 parent 3f5e431 commit 05f814a
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 18 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@ Press **START** to use the menu, and use the **D-pad** to select a menu item or

You can play up to twelve measures in a row by using the **R and L** triggers, or by switching the "grid" value in the **START** mneu. If "loop all" is on, then the measures will play one after another. If it is off, it will only repeat one measure. It is recommended that you stop playback before editing another grid.

## How PSP Homebrew is Built

When I wrote PSP software as a teenager, I used a Windows build of the [universally-known PSP SDK](https://github.com/pspdev/pspsdk), through Wine, on my Mac. The build process revolves around GNU Make, but there are many extra steps. Every PSP binary is named `EBOOT.PBP` ("PSP binary package"). The actual machine code is only one out of up to eight elements.

* `PARAM.SFO` - Metadata about the program, contains its title, version, language, and parental rating - the program will not be recognized at all if this is not present
* `DATA.PSP` - The binary itself, usually comes as a \*.elf or a \*.prx (in typical Executable and Linkable format), technically has no filename until it's dumped from the package

A package really only needs these first two, the six remaining elements are totally optional.

* `DATA.PSAR` - Compressed archive for system software updates or video game updates
* `ICON0.PNG` - The icon of the game or app, appears in the vertical list next to the others when in the XMB
* `ICON1.PMF` - A short animation that takes the place of `ICON0.PNG` when focused - no audio included (.PMF is a native video format on PSP, .PAM is the PS3 version)
* `PIC0.PNG` - A caption or description image, appears on top of `PIC1.PNG` and after a short delay
* `PIC1.PNG` - The background image that appears behind the XMB icons when focused
* `SND0.AC3` - Sound that plays - often theme music for a game or a movie

One specifies which real files they want compiled into their EBOOT via the [Makefile](https://github.com/Babkock/ToneMatrix/blob/master/src/Makefile). The PARAM.SFO is generated by **mksfo**, the PRX is built from **psp-prxgen**, and the PBP is packaged with **pack-pbp** (it can be unpackaged with **unpack-pbp**).

## Installation

If you have custom firmware or a homebrew-enabled PSP, place the **"unsigned"** folder into the `/PSP/GAME` folder on your Memory Stick. If you have official firmware on your PSP (or if you have a PSPgo), place the **"signed"** folder into the `/PSP/GAME` folder on your Memory Stick.
Expand Down
1 change: 0 additions & 1 deletion src/draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ void tmDrawGrid(void) {
oslDrawImageXY(select, x1form, y1form);
}
}
return;
}
13 changes: 6 additions & 7 deletions src/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
#include <unistd.h>
#include "main.h"

typedef struct {
int year, month, day;
int minute, hour;
} metadata;

void tmFileDialog(bool save) {
int x;
unsigned char option = 0;
Expand All @@ -16,10 +21,7 @@ void tmFileDialog(bool save) {
char tmp[30];

SceIoStat a;
typedef struct {
int year, month, day;
int minute, hour;
} metadata;

metadata songMeta[MAX_SAVE_SLOTS];

current = 0;
Expand Down Expand Up @@ -104,7 +106,6 @@ void tmFileDialog(bool save) {
oslEndDrawing();
oslSyncFrame();
}
return;
}

bool tmDoesFileExist(const char *path) {
Expand Down Expand Up @@ -133,7 +134,6 @@ void tmRead(int slot) {
fseek(in, 5, SEEK_CUR);
}
fclose(in);
return;
}

void tmWrite(int slot) {
Expand All @@ -154,5 +154,4 @@ void tmWrite(int slot) {
fprintf(out, "%c%c%c%c\a", 82, 42, 82, 22);
}
fclose(out);
return;
}
2 changes: 0 additions & 2 deletions src/grid.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ void tmClear(tmGrid *g) {
g->grid[y][z] = OFF;
}
g->grid[0][0] = CURSOFF;
return;
}

bool tmIsGridEmpty(tmGrid *g) {
Expand All @@ -36,5 +35,4 @@ void tmSwitchGrid(int *a, int *b) {
data[current].grid[x][y] = OFF;
}
}
return;
}
5 changes: 0 additions & 5 deletions src/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
unsigned char tmMenu(void) {
int x;
char mstrings[MAX_MENU_ITEMS][40];
char ver[25];
while (!osl_quit) {
oslStartDrawing();
oslReadKeys();
Expand Down Expand Up @@ -57,9 +56,6 @@ unsigned char tmMenu(void) {
oslDrawString(10, (60+(x*10)), mstrings[x]);
oslSetTextColor(RGBA(255,255,255,255));
}
bzero(ver, sizeof(ver));
// sprintf(ver, "ToneMatrix %s by Babkock", VERSION);
oslDrawString(10, 240, ver);
if ((osl_keys->pressed.up) && (menuoption > 0)) {
menuoption--;
if (menuoption == BREAK)
Expand Down Expand Up @@ -163,7 +159,6 @@ void tmHelp(void) {
oslEndDrawing();
oslSyncFrame();
}
return;
}

bool tmClearAllWarning(void) {
Expand Down
3 changes: 0 additions & 3 deletions src/sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,15 @@ void tmSoundLoop(void) {
}
}
sceKernelExitDeleteThread(0);
return;
}

void tmStop(void) {
isplaying = FALSE;
col = 0;
sceKernelTerminateThread(soundloop);
return;
}

void tmStart(void) {
isplaying = TRUE;
sceKernelStartThread(soundloop, 0, NULL);
return;
}

0 comments on commit 05f814a

Please sign in to comment.