From 490c6b4b5d10d66a5149f61a360a11d257e5bbdf Mon Sep 17 00:00:00 2001 From: modeco80 Date: Fri, 1 Jul 2022 09:53:04 -0500 Subject: [PATCH] begin structure for realcore/realfile/snd libs make the binary link to realcore --- CMakeLists.txt | 2 ++ README.md | 2 +- src/bx/CMakeLists.txt | 1 + src/bx/main.cpp | 2 -- src/libs/CMakeLists.txt | 2 ++ src/libs/real/CMakeLists.txt | 4 ++++ src/libs/real/include/cmn/eacmem.h | 15 +++++++++++++++ src/libs/real/realcore/CMakeLists.txt | 14 ++++++++++++++ src/libs/real/realcore/inittmr.cpp | 19 +++++++++++++++++++ src/{ => libs}/snd/iop/TODO.txt | 0 10 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 src/libs/CMakeLists.txt create mode 100644 src/libs/real/CMakeLists.txt create mode 100644 src/libs/real/include/cmn/eacmem.h create mode 100644 src/libs/real/realcore/CMakeLists.txt create mode 100644 src/libs/real/realcore/inittmr.cpp rename src/{ => libs}/snd/iop/TODO.txt (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 372258c..976542e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,4 +8,6 @@ endif() include(${CMAKE_SOURCE_DIR}/cmake/Policies.cmake) project(ssxog LANGUAGES C CXX) + +add_subdirectory(src/libs) add_subdirectory(src/bx) diff --git a/README.md b/README.md index a786d2b..f801718 100644 --- a/README.md +++ b/README.md @@ -59,4 +59,4 @@ Note that the Ninja CMake generator does not work with the SCE SDK, and should n # Documentation -[Style Guide](docs/styleguide.md) +[Style Guide](docs/styleguide.md) - the style for the SSX codebase. diff --git a/src/bx/CMakeLists.txt b/src/bx/CMakeLists.txt index 1e4e4bc..0a49a87 100644 --- a/src/bx/CMakeLists.txt +++ b/src/bx/CMakeLists.txt @@ -12,6 +12,7 @@ target_link_libraries(ssx #kernel # Project libraries (by alias) + REAL::core ) set_target_properties(ssx PROPERTIES diff --git a/src/bx/main.cpp b/src/bx/main.cpp index deff60e..ba6f08d 100644 --- a/src/bx/main.cpp +++ b/src/bx/main.cpp @@ -5,6 +5,4 @@ int main(int argc, char** argv) { printf("meow\n"); - - void* a = nullptr; } diff --git a/src/libs/CMakeLists.txt b/src/libs/CMakeLists.txt new file mode 100644 index 0000000..2ac4fbf --- /dev/null +++ b/src/libs/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(real) +#add_subdirectory(snd) \ No newline at end of file diff --git a/src/libs/real/CMakeLists.txt b/src/libs/real/CMakeLists.txt new file mode 100644 index 0000000..01dc6aa --- /dev/null +++ b/src/libs/real/CMakeLists.txt @@ -0,0 +1,4 @@ +# master cmakelists for REAL +# brings in every lib tree + +add_subdirectory(realcore) \ No newline at end of file diff --git a/src/libs/real/include/cmn/eacmem.h b/src/libs/real/include/cmn/eacmem.h new file mode 100644 index 0000000..6d8123d --- /dev/null +++ b/src/libs/real/include/cmn/eacmem.h @@ -0,0 +1,15 @@ +#ifndef REAL_EACMEM_H +#define REAL_EACMEM_H + +#include + +// MB_... flags definition + +// default +#define MB_LOW 0x00 +//.... + +char* MEM_alloc(const char* tag, size_t size, int flags); +void MEM_free(void* ptr); + +#endif // REAL_EACMEM_H diff --git a/src/libs/real/realcore/CMakeLists.txt b/src/libs/real/realcore/CMakeLists.txt new file mode 100644 index 0000000..438b6f0 --- /dev/null +++ b/src/libs/real/realcore/CMakeLists.txt @@ -0,0 +1,14 @@ + + +add_library(realcore + inittmr.cpp + ) + +set_target_properties(realcore PROPERTIES + CXX_STANDARD 98 + CXX_EXTENSIONS ON + CXX_STANDARD_REQUIRED ON + ) + +# alias target. +add_library(REAL::core ALIAS realcore) \ No newline at end of file diff --git a/src/libs/real/realcore/inittmr.cpp b/src/libs/real/realcore/inittmr.cpp new file mode 100644 index 0000000..2838dcd --- /dev/null +++ b/src/libs/real/realcore/inittmr.cpp @@ -0,0 +1,19 @@ + +#ifdef BX_PLATFORM_PS2 + +// called on intc +static void tintchandler() +{ + + +} + +#endif + +void inittimer(int hz) +{ +#ifdef BX_PLATFORM_PS2 + + +#endif +} \ No newline at end of file diff --git a/src/snd/iop/TODO.txt b/src/libs/snd/iop/TODO.txt similarity index 100% rename from src/snd/iop/TODO.txt rename to src/libs/snd/iop/TODO.txt