2019-12-03 21:45:08 +00:00
|
|
|
/* ReC98
|
|
|
|
* -----
|
2022-02-15 13:19:07 +00:00
|
|
|
* 2nd part of code segment #1 of TH03's MAIN.EXE
|
2019-12-03 21:45:08 +00:00
|
|
|
*/
|
|
|
|
|
2021-11-23 11:26:11 +00:00
|
|
|
extern "C" {
|
[Maintenance] Templatize RGB and palette types for 4- and 8-bit components
Right, PC-98 hardware only supports 4 bits per RGB component, for a
total of 4,096 possible colors. The 8-bit RGB color values we've been
seeing throughout the later games are a master.lib extension, to allow
for more toning precision. Which TH01, with all its NIH syndrome,
doesn't use.
And yup, that means templates in the most basic header files… Since
that would have meant renaming *everything* to compile as C++, I simply
made these types exclusive to C++ code, thcrap style.
Part of P0066, funded by Keyblade Wiedling Neko and Splashman.
2020-01-05 11:05:42 +00:00
|
|
|
#include "platform.h"
|
2019-12-03 21:45:08 +00:00
|
|
|
#include "pc98.h"
|
|
|
|
#include "th03/sprite16.hpp"
|
2020-04-05 14:17:33 +00:00
|
|
|
#include "th03/main/playfld.hpp"
|
2021-11-22 10:48:24 +00:00
|
|
|
#include "th03/main/player/shot.hpp"
|
2019-12-03 21:45:08 +00:00
|
|
|
|
|
|
|
void pascal near shots_update(void)
|
|
|
|
{
|
|
|
|
shotpair_t near *shotpair = shotpairs;
|
|
|
|
for(int i = 0; i < SHOTPAIR_COUNT; i++, shotpair++) {
|
|
|
|
if(shotpair->flag) {
|
|
|
|
shotpair->topleft.y.v += shotpair->velocity_y.v;
|
|
|
|
if(shotpair->topleft.y.v <= to_sp(-1.0f)) {
|
|
|
|
shotpair->flag = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void pascal near shots_render(void)
|
|
|
|
{
|
|
|
|
shotpair_t near *shotpair = shotpairs;
|
|
|
|
|
|
|
|
sprite16_put_w = SHOT_W;
|
|
|
|
sprite16_put_h = SHOT_H;
|
|
|
|
sprite16_clip_left = 0;
|
|
|
|
sprite16_clip_right = RES_X - 1;
|
|
|
|
|
|
|
|
for(int i = 0; i < SHOTPAIR_COUNT; i++, shotpair++) {
|
|
|
|
if(shotpair->flag) {
|
2022-02-10 03:39:40 +00:00
|
|
|
sprite16_offset_t so = (shotpair->so_anim + shotpair->so_pid);
|
2020-08-20 19:59:45 +00:00
|
|
|
screen_x_t left = playfield_fg_x_to_screen(
|
2019-12-03 21:45:08 +00:00
|
|
|
shotpair->topleft.x, shotpair->pid
|
|
|
|
);
|
2020-08-25 18:29:24 +00:00
|
|
|
screen_y_t top = shotpair->topleft.y.to_pixel() + PLAYFIELD_TOP;
|
2019-12-03 21:45:08 +00:00
|
|
|
|
|
|
|
sprite16_put(left + 0, top, so);
|
|
|
|
sprite16_put(left + SHOTPAIR_DISTANCE, top, so);
|
|
|
|
|
|
|
|
shotpair->so_anim += SHOT_VRAM_W;
|
|
|
|
if(shotpair->so_anim >= (SHOT_VRAM_W * SHOT_SPRITE_COUNT)) {
|
|
|
|
shotpair->so_anim = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|