ReC98/th01/main_13_.cpp

60 lines
1.2 KiB
C++
Raw Normal View History

/* ReC98
* -----
* 2nd part of code segment #13 of TH01's REIIDEN.EXE
*/
extern "C" {
#include "th01/th01.h"
#include "th01/math/wave.hpp"
#pragma option -2
#pragma option -O-
#pragma option -Z-
#include "th01/hardware/grp2xscs.cpp"
void egc_wave_unput(
screen_x_t left,
vram_y_t top,
int len,
pixel_t amp,
int ph,
pixel_t w,
pixel_t h
)
{
int t = ph;
for(pixel_t y = 0; y < h; y++) {
screen_x_t x = (wave_x(amp, t) + left);
t += (0x100 / len);
egc_copy_rect_1_to_0_16(x, top + y, w, 1);
}
}
void graph_hline_unput_masked(
screen_x_t left, vram_y_t top, dots8_t *mask, vram_byte_amount_t w
)
{
planar8_t px8;
register vram_offset_t p = vram_offset_shift(left, top);
for(vram_byte_amount_t x = 0; x < w; x++, p++) {
if(mask[x]) {
graph_accesspage_func(1);
px8.B = mask[x] & VRAM_PLANE_B[p];
px8.R = mask[x] & VRAM_PLANE_R[p];
px8.G = mask[x] & VRAM_PLANE_G[p];
px8.E = mask[x] & VRAM_PLANE_E[p];
graph_accesspage_func(0);
grcg_setcolor_rmw(0);
VRAM_PLANE_B[p] = mask[x];
grcg_off();
VRAM_PLANE_B[p] |= px8.B;
VRAM_PLANE_R[p] |= px8.R;
VRAM_PLANE_G[p] |= px8.G;
VRAM_PLANE_E[p] |= px8.E;
}
}
}
}