Skip to content

Commit

Permalink
[Maintenance] [th04/th05] Split segment #1 before the EMS functions
Browse files Browse the repository at this point in the history
Well, except for GameCore(), which has nothing of interest.

Part of P0168, funded by Blue Bolt and rosenrose.
  • Loading branch information
nmlgc committed Nov 28, 2021
1 parent 99aee2b commit dbd9e23
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 60 deletions.
4 changes: 2 additions & 2 deletions Makefile.mak
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ bin\th04\op.exe: bin\th04\op.obj th04\m_char.cpp bin\th01\vplanset.obj bin\th02\
$**
|

bin\th04\main.exe: bin\th04\main.obj bin\th04\slowdown.obj bin\th04\player_p.obj bin\th04\scoreupd.obj th04\main011.cpp bin\th04\cfg_lres.obj bin\th01\vplanset.obj bin\th03\vector2.obj bin\th02\frmdely1.obj bin\th03\hfliplut.obj th04\mpn_free.cpp bin\th04\input_w.obj th04\mpn_l_i.cpp bin\th04\vector.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.obj bin\th04\snd_kaja.obj bin\th04\snd_mode.obj bin\th04\snd_load.obj bin\th04\cdg_put.obj bin\th04\exit.obj bin\th04\initmain.obj bin\th04\cdg_p_na.obj bin\th04\cdg_p_pr.obj bin\th04\input_s.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\cdg_load.obj th04\gather.cpp bin\th04\scrolly3.obj bin\th04\motion_3.obj th04\bullet_u.cpp th04\main032.cpp
bin\th04\main.exe: bin\th04\main.obj bin\th04\slowdown.obj bin\th04\player_p.obj bin\th04\scoreupd.obj th04\main013.cpp bin\th04\cfg_lres.obj bin\th01\vplanset.obj bin\th03\vector2.obj bin\th02\frmdely1.obj bin\th03\hfliplut.obj th04\mpn_free.cpp bin\th04\input_w.obj th04\mpn_l_i.cpp bin\th04\vector.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.obj bin\th04\snd_kaja.obj bin\th04\snd_mode.obj bin\th04\snd_load.obj bin\th04\cdg_put.obj bin\th04\exit.obj bin\th04\initmain.obj bin\th04\cdg_p_na.obj bin\th04\cdg_p_pr.obj bin\th04\input_s.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th04\cdg_load.obj th04\gather.cpp bin\th04\scrolly3.obj bin\th04\motion_3.obj th04\bullet_u.cpp th04\main032.cpp
$(CC) $(CFLAGS) $(LARGE_LFLAGS) -DGAME=4 -DBINARY='M' -3 -Z -nbin\th04\ -eMAIN.EXE @&&|
$**
|
Expand All @@ -149,7 +149,7 @@ bin\th05\op.exe: th05\op010.cpp bin\th05\op.obj th05\op011.cpp th05\m_char.cpp b
$**
|

bin\th05\main.exe: bin\th05\main.obj bin\th04\slowdown.obj bin\th05\cfg_lres.obj th05\main010.cpp th05\main011.cpp th05\p_common.cpp th05\p_reimu.cpp th05\p_marisa.cpp th05\p_mima.cpp th05\p_yuuka.cpp bin\th05\player.obj bin\th05\hud_bar.obj bin\th05\scoreupd.obj th05\main012.cpp bin\th04\player_p.obj th05\main013.cpp th05\player_a.cpp bin\th05\bullet_1.obj th05\bullet_c.cpp bin\th03\vector2.obj bin\th03\hfliplut.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.obj bin\th04\snd_mode.obj bin\th05\bullet.obj bin\th04\cdg_p_na.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th05\cdg_put.obj bin\th04\exit.obj bin\th05\vector.obj bin\th05\snd_load.obj bin\th05\snd_kaja.obj bin\th05\initmain.obj bin\th05\input_s.obj bin\th05\inp_h_w.obj bin\th05\frmdelay.obj bin\th04\cdg_load.obj bin\th04\scrolly3.obj bin\th04\motion_3.obj th05\main031.cpp th05\gather.cpp th05\main032.cpp th05\bullet_u.cpp th05\main034.cpp th05\main035.cpp
bin\th05\main.exe: bin\th05\main.obj bin\th04\slowdown.obj bin\th05\cfg_lres.obj th05\main010.cpp th05\main011.cpp th05\p_common.cpp th05\p_reimu.cpp th05\p_marisa.cpp th05\p_mima.cpp th05\p_yuuka.cpp bin\th05\player.obj bin\th05\hud_bar.obj bin\th05\scoreupd.obj th05\main013.cpp bin\th04\player_p.obj th05\main014.cpp th05\player_a.cpp bin\th05\bullet_1.obj th05\bullet_c.cpp bin\th03\vector2.obj bin\th03\hfliplut.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.obj bin\th04\snd_mode.obj bin\th05\bullet.obj bin\th04\cdg_p_na.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th05\cdg_put.obj bin\th04\exit.obj bin\th05\vector.obj bin\th05\snd_load.obj bin\th05\snd_kaja.obj bin\th05\initmain.obj bin\th05\input_s.obj bin\th05\inp_h_w.obj bin\th05\frmdelay.obj bin\th04\cdg_load.obj bin\th04\scrolly3.obj bin\th04\motion_3.obj th05\main031.cpp th05\gather.cpp th05\main032.cpp th05\bullet_u.cpp th05\main034.cpp th05\main035.cpp
$(CC) $(CFLAGS) $(LARGE_LFLAGS) -3 -Z -DGAME=5 -DBINARY='M' -nbin\th05\ -eMAIN.EXE @&&|
$**
|
Expand Down
2 changes: 1 addition & 1 deletion th04/main011.cpp → th04/main013.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* ReC98
* -----
* 2nd part of code segment #1 of TH04's MAIN.EXE
* 4th part of code segment #1 of TH04's MAIN.EXE
*/

