diff --git a/src/GBI.cpp b/src/GBI.cpp index f14cdf3c..372b8e7f 100644 --- a/src/GBI.cpp +++ b/src/GBI.cpp @@ -119,8 +119,7 @@ void GBI_Unknown( u32 w0, u32 w1 ) void GBIInfo::init() { m_pCurrent = NULL; - for (u32 i = 0; i <= 0xFF; ++i) - cmd[i] = GBI_Unknown; + _flushCommands(); } void GBIInfo::destroy() @@ -144,6 +143,11 @@ bool GBIInfo::isHWLSupported() const return true; } +void GBIInfo::_flushCommands() +{ + std::fill(std::begin(cmd), std::end(cmd), GBI_Unknown); +} + void GBIInfo::_makeCurrent(MicrocodeInfo * _pCurrent) { if (_pCurrent->type == NONE) { @@ -153,8 +157,7 @@ void GBIInfo::_makeCurrent(MicrocodeInfo * _pCurrent) if (m_pCurrent == NULL || (m_pCurrent->type != _pCurrent->type)) { m_pCurrent = _pCurrent; - for (int i = 0; i <= 0xFF; ++i) - cmd[i] = GBI_Unknown; + _flushCommands(); RDP_Init(); diff --git a/src/GBI.h b/src/GBI.h index c4c57a2d..b74a0acb 100644 --- a/src/GBI.h +++ b/src/GBI.h @@ -698,6 +698,8 @@ struct GBIInfo bool isBranchLessZ() const { return m_pCurrent != NULL ? m_pCurrent->branchLessZ : true; } private: + void _flushCommands(); + void _makeCurrent(MicrocodeInfo * _pCurrent); bool _makeExistingMicrocodeCurrent(u32 uc_start, u32 uc_dstart, u32 uc_dsize);