2022-04-29 18:06:14 +00:00
|
|
|
#include <stddef.h>
|
|
|
|
#include "platform.h"
|
|
|
|
#include "master.hpp"
|
|
|
|
#include "th02/main/execl.hpp"
|
|
|
|
#include "th04/score.h"
|
|
|
|
#include "th04/hardware/inputvar.h"
|
|
|
|
#include "th04/main/frames.h"
|
|
|
|
#include "th04/main/demo.hpp"
|
|
|
|
#if (GAME == 5)
|
|
|
|
#include "th04/common.h"
|
|
|
|
#include "th05/mem.h"
|
|
|
|
#include "th05/resident.hpp"
|
|
|
|
#else
|
|
|
|
#include "th04/mem.h"
|
|
|
|
#include "th04/resident.hpp"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void near DemoPlay(void)
|
|
|
|
{
|
2023-10-13 21:17:39 +00:00
|
|
|
#undef BINARY_OP
|
|
|
|
#define BINARY_OP DEMOPLAY_BINARY_OP
|
|
|
|
extern const char BINARY_OP[];
|
2022-04-29 18:06:14 +00:00
|
|
|
|
|
|
|
#if (GAME == 5)
|
|
|
|
size_t shift_offset = (resident->demo_num <= 4) ? DEMO_N : DEMO_N_EXTRA;
|
|
|
|
#else
|
|
|
|
#define shift_offset DEMO_N
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// In TH04, replay playback ends by pressing anything. In TH05, only the
|
|
|
|
// non-movement inputs (shot, bomb, cancel, OK, and Q) work.
|
|
|
|
if(
|
|
|
|
((GAME == 5) && ((key_det & ~INPUT_MOVEMENT) == 0)) ||
|
|
|
|
((GAME == 4) && (key_det == INPUT_NONE))
|
|
|
|
) {
|
|
|
|
key_det = DemoBuf[stage_frame];
|
|
|
|
shiftkey = DemoBuf[stage_frame + shift_offset];
|
|
|
|
if(
|
|
|
|
((GAME == 5) && (resident->demo_num > 4)) ||
|
|
|
|
(stage_frame < (DEMO_N - 4))
|
|
|
|
) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2023-10-13 21:17:39 +00:00
|
|
|
demo_end();
|
2022-04-29 18:06:14 +00:00
|
|
|
}
|