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();
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  const 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 
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 
511 
521  VDPAccessSlots::Calculator getAccessSlotCalculator(
522  EmuTime::param time, EmuTime::param limit) const;
523 
524  template<typename Archive>
525  void serialize(Archive& ar, unsigned version);
526 
527 private:
528  void initTables();
529 
530  // VdpVersion bitmasks
531  static const unsigned VM_MSX1 = 1; // set-> MSX1, unset-> MSX2 or MSX2+
532  static const unsigned VM_PAL = 2; // set-> fixed PAL, unset-> fixed NTSC or switchable
533  static const unsigned VM_NO_MIRRORING = 4; // set-> no (screen2) mirroring
534  static const unsigned VM_PALCOL_MIRRORING = 8; // set-> pattern/color-table mirroring
535  static const unsigned VM_VRAM_REMAPPING = 16; // set-> 4k,8/16k VRAM remapping
536  static const unsigned VM_TOSHIBA_PALETTE = 32; // set-> has Toshiba palette
537  static const unsigned VM_YJK = 64; // set-> has YJK (MSX2+)
538 
540  enum VdpVersion {
545  TMS99X8A = VM_MSX1 | VM_PALCOL_MIRRORING | VM_VRAM_REMAPPING,
546 
548  TMS9929A = VM_MSX1 | VM_PALCOL_MIRRORING | VM_VRAM_REMAPPING | VM_PAL,
549 
551  TMS9129 = VM_MSX1 | VM_PAL,
552 
554  TMS91X8 = VM_MSX1,
555 
557  T6950PAL = VM_MSX1 | VM_TOSHIBA_PALETTE | VM_NO_MIRRORING | VM_PAL,
558 
560  T6950NTSC = VM_MSX1 | VM_TOSHIBA_PALETTE | VM_NO_MIRRORING,
561 
563  T7937APAL = VM_MSX1 | VM_TOSHIBA_PALETTE | VM_PAL,
564 
566  T7937ANTSC = VM_MSX1 | VM_TOSHIBA_PALETTE,
567 
569  V9938 = 0,
570 
572  V9958 = VM_YJK,
573  };
574 
575  struct SyncBase : public Schedulable {
576  explicit SyncBase(VDP& vdp_) : Schedulable(vdp_.getScheduler()) {}
577  friend class VDP;
578  };
579 
580  struct SyncVSync : public SyncBase {
581  explicit SyncVSync(VDP& vdp) : SyncBase(vdp) {}
582  void executeUntil(EmuTime::param time) override {
583  auto& vdp = OUTER(VDP, syncVSync);
584  vdp.execVSync(time);
585  }
586  } syncVSync;
587 
588  struct SyncDisplayStart : public SyncBase {
589  explicit SyncDisplayStart(VDP& vdp) : SyncBase(vdp) {}
590  void executeUntil(EmuTime::param time) override {
591  auto& vdp = OUTER(VDP, syncDisplayStart);
592  vdp.execDisplayStart(time);
593  }
594  } syncDisplayStart;
595 
596  struct SyncVScan : public SyncBase {
597  explicit SyncVScan(VDP& vdp) : SyncBase(vdp) {}
598  void executeUntil(EmuTime::param time) override {
599  auto& vdp = OUTER(VDP, syncVScan);
600  vdp.execVScan(time);
601  }
602  } syncVScan;
603 
604  struct SyncHScan : public SyncBase {
605  explicit SyncHScan(VDP& vdp) : SyncBase(vdp) {}
606  void executeUntil(EmuTime::param /*time*/) override {
607  auto& vdp = OUTER(VDP, syncHScan);
608  vdp.execHScan();
609  }
610  } syncHScan;
611 
612  struct SyncHorAdjust : public SyncBase {
613  explicit SyncHorAdjust(VDP& vdp) : SyncBase(vdp) {}
614  void executeUntil(EmuTime::param time) override {
615  auto& vdp = OUTER(VDP, syncHorAdjust);
616  vdp.execHorAdjust(time);
617  }
618  } syncHorAdjust;
619 
620  struct SyncSetMode : public SyncBase {
621  explicit SyncSetMode(VDP& vdp) : SyncBase(vdp) {}
622  void executeUntil(EmuTime::param time) override {
623  auto& vdp = OUTER(VDP, syncSetMode);
624  vdp.execSetMode(time);
625  }
626  } syncSetMode;
627 
628  struct SyncSetBlank : public SyncBase {
629  explicit SyncSetBlank(VDP& vdp) : SyncBase(vdp) {}
630  void executeUntil(EmuTime::param time) override {
631  auto& vdp = OUTER(VDP, syncSetBlank);
632  vdp.execSetBlank(time);
633  }
634  } syncSetBlank;
635 
636  struct SyncCpuVramAccess : public SyncBase {
637  explicit SyncCpuVramAccess(VDP& vdp) : SyncBase(vdp) {}
638  void executeUntil(EmuTime::param time) override {
639  auto& vdp = OUTER(VDP, syncCpuVramAccess);
640  vdp.execCpuVramAccess(time);
641  }
642  } syncCpuVramAccess;
643 
644  void execVSync(EmuTime::param time);
645  void execDisplayStart(EmuTime::param time);
646  void execVScan(EmuTime::param time);
647  void execHScan();
648  void execHorAdjust(EmuTime::param time);
649  void execSetMode(EmuTime::param time);
650  void execSetBlank(EmuTime::param time);
651  void execCpuVramAccess(EmuTime::param time);
652 
663  static const int LINE_COUNT_RESET_TICKS = 15 * TICKS_PER_LINE;
664 
668  inline int getNumberOfLines() const {
669  return controlRegs[9] & 0x80 ? 212 : 192;
670  }
671 
681  inline bool getHR(int ticksThisFrame) const {
682  // Note: These constants are located inside this function because
683  // GCC 4.0.x won't link if they are in the class scope.
687  static const int HBLANK_LEN_TXT = 404;
691  static const int HBLANK_LEN_GFX = 312;
692  return
693  ( ticksThisFrame + TICKS_PER_LINE - getRightBorder()
694  ) % TICKS_PER_LINE
695  < (displayMode.isTextMode() ? HBLANK_LEN_TXT : HBLANK_LEN_GFX);
696  }
697 
698  // VideoSystemChangeListener interface:
699  void preVideoSystemChange() override;
700  void postVideoSystemChange() override;
701 
706  void resetInit();
707 
712  void resetMasks(EmuTime::param time);
713 
717  void frameStart(EmuTime::param time);
718 
726  void scheduleDisplayStart(EmuTime::param time);
727 
733  void scheduleVScan(EmuTime::param time);
734 
740  void scheduleHScan(EmuTime::param time);
741 
744  void vramWrite(byte value, EmuTime::param time);
745 
748  byte vramRead(EmuTime::param time);
749 
751  void scheduleCpuVramAccess(bool isRead, byte write, EmuTime::param time);
752  void executeCpuVramAccess(EmuTime::param time);
753 
756  byte peekStatusReg(byte reg, EmuTime::param time) const;
757  byte readStatusReg(byte reg, EmuTime::param time);
758 
761  void changeRegister(byte reg, byte val, EmuTime::param time);
762 
765  void syncAtNextLine(SyncBase& type, EmuTime::param time);
766 
769  void createRenderer();
770 
774  void updateNameBase(EmuTime::param time);
775 
779  void updateColorBase(EmuTime::param time);
780 
784  void updatePatternBase(EmuTime::param time);
785 
789  void updateSpriteAttributeBase(EmuTime::param time);
790 
794  void updateSpritePatternBase(EmuTime::param time);
795 
799  void updateDisplayMode(DisplayMode newMode, bool cmdBit, EmuTime::param time);
800 
807  void setPalette(int index, word grb, EmuTime::param time);
808 
809  // Observer<Setting>
810  void update(const Setting& setting) override;
811 
812 private:
813  Display& display;
814  EnumSetting<bool>& cmdTiming;
815  EnumSetting<bool>& tooFastAccess;
816 
817  struct RegDebug final : SimpleDebuggable {
818  explicit RegDebug(VDP& vdp);
819  byte read(unsigned address) override;
820  void write(unsigned address, byte value, EmuTime::param time) override;
821  } vdpRegDebug;
822 
823  struct StatusRegDebug final : SimpleDebuggable {
824  explicit StatusRegDebug(VDP& vdp);
825  byte read(unsigned address, EmuTime::param time) override;
826  } vdpStatusRegDebug;
827 
828  struct PaletteDebug final : SimpleDebuggable {
829  explicit PaletteDebug(VDP& vdp);
830  byte read(unsigned address) override;
831  void write(unsigned address, byte value, EmuTime::param time) override;
832  } vdpPaletteDebug;
833 
834  struct VRAMPointerDebug final : SimpleDebuggable {
835  explicit VRAMPointerDebug(VDP& vdp);
836  byte read(unsigned address) override;
837  void write(unsigned address, byte value, EmuTime::param time) override;
838  } vramPointerDebug;
839 
840  class Info : public InfoTopic {
841  public:
842  void execute(array_ref<TclObject> tokens,
843  TclObject& result) const override;
844  std::string help(const std::vector<std::string>& tokens) const override;
845  virtual int calc(const EmuTime& time) const = 0;
846  protected:
847  Info(VDP& vdp_, const std::string& name, std::string helpText_);
848  VDP& vdp;
849  const std::string helpText;
850  };
851 
852  struct FrameCountInfo final : Info {
853  explicit FrameCountInfo(VDP& vdp);
854  int calc(const EmuTime& time) const override;
855  } frameCountInfo;
856 
857  struct CycleInFrameInfo final : Info {
858  explicit CycleInFrameInfo(VDP& vdp);
859  int calc(const EmuTime& time) const override;
860  } cycleInFrameInfo;
861 
862  struct LineInFrameInfo final : Info {
863  explicit LineInFrameInfo(VDP& vdp);
864  int calc(const EmuTime& time) const override;
865  } lineInFrameInfo;
866 
867  struct CycleInLineInfo final : Info {
868  explicit CycleInLineInfo(VDP& vdp);
869  int calc(const EmuTime& time) const override;
870  } cycleInLineInfo;
871 
872  struct MsxYPosInfo final : Info {
873  explicit MsxYPosInfo(VDP& vdp);
874  int calc(const EmuTime& time) const override;
875  } msxYPosInfo;
876 
877  struct MsxX256PosInfo final : Info {
878  explicit MsxX256PosInfo(VDP& vdp);
879  int calc(const EmuTime& time) const override;
880  } msxX256PosInfo;
881 
882  struct MsxX512PosInfo final : Info {
883  explicit MsxX512PosInfo(VDP& vdp);
884  int calc(const EmuTime& time) const override;
885  } msxX512PosInfo;
886 
889  std::unique_ptr<Renderer> renderer;
890 
893  std::unique_ptr<VDPCmdEngine> cmdEngine;
894 
897  std::unique_ptr<SpriteChecker> spriteChecker;
898 
901  std::unique_ptr<VDPVRAM> vram;
902 
906  const RawFrame* externalVideo;
907 
913  const RawFrame* superimposing;
914 
917  VDPClock frameStartTime;
918 
921  OptionalIRQHelper irqVertical;
922 
925  OptionalIRQHelper irqHorizontal;
926 
929  EmuTime displayStartSyncTime;
930 
933  EmuTime vScanSyncTime;
934 
937  EmuTime hScanSyncTime;
938 
939  TclCallback tooFastCallback;
940 
943  VdpVersion version;
944 
949  int saturationPr;
950 
955  int saturationPb;
956 
962  int frameCount;
963 
966  int displayStart;
967 
971  int horizontalScanOffset;
972 
976  int horizontalAdjust;
977 
980  byte controlRegs[32];
981 
986  int controlRegMask;
987 
994  byte controlValueMasks[32];
995 
999  int blinkCount;
1000 
1004  int vramPointer;
1005 
1008  word palette[16];
1009 
1012  bool isDisplayArea;
1013 
1019  bool palTiming;
1020 
1024  bool interlaced;
1025 
1030  byte statusReg0;
1031 
1037  byte statusReg1;
1038 
1043  byte statusReg2;
1044 
1047  bool blinkState;
1048 
1051  byte dataLatch;
1052 
1055  bool registerDataStored;
1056 
1059  bool paletteDataStored;
1060 
1068  byte cpuVramData;
1069 
1073  bool cpuVramReqIsRead;
1074  bool pendingCpuAccess; // always equal to pendingSyncPoint(CPU_VRAM_ACCESS)
1075 
1079  bool cpuExtendedVram;
1080 
1086  DisplayMode displayMode;
1087 
1092  bool displayEnabled;
1093 
1097  bool warningPrinted;
1098 
1100  bool brokenCmdTiming;
1101  bool allowTooFastAccess;
1102 
1104  MSXCPU& cpu;
1105  const byte fixedVDPIOdelayCycles;
1106 };
1108 
1109 } // namespace openmsx
1110 
1111 #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
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:32
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
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
void initTables()
This function should be called (once) before the next functions.
unique_ptr< Renderer > createRenderer(VDP &vdp, Display &display)
Create the Renderer selected by the current renderer setting.
This class implements a subset of the proposal for std::array_ref (proposed for the next c++ standard...
Definition: array_ref.hh:19
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:147
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
int getBlinkForegroundColor() const
Gets the current blinking color for blinking text.
Definition: VDP.hh:205
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