2019-12-03 21:45:08 +00:00
|
|
|
/* ReC98
|
|
|
|
* -----
|
|
|
|
* Code segment #1 of TH03's MAIN.EXE
|
|
|
|
*/
|
|
|
|
|
|
|
|
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"
|
|
|
|
#include "th03/playfld.hpp"
|
|
|
|
#include "th03/shots.hpp"
|
|
|
|
|
|
|
|
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) {
|
|
|
|
int so = shotpair->so_anim + shotpair->so_pid;
|
|
|
|
int left = playfield_fg_x_to_screen(
|
|
|
|
shotpair->topleft.x, shotpair->pid
|
|
|
|
);
|
|
|
|
int top = shotpair->topleft.y.to_screen() + PLAYFIELD_Y;
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|