2019-01-25 02:36:42 +00:00
|
|
|
/*** T I L E S ***/
|
2019-02-26 03:19:08 +00:00
|
|
|
#ifndef __TILES_H__
|
|
|
|
#define __TILES_H__
|
2019-01-25 02:36:42 +00:00
|
|
|
|
|
|
|
void tile_init();
|
|
|
|
|
2019-04-26 01:55:23 +00:00
|
|
|
void loadTiles(unsigned int tilesOffset, unsigned int far *memTiles);
|
2019-01-25 02:36:42 +00:00
|
|
|
void loadMap(unsigned char *map, unsigned int w, unsigned int h);
|
2019-04-26 01:55:23 +00:00
|
|
|
void drawSprite(unsigned int far *sprite, int x, int y);
|
2019-01-25 02:36:42 +00:00
|
|
|
void scroll(int newX, int newY);
|
|
|
|
void drawScreen();
|
2019-02-16 00:39:50 +00:00
|
|
|
|
2019-02-26 03:19:08 +00:00
|
|
|
void blit32x32(unsigned int offsetFrom, unsigned int offsetTo);
|
|
|
|
|
2019-08-07 02:47:15 +00:00
|
|
|
void writeTile(unsigned int *buf, unsigned int far *tile);
|
|
|
|
void overlaySprite(unsigned int *buf, unsigned int far *sprite, int shift, int yStart);
|
|
|
|
void paintBuffer(unsigned int *buf, unsigned int vidOffset);
|
|
|
|
|
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
|
|
|
|
2019-04-26 01:55:23 +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;
|
2019-04-26 01:55:23 +00:00
|
|
|
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;
|
|
|
|
|
2019-02-26 03:19:08 +00:00
|
|
|
extern TiledScreen_t screen;
|
|
|
|
|
|
|
|
#endif
|