+/**
+ * \brief Blit an entire buffer to the screen
+ * \note Assumes Pitch = 4*W
+ */
+void Video_Blit(uint32_t *Source, short DstX, short DstY, short W, short H)
+{
+ int i;
+ uint32_t *buf;
+
+ _SysDebug("Video_Blit: (%p (%i, %i) %ix%i)", Source, DstX, DstY, W, H);
+
+ // TODO: Handle -ve X/Y by clipping
+ if( DstX < 0 || DstY < 0 ) return ;
+ // TODO: Handle out of bounds by clipping too
+ if( DstX + W > giScreenWidth ) return;
+ if( DstY + H > giScreenHeight ) return;
+
+ if( W <= 0 || H <= 0 ) return;
+
+ _SysDebug(" Clipped to (%i, %i) %ix%i", DstX, DstY, W, H);
+ _SysDebug(" Source[0] = 0x%x", Source[0]);
+ buf = gpScreenBuffer + DstY*giScreenWidth + DstX;
+ while( H -- )
+ {
+ for( i = W; i --; )
+ *buf++ = *Source++;
+ buf += giScreenWidth - W;
+ }
+}
+