summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spuregion.c10
-rw-r--r--spuregion.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/spuregion.c b/spuregion.c
index da36a64..6ad9cca 100644
--- a/spuregion.c
+++ b/spuregion.c
@@ -39,6 +39,16 @@ uint8_t cSpuRegion::openSections()
return usedSections + 1;
}
+bool cSpuRegion::newSection()
+{
+ if (usedSections + 1 == MAX_SECTIONS) {
+ return false;
+ }
+
+ usedSections++;
+ return true;
+}
+
sSection *cSpuRegion::section(uint8_t num)
{
if (usedSections == MAX_SECTIONS) {
diff --git a/spuregion.h b/spuregion.h
index e22d7f6..b31d1cb 100644
--- a/spuregion.h
+++ b/spuregion.h
@@ -48,6 +48,7 @@ public:
uint16_t endLine;
uint8_t openSections();
+ bool newSection();
sSection *section(uint8_t num);
bool addIndex(tIndex idx);