[Reverse-engineering] [th01] Reimu's X position

13 copies of the clamping branches… Quality.

Part of P0096, funded by Ember2528.
This commit is contained in:
nmlgc 2020-06-05 21:45:55 +02:00
parent dd89843fae
commit 52b8414993
8 changed files with 379 additions and 353 deletions

View File

@ -59,7 +59,7 @@ bin\th01\op.exe: bin\piloadc.obj bin\th01\op.obj th01\op_01.cpp th01\op_02.c th0
$**
|
bin\th01\reiiden.exe: bin\piloadc.obj bin\th01\reiiden.obj th01\main_01.cpp th01\main_02.c th01\main_03.c th01\main_04.c th01\main_05.c th01\main_06.cpp th01\main_07.cpp th01\main_08.cpp th01\main_12.c th01\main_13.cpp th01\main_13_.c th01\main_14.c th01\main_16.c th01\main_19.cpp th01\main_25.cpp th01\main_38.cpp
bin\th01\reiiden.exe: bin\piloadc.obj bin\th01\reiiden.obj th01\main_01.cpp th01\main_02.c th01\main_03.c th01\main_04.c th01\main_05.c th01\main_06.cpp th01\main_07.cpp th01\main_08.cpp th01\main_12.c th01\main_13.cpp th01\main_13_.c th01\main_14.c th01\main_16.c th01\main_19.cpp th01\main_25.cpp th01\main_27.cpp th01\main_38.cpp
$(CC) $(CFLAGS) -ml -3 -DGAME=1 -DBINARY='M' -nbin\th01\ -eREIIDEN.EXE @&&|
$**
|

12
th01/main/player/move.cpp Normal file
View File

@ -0,0 +1,12 @@
#include "th01/main/playfld.hpp"
#include "th01/main/player/player.hpp"
void player_move_and_clamp(int delta)
{
player_left += delta;
if(player_left < PLAYER_LEFT_MIN) {
player_left = PLAYER_LEFT_MIN;
} else if(player_left >= PLAYER_LEFT_MAX) {
player_left = PLAYER_LEFT_MAX;
}
}

View File

@ -0,0 +1,10 @@
static const int PLAYER_W = 32;
static const int PLAYER_LEFT_MIN = (PLAYFIELD_LEFT);
static const int PLAYER_LEFT_MAX = (PLAYFIELD_RIGHT - PLAYER_W);
static const int PLAYER_LEFT_START = (PLAYFIELD_CENTER - (PLAYER_W / 2));
extern int player_left;
void player_move_and_clamp(int delta);

View File

@ -0,0 +1,10 @@
PLAYER_W = 32
PLAYER_LEFT_MIN = (PLAYFIELD_LEFT)
PLAYER_LEFT_MAX = (PLAYFIELD_RIGHT - PLAYER_W)
PLAYER_LEFT_START = (PLAYFIELD_CENTER - (PLAYER_W / 2))
public _PLAYER_INVINCIBILITY_TIME, _player_left
_player_invincibility_time dw ?
_player_left dw ?

5
th01/main/playfld.hpp Normal file
View File

@ -0,0 +1,5 @@
static const int PLAYFIELD_LEFT = 0;
static const int PLAYFIELD_RIGHT = RES_X;
static const int PLAYFIELD_CENTER = (
((PLAYFIELD_RIGHT - PLAYFIELD_LEFT) / 2) + PLAYFIELD_LEFT
);

3
th01/main/playfld.inc Normal file
View File

@ -0,0 +1,3 @@
PLAYFIELD_LEFT = 0
PLAYFIELD_RIGHT = RES_X
PLAYFIELD_CENTER = (((PLAYFIELD_RIGHT - PLAYFIELD_LEFT) / 2) + PLAYFIELD_LEFT)

12
th01/main_27.cpp Normal file
View File

@ -0,0 +1,12 @@
/* ReC98
* -----
* Code segment #27 of TH01's REIIDEN.EXE
*/
extern "C" {
#include "platform.h"
#include "pc98.h"
#include "th01/main/player/move.cpp"
}

File diff suppressed because it is too large Load Diff