2020-05-24 17:04:55 +00:00
|
|
|
#include "th01/end/pic.hpp"
|
|
|
|
|
|
|
|
#pragma option -O-
|
|
|
|
|
|
|
|
void pascal end_pics_load_palette_show(const char *fn)
|
|
|
|
{
|
|
|
|
graph_accesspage_func(1);
|
|
|
|
grp_put_palette_show(fn);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Avoid symbol duplication...
|
|
|
|
#define egc_start_copy egc_start_copy_1
|
|
|
|
#include "th01/hardware/egcscopy.c"
|
|
|
|
|
2020-08-21 18:13:08 +00:00
|
|
|
static const pixel_t PIC_W = (RES_X / 2);
|
|
|
|
static const pixel_t PIC_H = (RES_Y / 2);
|
2020-08-20 19:59:45 +00:00
|
|
|
static const screen_x_t PIC_LEFT = ((RES_X / 2) - (PIC_W / 2));
|
|
|
|
static const screen_y_t PIC_TOP = ((RES_Y / 2) - (PIC_H / 2));
|
2020-05-24 17:04:55 +00:00
|
|
|
|
2020-08-21 18:13:08 +00:00
|
|
|
static const pixel_t PIC_VRAM_W = (PIC_W / BYTE_DOTS);
|
2020-05-24 17:04:55 +00:00
|
|
|
|
|
|
|
void end_pic_show(int quarter)
|
|
|
|
{
|
|
|
|
egc_start_copy();
|
|
|
|
|
2020-08-21 18:13:08 +00:00
|
|
|
pixel_t src_left = ((quarter % 2) * PIC_W);
|
|
|
|
pixel_t src_top = ((quarter / 2) * PIC_H);
|
2020-08-21 17:18:28 +00:00
|
|
|
uvram_offset_t vram_offset_src = vram_offset_shift(src_left, src_top);
|
|
|
|
uvram_offset_t vram_offset_dst = vram_offset_shift(PIC_LEFT, PIC_TOP);
|
2020-08-21 18:13:08 +00:00
|
|
|
vram_word_amount_t vram_x;
|
|
|
|
pixel_t y;
|
2020-05-24 17:04:55 +00:00
|
|
|
|
|
|
|
for(y = 0; y < PIC_H; y++) {
|
|
|
|
for(vram_x = 0; vram_x < (PIC_VRAM_W / sizeof(dots16_t)); vram_x++) {
|
|
|
|
dots16_t d;
|
|
|
|
|
2020-09-25 19:21:56 +00:00
|
|
|
graph_accesspage_func(1); egc_snap(d, vram_offset_src, 16);
|
|
|
|
graph_accesspage_func(0); egc_put(vram_offset_dst, d, 16);
|
2020-05-24 17:04:55 +00:00
|
|
|
|
|
|
|
vram_offset_src += sizeof(dots16_t);
|
|
|
|
vram_offset_dst += sizeof(dots16_t);
|
|
|
|
}
|
|
|
|
vram_offset_src += (ROW_SIZE - PIC_VRAM_W);
|
|
|
|
vram_offset_dst += (ROW_SIZE - PIC_VRAM_W);
|
|
|
|
}
|
|
|
|
egc_off();
|
|
|
|
}
|
|
|
|
|
|
|
|
#pragma option -O.
|