pete286/tiles.h

43 lines
1.1 KiB
C
Raw Normal View History

/*** T I L E S ***/
#ifndef __TILES_H__
#define __TILES_H__
void tile_init();
void loadTiles(unsigned int tilesOffset, unsigned int far *memTiles);
void loadMap(unsigned char *map, unsigned int w, unsigned int h);
void drawSprite(unsigned int far *sprite, int x, int y);
void scroll(int newX, int newY);
void drawScreen();
2019-02-16 00:39:50 +00:00
void blit32x32(unsigned int offsetFrom, unsigned int offsetTo);
2019-02-16 00:39:50 +00:00
#define PAGE_TILES_W 21
#define PAGE_TILES_H 14
#define PAGE_TILES_COUNT (PAGE_TILES_H * PAGE_TILES_W)
#define PAGE_STRIDE (PAGE_TILES_W << 1)
2019-02-18 01:14:56 +00:00
#define NUM_BUFFERS 20
2019-02-18 01:14:56 +00:00
#define BUF_WSTRIDE 16
#define BUF_WSIZE (BUF_WSTRIDE * 4)
typedef struct {
unsigned int w;
unsigned int h;
int scrollX;
int scrollY;
unsigned int pageOffset[2];
unsigned char dirty[2][PAGE_TILES_COUNT];
unsigned int tilesOffset;
unsigned int far *memTiles;
2019-02-18 01:14:56 +00:00
unsigned char *map;
unsigned int buffer[NUM_BUFFERS][BUF_WSIZE];
unsigned int bufferOffset[NUM_BUFFERS];
unsigned char currentPage;
unsigned char nextBuffer;
unsigned char firstBuffer;
} TiledScreen_t;
extern TiledScreen_t screen;
#endif