2015-08-15 10:40:27 -04:00
|
|
|
#pragma once
|
2017-06-28 19:00:08 -04:00
|
|
|
#include "stdafx.h"
|
|
|
|
#include "HdData.h"
|
2015-08-15 10:40:27 -04:00
|
|
|
|
2018-07-13 22:19:26 -04:00
|
|
|
class EmulationSettings;
|
|
|
|
|
2017-06-28 19:00:08 -04:00
|
|
|
class HdNesPack
|
2015-08-15 10:40:27 -04:00
|
|
|
{
|
|
|
|
private:
|
2018-07-01 15:21:05 -04:00
|
|
|
shared_ptr<HdPackData> _hdData;
|
2018-07-13 22:19:26 -04:00
|
|
|
EmulationSettings *_settings;
|
2018-07-01 15:21:05 -04:00
|
|
|
|
2017-06-28 19:00:08 -04:00
|
|
|
int32_t _backgroundIndex = -1;
|
2018-02-17 23:44:25 -05:00
|
|
|
HdScreenInfo *_hdScreenInfo = nullptr;
|
2017-08-12 21:21:55 -04:00
|
|
|
uint32_t* _palette = nullptr;
|
2018-02-17 23:44:25 -05:00
|
|
|
bool _contoursEnabled = false;
|
|
|
|
HdPackTileInfo* _cachedTile = nullptr;
|
|
|
|
bool _cacheEnabled = false;
|
|
|
|
bool _useCachedTile = false;
|
|
|
|
int32_t _scrollX = 0;
|
|
|
|
int32_t _bgScrollX = 0;
|
|
|
|
int32_t _bgScrollY = 0;
|
2015-08-15 10:40:27 -04:00
|
|
|
|
2017-07-25 19:46:25 -04:00
|
|
|
__forceinline void BlendColors(uint8_t output[4], uint8_t input[4]);
|
2019-12-20 13:53:13 -05:00
|
|
|
__forceinline uint32_t AdjustBrightness(uint8_t input[4], int brightness);
|
2017-07-25 19:46:25 -04:00
|
|
|
__forceinline void DrawColor(uint32_t color, uint32_t* outputBuffer, uint32_t scale, uint32_t screenWidth);
|
2017-08-15 19:18:00 -04:00
|
|
|
__forceinline void DrawTile(HdPpuTileInfo &tileInfo, HdPackTileInfo &hdPackTileInfo, uint32_t* outputBuffer, uint32_t screenWidth);
|
2018-02-17 23:44:25 -05:00
|
|
|
|
|
|
|
__forceinline HdPackTileInfo* GetCachedMatchingTile(uint32_t x, uint32_t y, HdPpuTileInfo* tile);
|
|
|
|
__forceinline HdPackTileInfo* GetMatchingTile(uint32_t x, uint32_t y, HdPpuTileInfo* tile, bool* disableCache = nullptr);
|
2015-08-15 10:40:27 -04:00
|
|
|
|
2018-02-17 23:44:25 -05:00
|
|
|
__forceinline bool IsNextToSprite(uint32_t x, uint32_t y);
|
2017-07-25 19:46:25 -04:00
|
|
|
__forceinline void DrawCustomBackground(uint32_t *outputBuffer, uint32_t x, uint32_t y, uint32_t scale, uint32_t screenWidth);
|
2015-08-15 10:40:27 -04:00
|
|
|
|
2018-02-17 23:44:25 -05:00
|
|
|
void OnLineStart(HdPpuPixelInfo &lineFirstPixel);
|
|
|
|
void OnBeforeApplyFilter();
|
|
|
|
__forceinline void GetPixels(uint32_t x, uint32_t y, HdPpuPixelInfo &pixelInfo, uint32_t *outputBuffer, uint32_t screenWidth);
|
2018-03-11 22:42:32 -04:00
|
|
|
__forceinline void ProcessGrayscaleAndEmphasis(HdPpuPixelInfo &pixelInfo, uint32_t* outputBuffer, uint32_t hdScreenWidth);
|
2018-02-17 23:44:25 -05:00
|
|
|
|
2015-08-15 10:40:27 -04:00
|
|
|
public:
|
2019-12-20 13:53:13 -05:00
|
|
|
static constexpr uint32_t CurrentVersion = 105;
|
2018-02-17 23:44:25 -05:00
|
|
|
|
2018-07-13 22:19:26 -04:00
|
|
|
HdNesPack(shared_ptr<HdPackData> hdData, EmulationSettings* settings);
|
2017-06-28 19:00:08 -04:00
|
|
|
~HdNesPack();
|
2015-08-15 10:40:27 -04:00
|
|
|
|
2017-06-28 19:00:08 -04:00
|
|
|
uint32_t GetScale();
|
2017-07-25 19:46:25 -04:00
|
|
|
|
2018-02-17 23:44:25 -05:00
|
|
|
void Process(HdScreenInfo *hdScreenInfo, uint32_t *outputBuffer, OverscanDimensions &overscan);
|
2015-08-15 10:40:27 -04:00
|
|
|
};
|