1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

Add a little more VIDC detail.

This commit is contained in:
Thomas Harte 2024-03-07 10:05:22 -05:00
parent 3405b3b287
commit 38b5624639

View File

@ -60,6 +60,96 @@ constexpr std::array<Zone, 0x20> zones(bool is_read) {
namespace Archimedes {
struct Video {
void write(uint32_t value) {
const auto target = (value >> 24) & 0xfc;
switch(target) {
case 0x00: case 0x04: case 0x08: case 0x0c:
case 0x10: case 0x14: case 0x18: case 0x1c:
case 0x20: case 0x24: case 0x28: case 0x2c:
case 0x30: case 0x34: case 0x38: case 0x3c:
logger.error().append("TODO: Video palette logical colour %d to %03x", (target >> 2), value & 0x1fff);
break;
case 0x40:
logger.error().append("TODO: Video border colour to %03x", value & 0x1fff);
break;
case 0x44: case 0x48: case 0x4c:
logger.error().append("TODO: Cursor colour %d to %03x", (target - 0x44) >> 2, value & 0x1fff);
break;
case 0x60: case 0x64: case 0x68: case 0x6c:
case 0x70: case 0x74: case 0x78: case 0x7c:
logger.error().append("TODO: Stereo image register %d to %03x", (target - 0x60) >> 2, value & 0x7);
break;
case 0x80:
logger.error().append("TODO: Video horizontal period: %d", (value >> 14) & 0x3ff);
break;
case 0x84:
logger.error().append("TODO: Video horizontal sync width: %d", (value >> 14) & 0x3ff);
break;
case 0x88:
logger.error().append("TODO: Video horizontal border start: %d", (value >> 14) & 0x3ff);
break;
case 0x8c:
logger.error().append("TODO: Video horizontal display start: %d", (value >> 14) & 0x3ff);
break;
case 0x90:
logger.error().append("TODO: Video horizontal display end: %d", (value >> 14) & 0x3ff);
break;
case 0x94:
logger.error().append("TODO: Video horizontal border end: %d", (value >> 14) & 0x3ff);
break;
case 0x98:
logger.error().append("TODO: Video horizontal cursor end: %d", (value >> 14) & 0x3ff);
break;
case 0x9c:
logger.error().append("TODO: Video horizontal interlace: %d", (value >> 14) & 0x3ff);
break;
case 0xa0:
logger.error().append("TODO: Video vertical period: %d", (value >> 14) & 0x3ff);
break;
case 0xa4:
logger.error().append("TODO: Video vertical sync width: %d", (value >> 14) & 0x3ff);
break;
case 0xa8:
logger.error().append("TODO: Video vertical border start: %d", (value >> 14) & 0x3ff);
break;
case 0xac:
logger.error().append("TODO: Video vertical display start: %d", (value >> 14) & 0x3ff);
break;
case 0xb0:
logger.error().append("TODO: Video vertical display end: %d", (value >> 14) & 0x3ff);
break;
case 0xb4:
logger.error().append("TODO: Video vertical border end: %d", (value >> 14) & 0x3ff);
break;
case 0xb8:
logger.error().append("TODO: Video vertical cursor start: %d", (value >> 14) & 0x3ff);
break;
case 0xbc:
logger.error().append("TODO: Video vertical cursor end: %d", (value >> 14) & 0x3ff);
break;
case 0xc0:
logger.error().append("TODO: Sound frequency: %d", value & 0x7f);
break;
case 0xe0:
logger.error().append("TODO: video control: %08x", value);
break;
default:
logger.error().append("TODO: unrecognised VIDC write of %08x", value);
break;
}
}
};
struct Interrupts {
uint8_t irq_status_a() const {
return irq_status_a_;
@ -79,7 +169,6 @@ struct Memory {
template <typename IntT>
bool write(uint32_t address, IntT source, InstructionSet::ARM::Mode mode, bool trans) {
(void)mode;
(void)trans;
switch (write_zones_[(address >> 21) & 31]) {
@ -126,7 +215,8 @@ struct Memory {
break;
case Zone::VideoController:
logger.error().append("TODO: Write to video controller of %08x to %08x", source, address);
// TODO: handle byte writes correctly.
vidc_.write(source);
break;
case Zone::PhysicallyMappedRAM:
@ -221,6 +311,7 @@ struct Memory {
std::array<uint8_t, 4*1024*1024> ram_{};
std::array<uint8_t, 2*1024*1024> rom_;
Interrupts ioc_;
Video vidc_;
template <typename IntT>
IntT &physical_ram(uint32_t address) {