1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2024-11-22 14:33:51 +00:00
8bitworkshop/presets/c64/scrolling.h

52 lines
1.3 KiB
C
Raw Normal View History

2020-02-02 18:17:31 +00:00
#ifndef _SCROLLING_H
#define _SCROLLING_H
#include "common.h"
// drawable screen area (only shows 38 x 24)
#define COLS 40
#define ROWS 25
extern sbyte scroll_fine_x; // X fine scroll (pixels)
extern sbyte scroll_fine_y; // Y fine scroll (pixels)
extern byte origin_x; // X scroll origin (columns)
extern byte origin_y; // Y scroll origin (rows)
extern byte* hidbuf; // hidden screen buffer(s)
extern byte* visbuf; // visible screen buffer(s)
2020-02-04 17:58:46 +00:00
extern byte colorbuf[COLS*ROWS]; // color RAM buffer
2020-02-02 18:17:31 +00:00
extern byte swap_needed; // TRUE if scroll_update() swaps
// call this at start of program
void scroll_setup(void);
// scroll in X or Y directions
2022-08-25 20:52:04 +00:00
void scroll_xy(sbyte delta_x, sbyte delta_y);
2020-02-02 18:17:31 +00:00
void scroll_horiz(sbyte delta_x);
void scroll_vert(sbyte delta_y);
2022-07-20 19:32:47 +00:00
// call this right after vblank
2020-02-02 18:17:31 +00:00
void scroll_update(void);
// caller must implement these two
void scroll_draw_column(byte col);
void scroll_draw_row(byte row);
2022-08-09 14:47:55 +00:00
/* incremental scrolling library */
extern int pixofs_x; // X scroll pixel offset
extern int pixofs_y; // Y scroll pixel offset
2022-08-11 20:27:20 +00:00
extern sbyte fine_correct_x;
extern sbyte fine_correct_y;
2022-08-09 14:47:55 +00:00
void scroll_start(byte dir);
void scroll_finish(void);
void scroll_refresh(void);
#define SCROLL_LEFT 1
#define SCROLL_RIGHT 2
#define SCROLL_UP 4
#define SCROLL_DOWN 8
2020-02-02 18:17:31 +00:00
#endif