2012-12-28 20:58:00 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "GPUInterface.h"
|
|
|
|
|
|
|
|
class GPUCommon : public GPUInterface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
GPUCommon() :
|
|
|
|
dlIdGenerator(1),
|
2012-12-29 01:10:29 +00:00
|
|
|
currentList(NULL),
|
|
|
|
stackptr(0),
|
2013-01-02 19:56:30 +00:00
|
|
|
dumpNextFrame_(false),
|
|
|
|
dumpThisFrame_(false)
|
2012-12-28 20:58:00 +00:00
|
|
|
{}
|
2012-12-29 01:10:29 +00:00
|
|
|
|
2013-02-03 23:41:16 +00:00
|
|
|
virtual void InterruptStart();
|
|
|
|
virtual void InterruptEnd();
|
|
|
|
|
2012-12-29 01:10:29 +00:00
|
|
|
virtual void PreExecuteOp(u32 op, u32 diff);
|
|
|
|
virtual bool InterpretList(DisplayList &list);
|
|
|
|
virtual bool ProcessDLQueue();
|
2012-12-28 20:58:00 +00:00
|
|
|
virtual void UpdateStall(int listid, u32 newstall);
|
2012-12-22 06:50:35 +00:00
|
|
|
virtual u32 EnqueueList(u32 listpc, u32 stall, int subIntrBase, bool head);
|
2012-12-28 20:58:00 +00:00
|
|
|
virtual int listStatus(int listid);
|
2012-12-29 19:41:33 +00:00
|
|
|
virtual void DoState(PointerWrap &p);
|
2012-12-28 20:58:00 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
typedef std::deque<DisplayList> DisplayListQueue;
|
2012-12-29 01:10:29 +00:00
|
|
|
|
2012-12-28 20:58:00 +00:00
|
|
|
int dlIdGenerator;
|
|
|
|
DisplayList *currentList;
|
|
|
|
DisplayListQueue dlQueue;
|
2012-12-29 01:10:29 +00:00
|
|
|
|
2013-02-03 23:41:16 +00:00
|
|
|
bool interruptRunning;
|
2012-12-29 01:10:29 +00:00
|
|
|
u32 prev;
|
|
|
|
u32 stack[2];
|
|
|
|
u32 stackptr;
|
|
|
|
bool finished;
|
|
|
|
|
|
|
|
bool dumpNextFrame_;
|
|
|
|
bool dumpThisFrame_;
|
2013-02-03 23:41:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
virtual DisplayList* getList(int listid)
|
|
|
|
{
|
2013-02-12 09:12:32 +00:00
|
|
|
if (currentList && currentList->id == listid)
|
2013-02-03 23:41:16 +00:00
|
|
|
return currentList;
|
|
|
|
for(auto it = dlQueue.begin(); it != dlQueue.end(); ++it)
|
|
|
|
{
|
|
|
|
if(it->id == listid)
|
|
|
|
return &*it;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
2013-02-10 15:36:06 +00:00
|
|
|
|
|
|
|
const std::deque<DisplayList>& GetDisplayLists()
|
|
|
|
{
|
|
|
|
return dlQueue;
|
|
|
|
}
|
|
|
|
DisplayList* GetCurrentDisplayList()
|
|
|
|
{
|
|
|
|
return currentList;
|
|
|
|
}
|
2013-02-03 23:41:16 +00:00
|
|
|
};
|