2016-03-20 17:00:00 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* REminiscence - Flashback interpreter
|
2018-01-20 17:00:00 +01:00
|
|
|
* Copyright (C) 2005-2018 Gregory Montoir (cyx@users.sourceforge.net)
|
2015-08-02 18:00:00 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef VIDEO_H__
|
|
|
|
#define VIDEO_H__
|
|
|
|
|
|
|
|
#include "intern.h"
|
|
|
|
|
|
|
|
struct Resource;
|
|
|
|
struct SystemStub;
|
|
|
|
|
|
|
|
struct Video {
|
2018-02-10 17:00:00 +01:00
|
|
|
typedef void (Video::*drawCharFunc)(uint8_t *, int, int, int, const uint8_t *, uint8_t, uint8_t);
|
2016-05-09 18:00:00 +02:00
|
|
|
|
2015-08-02 18:00:00 +02:00
|
|
|
enum {
|
|
|
|
GAMESCREEN_W = 256,
|
|
|
|
GAMESCREEN_H = 224,
|
|
|
|
SCREENBLOCK_W = 8,
|
|
|
|
SCREENBLOCK_H = 8,
|
|
|
|
CHAR_W = 8,
|
|
|
|
CHAR_H = 8
|
|
|
|
};
|
|
|
|
|
|
|
|
static const uint8_t _conradPal1[];
|
|
|
|
static const uint8_t _conradPal2[];
|
|
|
|
static const uint8_t _textPal[];
|
|
|
|
static const uint8_t _palSlot0xF[];
|
2017-12-06 17:00:00 +01:00
|
|
|
static const uint8_t _font8Jp[];
|
2015-08-02 18:00:00 +02:00
|
|
|
|
|
|
|
Resource *_res;
|
|
|
|
SystemStub *_stub;
|
|
|
|
|
2016-03-20 17:00:00 +01:00
|
|
|
int _w, _h;
|
|
|
|
int _layerSize;
|
2018-02-10 17:00:00 +01:00
|
|
|
int _layerScale; // 1 for Amiga/PC, 2 for Macintosh
|
2015-08-02 18:00:00 +02:00
|
|
|
uint8_t *_frontLayer;
|
|
|
|
uint8_t *_backLayer;
|
|
|
|
uint8_t *_tempLayer;
|
|
|
|
uint8_t *_tempLayer2;
|
|
|
|
uint8_t _unkPalSlot1, _unkPalSlot2;
|
|
|
|
uint8_t _mapPalSlot1, _mapPalSlot2, _mapPalSlot3, _mapPalSlot4;
|
|
|
|
uint8_t _charFrontColor;
|
|
|
|
uint8_t _charTransparentColor;
|
|
|
|
uint8_t _charShadowColor;
|
|
|
|
uint8_t *_screenBlocks;
|
|
|
|
bool _fullRefresh;
|
|
|
|
uint8_t _shakeOffset;
|
2016-05-09 18:00:00 +02:00
|
|
|
drawCharFunc _drawChar;
|
2015-08-02 18:00:00 +02:00
|
|
|
|
|
|
|
Video(Resource *res, SystemStub *stub);
|
|
|
|
~Video();
|
|
|
|
|
|
|
|
void markBlockAsDirty(int16_t x, int16_t y, uint16_t w, uint16_t h);
|
|
|
|
void updateScreen();
|
|
|
|
void fullRefresh();
|
|
|
|
void fadeOut();
|
|
|
|
void fadeOutPalette();
|
|
|
|
void setPaletteColorBE(int num, int offset);
|
|
|
|
void setPaletteSlotBE(int palSlot, int palNum);
|
|
|
|
void setPaletteSlotLE(int palSlot, const uint8_t *palData);
|
|
|
|
void setTextPalette();
|
|
|
|
void setPalette0xF();
|
2016-03-20 17:00:00 +01:00
|
|
|
void PC_decodeLev(int level, int room);
|
2015-08-02 18:00:00 +02:00
|
|
|
void PC_decodeMap(int level, int room);
|
|
|
|
void PC_setLevelPalettes();
|
|
|
|
void PC_decodeIcn(const uint8_t *src, int num, uint8_t *dst);
|
|
|
|
void PC_decodeSpc(const uint8_t *src, int w, int h, uint8_t *dst);
|
|
|
|
void AMIGA_decodeLev(int level, int room);
|
|
|
|
void AMIGA_decodeSpm(const uint8_t *src, uint8_t *dst);
|
|
|
|
void AMIGA_decodeIcn(const uint8_t *src, int num, uint8_t *dst);
|
|
|
|
void AMIGA_decodeSpc(const uint8_t *src, int w, int h, uint8_t *dst);
|
2016-03-20 17:00:00 +01:00
|
|
|
void AMIGA_decodeCmp(const uint8_t *src, uint8_t *dst);
|
2015-08-02 18:00:00 +02:00
|
|
|
void drawSpriteSub1(const uint8_t *src, uint8_t *dst, int pitch, int h, int w, uint8_t colMask);
|
|
|
|
void drawSpriteSub2(const uint8_t *src, uint8_t *dst, int pitch, int h, int w, uint8_t colMask);
|
|
|
|
void drawSpriteSub3(const uint8_t *src, uint8_t *dst, int pitch, int h, int w, uint8_t colMask);
|
|
|
|
void drawSpriteSub4(const uint8_t *src, uint8_t *dst, int pitch, int h, int w, uint8_t colMask);
|
|
|
|
void drawSpriteSub5(const uint8_t *src, uint8_t *dst, int pitch, int h, int w, uint8_t colMask);
|
|
|
|
void drawSpriteSub6(const uint8_t *src, uint8_t *dst, int pitch, int h, int w, uint8_t colMask);
|
2017-12-06 17:00:00 +01:00
|
|
|
void PC_drawChar(uint8_t c, int16_t y, int16_t x, bool forceDefaultFont = false);
|
2018-02-10 17:00:00 +01:00
|
|
|
void PC_drawStringChar(uint8_t *dst, int pitch, int x, int y, const uint8_t *src, uint8_t color, uint8_t chr);
|
|
|
|
void AMIGA_drawStringChar(uint8_t *dst, int pitch, int x, int y, const uint8_t *src, uint8_t color, uint8_t chr);
|
|
|
|
void MAC_drawStringChar(uint8_t *dst, int pitch, int x, int y, const uint8_t *src, uint8_t color, uint8_t chr);
|
2015-08-02 18:00:00 +02:00
|
|
|
const char *drawString(const char *str, int16_t x, int16_t y, uint8_t col);
|
2018-02-10 17:00:00 +01:00
|
|
|
void drawStringLen(const char *str, int len, int x, int y, uint8_t color);
|
2016-03-20 17:00:00 +01:00
|
|
|
static Color AMIGA_convertColor(const uint16_t color, bool bgr = false);
|
2018-02-10 17:00:00 +01:00
|
|
|
void MAC_decodeMap(int level, int room);
|
|
|
|
void MAC_markBlockAsDirty(int x, int y, int w, int h);
|
|
|
|
static void MAC_drawBuffer(DecodeBuffer *buf, int src_x, int src_y, int src_w, int src_h, uint8_t color);
|
|
|
|
static void MAC_drawBufferMask(DecodeBuffer *buf, int src_x, int src_y, int src_w, int src_h, uint8_t color);
|
|
|
|
static void MAC_drawBufferFont(DecodeBuffer *buf, int src_x, int src_y, int src_w, int src_h, uint8_t color);
|
|
|
|
void MAC_fillRect(int x, int y, int w, int h, uint8_t color);
|
2015-08-02 18:00:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VIDEO_H__
|