1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-29 15:29:36 +00:00
CLK/Machines/Amiga/Blitter.hpp

70 lines
1.5 KiB
C++
Raw Normal View History

2021-07-22 22:43:07 +00:00
//
// Blitter.hpp
// Clock Signal
//
// Created by Thomas Harte on 22/07/2021.
// Copyright © 2021 Thomas Harte. All rights reserved.
//
#ifndef Blitter_hpp
#define Blitter_hpp
#include <cstddef>
#include <cstdint>
#include "../../ClockReceiver/ClockReceiver.hpp"
#include "DMADevice.hpp"
2021-07-22 22:43:07 +00:00
namespace Amiga {
2021-10-29 18:29:22 +00:00
class Blitter: public DMADevice<4, 4> {
2021-07-22 22:43:07 +00:00
public:
using DMADevice::DMADevice;
2021-07-22 22:43:07 +00:00
// Various setters; it's assumed that address decoding is handled externally.
//
// In all cases where a channel is identified numerically, it's taken that
// 0 = A, 1 = B, 2 = C, 3 = D.
void set_control(int index, uint16_t value);
void set_first_word_mask(uint16_t value);
void set_last_word_mask(uint16_t value);
2021-07-22 22:43:07 +00:00
void set_size(uint16_t value);
void set_minterms(uint16_t value);
// void set_vertical_size(uint16_t value);
// void set_horizontal_size(uint16_t value);
2021-07-22 22:43:07 +00:00
void set_data(int channel, uint16_t value);
uint16_t get_status();
bool advance_dma();
2021-07-22 22:43:07 +00:00
private:
int width_ = 0, height_ = 0;
int shifts_[2]{};
2021-09-26 23:18:12 +00:00
uint16_t a_mask_[2] = {0xffff, 0xffff};
bool line_mode_ = false;
2021-09-26 23:18:12 +00:00
bool one_dot_ = false;
int line_direction_ = 0;
int line_sign_ = 1;
uint32_t direction_ = 1;
2021-09-29 02:11:58 +00:00
bool inclusive_fill_ = false;
bool exclusive_fill_ = false;
bool fill_carry_ = false;
2021-09-26 23:18:12 +00:00
bool channel_enables_[4]{};
uint8_t minterms_ = 0;
2021-09-24 02:05:59 +00:00
uint32_t a32_ = 0, b32_ = 0;
uint16_t a_data_ = 0, b_data_ = 0, c_data_ = 0;
2021-09-21 03:08:26 +00:00
2021-10-29 01:12:46 +00:00
bool not_zero_flag_ = false;
2021-07-22 22:43:07 +00:00
};
}
#endif /* Blitter_hpp */