VramBitMappedView.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef VRAMBITMAPPEDVIEW
  2. #define VRAMBITMAPPEDVIEW
  3. #include <QString>
  4. #include <QWidget>
  5. #include <QImage>
  6. #include <QPixmap>
  7. #include <QMouseEvent>
  8. #include <QColor>
  9. class VramBitMappedView : public QWidget
  10. {
  11. Q_OBJECT
  12. public:
  13. VramBitMappedView(QWidget* parent = 0);
  14. void setZoom(float zoom);
  15. void setScreenMode(int mode);
  16. void setLines(int nrLines);
  17. void setVramSource(const unsigned char* adr);
  18. void setVramAddress(int adr);
  19. void setPaletteSource(const unsigned char* adr);
  20. void setBorderColor(int value);
  21. void mousePressEvent(QMouseEvent* e);
  22. void mouseMoveEvent (QMouseEvent* e);
  23. public slots:
  24. void refresh();
  25. signals:
  26. void imageChanged();
  27. void imagePosition(int xcoormsx, int ycoormsx, int color,
  28. unsigned addr, int byte);
  29. void imageClicked (int xcoormsx, int ycoormsx, int color,
  30. unsigned addr, int byte);
  31. private:
  32. void paintEvent(QPaintEvent*);
  33. void decode();
  34. void decodePallet();
  35. void decodeSCR5();
  36. void decodeSCR6();
  37. void decodeSCR7();
  38. void decodeSCR8();
  39. void decodeSCR10();
  40. void decodeSCR12();
  41. void setPixel2x2(int x, int y, QRgb c);
  42. void setPixel1x2(int x, int y, QRgb c);
  43. QRgb getColor(int c);
  44. QRgb msxpallet[16];
  45. QImage image;
  46. QPixmap piximage;
  47. const unsigned char* pallet;
  48. const unsigned char* vramBase;
  49. float zoomFactor;
  50. unsigned int vramAddress;
  51. int lines;
  52. int screenMode;
  53. int borderColor;
  54. };
  55. #endif // VRAMBITMAPPEDVIEW