2021-07-15 17:20:11 +00:00
|
|
|
#include "th02/main/scroll.hpp"
|
|
|
|
|
2020-04-30 17:24:28 +00:00
|
|
|
// [scroll_line] is advanced by 1 for every 16 units.
|
|
|
|
extern SubpixelLength8 scroll_subpixel_line;
|
|
|
|
|
2023-03-27 21:34:53 +00:00
|
|
|
// Amount to add to [scroll_subpixel_line] every frame. Replaces TH02's
|
|
|
|
// separate pixel-based [scroll_speed] and [scroll_interval] with a single
|
|
|
|
// variable.
|
2020-04-30 17:24:28 +00:00
|
|
|
extern SubpixelLength8 scroll_speed;
|
|
|
|
|
2020-08-20 19:59:45 +00:00
|
|
|
extern vram_y_t scroll_line_on_page[2];
|
2020-04-30 17:24:28 +00:00
|
|
|
|
|
|
|
// Playfield-space pixels scrolled in the last frame.
|
|
|
|
extern Subpixel scroll_last_delta;
|
|
|
|
|
|
|
|
// If false, the game doesn't draw stage tiles, assuming that someone else
|
|
|
|
// draws the background.
|
|
|
|
extern bool scroll_active;
|
|
|
|
|
2023-10-07 20:26:56 +00:00
|
|
|
#pragma codeseg mai_TEXT main_01
|
2023-05-27 21:45:12 +00:00
|
|
|
|
2020-04-30 17:24:28 +00:00
|
|
|
// Transforms [y] to its corresponding VRAM line, adding the current
|
|
|
|
// [scroll_line] or 0 if scrolling is disabled.
|
2022-11-24 05:33:36 +00:00
|
|
|
extern "C" vram_y_t pascal near scroll_subpixel_y_to_vram_seg1(subpixel_t y);
|
2023-05-27 21:45:12 +00:00
|
|
|
|
|
|
|
#pragma codeseg
|
|
|
|
|
2024-05-26 17:39:06 +00:00
|
|
|
extern "C" {
|
|
|
|
|
2023-05-27 21:45:12 +00:00
|
|
|
// Transforms [y] to its corresponding VRAM line, adding the current
|
|
|
|
// [scroll_line] or 0 if scrolling is disabled.
|
2020-08-20 19:59:45 +00:00
|
|
|
vram_y_t pascal near scroll_subpixel_y_to_vram_seg3(subpixel_t y);
|
2023-05-27 21:45:12 +00:00
|
|
|
|
2020-04-30 17:24:28 +00:00
|
|
|
// Like the one above, but always adds [scroll_line], even if scrolling is
|
|
|
|
// disabled.
|
2020-08-20 19:59:45 +00:00
|
|
|
vram_y_t pascal near scroll_subpixel_y_to_vram_always(subpixel_t y);
|
2024-05-26 17:39:06 +00:00
|
|
|
|
|
|
|
}
|