-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Decompilation] [th05] Stage 5 midboss: Rendering
15 lines of code, and still not quirk-free. Completes P0225, funded by Enderwolf, Blue Bolt, 32th System, and Yanga.
- Loading branch information
Showing
9 changed files
with
82 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/// Stage 5 midboss | ||
/// --------------- | ||
|
||
#pragma option -zCmain_0_TEXT | ||
|
||
#include "platform.h" | ||
#include "pc98.h" | ||
#include "master.hpp" | ||
#include "th02/v_colors.hpp" | ||
#include "th04/math/motion.hpp" | ||
#include "th01/math/subpixel.hpp" | ||
#include "th04/main/phase.hpp" | ||
#include "th04/main/scroll.hpp" | ||
#include "th04/main/playfld.hpp" | ||
#include "th04/main/midboss/midboss.hpp" | ||
|
||
// Constants | ||
// --------- | ||
|
||
static const pixel_t MIDBOSS5_W = 64; | ||
static const pixel_t MIDBOSS5_H = 64; | ||
// --------- | ||
|
||
// Rendering | ||
// --------- | ||
|
||
void pascal near midboss5_render(void) | ||
{ | ||
if(midboss.phase < PHASE_EXPLODE_BIG) { | ||
// ZUN quirk: Should refer to the correct height of the midboss rather | ||
// than hardcoding a wrong 32 pixels. As a result, this midboss plops | ||
// into view rather suddenly during its initial entrance from the top | ||
// of the playfield. Fixed in uth05win. | ||
if(midboss.pos.cur.y < to_sp(PLAYFIELD_TOP - (32 / 2))) { | ||
return; | ||
} | ||
|
||
screen_x_t left = midboss.pos.cur.to_screen_left(MIDBOSS5_W); | ||
vram_y_t top = midboss.pos.cur.to_vram_top_scrolled_seg1(MIDBOSS5_H); | ||
midboss_put_generic(left, top, midboss.sprite); | ||
} else if(midboss.phase == PHASE_BOSS_EXPLODE_BIG) { | ||
midboss_defeat_render(); | ||
} | ||
} | ||
// --------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "th05/main/midboss/m5.cpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters