2021-09-15 23:24:19 +00:00
|
|
|
#ifndef COMMAND_MACROS_BASE_H
|
|
|
|
#define COMMAND_MACROS_BASE_H
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Command Base macros intended for use in designing of more specific command macros
|
2021-11-30 23:40:42 +00:00
|
|
|
* Each macro packs bytes (B), halfwords (H) and words (W, for consistency) into a single word
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
*/
|
2021-12-27 19:23:03 +00:00
|
|
|
/*
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
#define CMD_BBBB(a, b, c, d) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 8, 8) | _SHIFTL(d, 0, 8))
|
|
|
|
|
|
|
|
#define CMD_BBH(a, b, c) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 0, 16))
|
|
|
|
|
|
|
|
#define CMD_HBB(a, b, c) (_SHIFTL(a, 16, 16) | _SHIFTL(b, 8, 8) | _SHIFTL(c, 0, 8))
|
|
|
|
|
|
|
|
#define CMD_HH(a, b) (_SHIFTL(a, 16, 16) | _SHIFTL(b, 0, 16))
|
|
|
|
|
|
|
|
#define CMD_W(a) (a)
|
2021-12-27 19:23:03 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#if IS_BIG_ENDIAN
|
|
|
|
#if IS_64_BIT
|
|
|
|
#define CMD_BBBB(a, b, c, d) \
|
|
|
|
((uintptr_t)(_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 8, 8) | _SHIFTL(d, 0, 8)) << 32)
|
|
|
|
#define CMD_BBH(a, b, c) ((uintptr_t)(_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 0, 16)) << 32)
|
|
|
|
#define CMD_HH(a, b) ((uintptr_t)(_SHIFTL(a, 16, 16) | _SHIFTL(b, 0, 16)) << 32)
|
|
|
|
#define CMD_W(a) ((uintptr_t)(a) << 32)
|
|
|
|
#else
|
|
|
|
#define CMD_BBBB(a, b, c, d) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 8, 8) | _SHIFTL(d, 0, 8))
|
|
|
|
#define CMD_BBH(a, b, c) (_SHIFTL(a, 24, 8) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 0, 16))
|
|
|
|
#define CMD_HBB(a, b, c) (_SHIFTL(a, 16, 16) | _SHIFTL(b, 8, 8) | _SHIFTL(c, 0, 8))
|
|
|
|
#define CMD_HH(a, b) (_SHIFTL(a, 16, 16) | _SHIFTL(b, 0, 16))
|
|
|
|
#define CMD_W(a) (a)
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#if IS_64_BIT
|
|
|
|
#define CMD_BBBB(a, b, c, d) (_SHIFTL(a, 0, 8) | _SHIFTL(b, 8, 8) | _SHIFTL(c, 16, 8) | _SHIFTL(d, 24, 8))
|
|
|
|
#define CMD_BBH(a, b, c) (_SHIFTL(a, 0, 8) | _SHIFTL(b, 8, 8) | _SHIFTL(c, 16, 16))
|
|
|
|
#define CMD_HBB(a, b, c) (_SHIFTL(a, 0, 16) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 24, 8))
|
|
|
|
#define CMD_HH(a, b) (_SHIFTL(a, 0, 16) | _SHIFTL(b, 16, 16))
|
|
|
|
#define CMD_W(a) (a)
|
|
|
|
#else
|
|
|
|
#define CMD_BBBB(a, b, c, d) (_SHIFTL(a, 0, 8) | _SHIFTL(b, 8, 8) | _SHIFTL(c, 16, 8) | _SHIFTL(d, 24, 8))
|
|
|
|
#define CMD_BBH(a, b, c) (_SHIFTL(a, 0, 8) | _SHIFTL(b, 8, 8) | _SHIFTL(c, 16, 16))
|
|
|
|
#define CMD_HBB(a, b, c) (_SHIFTL(a, 0, 16) | _SHIFTL(b, 16, 8) | _SHIFTL(c, 24, 8))
|
|
|
|
#define CMD_HH(a, b) (_SHIFTL(a, 0, 16) | _SHIFTL(b, 16, 16))
|
|
|
|
#define CMD_W(a) (a)
|
|
|
|
#endif
|
|
|
|
#endif
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
|
2021-11-25 02:41:23 +00:00
|
|
|
#ifdef __GNUC__
|
|
|
|
#define CMD_F(a) {.f = (a)}
|
|
|
|
#else
|
2021-12-27 19:23:03 +00:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
#define CMD_F(a) {.f = (a)}
|
|
|
|
#else
|
2021-11-25 02:41:23 +00:00
|
|
|
#define CMD_F(a) {(a)}
|
|
|
|
#endif
|
2021-12-27 19:23:03 +00:00
|
|
|
#endif
|
2021-11-25 02:41:23 +00:00
|
|
|
|
2022-02-12 19:50:06 +00:00
|
|
|
#define CMD_PTR(a) (uintptr_t)(a)
|
2021-05-08 21:16:21 +00:00
|
|
|
|
Create Macros for Cutscene Data (#63)
* Added additional (potentially unused) fields to macros, now builds OK
* Ran formatter, attempted better macro formatting
* Formatted unknown fields as hex, further cleanups
* Rename and prefix macros, use command base macros, format cutscenes with indents
* Move command macros into a new file and include it globally
* Generate cutscene command macros for Bg_Toki_Swd, Cleanups
* Rename CS_TEXTBOX commands to CS_TEXT, fix typo ic command_macros_base.h
* Introduce CS_CMD_CONTINUE and CS_CMD_STOP
* Remove apparently redundant arguments in certain commands, include the values in the macros directly
* Re-add cutscene terminator destination enum values to example cutscene data
* Format what should be floats as hex, Change actorAnim to actorAction
* Allow floating-point representation of values in cutscene data (asm-processor hack)
* Include cutscene commands only where necessary, documentation fixes
* Rename actor actions to npc actions, separate player action from npc actions
* Remove PlayerActionIDs for now as relevant information on it is not yet decompiled
* Generate cutscene data for en_ru1, remove apparent redundancies in CS_LIGHTING and CS_PLAY/STOP/FADE_BGM commands, relax static requirement in asm-processor CutsceneData float conversion
2020-05-20 11:37:28 +00:00
|
|
|
#endif
|