2023-12-27 09:24:00 +00:00
|
|
|
cmake_minimum_required(VERSION 3.10)
|
|
|
|
|
2024-10-12 21:03:13 +00:00
|
|
|
project(sotn)
|
2023-12-27 09:24:00 +00:00
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
2024-01-11 22:46:35 +00:00
|
|
|
if (WIN32)
|
2024-10-13 11:31:20 +00:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
2024-01-11 22:46:35 +00:00
|
|
|
endif()
|
2023-12-27 09:24:00 +00:00
|
|
|
|
2024-01-11 22:46:35 +00:00
|
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
|
2024-10-13 11:31:20 +00:00
|
|
|
set(CMAKE_BUILD_TYPE Debug)
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
|
|
|
|
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fsanitize=address")
|
|
|
|
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-implicit-function-declaration")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-incompatible-pointer-types")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-int-conversion")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-return-mismatch")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-return-type")
|
2024-01-11 00:34:12 +00:00
|
|
|
endif()
|
|
|
|
|
2024-01-11 22:46:35 +00:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
2024-10-13 11:31:20 +00:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-implicit-function-declaration")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-return-type")
|
2024-01-11 22:46:35 +00:00
|
|
|
endif()
|
|
|
|
|
2023-12-27 09:24:00 +00:00
|
|
|
find_package(SDL2 REQUIRED)
|
|
|
|
|
|
|
|
set(SOURCE_FILES_PC
|
2024-10-12 21:03:13 +00:00
|
|
|
src/pc/main.c
|
2023-12-27 09:24:00 +00:00
|
|
|
src/pc/log.c
|
|
|
|
src/pc/stubs.c
|
|
|
|
src/pc/sotn.c
|
|
|
|
src/pc/pc.c
|
2024-08-04 16:36:43 +00:00
|
|
|
src/pc/io.c
|
2024-01-22 19:29:45 +00:00
|
|
|
src/pc/str.c
|
2024-01-01 23:31:56 +00:00
|
|
|
src/pc/sim_pc.c
|
2024-06-06 22:11:18 +00:00
|
|
|
src/pc/pl_arc.c
|
2024-02-01 00:04:05 +00:00
|
|
|
src/pc/pl_ric.c
|
2024-10-08 17:56:45 +00:00
|
|
|
src/pc/servant_pc.c
|
2024-06-06 21:21:03 +00:00
|
|
|
src/pc/stages/stage_loader.c
|
|
|
|
src/pc/stages/stage_dummy.c
|
2024-07-10 20:53:04 +00:00
|
|
|
src/pc/weapon_pc.c
|
2024-07-22 21:20:01 +00:00
|
|
|
src/pc/psxsdk/PsyCross/src/gte/PsyX_GTE.cpp
|
|
|
|
src/pc/psxsdk/PsyCross/src/gte/inline_c.c
|
|
|
|
src/pc/psxsdk/PsyCross/src/gte/libgte_.c
|
2023-12-27 09:24:00 +00:00
|
|
|
)
|
|
|
|
|
2023-12-27 16:26:24 +00:00
|
|
|
if(WIN32)
|
2024-10-13 11:31:20 +00:00
|
|
|
list(APPEND SOURCE_FILES_PC src/pc/plat_win.c)
|
2023-12-27 16:26:24 +00:00
|
|
|
else()
|
2024-10-13 11:31:20 +00:00
|
|
|
list(APPEND SOURCE_FILES_PC src/pc/plat_unix.c)
|
2023-12-27 16:26:24 +00:00
|
|
|
endif()
|
|
|
|
|
2023-12-27 09:24:00 +00:00
|
|
|
set(SOURCE_FILES_PSX_SDK
|
|
|
|
src/main/psxsdk/libgpu/ext.c
|
2024-01-21 17:58:32 +00:00
|
|
|
src/main/psxsdk/libgpu/prim.c
|
2023-12-27 09:24:00 +00:00
|
|
|
)
|
|
|
|
|
2024-06-18 17:59:51 +00:00
|
|
|
set(WANT_LIBSND_LLE FALSE CACHE BOOL "Whether to append use LLE for libsnd")
|
|
|
|
set(SOURCE_FILES_LIBSND_LLE
|
|
|
|
# libsnd
|
|
|
|
src/main/psxsdk/libsnd/adsr.c
|
|
|
|
src/main/psxsdk/libsnd/cres.c
|
|
|
|
src/main/psxsdk/libsnd/decre.c
|
|
|
|
src/main/psxsdk/libsnd/libsnd_i.h
|
|
|
|
src/main/psxsdk/libsnd/next.c
|
|
|
|
src/main/psxsdk/libsnd/pause.c
|
|
|
|
src/main/psxsdk/libsnd/play.c
|
|
|
|
src/main/psxsdk/libsnd/replay.c
|
|
|
|
src/main/psxsdk/libsnd/scsmvol.c
|
|
|
|
src/main/psxsdk/libsnd/scssattr.c
|
|
|
|
src/main/psxsdk/libsnd/scssvol.c
|
|
|
|
src/main/psxsdk/libsnd/seqinit.c
|
|
|
|
src/main/psxsdk/libsnd/seqread.c
|
|
|
|
src/main/psxsdk/libsnd/seskoff.c
|
|
|
|
src/main/psxsdk/libsnd/seskon.c
|
|
|
|
src/main/psxsdk/libsnd/sscall.c
|
|
|
|
src/main/psxsdk/libsnd/ssclose.c
|
|
|
|
src/main/psxsdk/libsnd/ssend.c
|
|
|
|
src/main/psxsdk/libsnd/ssinit.c
|
|
|
|
src/main/psxsdk/libsnd/ssinit_h.c
|
|
|
|
src/main/psxsdk/libsnd/ssplay.c
|
|
|
|
src/main/psxsdk/libsnd/ssquit.c
|
|
|
|
src/main/psxsdk/libsnd/ssstart.c
|
|
|
|
src/main/psxsdk/libsnd/sstable.c
|
|
|
|
src/main/psxsdk/libsnd/sstick.c
|
|
|
|
src/main/psxsdk/libsnd/ssvol.c
|
|
|
|
src/main/psxsdk/libsnd/stop.c
|
|
|
|
src/main/psxsdk/libsnd/tempo.c
|
|
|
|
src/main/psxsdk/libsnd/ut_gpa.c
|
|
|
|
src/main/psxsdk/libsnd/ut_gva.c
|
|
|
|
src/main/psxsdk/libsnd/ut_rdel.c
|
|
|
|
src/main/psxsdk/libsnd/ut_rdep.c
|
|
|
|
src/main/psxsdk/libsnd/ut_rev.c
|
|
|
|
src/main/psxsdk/libsnd/ut_rfb.c
|
|
|
|
src/main/psxsdk/libsnd/ut_roff.c
|
|
|
|
src/main/psxsdk/libsnd/ut_ron.c
|
|
|
|
src/main/psxsdk/libsnd/ut_sva.c
|
|
|
|
src/main/psxsdk/libsnd/vm_doff.c
|
|
|
|
src/main/psxsdk/libsnd/vm_don.c
|
|
|
|
src/main/psxsdk/libsnd/vm_vsu.c
|
|
|
|
src/main/psxsdk/libsnd/vmanager.c
|
|
|
|
src/main/psxsdk/libsnd/vs_mono.c
|
|
|
|
src/main/psxsdk/libsnd/vs_srv.c
|
|
|
|
src/main/psxsdk/libsnd/vs_vab.c
|
|
|
|
src/main/psxsdk/libsnd/vs_vfb.c
|
|
|
|
src/main/psxsdk/libsnd/vs_vh.c
|
|
|
|
src/main/psxsdk/libsnd/vs_vtb.c
|
|
|
|
src/main/psxsdk/libsnd/vs_vtbp.c
|
|
|
|
src/main/psxsdk/libsnd/vs_vtc.c
|
2024-07-11 17:03:39 +00:00
|
|
|
|
2024-06-18 17:59:51 +00:00
|
|
|
# libspu
|
|
|
|
src/main/psxsdk/libspu/s_cb.c
|
|
|
|
src/main/psxsdk/libspu/s_crwa.c
|
|
|
|
src/main/psxsdk/libspu/s_dcb.c
|
|
|
|
src/main/psxsdk/libspu/s_gva.c
|
|
|
|
src/main/psxsdk/libspu/s_i.c
|
|
|
|
src/main/psxsdk/libspu/s_ini.c
|
|
|
|
src/main/psxsdk/libspu/s_it.c
|
|
|
|
src/main/psxsdk/libspu/s_itc.c
|
|
|
|
src/main/psxsdk/libspu/s_m_f.c
|
|
|
|
src/main/psxsdk/libspu/s_m_init.c
|
|
|
|
src/main/psxsdk/libspu/s_m_m.c
|
|
|
|
src/main/psxsdk/libspu/s_m_util.c
|
|
|
|
src/main/psxsdk/libspu/s_m_wsa.c
|
|
|
|
src/main/psxsdk/libspu/s_n2p.c
|
|
|
|
src/main/psxsdk/libspu/s_q.c
|
|
|
|
src/main/psxsdk/libspu/s_r.c
|
|
|
|
src/main/psxsdk/libspu/s_sav.c
|
|
|
|
src/main/psxsdk/libspu/s_sca.c
|
|
|
|
src/main/psxsdk/libspu/s_si.c
|
|
|
|
src/main/psxsdk/libspu/s_sic.c
|
|
|
|
src/main/psxsdk/libspu/s_sk.c
|
|
|
|
src/main/psxsdk/libspu/s_snv.c
|
|
|
|
src/main/psxsdk/libspu/s_sr.c
|
|
|
|
src/main/psxsdk/libspu/s_srmp.c
|
|
|
|
src/main/psxsdk/libspu/s_stm.c
|
|
|
|
src/main/psxsdk/libspu/s_stsa.c
|
|
|
|
src/main/psxsdk/libspu/s_sva.c
|
|
|
|
src/main/psxsdk/libspu/s_w.c
|
|
|
|
src/main/psxsdk/libspu/s_wp.c
|
|
|
|
src/main/psxsdk/libspu/spu.c
|
|
|
|
src/main/psxsdk/libspu/sr_gaks.c
|
2024-06-19 16:37:07 +00:00
|
|
|
|
|
|
|
src/pc/psxsdk/emu.cpp
|
|
|
|
src/pc/psxsdk/mednafen/spu.cpp
|
2024-06-18 17:59:51 +00:00
|
|
|
)
|
2024-10-13 11:31:20 +00:00
|
|
|
if(WANT_LIBSND_LLE)
|
|
|
|
list(APPEND SOURCE_FILES_PSX_SDK ${SOURCE_FILES_LIBSND_LLE})
|
2024-06-18 17:59:51 +00:00
|
|
|
endif()
|
|
|
|
|
2023-12-27 09:24:00 +00:00
|
|
|
set(SOURCE_FILES_MOCK_SDK
|
|
|
|
src/pc/psxsdk/libapi.c
|
|
|
|
src/pc/psxsdk/libetc.c
|
|
|
|
src/pc/psxsdk/libgpu.c
|
|
|
|
src/pc/psxsdk/libgte.c
|
|
|
|
src/pc/psxsdk/libgs.c
|
|
|
|
src/pc/psxsdk/libcd.c
|
|
|
|
src/pc/psxsdk/libcard.c
|
|
|
|
src/pc/psxsdk/libspu.c
|
|
|
|
src/pc/psxsdk/libsnd.c
|
|
|
|
src/pc/psxsdk/cdc.c
|
|
|
|
)
|
|
|
|
|
|
|
|
set(SOURCE_FILES_3RD
|
2024-10-13 11:31:20 +00:00
|
|
|
src/pc/3rd/cJSON/cJSON.c
|
2023-12-27 09:24:00 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
set(SOURCE_FILES_DRA
|
|
|
|
src/dra/42398.c
|
|
|
|
src/dra/play.c
|
|
|
|
src/dra/loading.c
|
|
|
|
src/dra/pads.c
|
|
|
|
src/dra/save_mgr_pre.c
|
|
|
|
src/dra/save_mgr.c
|
|
|
|
src/dra/4A538.c
|
|
|
|
src/dra/collider.c
|
|
|
|
src/dra/demo.c
|
2024-01-02 09:22:44 +00:00
|
|
|
src/dra/5087C.c
|
2024-01-07 16:41:18 +00:00
|
|
|
src/dra/lba_stage.c
|
2024-01-07 02:28:34 +00:00
|
|
|
src/dra/config_us.c
|
2023-12-27 09:24:00 +00:00
|
|
|
src/dra/menu.c
|
2024-02-25 17:44:11 +00:00
|
|
|
src/dra/5D5BC.c
|
2024-07-14 16:35:13 +00:00
|
|
|
src/dra/d_C910.c
|
2024-11-11 23:53:30 +00:00
|
|
|
src/dra/624DC.c
|
|
|
|
src/dra/628AC.c
|
2023-12-27 09:24:00 +00:00
|
|
|
src/dra/63ED4.c
|
2024-07-14 16:35:13 +00:00
|
|
|
src/dra/d_CD80.c
|
2024-01-14 23:30:58 +00:00
|
|
|
src/dra/692E8.c
|
|
|
|
src/dra/6D59C.c
|
|
|
|
src/dra/704D0.c
|
|
|
|
src/dra/71830.c
|
2024-01-20 19:06:37 +00:00
|
|
|
src/dra/72BB0.c
|
2024-06-03 20:47:30 +00:00
|
|
|
src/dra/75F54.c
|
2024-07-17 04:27:16 +00:00
|
|
|
src/dra/78D0C.c
|
2024-07-14 16:35:13 +00:00
|
|
|
src/dra/d_CF74.c
|
2024-06-03 20:47:30 +00:00
|
|
|
src/dra/7A4D0.c
|
2024-01-20 19:06:37 +00:00
|
|
|
src/dra/7E4BC.c
|
2024-06-02 18:29:17 +00:00
|
|
|
src/dra/d_DBD4.c
|
|
|
|
src/dra/d_E294.c
|
2024-07-14 16:35:13 +00:00
|
|
|
src/dra/d_10798.c
|
2024-01-20 19:06:37 +00:00
|
|
|
src/dra/843B0.c
|
2024-07-12 07:32:13 +00:00
|
|
|
src/dra/8A0A4.c
|
2024-06-03 20:47:30 +00:00
|
|
|
src/dra/8D3E8.c
|
2023-12-27 09:24:00 +00:00
|
|
|
src/dra/91EBC.c
|
|
|
|
src/dra/92F60.c
|
|
|
|
src/dra/93290.c
|
|
|
|
src/dra/93BDC.c
|
|
|
|
src/dra/94F50.c
|
|
|
|
src/dra/953A0.c
|
2024-06-02 18:29:17 +00:00
|
|
|
src/dra/d_24CEC.c
|
2024-06-02 19:37:19 +00:00
|
|
|
src/dra/d_2F324.c
|
2024-06-04 00:47:36 +00:00
|
|
|
src/dra/d_3B0D4.c
|
2024-08-08 22:06:26 +00:00
|
|
|
src/dra/bss.c
|
2023-12-27 09:24:00 +00:00
|
|
|
)
|
|
|
|
|
2024-08-08 22:12:22 +00:00
|
|
|
set(SOURCE_FILES_RIC
|
2024-08-15 13:57:54 +00:00
|
|
|
src/ric/pl_header.c
|
2024-08-08 22:12:22 +00:00
|
|
|
src/ric/1AC60.c
|
|
|
|
src/ric/1FCD0.c
|
|
|
|
src/ric/20920.c
|
|
|
|
src/ric/24788.c
|
|
|
|
src/ric/2A060.c
|
|
|
|
src/ric/319C4.c
|
|
|
|
src/ric/spriteparts.c
|
|
|
|
src/ric/1CB04.c
|
|
|
|
src/ric/202A8.c
|
2024-09-30 20:19:51 +00:00
|
|
|
src/ric/211D0.c
|
2024-08-08 22:12:22 +00:00
|
|
|
src/ric/26C84.c
|
|
|
|
src/ric/2C4C4.c
|
2024-08-24 08:57:53 +00:00
|
|
|
src/ric/e_giant_spinning_cross.c
|
2024-08-08 22:12:22 +00:00
|
|
|
src/ric/bss.c
|
|
|
|
src/ric/d_18568.c
|
2024-08-24 08:57:53 +00:00
|
|
|
src/ric/pl_anims.c
|
2024-08-08 22:12:22 +00:00
|
|
|
)
|
|
|
|
|
2024-08-15 00:28:44 +00:00
|
|
|
set(SOURCE_FILES_TT_000
|
2024-10-08 22:33:14 +00:00
|
|
|
src/servant/tt_000/bat.c
|
|
|
|
src/servant/tt_000/servant_clutdata.c
|
|
|
|
src/servant/tt_000/bat_animation_data.c
|
|
|
|
src/servant/tt_000/bat_data.c
|
|
|
|
src/servant/tt_000/servant_spriteparts.c
|
|
|
|
src/servant/tt_000/servant_events.c
|
2024-08-15 00:28:44 +00:00
|
|
|
)
|
|
|
|
|
2024-10-08 17:56:45 +00:00
|
|
|
set(SOURCE_FILES_TT_001
|
|
|
|
src/servant/tt_001/ghost.c
|
|
|
|
src/servant/tt_001/servant_clutdata.c
|
|
|
|
src/servant/tt_001/ghost_animation_data.c
|
|
|
|
src/servant/tt_001/ghost_data.c
|
|
|
|
src/servant/tt_001/servant_spriteparts.c
|
2024-10-08 22:33:14 +00:00
|
|
|
src/servant/tt_001/servant_events.c
|
2024-10-08 17:56:45 +00:00
|
|
|
)
|
|
|
|
|
2024-11-19 14:23:05 +00:00
|
|
|
set(SOURCE_FILES_TT_002
|
|
|
|
src/servant/tt_002/faerie.c
|
|
|
|
src/servant/tt_002/faerie_ability_data.c
|
|
|
|
src/servant/tt_002/faerie_animation_data.c
|
|
|
|
src/servant/tt_002/faerie_data.c
|
|
|
|
src/servant/tt_002/faerie_spriteparts.c
|
|
|
|
src/servant/tt_002/servant_events.c
|
|
|
|
)
|
|
|
|
|
2024-01-11 20:13:33 +00:00
|
|
|
set(SOURCE_FILES_STAGE_SEL
|
2024-06-06 21:21:03 +00:00
|
|
|
src/pc/stages/stage_sel.c
|
2024-01-11 20:13:33 +00:00
|
|
|
src/st/sel/banks.c
|
|
|
|
src/st/sel/CD54.c
|
|
|
|
src/st/sel/2C048.c
|
|
|
|
src/st/sel/33164.c
|
|
|
|
src/st/sel/3410C.c
|
|
|
|
src/st/sel/3585C.c
|
Extract cutscene scripts, portraits and normalize code (#1686)
More research on how cutscenes work.
I normalized all the various C files as `cutscene.c`, marked all the
isolated function as `static` and renamed the main entity as
`{STAGE}_CutsceneExec` (e.g. `CEN_CutsceneExec`). I am using the
`OVL_EXPORT` to automate the names.
TO-DO:
- [x] Rename entity as `{STAGE}_EntityCutscene` for consistency
- [x] CEN
- [x] DRE
- [x] NO3
- [x] NZ0
- [x] ST0
- [x] MAR
~~SEL~~
The offset of the portrait data seems to be hardcoded. I have no idea
how to resolve these offsets at compilation time. The entire cutscene
script thing is very sketchy and horribly designed by the original
developers. What a nightmare to integrate into our project.
This is how a cutscene script gets decompiled:
```
LOAD_PORTRAIT(0x80188D8C, 0),
SET_PORTRAIT(1, 0),
SCRIPT_UNKNOWN_11(),
PLAY_SOUND(0x37B),
WAIT_FOR_SOUND(),
SET_SPEED(4),
'T','h','a','t',' ','v','o','i','c','e','!',' ',
SET_WAIT(16),
SET_SPEED(3),
'A','l','u','c','a','r','d',',',
LINE_BREAK(),
SET_WAIT(16),
SET_FLAG(2),
'i','t','\'','s',' ','y','o','u','!',
SET_WAIT(48),
NEXT_DIALOG(),
```
2024-09-29 02:56:35 +00:00
|
|
|
src/st/sel/cutscene.c
|
2024-01-11 20:13:33 +00:00
|
|
|
)
|
|
|
|
|
2024-09-27 22:13:29 +00:00
|
|
|
set(SOURCE_FILES_STAGE_CEN
|
|
|
|
src/pc/stages/stage_cen.c
|
|
|
|
src/st/cen/header.c
|
|
|
|
src/st/cen/e_laydef.c
|
|
|
|
src/st/cen/e_init.c
|
|
|
|
src/st/cen/rooms.c
|
|
|
|
src/st/cen/e_layout.c
|
|
|
|
src/st/cen/cutscene_data.c
|
|
|
|
src/st/cen/tile_data.c
|
|
|
|
src/st/cen/sprites.c
|
|
|
|
src/st/cen/st_debug.c
|
|
|
|
src/st/cen/e_breakable.c
|
|
|
|
src/st/cen/DB18.c
|
2024-10-14 00:06:52 +00:00
|
|
|
src/st/cen/d_prize_drops.c
|
Extract cutscene scripts, portraits and normalize code (#1686)
More research on how cutscenes work.
I normalized all the various C files as `cutscene.c`, marked all the
isolated function as `static` and renamed the main entity as
`{STAGE}_CutsceneExec` (e.g. `CEN_CutsceneExec`). I am using the
`OVL_EXPORT` to automate the names.
TO-DO:
- [x] Rename entity as `{STAGE}_EntityCutscene` for consistency
- [x] CEN
- [x] DRE
- [x] NO3
- [x] NZ0
- [x] ST0
- [x] MAR
~~SEL~~
The offset of the portrait data seems to be hardcoded. I have no idea
how to resolve these offsets at compilation time. The entire cutscene
script thing is very sketchy and horribly designed by the original
developers. What a nightmare to integrate into our project.
This is how a cutscene script gets decompiled:
```
LOAD_PORTRAIT(0x80188D8C, 0),
SET_PORTRAIT(1, 0),
SCRIPT_UNKNOWN_11(),
PLAY_SOUND(0x37B),
WAIT_FOR_SOUND(),
SET_SPEED(4),
'T','h','a','t',' ','v','o','i','c','e','!',' ',
SET_WAIT(16),
SET_SPEED(3),
'A','l','u','c','a','r','d',',',
LINE_BREAK(),
SET_WAIT(16),
SET_FLAG(2),
'i','t','\'','s',' ','y','o','u','!',
SET_WAIT(48),
NEXT_DIALOG(),
```
2024-09-29 02:56:35 +00:00
|
|
|
src/st/cen/cutscene.c
|
2024-09-27 22:13:29 +00:00
|
|
|
src/st/cen/F890.c
|
|
|
|
src/st/cen/st_update.c
|
|
|
|
src/st/cen/collision.c
|
|
|
|
src/st/cen/create_entity.c
|
|
|
|
src/st/cen/e_red_door.c
|
|
|
|
src/st/cen/st_common.c
|
|
|
|
src/st/cen/e_collect.c
|
|
|
|
src/st/cen/blit_char.c
|
|
|
|
src/st/cen/e_misc.c
|
|
|
|
src/st/cen/e_stage_name.c
|
|
|
|
src/st/cen/e_particles.c
|
|
|
|
src/st/cen/e_room_fg.c
|
|
|
|
src/st/cen/popup.c
|
|
|
|
src/st/cen/prim_helpers.c
|
|
|
|
)
|
|
|
|
|
2024-11-06 19:51:31 +00:00
|
|
|
set(SOURCE_FILES_STAGE_NZ0
|
|
|
|
src/pc/stages/stage_nz0.c
|
|
|
|
src/st/nz0/header.c
|
|
|
|
src/st/nz0/e_laydef.c
|
|
|
|
src/st/nz0/e_init.c
|
|
|
|
src/st/nz0/rooms.c
|
|
|
|
src/st/nz0/e_layout.c
|
|
|
|
src/st/nz0/cutscene_data.c
|
|
|
|
src/st/nz0/tile_data.c
|
|
|
|
src/st/nz0/sprites.c
|
|
|
|
src/st/nz0/30958.c
|
|
|
|
src/st/nz0/e_breakable.c
|
|
|
|
src/st/nz0/d_prize_drops.c
|
|
|
|
src/st/nz0/311C0.c
|
|
|
|
src/st/nz0/337B4.c
|
|
|
|
src/st/nz0/e_explosion_puff_opaque.c
|
|
|
|
src/st/nz0/bossfight.c
|
|
|
|
src/st/nz0/slogra.c
|
|
|
|
src/st/nz0/gaibon.c
|
|
|
|
src/st/nz0/e_elevator.c
|
|
|
|
src/st/nz0/cutscene.c
|
|
|
|
src/st/nz0/maria.c
|
|
|
|
src/st/nz0/st_update.c
|
|
|
|
src/st/nz0/collision.c
|
|
|
|
src/st/nz0/create_entity.c
|
|
|
|
src/st/nz0/e_red_door.c
|
|
|
|
src/st/nz0/st_common.c
|
|
|
|
src/st/nz0/e_collect.c
|
|
|
|
src/st/nz0/blit_char.c
|
|
|
|
src/st/nz0/e_misc.c
|
|
|
|
src/st/nz0/e_particles.c
|
|
|
|
src/st/nz0/e_room_fg.c
|
|
|
|
src/st/nz0/popup.c
|
|
|
|
src/st/nz0/e_bone_scimitar.c
|
|
|
|
src/st/nz0/e_axe_knight.c
|
|
|
|
src/st/nz0/e_bloody_zombie.c
|
|
|
|
src/st/nz0/e_skeleton.c
|
|
|
|
src/st/nz0/e_spittle_bone.c
|
|
|
|
src/st/nz0/e_subweapon_container.c
|
|
|
|
src/st/nz0/e_blood_skeleton.c
|
|
|
|
src/st/nz0/e_magically_sealed_door.c
|
|
|
|
src/st/nz0/e_stage_name.c
|
|
|
|
src/st/nz0/prim_helpers.c
|
|
|
|
src/st/nz0/e_life_up.c
|
|
|
|
)
|
|
|
|
|
2024-06-12 21:03:56 +00:00
|
|
|
set(SOURCE_FILES_STAGE_WRP
|
|
|
|
src/pc/stages/stage_wrp.c
|
2024-10-10 20:37:25 +00:00
|
|
|
src/st/wrp/header.c
|
2024-07-02 20:38:36 +00:00
|
|
|
src/st/wrp/e_laydef.c
|
2024-07-22 14:57:21 +00:00
|
|
|
src/st/wrp/e_init.c
|
2024-06-12 21:03:56 +00:00
|
|
|
src/st/wrp/st_debug.c
|
|
|
|
src/st/wrp/e_breakable.c
|
2024-10-14 00:06:52 +00:00
|
|
|
src/st/wrp/d_prize_drops.c
|
2024-07-02 20:38:36 +00:00
|
|
|
src/st/wrp/rooms.c
|
|
|
|
src/st/wrp/e_layout.c
|
|
|
|
src/st/wrp/tile_data.c
|
|
|
|
src/st/wrp/sprites.c
|
2024-06-12 21:03:56 +00:00
|
|
|
src/st/wrp/warp.c
|
|
|
|
src/st/wrp/st_update.c
|
|
|
|
src/st/wrp/collision.c
|
|
|
|
src/st/wrp/create_entity.c
|
|
|
|
src/st/wrp/e_red_door.c
|
|
|
|
src/st/wrp/st_common.c
|
|
|
|
src/st/wrp/e_collect.c
|
|
|
|
src/st/wrp/blit_char.c
|
|
|
|
src/st/wrp/e_misc.c
|
|
|
|
src/st/wrp/e_stage_name.c
|
|
|
|
src/st/wrp/e_particles.c
|
|
|
|
src/st/wrp/e_room_fg.c
|
|
|
|
src/st/wrp/popup.c
|
|
|
|
src/st/wrp/prim_helpers.c
|
2024-06-18 23:01:03 +00:00
|
|
|
src/st/wrp/bss.c
|
2024-06-12 21:03:56 +00:00
|
|
|
)
|
|
|
|
|
2024-07-10 20:53:04 +00:00
|
|
|
set(SOURCE_FILES_WEAPON
|
|
|
|
src/weapon/w_000.c
|
2024-08-09 16:53:10 +00:00
|
|
|
src/weapon/w_002.c
|
2024-08-18 21:52:32 +00:00
|
|
|
src/weapon/w_007.c
|
2024-08-20 05:00:58 +00:00
|
|
|
src/weapon/w_012.c
|
|
|
|
src/weapon/w_034.c
|
2024-10-11 17:36:59 +00:00
|
|
|
src/weapon/w_037.c
|
2024-08-19 17:51:24 +00:00
|
|
|
src/weapon/w_041.c
|
2024-08-18 08:22:14 +00:00
|
|
|
src/weapon/w_045.c
|
2024-08-15 21:36:06 +00:00
|
|
|
src/weapon/w_046.c
|
2024-08-16 02:47:21 +00:00
|
|
|
src/weapon/w_051.c
|
2024-08-19 17:51:24 +00:00
|
|
|
src/weapon/w_052.c
|
2024-07-10 20:53:04 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# WEAPON_ID needs to be a string and not just a number
|
|
|
|
set_source_files_properties(src/weapon/w_000.c PROPERTIES COMPILE_DEFINITIONS WEAPON_ID=w_000)
|
2024-08-09 16:53:10 +00:00
|
|
|
set_source_files_properties(src/weapon/w_002.c PROPERTIES COMPILE_DEFINITIONS WEAPON_ID=w_002)
|
2024-08-18 21:52:32 +00:00
|
|
|
set_source_files_properties(src/weapon/w_007.c PROPERTIES COMPILE_DEFINITIONS WEAPON_ID=w_007)
|
2024-08-20 05:00:58 +00:00
|
|
|
set_source_files_properties(src/weapon/w_012.c PROPERTIES COMPILE_DEFINITIONS WEAPON_ID=w_012)
|
|
|
|
set_source_files_properties(src/weapon/w_034.c PROPERTIES COMPILE_DEFINITIONS WEAPON_ID=w_034)
|
2024-10-11 17:36:59 +00:00
|
|
|
set_source_files_properties(src/weapon/w_037.c PROPERTIES COMPILE_DEFINITIONS WEAPON_ID=w_037)
|
2024-08-19 17:51:24 +00:00
|
|
|
set_source_files_properties(src/weapon/w_041.c PROPERTIES COMPILE_DEFINITIONS WEAPON_ID=w_041)
|
2024-08-18 08:22:14 +00:00
|
|
|
set_source_files_properties(src/weapon/w_045.c PROPERTIES COMPILE_DEFINITIONS WEAPON_ID=w_045)
|
2024-08-15 21:36:06 +00:00
|
|
|
set_source_files_properties(src/weapon/w_046.c PROPERTIES COMPILE_DEFINITIONS WEAPON_ID=w_046)
|
2024-08-16 02:47:21 +00:00
|
|
|
set_source_files_properties(src/weapon/w_051.c PROPERTIES COMPILE_DEFINITIONS WEAPON_ID=w_051)
|
2024-08-19 17:51:24 +00:00
|
|
|
set_source_files_properties(src/weapon/w_052.c PROPERTIES COMPILE_DEFINITIONS WEAPON_ID=w_052)
|
2024-07-10 20:53:04 +00:00
|
|
|
|
2024-01-19 02:32:22 +00:00
|
|
|
# organization is:
|
|
|
|
# two executables, sdl2 and null, plus a shared library "core"
|
|
|
|
# any executable links core (which is pc shared code + sotn psx code)
|
|
|
|
# the null backend is present to try and help with developing a backend-agnostic interface
|
|
|
|
# and for a basic "does it segfault" check in CI
|
|
|
|
|
|
|
|
# core library
|
|
|
|
|
|
|
|
set(SOURCE_FILES_CORE
|
|
|
|
${SOURCE_FILES_DRA}
|
2024-08-08 22:12:22 +00:00
|
|
|
${SOURCE_FILES_RIC}
|
2023-12-27 09:24:00 +00:00
|
|
|
${SOURCE_FILES_PC}
|
|
|
|
${SOURCE_FILES_PSX_SDK}
|
|
|
|
${SOURCE_FILES_MOCK_SDK}
|
|
|
|
${SOURCE_FILES_3RD}
|
2024-01-11 20:13:33 +00:00
|
|
|
${SOURCE_FILES_STAGE_SEL}
|
2024-10-13 21:15:19 +00:00
|
|
|
${SOURCE_FILES_STAGE_CEN}
|
2024-11-06 19:51:31 +00:00
|
|
|
${SOURCE_FILES_STAGE_NZ0}
|
2024-06-12 21:03:56 +00:00
|
|
|
${SOURCE_FILES_STAGE_WRP}
|
2024-07-10 20:53:04 +00:00
|
|
|
${SOURCE_FILES_WEAPON}
|
2024-08-15 00:28:44 +00:00
|
|
|
${SOURCE_FILES_TT_000}
|
2024-10-08 17:56:45 +00:00
|
|
|
${SOURCE_FILES_TT_001}
|
2024-11-19 14:23:05 +00:00
|
|
|
${SOURCE_FILES_TT_002}
|
2024-01-11 20:13:33 +00:00
|
|
|
)
|
2023-12-27 09:24:00 +00:00
|
|
|
|
2024-01-19 02:32:22 +00:00
|
|
|
add_library(core ${SOURCE_FILES_CORE})
|
|
|
|
|
2024-10-13 11:31:20 +00:00
|
|
|
target_include_directories(core PUBLIC
|
2024-01-19 02:32:22 +00:00
|
|
|
include
|
|
|
|
src/dra
|
|
|
|
src/pc/3rd
|
2024-10-13 11:31:20 +00:00
|
|
|
)
|
2024-01-19 02:32:22 +00:00
|
|
|
|
2024-10-13 11:31:20 +00:00
|
|
|
target_compile_definitions(core PUBLIC
|
2024-01-20 21:07:25 +00:00
|
|
|
_USE_MATH_DEFINES # needed for msvc
|
2024-01-19 02:32:22 +00:00
|
|
|
VERSION_PC
|
|
|
|
PERMUTER
|
|
|
|
NON_MATCHING
|
|
|
|
HARD_LINK
|
|
|
|
DEMO_KEY_PTR=0
|
|
|
|
_internal_version_us
|
2024-10-13 11:31:20 +00:00
|
|
|
)
|
2024-01-19 02:32:22 +00:00
|
|
|
|
|
|
|
# sdl2 target
|
|
|
|
add_executable(${PROJECT_NAME}
|
|
|
|
src/pc/sdl2.c
|
2024-07-14 09:00:15 +00:00
|
|
|
src/pc/render_soft.c
|
|
|
|
src/pc/render_shared.c
|
|
|
|
src/pc/render_gl.c
|
|
|
|
src/pc/psxsdk/mednafen/gpu.cpp
|
|
|
|
src/pc/psxsdk/mednafen/gpu_line.cpp
|
|
|
|
src/pc/psxsdk/mednafen/gpu_polygon.cpp
|
|
|
|
src/pc/psxsdk/mednafen/gpu_sprite.cpp
|
2024-07-17 22:13:17 +00:00
|
|
|
src/pc/sdl2_macros.c
|
2024-10-13 11:31:20 +00:00
|
|
|
)
|
|
|
|
target_include_directories(${PROJECT_NAME} PRIVATE ${SDL2_INCLUDE_DIRS})
|
2024-01-20 21:07:25 +00:00
|
|
|
if (WIN32)
|
2024-10-13 11:31:20 +00:00
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE ${SDL2_LIBRARIES} core)
|
2024-01-20 21:07:25 +00:00
|
|
|
else()
|
2024-10-13 11:31:20 +00:00
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE ${SDL2_LIBRARIES} core m)
|
2024-01-20 21:07:25 +00:00
|
|
|
endif()
|
2024-06-18 17:59:51 +00:00
|
|
|
if(WANT_LIBSND_LLE)
|
2024-10-13 11:31:20 +00:00
|
|
|
target_compile_definitions(core PRIVATE WANT_LIBSND_LLE=1)
|
|
|
|
target_compile_definitions(${PROJECT_NAME} PRIVATE WANT_LIBSND_LLE=1)
|
2024-06-18 17:59:51 +00:00
|
|
|
endif()
|
|
|
|
|
2024-01-19 02:32:22 +00:00
|
|
|
# null target
|
|
|
|
add_executable(${PROJECT_NAME}_null
|
|
|
|
src/pc/null.c
|
2024-10-13 11:31:20 +00:00
|
|
|
)
|
2024-01-19 02:32:22 +00:00
|
|
|
|
2024-01-20 21:07:25 +00:00
|
|
|
if (WIN32)
|
2024-10-13 11:31:20 +00:00
|
|
|
target_link_libraries(${PROJECT_NAME}_null PRIVATE core)
|
2024-01-20 21:07:25 +00:00
|
|
|
else()
|
2024-10-13 11:31:20 +00:00
|
|
|
target_link_libraries(${PROJECT_NAME}_null PRIVATE core m)
|
2024-01-20 21:07:25 +00:00
|
|
|
endif()
|