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 
18 namespace openmsx {
19 
20 class PostProcessor;
21 class Renderer;
22 class VDPCmdEngine;
23 class VDPVRAM;
24 class MSXCPU;
25 class SpriteChecker;
26 class Display;
27 class RawFrame;
28 class Setting;
29 template<typename> class EnumSetting;
30 namespace VDPAccessSlots {
31  enum Delta : int;
32  class Calculator;
33 }
34 
60 class VDP final : public MSXDevice, private VideoSystemChangeListener
61  , private Observer<Setting>
62 {
63 public:
66  static const int TICKS_PER_SECOND = 3579545 * 6; // 21.5MHz;
68 
71  static const int TICKS_PER_LINE = 1368;
72 
73  explicit VDP(const DeviceConfig& config);
74  ~VDP();
75 
76  void powerUp(EmuTime::param time) override;
77  void reset(EmuTime::param time) override;
78  byte readIO(word port, EmuTime::param time) override;
79  byte peekIO(word port, EmuTime::param time) const override;
80  void writeIO(word port, byte value, EmuTime::param time) override;
81 
86  PostProcessor* getPostProcessor() const;
87 
92  inline bool isMSX1VDP() const {
93  return (version & VM_MSX1) != 0;
94  }
95 
99  inline bool isVDPwithPALonly() const {
100  return (version & VM_PAL) != 0;
101  }
102 
106  inline bool vdpLacksMirroring() const {
107  return (version & VM_NO_MIRRORING) != 0;
108  }
109 
113  inline bool vdpHasPatColMirroring() const {
114  return (version & VM_PALCOL_MIRRORING) != 0;
115  }
116 
120  inline bool isVDPwithVRAMremapping() const {
121  return (version & VM_VRAM_REMAPPING) != 0;
122  }
123 
127  inline bool hasToshibaPalette() const {
128  return (version & VM_TOSHIBA_PALETTE) != 0;
129  }
130 
134  inline bool hasYJK() const {
135  return (version & VM_YJK) != 0;
136  }
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 
525  bool cpuAccessScheduled() const {
526  return pendingCpuAccess; // pendingSyncPoint(CPU_VRAM_ACCESS)
527  }
528 
529  template<typename Archive>
530  void serialize(Archive& ar, unsigned version);
531 
532 private:
533  void initTables();
534 
535  // VdpVersion bitmasks
536  static const unsigned VM_MSX1 = 1; // set-> MSX1, unset-> MSX2 or MSX2+
537  static const unsigned VM_PAL = 2; // set-> fixed PAL, unset-> fixed NTSC or switchable
538  static const unsigned VM_NO_MIRRORING = 4; // set-> no (screen2) mirroring
539  static const unsigned VM_PALCOL_MIRRORING = 8; // set-> pattern/color-table mirroring
540  static const unsigned VM_VRAM_REMAPPING = 16; // set-> 4k,8/16k VRAM remapping
541  static const unsigned VM_TOSHIBA_PALETTE = 32; // set-> has Toshiba palette
542  static const unsigned VM_YJK = 64; // set-> has YJK (MSX2+)
543 
545  enum VdpVersion {
550  TMS99X8A = VM_MSX1 | VM_PALCOL_MIRRORING | VM_VRAM_REMAPPING,
551 
553  TMS9929A = VM_MSX1 | VM_PALCOL_MIRRORING | VM_VRAM_REMAPPING | VM_PAL,
554 
556  TMS9129 = VM_MSX1 | VM_PAL,
557 
559  TMS91X8 = VM_MSX1,
560 
562  T6950PAL = VM_MSX1 | VM_TOSHIBA_PALETTE | VM_NO_MIRRORING | VM_PAL,
563 
565  T6950NTSC = VM_MSX1 | VM_TOSHIBA_PALETTE | VM_NO_MIRRORING,
566 
568  T7937APAL = VM_MSX1 | VM_TOSHIBA_PALETTE | VM_PAL,
569 
571  T7937ANTSC = VM_MSX1 | VM_TOSHIBA_PALETTE,
572 
574  V9938 = 0,
575 
577  V9958 = VM_YJK,
578  };
579 
580  struct SyncBase : public Schedulable {
581  SyncBase(VDP& vdp_) : Schedulable(vdp_.getScheduler()) {}
582  friend class VDP;
583  };
584 
585  struct SyncVSync : public SyncBase {
586  SyncVSync(VDP& vdp) : SyncBase(vdp) {}
587  void executeUntil(EmuTime::param time) override {
588  auto& vdp = OUTER(VDP, syncVSync);
589  vdp.execVSync(time);
590  }
591  } syncVSync;
592 
593  struct SyncDisplayStart : public SyncBase {
594  SyncDisplayStart(VDP& vdp) : SyncBase(vdp) {}
595  void executeUntil(EmuTime::param time) override {
596  auto& vdp = OUTER(VDP, syncDisplayStart);
597  vdp.execDisplayStart(time);
598  }
599  } syncDisplayStart;
600 
601  struct SyncVScan : public SyncBase {
602  SyncVScan(VDP& vdp) : SyncBase(vdp) {}
603  void executeUntil(EmuTime::param time) override {
604  auto& vdp = OUTER(VDP, syncVScan);
605  vdp.execVScan(time);
606  }
607  } syncVScan;
608 
609  struct SyncHScan : public SyncBase {
610  SyncHScan(VDP& vdp) : SyncBase(vdp) {}
611  void executeUntil(EmuTime::param /*time*/) override {
612  auto& vdp = OUTER(VDP, syncHScan);
613  vdp.execHScan();
614  }
615  } syncHScan;
616 
617  struct SyncHorAdjust : public SyncBase {
618  SyncHorAdjust(VDP& vdp) : SyncBase(vdp) {}
619  void executeUntil(EmuTime::param time) override {
620  auto& vdp = OUTER(VDP, syncHorAdjust);
621  vdp.execHorAdjust(time);
622  }
623  } syncHorAdjust;
624 
625  struct SyncSetMode : public SyncBase {
626  SyncSetMode(VDP& vdp) : SyncBase(vdp) {}
627  void executeUntil(EmuTime::param time) override {
628  auto& vdp = OUTER(VDP, syncSetMode);
629  vdp.execSetMode(time);
630  }
631  } syncSetMode;
632 
633  struct SyncSetBlank : public SyncBase {
634  SyncSetBlank(VDP& vdp) : SyncBase(vdp) {}
635  void executeUntil(EmuTime::param time) override {
636  auto& vdp = OUTER(VDP, syncSetBlank);
637  vdp.execSetBlank(time);
638  }
639  } syncSetBlank;
640 
641  struct SyncCpuVramAccess : public SyncBase {
642  SyncCpuVramAccess(VDP& vdp) : SyncBase(vdp) {}
643  void executeUntil(EmuTime::param time) override {
644  auto& vdp = OUTER(VDP, syncCpuVramAccess);
645  vdp.execCpuVramAccess(time);
646  }
647  } syncCpuVramAccess;
648 
649  void execVSync(EmuTime::param time);
650  void execDisplayStart(EmuTime::param time);
651  void execVScan(EmuTime::param time);
652  void execHScan();
653  void execHorAdjust(EmuTime::param time);
654  void execSetMode(EmuTime::param time);
655  void execSetBlank(EmuTime::param time);
656  void execCpuVramAccess(EmuTime::param time);
657 
668  static const int LINE_COUNT_RESET_TICKS = 15 * TICKS_PER_LINE;
669 
673  inline int getNumberOfLines() const {
674  return controlRegs[9] & 0x80 ? 212 : 192;
675  }
676 
686  inline bool getHR(int ticksThisFrame) const {
687  // Note: These constants are located inside this function because
688  // GCC 4.0.x won't link if they are in the class scope.
692  static const int HBLANK_LEN_TXT = 404;
696  static const int HBLANK_LEN_GFX = 312;
697  return
698  ( ticksThisFrame + TICKS_PER_LINE - getRightBorder()
699  ) % TICKS_PER_LINE
700  < (displayMode.isTextMode() ? HBLANK_LEN_TXT : HBLANK_LEN_GFX);
701  }
702 
703  // VideoSystemChangeListener interface:
704  void preVideoSystemChange() override;
705  void postVideoSystemChange() override;
706 
711  void resetInit();
712 
717  void resetMasks(EmuTime::param time);
718 
722  void frameStart(EmuTime::param time);
723 
731  void scheduleDisplayStart(EmuTime::param time);
732 
738  void scheduleVScan(EmuTime::param time);
739 
745  void scheduleHScan(EmuTime::param time);
746 
749  void vramWrite(byte value, EmuTime::param time);
750 
753  byte vramRead(EmuTime::param time);
754 
756  void scheduleCpuVramAccess(bool isRead, byte write, EmuTime::param time);
757  void executeCpuVramAccess(EmuTime::param time);
758 
761  byte peekStatusReg(byte reg, EmuTime::param time) const;
762  byte readStatusReg(byte reg, EmuTime::param time);
763 
766  void changeRegister(byte reg, byte val, EmuTime::param time);
767 
770  void syncAtNextLine(SyncBase& type, EmuTime::param time);
771 
774  void createRenderer();
775 
779  void updateNameBase(EmuTime::param time);
780 
784  void updateColorBase(EmuTime::param time);
785 
789  void updatePatternBase(EmuTime::param time);
790 
794  void updateSpriteAttributeBase(EmuTime::param time);
795 
799  void updateSpritePatternBase(EmuTime::param time);
800 
804  void updateDisplayMode(DisplayMode newMode, EmuTime::param time);
805 
812  void setPalette(int index, word grb, EmuTime::param time);
813 
814  // Observer<Setting>
815  void update(const Setting& setting) override;
816 
817 private:
818  Display& display;
819  EnumSetting<bool>& cmdTiming;
820  EnumSetting<bool>& tooFastAccess;
821 
822  struct RegDebug final : SimpleDebuggable {
823  explicit RegDebug(VDP& vdp);
824  byte read(unsigned address) override;
825  void write(unsigned address, byte value, EmuTime::param time) override;
826  } vdpRegDebug;
827 
828  struct StatusRegDebug final : SimpleDebuggable {
829  explicit StatusRegDebug(VDP& vdp);
830  byte read(unsigned address, EmuTime::param time) override;
831  } vdpStatusRegDebug;
832 
833  struct PaletteDebug final : SimpleDebuggable {
834  explicit PaletteDebug(VDP& vdp);
835  byte read(unsigned address) override;
836  void write(unsigned address, byte value, EmuTime::param time) override;
837  } vdpPaletteDebug;
838 
839  struct VRAMPointerDebug final : SimpleDebuggable {
840  explicit VRAMPointerDebug(VDP& vdp);
841  byte read(unsigned address) override;
842  void write(unsigned address, byte value, EmuTime::param time) override;
843  } vramPointerDebug;
844 
845  class Info : public InfoTopic {
846  public:
847  void execute(array_ref<TclObject> tokens,
848  TclObject& result) const override;
849  std::string help(const std::vector<std::string>& tokens) const override;
850  virtual int calc(const EmuTime& time) const = 0;
851  protected:
852  Info(VDP& vdp_, const std::string& name, std::string helpText_);
853  VDP& vdp;
854  const std::string helpText;
855  };
856 
857  struct FrameCountInfo final : Info {
858  FrameCountInfo(VDP& vdp);
859  int calc(const EmuTime& time) const override;
860  } frameCountInfo;
861 
862  struct CycleInFrameInfo final : Info {
863  CycleInFrameInfo(VDP& vdp);
864  int calc(const EmuTime& time) const override;
865  } cycleInFrameInfo;
866 
867  struct LineInFrameInfo final : Info {
868  LineInFrameInfo(VDP& vdp);
869  int calc(const EmuTime& time) const override;
870  } lineInFrameInfo;
871 
872  struct CycleInLineInfo final : Info {
873  CycleInLineInfo(VDP& vdp);
874  int calc(const EmuTime& time) const override;
875  } cycleInLineInfo;
876 
877  struct MsxYPosInfo final : Info {
878  MsxYPosInfo(VDP& vdp);
879  int calc(const EmuTime& time) const override;
880  } msxYPosInfo;
881 
882  struct MsxX256PosInfo final : Info {
883  MsxX256PosInfo(VDP& vdp);
884  int calc(const EmuTime& time) const override;
885  } msxX256PosInfo;
886 
887  struct MsxX512PosInfo final : Info {
888  MsxX512PosInfo(VDP& vdp);
889  int calc(const EmuTime& time) const override;
890  } msxX512PosInfo;
891 
894  std::unique_ptr<Renderer> renderer;
895 
898  std::unique_ptr<VDPCmdEngine> cmdEngine;
899 
902  std::unique_ptr<SpriteChecker> spriteChecker;
903 
906  std::unique_ptr<VDPVRAM> vram;
907 
911  const RawFrame* externalVideo;
912 
918  const RawFrame* superimposing;
919 
922  VDPClock frameStartTime;
923 
926  OptionalIRQHelper irqVertical;
927 
930  OptionalIRQHelper irqHorizontal;
931 
934  EmuTime displayStartSyncTime;
935 
938  EmuTime vScanSyncTime;
939 
942  EmuTime hScanSyncTime;
943 
944  TclCallback tooFastCallback;
945 
948  VdpVersion version;
949 
955  int frameCount;
956 
959  int displayStart;
960 
964  int horizontalScanOffset;
965 
969  int horizontalAdjust;
970 
973  byte controlRegs[32];
974 
979  int controlRegMask;
980 
987  byte controlValueMasks[32];
988 
992  int blinkCount;
993 
997  int vramPointer;
998 
1001  word palette[16];
1002 
1005  bool isDisplayArea;
1006 
1012  bool palTiming;
1013 
1017  bool interlaced;
1018 
1023  byte statusReg0;
1024 
1030  byte statusReg1;
1031 
1036  byte statusReg2;
1037 
1040  bool blinkState;
1041 
1044  byte dataLatch;
1045 
1048  bool registerDataStored;
1049 
1052  bool paletteDataStored;
1053 
1061  byte cpuVramData;
1062 
1066  bool cpuVramReqIsRead;
1067  bool pendingCpuAccess; // always equal to pendingSyncPoint(CPU_VRAM_ACCESS)
1068 
1072  bool cpuExtendedVram;
1073 
1079  DisplayMode displayMode;
1080 
1085  bool displayEnabled;
1086 
1090  bool warningPrinted;
1091 
1093  bool brokenCmdTiming;
1094  bool allowTooFastAccess;
1095 
1097  MSXCPU& cpu;
1098  const byte fixedVDPIOdelayCycles;
1099 };
1101 
1102 } // namespace openmsx
1103 
1104 #endif
int getBlinkBackgroundColor() const
Gets the current blinking color for blinking text.
Definition: VDP.hh:212
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
int getBlinkForegroundColor() const
Gets the current blinking color for blinking text.
Definition: VDP.hh:205
bool isBorderMasked() const
Gets the current border mask setting.
Definition: VDP.hh:296
bool isEvenOddEnabled() const
Get even/odd page alternation status.
Definition: VDP.hh:348
bool vdpHasPatColMirroring() const
Is this a VDP that has pattern/colortable mirroring?
Definition: VDP.hh:113
void setSpriteStatus(byte value)
Should only be used by SpriteChecker.
Definition: VDP.hh:484
bool spritesEnabled() const
Are sprites enabled?
Definition: VDP.hh:245
Represents the output window/screen of openMSX.
Definition: Display.hh:31
int getHorizontalAdjust() const
This is a combination of the (horizontal) set adjust register and the YJK-mode bit.
Definition: VDP.hh:428
SpriteChecker & getSpriteChecker()
Get the sprite checker for this VDP.
Definition: VDP.hh:167
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 vdpLacksMirroring() const
Is this a VDP that lacks mirroring?
Definition: VDP.hh:106
DisplayMode getDisplayMode() const
Get the display mode the VDP is in.
Definition: VDP.hh:141
int getRightBorder() const
Gets the number of VDP clockticks between start of line and the start of the right border...
Definition: VDP.hh:457
int getTicksPerFrame() const
Gets the number of VDP clockticks (21MHz) per frame.
Definition: VDP.hh:407
int getLeftSprites() const
Gets the number of VDP clockticks between start of line and the start of the sprite plane...
Definition: VDP.hh:439
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;...
Represents a VDP display mode.
Definition: DisplayMode.hh:14
byte getVerticalScroll() const
Gets the current vertical scroll (line displayed at Y=0).
Definition: VDP.hh:269
byte getHorizontalScrollHigh() const
Gets the current horizontal scroll higher bits.
Definition: VDP.hh:287
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
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
bool hasToshibaPalette() const
Is this a VDP with a Toshiba palette?
Definition: VDP.hh:127
EmuTime::param getFrameStartTime() const
Definition: VDP.hh:382
bool getCmdBit() const
Are commands possible in non Graphic modes? (V9958 only)
Definition: VDP.hh:401
bool getBlinkState() const
Gets the current blink state.
Definition: VDP.hh:219
int getEvenOddMask() const
Expresses the state of even/odd page interchange in a mask on the line number.
Definition: VDP.hh:369
bool isInterlaced() const
Get interlace status.
Definition: VDP.hh:333
bool isSpriteMag() const
Are sprites magnified?
Definition: VDP.hh:394
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
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)
int getForegroundColor() const
Gets the current foreground color.
Definition: VDP.hh:181
bool isVDPwithPALonly() const
Is this a VDP only capable of PAL?
Definition: VDP.hh:99
byte getStatusReg0() const
Should only be used by SpriteChecker.
Definition: VDP.hh:474
bool getTransparency() const
Gets the current transparency setting.
Definition: VDP.hh:174
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 isMSX1VDP() const
Is this an MSX1 VDP?
Definition: VDP.hh:92
int getSpriteSize() const
Gets the sprite size in pixels (8/16).
Definition: VDP.hh:388
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
unsigned char byte
8 bit unsigned integer
Definition: openmsx.hh:25
bool getEvenOdd() const
Is the even or odd field being displayed?
Definition: VDP.hh:355
bool getBrokenCmdTiming() const
Value of the cmdTiming setting, true means commands have infinite speed.
Definition: VDP.hh:504
VDP-VRAM access slot calculator, meant to be used in the inner loops of the VDPCmdEngine commands...
bool isVDPwithVRAMremapping() const
Does this VDP have VRAM remapping when switching from 4k to 8/16k mode?
Definition: VDP.hh:120
Unified implementation of MSX Video Display Processors (VDPs).
Definition: VDP.hh:60
Abstract base class for post processors.
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
byte getHorizontalScrollLow() const
Gets the current horizontal scroll lower bits.
Definition: VDP.hh:278
bool cpuAccessScheduled() const
Is there a CPU-VRAM access scheduled.
Definition: VDP.hh:525
bool isPalTiming() const
Is PAL timing active? This setting is fixed at start of frame.
Definition: VDP.hh:322
bool hasYJK() const
Does this VDP support YJK display?
Definition: VDP.hh:134
Manages VRAM contents and synchronises the various users of the VRAM.
Definition: VDPVRAM.hh:384
int getLineZero() const
Get the absolute line number of display line zero.
Definition: VDP.hh:314
bool spritesEnabledRegister() const
Still faster variant (just looks at the sprite-enabled-bit).
Definition: VDP.hh:262
Generic Gang-of-Four Observer class, templatized edition.
Definition: Observer.hh:9
#define OUTER(type, member)
Definition: outer.hh:38
bool getVRMode() const
Returns current VR mode.
Definition: VDP.hh:492
word getPalette(int index) const
Gets a palette entry.
Definition: VDP.hh:228
Scheduler & getScheduler() const
Definition: MSXDevice.cc:148
bool spritesEnabledFast() const
Same as spritesEnabled(), but may only be called in sprite mode 1 or 2.
Definition: VDP.hh:254
void setExternalVideoSource(const RawFrame *externalSource)
Enable superimposing.
Definition: VDP.hh:498
void serialize(Archive &ar, T &t, unsigned version)
VDPVRAM & getVRAM()
Get the VRAM object for this VDP.
Definition: VDP.hh:147
int getLeftBorder() const
Gets the number of VDP clockticks between start of line and the end of the left border.
Definition: VDP.hh:450
int getBackgroundColor() const
Gets the current background color.
Definition: VDP.hh:193
unsigned short word
16 bit unsigned integer
Definition: openmsx.hh:28