aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXaviDCR92 <xavi.dcr@gmail.com>2018-03-26 08:50:33 +0200
committerXaviDCR92 <xavi.dcr@gmail.com>2018-03-26 08:50:33 +0200
commit2c3b747732efd11fd279c27e1092e63e9f761c96 (patch)
tree95ae7e8a21f96c0c9ab0573ac7e1641d03e38d16
parent4887461e35b64c697cbabaf0268c77ae68576c5e (diff)
* Game can now compile without PSXSDK_DEBUG flag.
* RCNT2 ISR is now disabled as soon as SystemLoadFileIntoBuffer() is called. Hopefully that will avoid problems with real HW.
-rw-r--r--Bin/AIRPORT.binbin1709904 -> 1693440 bytes
-rw-r--r--Bin/AIRPORT.cue12
-rw-r--r--[-rwxr-xr-x]Source/Exe/AIRPORT.elfbin450040 -> 321112 bytes
-rw-r--r--Source/Exe/AIRPORT.isobin1488896 -> 1474560 bytes
-rw-r--r--Source/Makefile10
-rw-r--r--Source/PltParser.c6
-rw-r--r--Source/Sfx.c6
-rw-r--r--Source/System.c9
8 files changed, 27 insertions, 16 deletions
diff --git a/Bin/AIRPORT.bin b/Bin/AIRPORT.bin
index a284924..3e4de11 100644
--- a/Bin/AIRPORT.bin
+++ b/Bin/AIRPORT.bin
Binary files differ
diff --git a/Bin/AIRPORT.cue b/Bin/AIRPORT.cue
index 2e95890..7f3ca9c 100644
--- a/Bin/AIRPORT.cue
+++ b/Bin/AIRPORT.cue
@@ -3,13 +3,13 @@ TRACK 01 MODE2/2352
INDEX 01 00:00:00
FILE "TRACK01.bin" BINARY
TRACK 02 AUDIO
- INDEX 00 00:00:00
- INDEX 01 00:02:00
+ INDEX 00 00:00:00
+ INDEX 01 00:02:00
FILE "TRACK02.bin" BINARY
TRACK 03 AUDIO
- INDEX 00 00:00:00
- INDEX 01 00:02:00
+ INDEX 00 00:00:00
+ INDEX 01 00:02:00
FILE "TRACK03.bin" BINARY
TRACK 04 AUDIO
- INDEX 00 00:00:00
- INDEX 01 00:02:00
+ INDEX 00 00:00:00
+ INDEX 01 00:02:00
diff --git a/Source/Exe/AIRPORT.elf b/Source/Exe/AIRPORT.elf
index 97b999e..5517411 100755..100644
--- a/Source/Exe/AIRPORT.elf
+++ b/Source/Exe/AIRPORT.elf
Binary files differ
diff --git a/Source/Exe/AIRPORT.iso b/Source/Exe/AIRPORT.iso
index 9fb2569..94ded7e 100644
--- a/Source/Exe/AIRPORT.iso
+++ b/Source/Exe/AIRPORT.iso
Binary files differ
diff --git a/Source/Makefile b/Source/Makefile
index f410b4b..e060db1 100644
--- a/Source/Makefile
+++ b/Source/Makefile
@@ -11,9 +11,9 @@ GNU_SIZE = mipsel-unknown-elf-size
# Custom define flags for GCC
DEFINE= -DFIXMATH_FAST_SIN -D_PAL_MODE_
-DEFINE += -DPSXSDK_DEBUG
-#DEFINE += -DNO_CDDA
-#DEFINE += -DNO_INTRO
+#DEFINE += -DPSXSDK_DEBUG
+DEFINE += -DNO_CDDA
+DEFINE += -DNO_INTRO
# Compiler flags
LIBS= -lfixmath
@@ -174,12 +174,10 @@ $(OBJ_LEVELS_DIR)/%.LVL: $(SRC_LEVELS_DIR)/%.LVL
$(OBJ_LEVELS_DIR)/%.PLT: $(SRC_LEVELS_DIR)/%.PLT
cp $^ $@
-music: music_objects
-
$(MUSIC_OBJ_DIR)/%.bin: $(MUSIC_SRC_DIR)/%.mp3
$(FFMPEG_DIR)/$(FFMPEG) -i $< $(FFMPEG_FLAGS) $@
# ----------------------------------------
# Phony targets
# ----------------------------------------
-.PHONY: clean music
+.PHONY: clean run
diff --git a/Source/PltParser.c b/Source/PltParser.c
index c5f3a8f..6963683 100644
--- a/Source/PltParser.c
+++ b/Source/PltParser.c
@@ -401,6 +401,12 @@ uint8_t* PltParserGenerateFile(TYPE_PLT_CONFIG* ptrPltConfig)
return NULL;
}
+#ifndef PSXSDK_DEBUG
+# pragma message ("Remember to remove this")
+ printf("%d\n", minAircraftTime);
+ printf("%d\n", maxAircraftTime);
+#endif // PSXSDK_DEBUG
+
SystemClearFileBuffer();
// At this point, PltBuffer is filled with zeros. Start generating PLT file.
diff --git a/Source/Sfx.c b/Source/Sfx.c
index 2f8a565..a823c43 100644
--- a/Source/Sfx.c
+++ b/Source/Sfx.c
@@ -33,7 +33,9 @@ void SfxPlaySound(SsVag* sound)
bool SfxUploadSound_Ex(char* file_path, SsVag* vag, uint8_t voiceIndex)
{
+#ifdef PSXSDK_DEBUG
static size_t SPUBytesUsed;
+#endif // PSXSDK_DEBUG
if (voiceIndex >= NUMBER_OF_VOICES)
{
@@ -63,6 +65,8 @@ bool SfxUploadSound_Ex(char* file_path, SsVag* vag, uint8_t voiceIndex)
usedVoices[voiceIndex] = true;
+#ifdef PSXSDK_DEBUG
+
SPUBytesUsed += vag->data_size;
if (SPUBytesUsed != 0)
@@ -77,6 +81,8 @@ bool SfxUploadSound_Ex(char* file_path, SsVag* vag, uint8_t voiceIndex)
dprintf("SPU usage: %d%%\n", percentage);
}
+#endif // PSXSDK_DEBUG
+
return true;
}
diff --git a/Source/System.c b/Source/System.c
index 2a3513a..f6f8f25 100644
--- a/Source/System.c
+++ b/Source/System.c
@@ -139,7 +139,7 @@ static volatile uint16_t u16_0_01seconds_cnt_prev;
* @author: Xavier Del Campo
*
* @brief:
- * Executed on RCnt2 ISR.
+ * Executed on RCnt2 ISR every 100 us.
*
* *******************************************************************/
void ISR_RootCounter2(void)
@@ -149,7 +149,7 @@ void ISR_RootCounter2(void)
if ((int16_t)(u16_0_01seconds_cnt - 1000) >= (int16_t)(u16_0_01seconds_cnt_prev))
{
u16_0_01seconds_cnt_prev = u16_0_01seconds_cnt;
- DEBUG_PRINT_VAR(u16_0_01seconds_cnt_prev);
+ //~ DEBUG_PRINT_VAR(u16_0_01seconds_cnt_prev);
}
}
@@ -267,7 +267,7 @@ void SystemAcknowledgeFrame(void)
* @author: Xavier Del Campo
*
* @brief:
- * Creates a sine-line (more exactly, a parabola-like) effect and
+ * Creates a sine-like (more exactly, a sawtooth-like) effect and
* stores its value into a variable.
*
* @remarks:
@@ -491,6 +491,8 @@ bool SystemLoadFileToBuffer(char* fname, uint8_t* buffer, uint32_t szBuffer)
// Wait for possible previous operation from the GPU before entering this section.
while ( (SystemIsBusy() != false) || (GfxIsGPUBusy() != false) );
+ SystemDisableRCnt2Interrupt();
+
if (fname == NULL)
{
Serial_printf("SystemLoadFile: NULL fname!\n");
@@ -534,7 +536,6 @@ bool SystemLoadFileToBuffer(char* fname, uint8_t* buffer, uint32_t szBuffer)
system_busy = true;
- SystemDisableRCnt2Interrupt();
SystemDisableVBlankInterrupt();
f = fopen(fname, "r");