1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

GBI: Move command flushing to a private function

Gets rid of redundancy
This commit is contained in:
Lioncash 2015-10-10 13:36:52 -04:00
parent b3d0fc9113
commit c98dd06b95
2 changed files with 9 additions and 4 deletions

View File

@ -119,8 +119,7 @@ void GBI_Unknown( u32 w0, u32 w1 )
void GBIInfo::init() void GBIInfo::init()
{ {
m_pCurrent = NULL; m_pCurrent = NULL;
for (u32 i = 0; i <= 0xFF; ++i) _flushCommands();
cmd[i] = GBI_Unknown;
} }
void GBIInfo::destroy() void GBIInfo::destroy()
@ -144,6 +143,11 @@ bool GBIInfo::isHWLSupported() const
return true; return true;
} }
void GBIInfo::_flushCommands()
{
std::fill(std::begin(cmd), std::end(cmd), GBI_Unknown);
}
void GBIInfo::_makeCurrent(MicrocodeInfo * _pCurrent) void GBIInfo::_makeCurrent(MicrocodeInfo * _pCurrent)
{ {
if (_pCurrent->type == NONE) { if (_pCurrent->type == NONE) {
@ -153,8 +157,7 @@ void GBIInfo::_makeCurrent(MicrocodeInfo * _pCurrent)
if (m_pCurrent == NULL || (m_pCurrent->type != _pCurrent->type)) { if (m_pCurrent == NULL || (m_pCurrent->type != _pCurrent->type)) {
m_pCurrent = _pCurrent; m_pCurrent = _pCurrent;
for (int i = 0; i <= 0xFF; ++i) _flushCommands();
cmd[i] = GBI_Unknown;
RDP_Init(); RDP_Init();

View File

@ -698,6 +698,8 @@ struct GBIInfo
bool isBranchLessZ() const { return m_pCurrent != NULL ? m_pCurrent->branchLessZ : true; } bool isBranchLessZ() const { return m_pCurrent != NULL ? m_pCurrent->branchLessZ : true; }
private: private:
void _flushCommands();
void _makeCurrent(MicrocodeInfo * _pCurrent); void _makeCurrent(MicrocodeInfo * _pCurrent);
bool _makeExistingMicrocodeCurrent(u32 uc_start, u32 uc_dstart, u32 uc_dsize); bool _makeExistingMicrocodeCurrent(u32 uc_start, u32 uc_dstart, u32 uc_dsize);