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

Commit

Permalink
File separation
Browse files Browse the repository at this point in the history
  • Loading branch information
Babkock committed Sep 25, 2019
1 parent 05f814a commit 322ca17
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
6 changes: 1 addition & 5 deletions src/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
#include <time.h>
#include <unistd.h>
#include "main.h"

typedef struct {
int year, month, day;
int minute, hour;
} metadata;
#include "file.h"

void tmFileDialog(bool save) {
int x;
Expand Down
19 changes: 19 additions & 0 deletions src/file.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* ToneMatrix - file.h
* Copyright (c) 2012 Tanner Babcock */
#ifndef FILE_H
#define FILE_H

#define bool char
#define MAX_SAVE_SLOTS 10

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

void tmFileDialog(bool save);
bool tmDoesFileExist(const char *path);
void tmRead(int slot);
void tmWrite(int slot);

#endif
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ PSP_HEAP_SIZE_KB(2048);

void tmMainLoop(void) {
int x = 0, y = 0, q, m;
int tmpcurrent = current;
unsigned char tmpcurrent = current;
clock_t start, cu;
start = sceKernelLibcClock();
oslClearScreen(RGBA(0, 0, 0, 255));
Expand Down
9 changes: 1 addition & 8 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ enum {
MAX_X = 16,
MAX_Y = 8,
MAX_BPM = 250,
MIN_BPM = 60,
MAX_SAVE_SLOTS = 10
MIN_BPM = 60
};

typedef struct {
Expand All @@ -51,12 +50,6 @@ OSL_IMAGE *select;
int tmGetColor(char gridval, int x, int y);
void tmDrawGrid(void);

// file.c
void tmFileDialog(bool save);
bool tmDoesFileExist(const char *path);
void tmRead(int slot);
void tmWrite(int slot);

// grid.c
void tmClear(tmGrid *g);
bool tmIsGridEmpty(tmGrid *g);
Expand Down

0 comments on commit 322ca17

Please sign in to comment.