#include <proto/expansion.h>
#include <proto/dos.h>
#include <proto/intuition.h>
+#include <proto/input.h>
#include <exec/types.h>
#include <exec/memory.h>
#include <exec/libraries.h>
#include <exec/resident.h>
#include <exec/initializers.h>
#include <clib/debug_protos.h>
+#include <devices/inputevent.h>
#include <string.h>
#include <stdint.h>
#include "boardinfo.h"
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));
return 0;
}
+ struct IORequest io;
+ if (OpenDevice((STRPTR)"input.device", 0, &io, 0) == 0)
+ {
+ struct Library *InputBase = (struct Library *)io.io_Device;
+ UWORD qual = PeekQualifier();
+ CloseDevice(&io);
+
+ if (qual & (IEQUALIFIER_LSHIFT | IEQUALIFIER_RSHIFT))
+ return(FALSE);
+ }
+
struct ExpansionBase *ExpansionBase = NULL;
struct DOSBase *DOSBase = NULL;
struct IntuitionBase *IntuitionBase = NULL;
b->CardBase = (struct CardBase *)_gfxbase;
b->ExecBase = SysBase;
b->BoardName = "PiStorm RTG";
- b->BoardType = BT_MNT_ZZ9000;
- b->PaletteChipType = PCT_MNT_ZZ9000;
- b->GraphicsControllerType = GCT_MNT_ZZ9000;
+ b->BoardType = 14;
+ b->PaletteChipType = PCT_S3ViRGE;
+ b->GraphicsControllerType = GCT_S3ViRGE;
b->Flags = BIF_INDISPLAYCHAIN | BIF_GRANTDIRECTACCESS | BIF_HARDWARESPRITE | BIF_FLICKERFIXER;
b->RGBFormats = 1 | 2 | 512 | 1024 | 2048;
//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)) {