protected override void VideoParamsChanged(VideoManager sender, VideoParams value) { if (value == null || value.LinePitch < 320 || value.Width < 320 || value.Height < 240 || value.BPP != 32) { Logger.GetLogger().LogError("Profi.VideoParamsChanged: Unsupported params!"); throw new ArgumentOutOfRangeException("Unsupported VideoFrameParams"); } this.fillUlaTables(this.GetFrameTactCount(), value); }
public void SetVideoParams(VideoParams value) { if (value != this._videoParams) { this._videoParams = value; if (this._videoRenderer != null) { this._videoRenderer.SetVideoParams(this, value); } } }
private void fillUlaTables(int MaxTakt, VideoParams videoParams) { this._ulaLineOffset = new int[MaxTakt]; this._ulaAddrBW = new int[MaxTakt]; this._ulaAddrAT = new int[MaxTakt]; this._ulaDo = new byte[MaxTakt]; for (int i = 0; i < MaxTakt; i++) { int num = i / 224; int num2 = i % 224; if (num >= 24 && num < 264 && num2 >= 52 && num2 < 212) { if (num >= 48 && num < 240 && num2 >= 68 && num2 < 196) { this._ulaDo[i] = 3; if ((num2 & 3) == 3) { this._ulaDo[i] = 4; int num3 = num2 + 1 - 68; int num4 = num - 48; num3 >>= 2; int num5 = num3 | num4 >> 3 << 5; int num6 = num3 | num4 << 5; this._ulaAddrBW[i] = ((num6 & 6175) | (num6 & 1792) >> 3 | (num6 & 224) << 3); this._ulaAddrAT[i] = 6144 + num5; } } else if (num >= 48 && num < 240 && num2 == 67) { this._ulaDo[i] = 2; int num7 = num2 + 1 - 68; int num8 = num - 48; num7 >>= 2; int num9 = num7 | num8 >> 3 << 5; int num10 = num7 | num8 << 5; this._ulaAddrBW[i] = ((num10 & 6175) | (num10 & 1792) >> 3 | (num10 & 224) << 3); this._ulaAddrAT[i] = 6144 + num9; } else { this._ulaDo[i] = 1; } int num11 = num - 24; int num12 = (num2 - 52) * 2; this._ulaLineOffset[i] = num11 * videoParams.LinePitch + num12; } else { this._ulaDo[i] = 0; } } this._ulaInk = new uint[512]; this._ulaPaper = new uint[512]; for (int j = 0; j < 256; j++) { this._ulaInk[j] = Profi1024._zxpal[(j & 7) + ((j & 64) >> 3)]; this._ulaPaper[j] = Profi1024._zxpal[(j >> 3 & 7) + ((j & 64) >> 3)]; if ((j & 128) != 0) { this._ulaInk[j + 256] = Profi1024._zxpal[(j >> 3 & 7) + ((j & 64) >> 3)]; this._ulaPaper[j + 256] = Profi1024._zxpal[(j & 7) + ((j & 64) >> 3)]; } else { this._ulaInk[j + 256] = Profi1024._zxpal[(j & 7) + ((j & 64) >> 3)]; this._ulaPaper[j + 256] = Profi1024._zxpal[(j >> 3 & 7) + ((j & 64) >> 3)]; } } }
private void fillUlaTables(int MaxTakt, VideoParams videoParams) { this._ulaLineOffset = new int[MaxTakt]; this._ulaAddrBW = new int[MaxTakt]; this._ulaAddrAT = new int[MaxTakt]; this._ulaDo = new byte[MaxTakt]; int num = 0; for (int i = 0; i < 320; i++) { int j = 0; while (j < 224) { if (i >= 56 && i < 296 && j >= 52 && j < 212) { if (i >= 80 && i < 272 && j >= 68 && j < 196) { this._ulaDo[num] = 3; if ((j & 3) == 3) { this._ulaDo[num] = 4; int num2 = j + 1 - 68; int num3 = i - 80; num2 >>= 2; int num4 = num2 | num3 >> 3 << 5; int num5 = num2 | num3 << 5; this._ulaAddrBW[num] = ((num5 & 6175) | (num5 & 1792) >> 3 | (num5 & 224) << 3); this._ulaAddrAT[num] = 6144 + num4; } } else if (i >= 80 && i < 272 && j == 67) { this._ulaDo[num] = 2; int num6 = j + 1 - 68; int num7 = i - 80; num6 >>= 2; int num8 = num6 | num7 >> 3 << 5; int num9 = num6 | num7 << 5; this._ulaAddrBW[num] = ((num9 & 6175) | (num9 & 1792) >> 3 | (num9 & 224) << 3); this._ulaAddrAT[num] = 6144 + num8; } else { this._ulaDo[num] = 1; } int num10 = i - 56; int num11 = (j - 52) * 2; this._ulaLineOffset[num] = num10 * videoParams.LinePitch + num11; } else { this._ulaDo[num] = 0; } j++; num++; } } this._ulaInk = new uint[512]; this._ulaPaper = new uint[512]; for (int k = 0; k < 256; k++) { this._ulaInk[k] = Pentagon128._zxpal[(k & 7) + ((k & 64) >> 3)]; this._ulaPaper[k] = Pentagon128._zxpal[(k >> 3 & 7) + ((k & 64) >> 3)]; if ((k & 128) != 0) { this._ulaInk[k + 256] = Pentagon128._zxpal[(k >> 3 & 7) + ((k & 64) >> 3)]; this._ulaPaper[k + 256] = Pentagon128._zxpal[(k & 7) + ((k & 64) >> 3)]; } else { this._ulaInk[k + 256] = Pentagon128._zxpal[(k & 7) + ((k & 64) >> 3)]; this._ulaPaper[k + 256] = Pentagon128._zxpal[(k >> 3 & 7) + ((k & 64) >> 3)]; } } }
protected virtual void VideoParamsChanged(VideoManager sender, VideoParams value) { }
void IVideoRenderer.SetVideoParams(VideoManager sender, VideoParams value) { this.VideoParamsChanged(sender, value); }