|
|
1.1 root 1: //
2: // nono
1.1.1.3 root 3: // Copyright (C) 2020 nono project
4: // Licensed under nono-license.txt
1.1 root 5: //
6:
1.1.1.7 root 7: //
8: // スプライトコントローラ
9: //
10:
1.1 root 11: #pragma once
12:
13: #include "device.h"
14:
1.1.1.6 root 15: class SpriteDevice : public IODevice
1.1 root 16: {
1.1.1.3 root 17: using inherited = IODevice;
1.1.1.7 root 18:
1.1.1.10! root 19: static const uint32 baseaddr = 0xeb0000;
1.1 root 20:
21: struct sprite_scroll {
22: uint16 xpos;
23: uint16 ypos;
24: uint16 col;
25: uint16 prw;
26: } __attribute__((__packed__));
27:
28: struct sprite_ctrl {
29: struct sprite_scroll sprite[128];
30:
31: uint16 bg0x;
32: uint16 bg0y;
33: uint16 bg1x;
34: uint16 bg1y;
35: uint16 bgctrl;
36:
37: uint16 htotal; // 水平トータル
38: uint16 hdisp; // 水平表示位置
39: uint16 vdisp; // 垂直表示位置
40: uint16 res; // 解像度
41: };
42:
43: public:
44: SpriteDevice();
1.1.1.9 root 45: ~SpriteDevice() override;
1.1 root 46:
1.1.1.10! root 47: busdata Read(busaddr addr) override;
! 48: busdata Write(busaddr addr, uint32 data) override;
! 49: busdata Peek1(uint32 addr) override;
1.1 root 50:
51: private:
1.1.1.10! root 52: busdata Get16(uint32 addr) const;
! 53: busdata Set16(uint32 addr, uint32 data);
! 54:
1.1 root 55: struct sprite_ctrl reg {};
1.1.1.2 root 56: std::unique_ptr<uint8[]> mem {};
1.1 root 57: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.