openMSX
VDP.hh
Go to the documentation of this file.
1 #ifndef VDP_HH
2 #define VDP_HH
3 
4 #include "MSXDevice.hh"
5 #include "Schedulable.hh"
7 #include "SimpleDebuggable.hh"
8 #include "TclCallback.hh"
9 #include "InfoTopic.hh"
10 #include "IRQHelper.hh"
11 #include "Clock.hh"
12 #include "DisplayMode.hh"
13 #include "Observer.hh"
14 #include "openmsx.hh"
15 #include "outer.hh"
16 #include <memory>
17 #include <array>
18 
19 namespace openmsx {
20 
21 class PostProcessor;
22 class Renderer;
23 class VDPCmdEngine;
24 class VDPVRAM;
25 class MSXCPU;
26 class SpriteChecker;
27 class Display;
28 class RawFrame;
29 class Setting;
30 template<typename> class EnumSetting;
31 namespace VDPAccessSlots {
32  enum Delta : int;
33  class Calculator;
34 }
35 
61 class VDP final : public MSXDevice, private VideoSystemChangeListener
62  , private Observer<Setting>
63 {
64 public:
67  static const int TICKS_PER_SECOND = 3579545 * 6; // 21.5MHz;
69 
72  static const int TICKS_PER_LINE = 1368;
73 
74  explicit VDP(const DeviceConfig& config);
75  ~VDP() override;
76 
77  void powerUp(EmuTime::param time) override;
78  void reset(EmuTime::param time) override;
79  byte readIO(word port, EmuTime::param time) override;
80  byte peekIO(word port, EmuTime::param time) const override;
81  void writeIO(word port, byte value, EmuTime::param time) override;
82 
87  PostProcessor* getPostProcessor() const;
88 
93  inline bool isMSX1VDP() const {
94  return (version & VM_MSX1) != 0;
95  }
96 
100  inline bool isVDPwithPALonly() const {
101  return (version & VM_PAL) != 0;
102  }
103 
107  inline bool vdpLacksMirroring() const {
108  return (version & VM_NO_MIRRORING) != 0;
109  }
110 
114  inline bool vdpHasPatColMirroring() const {
115  return (version & VM_PALCOL_MIRRORING) != 0;
116  }
117 
121  inline bool isVDPwithVRAMremapping() const {
122  return (version & VM_VRAM_REMAPPING) != 0;
123  }
124 
128  inline bool hasYJK() const {
129  return (version & VM_YJK) != 0;
130  }
131 
136  std::array<std::array<uint8_t, 3>, 16> getMSX1Palette() const;
137 
141  inline DisplayMode getDisplayMode() const {
142  return displayMode;
143  }
144 
147  inline VDPVRAM& getVRAM() {
148  return *vram;
149  }
150 
155  inline const RawFrame* isSuperimposing() const {
156  // Note that bit 0 of r#0 has no effect on an V9938 or higher,
157  // but this bit is masked out. Also note that on an MSX1, if
158  // bit 0 of r#0 is enabled and there is no external video
159  // source, then we lose sync.
160  // Also note that because this property is fixed per frame we
161  // cannot (re)calculate it from register values.
162  return superimposing;
163  }
164 
168  return *spriteChecker;
169  }
170 
174  inline bool getTransparency() const {
175  return (controlRegs[8] & 0x20) == 0;
176  }
177 
181  inline int getForegroundColor() const {
182  return controlRegs[7] >> 4;
183  }
184 
193  inline int getBackgroundColor() const {
194  byte reg7 = controlRegs[7];
195  if (displayMode.getByte() == DisplayMode::GRAPHIC7) {
196  return reg7;
197  } else {
198  return reg7 & 0x0F;
199  }
200  }
201 
205  inline int getBlinkForegroundColor() const {
206  return controlRegs[12] >> 4;
207  }
208 
212  inline int getBlinkBackgroundColor() const {
213  return controlRegs[12] & 0x0F;
214  }
215 
219  inline bool getBlinkState() const {
220  return blinkState;
221  }
222 
228  inline word getPalette(int index) const {
229  return palette[index];
230  }
231 
237  inline bool isDisplayEnabled() const {
238  return isDisplayArea && displayEnabled;
239  }
240 
245  inline bool spritesEnabled() const {
246  return displayEnabled &&
247  (displayMode.getSpriteMode(isMSX1VDP()) != 0) &&
248  ((controlRegs[8] & 0x02) == 0x00);
249  }
250 
254  inline bool spritesEnabledFast() const {
255  assert(displayMode.getSpriteMode(isMSX1VDP()) != 0);
256  return displayEnabled && ((controlRegs[8] & 0x02) == 0x00);
257  }
258 
262  inline bool spritesEnabledRegister() const {
263  return (controlRegs[8] & 0x02) == 0x00;
264  }
265 
269  inline byte getVerticalScroll() const {
270  return controlRegs[23];
271  }
272 
278  inline byte getHorizontalScrollLow() const {
279  return controlRegs[27];
280  }
281 
287  inline byte getHorizontalScrollHigh() const {
288  return controlRegs[26];
289  }
290 
296  inline bool isBorderMasked() const {
297  return (controlRegs[25] & 0x02) != 0;
298  }
299 
306  inline bool isMultiPageScrolling() const {
307  return (controlRegs[25] & 0x01) && (controlRegs[2] & 0x20);
308  }
309 
314  inline int getLineZero() const {
315  return displayStart / TICKS_PER_LINE;
316  }
317 
322  inline bool isPalTiming() const {
323  return palTiming;
324  }
325 
333  inline bool isInterlaced() const {
334  return interlaced;
335  }
336 
348  inline bool isEvenOddEnabled() const {
349  return (controlRegs[9] & 4) != 0;
350  }
351 
355  inline bool getEvenOdd() const {
356  return (statusReg2 & 2) != 0;
357  }
358 
369  inline int getEvenOddMask() const {
370  // TODO: Verify which page is displayed on even fields.
371  return (((~controlRegs[9] & 4) << 6) | ((statusReg2 & 2) << 7)) &
372  (!blinkState << 8);
373  }
374 
378  inline int getTicksThisFrame(EmuTime::param time) const {
379  return frameStartTime.getTicksTill_fast(time);
380  }
381 
382  inline EmuTime::param getFrameStartTime() const {
383  return frameStartTime.getTime();
384  }
385 
388  inline int getSpriteSize() const {
389  return ((controlRegs[1] & 2) << 2) + 8;
390  }
391 
394  inline bool isSpriteMag() const {
395  return controlRegs[1] & 1;
396  }
397 
401  inline bool getCmdBit() const {
402  return (controlRegs[25] & 0x40) != 0;
403  }
404 
407  inline int getTicksPerFrame() const {
408  return palTiming ? TICKS_PER_LINE * 313 : TICKS_PER_LINE * 262;
409  }
410 
420  inline bool isInsideFrame(EmuTime::param time) const {
421  return time >= frameStartTime.getTime() &&
422  getTicksThisFrame(time) <= getTicksPerFrame();
423  }
424 
428  inline int getHorizontalAdjust() const {
429  return horizontalAdjust;
430  }
431 
439  inline int getLeftSprites() const {
440  return 100 + 102 + 56
441  + (horizontalAdjust - 7) * 4
442  + (displayMode.isTextMode() ? 36 : 0);
443  }
444 
450  inline int getLeftBorder() const {
451  return getLeftSprites() + (isBorderMasked() ? 8 * 4 : 0);
452  }
453 
457  inline int getRightBorder() const {
458  return getLeftSprites()
459  + (displayMode.isTextMode() ? 960 : 1024);
460  }
461 
467  inline int getLeftBackground() const {
468  return getLeftSprites() + getHorizontalScrollLow() * 4;
469  }
470 
474  byte getStatusReg0() const { return statusReg0; }
475 
484  void setSpriteStatus(byte value)
485  {
486  statusReg0 = (statusReg0 & 0x80) | (value & 0x7F);
487  }
488 
492  bool getVRMode() const {
493  return (controlRegs[8] & 8) != 0;
494  }
495 
498  void setExternalVideoSource(const RawFrame* externalSource) {
499  externalVideo = externalSource;
500  }
501 
504  bool getBrokenCmdTiming() const {
505  return brokenCmdTiming;
506  }
507 
510  EmuTime getAccessSlot(EmuTime::param time, VDPAccessSlots::Delta delta) const;
511 
521  VDPAccessSlots::Calculator getAccessSlotCalculator(
522  EmuTime::param time, EmuTime::param limit) const;
523 
542  auto now = getCurrentTime();
543  if (t <= now) {
544  // The largest amount of VDP cycles between 'progress'
545  // in command emulation:
546  // - worst case the LMMM takes 120+64 cycles to fully process one pixel
547  // - the largest gap between access slots is 70 cycles
548  // - but if we're unlucky the CPU steals that slot
549  int LARGEST_STALL = 184 + 2 * 70;
550 
551  t = now + VDPClock::duration(LARGEST_STALL);
552  }
553  syncCmdDone.setSyncPoint(t);
554  }
555 
556  template<typename Archive>
557  void serialize(Archive& ar, unsigned version);
558 
559 private:
560  void initTables();
561 
562  // VdpVersion bitmasks
563  static const unsigned VM_MSX1 = 1; // set-> MSX1, unset-> MSX2 or MSX2+
564  static const unsigned VM_PAL = 2; // set-> fixed PAL, unset-> fixed NTSC or switchable
565  static const unsigned VM_NO_MIRRORING = 4; // set-> no (screen2) mirroring
566  static const unsigned VM_PALCOL_MIRRORING = 8; // set-> pattern/color-table mirroring
567  static const unsigned VM_VRAM_REMAPPING = 16; // set-> 4k,8/16k VRAM remapping
568  static const unsigned VM_TOSHIBA_PALETTE = 32; // set-> has Toshiba palette
569  static const unsigned VM_YJK = 64; // set-> has YJK (MSX2+)
570 
572  enum VdpVersion {
577  TMS99X8A = VM_MSX1 | VM_PALCOL_MIRRORING | VM_VRAM_REMAPPING,
578 
580  TMS9929A = VM_MSX1 | VM_PALCOL_MIRRORING | VM_VRAM_REMAPPING | VM_PAL,
581 
583  TMS9129 = VM_MSX1 | VM_PAL,
584 
586  TMS91X8 = VM_MSX1,
587 
589  T6950PAL = VM_MSX1 | VM_TOSHIBA_PALETTE | VM_NO_MIRRORING | VM_PAL,
590 
592  T6950NTSC = VM_MSX1 | VM_TOSHIBA_PALETTE | VM_NO_MIRRORING,
593 
595  T7937APAL = VM_MSX1 | VM_TOSHIBA_PALETTE | VM_PAL,
596 
598  T7937ANTSC = VM_MSX1 | VM_TOSHIBA_PALETTE,
599 
601  V9938 = 0,
602 
604  V9958 = VM_YJK,
605  };
606 
607  struct SyncBase : public Schedulable {
608  explicit SyncBase(VDP& vdp_) : Schedulable(vdp_.getScheduler()) {}
612  protected:
613  ~SyncBase() = default;
614  };
615 
616  struct SyncVSync final : public SyncBase {
617  explicit SyncVSync(VDP& vdp) : SyncBase(vdp) {}
618  void executeUntil(EmuTime::param time) override {
619  auto& vdp = OUTER(VDP, syncVSync);
620  vdp.execVSync(time);
621  }
622  } syncVSync;
623 
624  struct SyncDisplayStart final : public SyncBase {
625  explicit SyncDisplayStart(VDP& vdp) : SyncBase(vdp) {}
626  void executeUntil(EmuTime::param time) override {
627  auto& vdp = OUTER(VDP, syncDisplayStart);
628  vdp.execDisplayStart(time);
629  }
630  } syncDisplayStart;
631 
632  struct SyncVScan final : public SyncBase {
633  explicit SyncVScan(VDP& vdp) : SyncBase(vdp) {}
634  void executeUntil(EmuTime::param time) override {
635  auto& vdp = OUTER(VDP, syncVScan);
636  vdp.execVScan(time);
637  }
638  } syncVScan;
639 
640  struct SyncHScan final : public SyncBase {
641  explicit SyncHScan(VDP& vdp) : SyncBase(vdp) {}
642  void executeUntil(EmuTime::param /*time*/) override {
643  auto& vdp = OUTER(VDP, syncHScan);
644  vdp.execHScan();
645  }
646  } syncHScan;
647 
648  struct SyncHorAdjust final : public SyncBase {
649  explicit SyncHorAdjust(VDP& vdp) : SyncBase(vdp) {}
650  void executeUntil(EmuTime::param time) override {
651  auto& vdp = OUTER(VDP, syncHorAdjust);
652  vdp.execHorAdjust(time);
653  }
654  } syncHorAdjust;
655 
656  struct SyncSetMode final : public SyncBase {
657  explicit SyncSetMode(VDP& vdp) : SyncBase(vdp) {}
658  void executeUntil(EmuTime::param time) override {
659  auto& vdp = OUTER(VDP, syncSetMode);
660  vdp.execSetMode(time);
661  }
662  } syncSetMode;
663 
664  struct SyncSetBlank final : public SyncBase {
665  explicit SyncSetBlank(VDP& vdp) : SyncBase(vdp) {}
666  void executeUntil(EmuTime::param time) override {
667  auto& vdp = OUTER(VDP, syncSetBlank);
668  vdp.execSetBlank(time);
669  }
670  } syncSetBlank;
671 
672  struct SyncCpuVramAccess final : public SyncBase {
673  explicit SyncCpuVramAccess(VDP& vdp) : SyncBase(vdp) {}
674  void executeUntil(EmuTime::param time) override {
675  auto& vdp = OUTER(VDP, syncCpuVramAccess);
676  vdp.execCpuVramAccess(time);
677  }
678  } syncCpuVramAccess;
679 
680  struct SyncCmdDone final : public SyncBase {
681  explicit SyncCmdDone(VDP& vdp) : SyncBase(vdp) {}
682  void executeUntil(EmuTime::param time) override {
683  auto& vdp = OUTER(VDP, syncCmdDone);
684  vdp.execSyncCmdDone(time);
685  }
686  } syncCmdDone;
687 
688  void execVSync(EmuTime::param time);
689  void execDisplayStart(EmuTime::param time);
690  void execVScan(EmuTime::param time);
691  void execHScan();
692  void execHorAdjust(EmuTime::param time);
693  void execSetMode(EmuTime::param time);
694  void execSetBlank(EmuTime::param time);
695  void execCpuVramAccess(EmuTime::param time);
696  void execSyncCmdDone(EmuTime::param time);
697 
701  inline int getNumberOfLines() const {
702  return controlRegs[9] & 0x80 ? 212 : 192;
703  }
704 
708  int getVerticalAdjust() const {
709  return (controlRegs[18] >> 4) ^ 0x07;
710  }
711 
721  inline bool getHR(int ticksThisFrame) const {
722  // Note: These constants are located inside this function because
723  // GCC 4.0.x won't link if they are in the class scope.
727  static const int HBLANK_LEN_TXT = 404;
731  static const int HBLANK_LEN_GFX = 312;
732  return
733  ( ticksThisFrame + TICKS_PER_LINE - getRightBorder()
734  ) % TICKS_PER_LINE
735  < (displayMode.isTextMode() ? HBLANK_LEN_TXT : HBLANK_LEN_GFX);
736  }
737 
738  // VideoSystemChangeListener interface:
739  void preVideoSystemChange() override;
740  void postVideoSystemChange() override;
741 
746  void resetInit();
747 
752  void resetMasks(EmuTime::param time);
753 
757  void frameStart(EmuTime::param time);
758 
766  void scheduleDisplayStart(EmuTime::param time);
767 
773  void scheduleVScan(EmuTime::param time);
774 
780  void scheduleHScan(EmuTime::param time);
781 
784  void vramWrite(byte value, EmuTime::param time);
785 
788  byte vramRead(EmuTime::param time);
789 
791  void scheduleCpuVramAccess(bool isRead, byte write, EmuTime::param time);
792  void executeCpuVramAccess(EmuTime::param time);
793 
796  byte peekStatusReg(byte reg, EmuTime::param time) const;
797  byte readStatusReg(byte reg, EmuTime::param time);
798 
801  void changeRegister(byte reg, byte val, EmuTime::param time);
802 
805  void syncAtNextLine(SyncBase& type, EmuTime::param time);
806 
809  void createRenderer();
810 
814  void updateNameBase(EmuTime::param time);
815 
819  void updateColorBase(EmuTime::param time);
820 
824  void updatePatternBase(EmuTime::param time);
825 
829  void updateSpriteAttributeBase(EmuTime::param time);
830 
834  void updateSpritePatternBase(EmuTime::param time);
835 
839  void updateDisplayMode(DisplayMode newMode, bool cmdBit, EmuTime::param time);
840 
847  void setPalette(int index, word grb, EmuTime::param time);
848 
849  // Observer<Setting>
850  void update(const Setting& setting) override;
851 
852 private:
853  Display& display;
854  EnumSetting<bool>& cmdTiming;
855  EnumSetting<bool>& tooFastAccess;
856 
857  struct RegDebug final : SimpleDebuggable {
858  explicit RegDebug(VDP& vdp);
859  byte read(unsigned address) override;
860  void write(unsigned address, byte value, EmuTime::param time) override;
861  } vdpRegDebug;
862 
863  struct StatusRegDebug final : SimpleDebuggable {
864  explicit StatusRegDebug(VDP& vdp);
865  byte read(unsigned address, EmuTime::param time) override;
866  } vdpStatusRegDebug;
867 
868  struct PaletteDebug final : SimpleDebuggable {
869  explicit PaletteDebug(VDP& vdp);
870  byte read(unsigned address) override;
871  void write(unsigned address, byte value, EmuTime::param time) override;
872  } vdpPaletteDebug;
873 
874  struct VRAMPointerDebug final : SimpleDebuggable {
875  explicit VRAMPointerDebug(VDP& vdp);
876  byte read(unsigned address) override;
877  void write(unsigned address, byte value, EmuTime::param time) override;
878  } vramPointerDebug;
879 
880  class Info : public InfoTopic {
881  public:
882  void execute(span<const TclObject> tokens,
883  TclObject& result) const override;
884  std::string help(const std::vector<std::string>& tokens) const override;
885  virtual int calc(const EmuTime& time) const = 0;
886  protected:
887  Info(VDP& vdp_, const std::string& name, std::string helpText_);
888  ~Info() = default;
889  VDP& vdp;
890  const std::string helpText;
891  };
892 
893  struct FrameCountInfo final : Info {
894  explicit FrameCountInfo(VDP& vdp);
895  int calc(const EmuTime& time) const override;
896  } frameCountInfo;
897 
898  struct CycleInFrameInfo final : Info {
899  explicit CycleInFrameInfo(VDP& vdp);
900  int calc(const EmuTime& time) const override;
901  } cycleInFrameInfo;
902 
903  struct LineInFrameInfo final : Info {
904  explicit LineInFrameInfo(VDP& vdp);
905  int calc(const EmuTime& time) const override;
906  } lineInFrameInfo;
907 
908  struct CycleInLineInfo final : Info {
909  explicit CycleInLineInfo(VDP& vdp);
910  int calc(const EmuTime& time) const override;
911  } cycleInLineInfo;
912 
913  struct MsxYPosInfo final : Info {
914  explicit MsxYPosInfo(VDP& vdp);
915  int calc(const EmuTime& time) const override;
916  } msxYPosInfo;
917 
918  struct MsxX256PosInfo final : Info {
919  explicit MsxX256PosInfo(VDP& vdp);
920  int calc(const EmuTime& time) const override;
921  } msxX256PosInfo;
922 
923  struct MsxX512PosInfo final : Info {
924  explicit MsxX512PosInfo(VDP& vdp);
925  int calc(const EmuTime& time) const override;
926  } msxX512PosInfo;
927 
930  std::unique_ptr<Renderer> renderer;
931 
934  std::unique_ptr<VDPCmdEngine> cmdEngine;
935 
938  std::unique_ptr<SpriteChecker> spriteChecker;
939 
942  std::unique_ptr<VDPVRAM> vram;
943 
947  const RawFrame* externalVideo;
948 
954  const RawFrame* superimposing;
955 
958  VDPClock frameStartTime;
959 
962  OptionalIRQHelper irqVertical;
963 
966  OptionalIRQHelper irqHorizontal;
967 
970  EmuTime displayStartSyncTime;
971 
974  EmuTime vScanSyncTime;
975 
978  EmuTime hScanSyncTime;
979 
980  TclCallback tooFastCallback;
981 
984  VdpVersion version;
985 
990  int saturationPr;
991 
996  int saturationPb;
997 
1003  int frameCount;
1004 
1007  int displayStart;
1008 
1012  int horizontalScanOffset;
1013 
1017  int horizontalAdjust;
1018 
1021  byte controlRegs[32];
1022 
1027  int controlRegMask;
1028 
1035  byte controlValueMasks[32];
1036 
1040  int blinkCount;
1041 
1045  int vramPointer;
1046 
1049  word palette[16];
1050 
1053  bool isDisplayArea;
1054 
1060  bool palTiming;
1061 
1065  bool interlaced;
1066 
1071  byte statusReg0;
1072 
1078  byte statusReg1;
1079 
1084  byte statusReg2;
1085 
1088  bool blinkState;
1089 
1092  byte dataLatch;
1093 
1096  bool registerDataStored;
1097 
1100  bool paletteDataStored;
1101 
1109  byte cpuVramData;
1110 
1114  bool cpuVramReqIsRead;
1115  bool pendingCpuAccess; // always equal to pendingSyncPoint(CPU_VRAM_ACCESS)
1116 
1120  bool cpuExtendedVram;
1121 
1127  DisplayMode displayMode;
1128 
1133  bool displayEnabled;
1134 
1138  bool warningPrinted;
1139 
1141  bool brokenCmdTiming;
1142  bool allowTooFastAccess;
1143 
1145  MSXCPU& cpu;
1146  const byte fixedVDPIOdelayCycles;
1147 };
1149 
1150 } // namespace openmsx
1151 
1152 #endif
bool isMultiPageScrolling() const
Is multi page scrolling enabled? It is considered enabled if both the multi page scrolling flag is en...
Definition: VDP.hh:306
bool pendingSyncPoint() const
Definition: Schedulable.cc:38
word getPalette(int index) const
Gets a palette entry.
Definition: VDP.hh:228
int getBlinkBackgroundColor() const
Gets the current blinking color for blinking text.
Definition: VDP.hh:212
bool getEvenOdd() const
Is the even or odd field being displayed?
Definition: VDP.hh:355
bool spritesEnabledRegister() const
Still faster variant (just looks at the sprite-enabled-bit).
Definition: VDP.hh:262
void setSpriteStatus(byte value)
Should only be used by SpriteChecker.
Definition: VDP.hh:484
Represents the output window/screen of openMSX.
Definition: Display.hh:31
EmuTime::param getFrameStartTime() const
Definition: VDP.hh:382
SpriteChecker & getSpriteChecker()
Get the sprite checker for this VDP.
Definition: VDP.hh:167
bool getBrokenCmdTiming() const
Value of the cmdTiming setting, true means commands have infinite speed.
Definition: VDP.hh:504
Definition: span.hh:34
void scheduleCmdSync(EmuTime t)
Only used when there are commandExecuting-probe listeners.
Definition: VDP.hh:541
int getLeftBorder() const
Gets the number of VDP clockticks between start of line and the end of the left border.
Definition: VDP.hh:450
uint8_t byte
8 bit unsigned integer
Definition: openmsx.hh:26
DisplayMode getDisplayMode() const
Get the display mode the VDP is in.
Definition: VDP.hh:141
bool isPalTiming() const
Is PAL timing active? This setting is fixed at start of frame.
Definition: VDP.hh:322
EmuTime getAccessSlot(EmuTime::param frame_, EmuTime::param time, Delta delta, const VDP &vdp)
Return the time of the next available access slot that is at least &#39;delta&#39; cycles later than &#39;time&#39;...
int getLineZero() const
Get the absolute line number of display line zero.
Definition: VDP.hh:314
int getEvenOddMask() const
Expresses the state of even/odd page interchange in a mask on the line number.
Definition: VDP.hh:369
byte getHorizontalScrollLow() const
Gets the current horizontal scroll lower bits.
Definition: VDP.hh:278
bool isVDPwithVRAMremapping() const
Does this VDP have VRAM remapping when switching from 4k to 8/16k mode?
Definition: VDP.hh:121
Represents a VDP display mode.
Definition: DisplayMode.hh:14
int getHorizontalAdjust() const
This is a combination of the (horizontal) set adjust register and the YJK-mode bit.
Definition: VDP.hh:428
bool isEvenOddEnabled() const
Get even/odd page alternation status.
Definition: VDP.hh:348
byte getVerticalScroll() const
Gets the current vertical scroll (line displayed at Y=0).
Definition: VDP.hh:269
bool hasYJK() const
Does this VDP support YJK display?
Definition: VDP.hh:128
int getBackgroundColor() const
Gets the current background color.
Definition: VDP.hh:193
int getLeftBackground() const
Gets the number of VDP clockticks between start of line and the time when the background pixel with X...
Definition: VDP.hh:467
byte getHorizontalScrollHigh() const
Gets the current horizontal scroll higher bits.
Definition: VDP.hh:287
bool isBorderMasked() const
Gets the current border mask setting.
Definition: VDP.hh:296
bool isVDPwithPALonly() const
Is this a VDP only capable of PAL?
Definition: VDP.hh:100
Every class that wants to get scheduled at some point must inherit from this class.
Definition: Schedulable.hh:33
A video frame as output by the VDP scanline conversion unit, before any postprocessing filters are ap...
Definition: RawFrame.hh:25
int getForegroundColor() const
Gets the current foreground color.
Definition: VDP.hh:181
unique_ptr< Renderer > createRenderer(VDP &vdp, Display &display)
Create the Renderer selected by the current renderer setting.
SERIALIZE_CLASS_VERSION(CassettePlayer, 2)
bool vdpLacksMirroring() const
Is this a VDP that lacks mirroring?
Definition: VDP.hh:107
bool vdpHasPatColMirroring() const
Is this a VDP that has pattern/colortable mirroring?
Definition: VDP.hh:114
int getTicksPerFrame() const
Gets the number of VDP clockticks (21MHz) per frame.
Definition: VDP.hh:407
bool getBlinkState() const
Gets the current blink state.
Definition: VDP.hh:219
int getLeftSprites() const
Gets the number of VDP clockticks between start of line and the start of the sprite plane...
Definition: VDP.hh:439
bool getTransparency() const
Gets the current transparency setting.
Definition: VDP.hh:174
bool isInsideFrame(EmuTime::param time) const
Is the given timestamp inside the current frame? Mainly useful for debugging, because relevant timest...
Definition: VDP.hh:420
bool isMSX1VDP() const
Is this an MSX1 VDP?
Definition: VDP.hh:93
bool isSpriteMag() const
Are sprites magnified?
Definition: VDP.hh:394
const RawFrame * isSuperimposing() const
Are we currently superimposing? In case of superimpose, returns a pointer to the to-be-superimposed f...
Definition: VDP.hh:155
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
An MSXDevice is an emulated hardware component connected to the bus of the emulated MSX...
Definition: MSXDevice.hh:31
int getSpriteSize() const
Gets the sprite size in pixels (8/16).
Definition: VDP.hh:388
bool spritesEnabled() const
Are sprites enabled?
Definition: VDP.hh:245
Scheduler & getScheduler() const
Definition: MSXDevice.cc:145
VDP-VRAM access slot calculator, meant to be used in the inner loops of the VDPCmdEngine commands...
uint16_t word
16 bit unsigned integer
Definition: openmsx.hh:29
byte getStatusReg0() const
Should only be used by SpriteChecker.
Definition: VDP.hh:474
Unified implementation of MSX Video Display Processors (VDPs).
Definition: VDP.hh:61
Abstract base class for post processors.
bool spritesEnabledFast() const
Same as spritesEnabled(), but may only be called in sprite mode 1 or 2.
Definition: VDP.hh:254
Manages VRAM contents and synchronises the various users of the VRAM.
Definition: VDPVRAM.hh:384
int getTicksThisFrame(EmuTime::param time) const
Gets the number of VDP clock ticks (21MHz) elapsed between a given time and the start of this frame...
Definition: VDP.hh:378
bool getCmdBit() const
Are commands possible in non Graphic modes? (V9958 only)
Definition: VDP.hh:401
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:9
#define OUTER(type, member)
Definition: outer.hh:38
bool isDisplayEnabled() const
Is the display enabled? Both the regular border and forced blanking by clearing the display enable bi...
Definition: VDP.hh:237
bool isInterlaced() const
Get interlace status.
Definition: VDP.hh:333
void setSyncPoint(EmuTime::param timestamp)
Definition: Schedulable.cc:23
int getBlinkForegroundColor() const
Gets the current blinking color for blinking text.
Definition: VDP.hh:205
TclObject t
int getRightBorder() const
Gets the number of VDP clockticks between start of line and the start of the right border...
Definition: VDP.hh:457
void setExternalVideoSource(const RawFrame *externalSource)
Enable superimposing.
Definition: VDP.hh:498
void serialize(Archive &ar, T &t, unsigned version)
bool getVRMode() const
Returns current VR mode.
Definition: VDP.hh:492
VDPVRAM & getVRAM()
Get the VRAM object for this VDP.
Definition: VDP.hh:147