Fix for the Psy-Q Saturn SDK
If you ever want to write code for the Sega Saturn using the Psy-Q SDK (available here), you may encounter a small problem with the toolset when using #include
directives.
Example:
#include "abc.h"
int main()
{
int b = a + 43;
return 0;
}
C:\Psyq\bin>ccsh -ITHING/ -S main.c
int a = 98;
This will crash with the following error: main.c:1: abc.h: No such file or directory
, which is quite strange given that we explicitely told the compiler to look in that THING
folder.
What we have:
CCSH.EXE
: main compiler executable (C Compiler Super-H)CPPSH.EXE
preprocessor (C PreProcessor Super-H)
CCSH
calls CPPSH
with the source file first to get a raw code file to compile, and then actually compiles it. Here, we can see by running CPPSH
alone that it still triggers the error, which means the problem effectively comes from CPPSH
. After a thorough analysis in Ida, it seems that even though the code that handles parsing the command-line parameters related to include directories, those paths aren't actually added to the program's internal directory array and thus never actually