void SetReadPlane (__REGA0(struct BoardInfo *b), __REGD0(UBYTE plane));
void WaitVerticalSync (__REGA0(struct BoardInfo *b), __REGD0(BOOL toggle));
+BOOL GetVSyncState(__REGA0(struct BoardInfo *b), __REGD0(BOOL toggle));
void FillRect (__REGA0(struct BoardInfo *b), __REGA1(struct RenderInfo *r), __REGD0(WORD x), __REGD1(WORD y), __REGD2(WORD w), __REGD3(WORD h), __REGD4(ULONG color), __REGD5(UBYTE mask), __REGD7(RGBFTYPE format));
void InvertRect (__REGA0(struct BoardInfo *b), __REGA1(struct RenderInfo *r), __REGD0(WORD x), __REGD1(WORD y), __REGD2(WORD w), __REGD3(WORD h), __REGD4(UBYTE mask), __REGD7(RGBFTYPE format));
//b->SetSplitPosition = (void *)NULL;
//b->ReInitMemory = (void *)NULL;
//b->WriteYUVRect = (void *)NULL;
- //b->GetVSyncState = (void *)NULL;
+ b->GetVSyncState = (void *)GetVSyncState;
//b->GetVBeamPos = (void *)NULL;
//b->SetDPMSLevel = (void *)NULL;
//b->ResetChip = (void *)NULL;
void SetReadPlane (__REGA0(struct BoardInfo *b), __REGD0(UBYTE plane)) {
}
+static uint16_t vblank;
+
void WaitVerticalSync (__REGA0(struct BoardInfo *b), __REGD0(BOOL toggle)) {
- // I don't know why this one has a bool in D0, but it isn't used for anything.
+ vblank = 0;
+ do {
+ READSHORT(RTG_WAITVSYNC, vblank);
+ } while (!vblank);
+}
+
+BOOL GetVSyncState(__REGA0(struct BoardInfo *b), __REGD0(BOOL toggle)) {
+ READSHORT(RTG_INVBLANK, vblank);
+ return vblank;
}
void FillRect (__REGA0(struct BoardInfo *b), __REGA1(struct RenderInfo *r), __REGD0(WORD x), __REGD1(WORD y), __REGD2(WORD w), __REGD3(WORD h), __REGD4(ULONG color), __REGD5(UBYTE mask), __REGD7(RGBFTYPE format)) {
}
void BlitTemplate (__REGA0(struct BoardInfo *b), __REGA1(struct RenderInfo *r), __REGA2(struct Template *t), __REGD0(WORD x), __REGD1(WORD y), __REGD2(WORD w), __REGD3(WORD h), __REGD4(UBYTE mask), __REGD7(RGBFTYPE format)) {
+#ifndef IRTG
if (!r || !t) return;
if (w < 1 || h < 1) return;
WRITEBYTE(RTG_U81, mask);
WRITEBYTE(RTG_U82, t->DrawMode);
WRITESHORT(RTG_COMMAND, RTGCMD_BLITTEMPLATE);
+#else
+ IWRITECMD(RTGCMD_BLITTEMPLATE);
+#endif
}
void BlitPattern (__REGA0(struct BoardInfo *b), __REGA1(struct RenderInfo *r), __REGA2(struct Pattern *p), __REGD0(WORD x), __REGD1(WORD y), __REGD2(WORD w), __REGD3(WORD h), __REGD4(UBYTE mask), __REGD7(RGBFTYPE format)) {
+#ifndef IRTG
if (!r || !p) return;
if (w < 1 || h < 1) return;
WRITEBYTE(RTG_U82, p->DrawMode);
WRITEBYTE(RTG_U83, (1 << p->Size));
WRITESHORT(RTG_COMMAND, RTGCMD_BLITPATTERN);
+#else
+ IWRITECMD(RTGCMD_BLITPATTERN);
+#endif
}
void DrawLine (__REGA0(struct BoardInfo *b), __REGA1(struct RenderInfo *r), __REGA2(struct Line *l), __REGD0(UBYTE mask), __REGD7(RGBFTYPE format)) {
}
void BlitPlanar2Chunky (__REGA0(struct BoardInfo *b), __REGA1(struct BitMap *bm), __REGA2(struct RenderInfo *r), __REGD0(SHORT x), __REGD1(SHORT y), __REGD2(SHORT dx), __REGD3(SHORT dy), __REGD4(SHORT w), __REGD5(SHORT h), __REGD6(UBYTE minterm), __REGD7(UBYTE mask)) {
+// iRTG path disabled for now, since it's really slow, see note in rtg-gfx.c.
+//#ifndef IRTG
if (!b || !r)
return;
WRITEBYTE(RTG_U83, bm->Depth);
WRITESHORT(RTG_COMMAND, RTGCMD_P2C);
+//#else
+// IWRITECMD(RTGCMD_P2C);
+//#endif
}
void BlitPlanar2Direct (__REGA0(struct BoardInfo *b), __REGA1(struct BitMap *bm), __REGA2(struct RenderInfo *r), __REGA3(struct ColorIndexMapping *clut), __REGD0(SHORT x), __REGD1(SHORT y), __REGD2(SHORT dx), __REGD3(SHORT dy), __REGD4(SHORT w), __REGD5(SHORT h), __REGD6(UBYTE minterm), __REGD7(UBYTE mask)) {