mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-10 13:29:38 +00:00
SWIM3: add support for floppy DMA.
This commit is contained in:
parent
e91843034b
commit
2525398b6e
@ -33,7 +33,16 @@ enum DmaPullResult : int {
|
||||
|
||||
class DmaOutChannel {
|
||||
public:
|
||||
virtual bool is_active() = 0;
|
||||
virtual bool is_active() { return true; };
|
||||
virtual DmaPullResult pull_data(uint32_t req_len, uint32_t *avail_len,
|
||||
uint8_t **p_data) = 0;
|
||||
};
|
||||
|
||||
// Base class for bidirectional DMA channels.
|
||||
class DmaBidirChannel {
|
||||
public:
|
||||
virtual bool is_active() { return true; };
|
||||
virtual int push_data(const char* src_ptr, int len) = 0;
|
||||
virtual DmaPullResult pull_data(uint32_t req_len, uint32_t *avail_len,
|
||||
uint8_t **p_data) = 0;
|
||||
};
|
||||
|
@ -24,6 +24,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#ifndef SWIM3_H
|
||||
#define SWIM3_H
|
||||
|
||||
#include <devices/common/dmacore.h>
|
||||
#include <devices/common/hwcomponent.h>
|
||||
#include <devices/common/hwinterrupt.h>
|
||||
#include <devices/floppy/superdrive.h>
|
||||
@ -78,6 +79,10 @@ public:
|
||||
uint8_t read(uint8_t reg_offset);
|
||||
void write(uint8_t reg_offset, uint8_t value);
|
||||
|
||||
void set_dma_channel(DmaBidirChannel *dma_ch) {
|
||||
this->dma_ch = dma_ch;
|
||||
};
|
||||
|
||||
protected:
|
||||
void update_irq();
|
||||
void start_stepping();
|
||||
@ -89,6 +94,8 @@ protected:
|
||||
private:
|
||||
std::unique_ptr<MacSuperdrive::MacSuperDrive> int_drive;
|
||||
|
||||
DmaBidirChannel* dma_ch;
|
||||
|
||||
uint8_t setup_reg;
|
||||
uint8_t mode_reg;
|
||||
uint8_t error;
|
||||
|
Loading…
x
Reference in New Issue
Block a user