#pragma option -zCmain_0_TEXT -zPmain_01
Expand Down
8 changes: 6 additions & 2 deletions th04_main.asm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ include th04/main/enemy/enemy.inc
extern __ctype:byte

.seq
main_01 group SLOWDOWN_TEXT, main__TEXT, PLAYER_P_TEXT, main_0_TEXT, main_01_TEXT, main_012_TEXT, CFG_LRES_TEXT, main_013_TEXT
main_01 group SLOWDOWN_TEXT, mai_TEXT, main_TEXT, main__TEXT, PLAYER_P_TEXT, main_0_TEXT, main_01_TEXT, main_012_TEXT, CFG_LRES_TEXT, main_013_TEXT
g_SHARED group SHARED, SHARED_
main_03 group GATHER_TEXT, SCROLLY3_TEXT, MOTION_3_TEXT, main_032_TEXT, main_033_TEXT

Expand Down Expand Up @@ -271,7 +271,7 @@ SLOWDOWN_TEXT segment word public 'CODE' use16
SLOWDOWN_TEXT ends

; Segment type: Pure code
main__TEXT segment word public 'CODE' use16
mai_TEXT segment word public 'CODE' use16
assume cs:main_01
;org 1
assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing
Expand Down Expand Up @@ -1050,7 +1050,9 @@ DemoPlay proc near
pop bp
retn
DemoPlay endp
mai_TEXT ends

main_TEXT segment word public 'CODE' use16

; =============== S U B R O U T I N E =======================================

Expand Down Expand Up @@ -3494,7 +3496,9 @@ sub_D6EB proc far
pop bp
retf
sub_D6EB endp
main_TEXT ends

main__TEXT segment byte public 'CODE' use16

; =============== S U B R O U T I N E =======================================

Expand Down
2 changes: 1 addition & 1 deletion th05/main010.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* 1st part of code segment #1 of TH05's MAIN.EXE
*/

#pragma option -zCmain_TEXT -zPmain_01
#pragma option -zCmai_TEXT -zPmain_01

extern "C" {
#include "th05/main/player/bombanim.cpp"
Expand Down
2 changes: 1 addition & 1 deletion th05/main011.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* 1st part of code segment #1 of TH05's MAIN.EXE
*/

#pragma option -zCmain__TEXT -zPmain_01
#pragma option -zCmain_TEXT -zPmain_01

extern "C" {
#include "th05/main/boss/render.cpp"
Expand Down
10 changes: 0 additions & 10 deletions th05/main012.cpp

This file was deleted.

37 changes: 3 additions & 34 deletions th05/main013.cpp
Original file line number Diff line number Diff line change
@@ -1,41 +1,10 @@
/* ReC98
* -----
* 4th part of code segment #1 of TH05's MAIN.EXE
* 4rd part of code segment #1 of TH05's MAIN.EXE
*/

#pragma option -zCmain_01_TEXT -zPmain_01
#pragma option -zCmain_0_TEXT -zPmain_01

extern "C" {
#include <stddef.h>
#include "platform.h"
#include "pc98.h"
#include "planar.h"
#include "master.hpp"
#include "th01/math/area.hpp"
#include "th01/math/subpixel.hpp"
#include "th03/formats/cdg.h"
#include "th04/math/motion.hpp"
#include "th05/main/playfld.hpp"
#include "th04/main/null.hpp"
#include "th04/main/score.hpp"
#include "th04/main/rank.hpp"
#include "th04/main/item/item.hpp"
#include "th04/main/stage/stage.hpp"
#include "th05/formats/bb.h"
#include "th05/main/boss/boss.hpp"

#include "th04/main/boss/end.cpp"
#include "th04/main/boss/reset.cpp"
#include "th04/formats/bb_stage.c"
#include "th05/main/stage/setup.cpp"

void pascal score_delta_commit(void)
{
while(score_delta > 0) {
score_update_and_render();
}
}

static int unused_6CAC[3];

#include "th04/main/hud/popup.cpp"
}
41 changes: 41 additions & 0 deletions th05/main014.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/* ReC98
* -----
* 5th part of code segment #1 of TH05's MAIN.EXE
*/

#pragma option -zCmain_01_TEXT -zPmain_01

extern "C" {
#include <stddef.h>
#include "platform.h"
#include "pc98.h"
#include "planar.h"
#include "master.hpp"
#include "th01/math/area.hpp"
#include "th01/math/subpixel.hpp"
#include "th03/formats/cdg.h"
#include "th04/math/motion.hpp"
#include "th05/main/playfld.hpp"
#include "th04/main/null.hpp"
#include "th04/main/score.hpp"
#include "th04/main/rank.hpp"
#include "th04/main/item/item.hpp"
#include "th04/main/stage/stage.hpp"
#include "th05/formats/bb.h"
#include "th05/main/boss/boss.hpp"

#include "th04/main/boss/end.cpp"
#include "th04/main/boss/reset.cpp"
#include "th04/formats/bb_stage.c"
#include "th05/main/stage/setup.cpp"

void pascal score_delta_commit(void)
{
while(score_delta > 0) {
score_update_and_render();
}
}

static int unused_6CAC[3];

}
20 changes: 11 additions & 9 deletions th05_main.asm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ include th05/main/enemy/enemy.inc
extern _strlen:proc

.seq
main_01 group SLOWDOWN_TEXT, mai_TEXT, CFG_LRES_TEXT, main_TEXT, main__TEXT, main_0_TEXT, PLAYER_P_TEXT, main_01_TEXT
main_01 group SLOWDOWN_TEXT, ma_TEXT, mai_TEXT, CFG_LRES_TEXT, main_TEXT, main__TEXT, main_0_TEXT, PLAYER_P_TEXT, main_01_TEXT
g_SHARED group SHARED, SHARED_
main_03 group SCROLLY3_TEXT, MOTION_3_TEXT, main_031_TEXT, main_032_TEXT, main_033_TEXT, main_034_TEXT, main_035_TEXT, main_036_TEXT

Expand Down Expand Up @@ -317,7 +317,7 @@ SLOWDOWN_TEXT segment word public 'CODE' use16
SLOWDOWN_TEXT ends

; Segment type: Pure code
mai_TEXT segment word public 'CODE' use16
ma_TEXT segment word public 'CODE' use16
assume cs:main_01
;org 0Dh
assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing
Expand Down Expand Up @@ -1228,7 +1228,9 @@ locret_B825:
leave
retn
DemoPlay endp
ma_TEXT ends

CFG_LRES_TEXT segment byte public 'CODE' use16

; =============== S U B R O U T I N E =======================================

Expand Down Expand Up @@ -1512,13 +1514,11 @@ loc_BAAA:
pop bp
retn
sub_BA66 endp
mai_TEXT ends

CFG_LRES_TEXT segment byte public 'CODE' use16
_cfg_load_resident_ptr procdesc near
CFG_LRES_TEXT ends

main_TEXT segment word public 'CODE' use16
mai_TEXT segment word public 'CODE' use16

; =============== S U B R O U T I N E =======================================

Expand Down Expand Up @@ -2046,9 +2046,9 @@ loc_C565:
pop bp
retn
sub_C52D endp
main_TEXT ends
mai_TEXT ends

main__TEXT segment byte public 'CODE' use16
main_TEXT segment byte public 'CODE' use16
REIMU_STARS_UPDATE_AND_RENDER procdesc pascal near

; =============== S U B R O U T I N E =======================================
Expand Down Expand Up @@ -3458,9 +3458,9 @@ yumeko_bg_render endp

SHINKI_BG_RENDER procdesc pascal near
EXALICE_BG_RENDER procdesc pascal near
main__TEXT ends
main_TEXT ends

main_0_TEXT segment word public 'CODE' use16
main__TEXT segment word public 'CODE' use16

; =============== S U B R O U T I N E =======================================

Expand Down Expand Up @@ -4651,7 +4651,9 @@ loc_F333:
pop bp
retf
sub_F2B4 endp
main__TEXT ends

main_0_TEXT segment byte public 'CODE' use16

; =============== S U B R O U T I N E =======================================

Expand Down

0 comments on commit dbd9e23

Please sign in to comment.