Add reu library

This commit is contained in:
drmortalwombat 2023-02-23 14:19:18 +01:00
parent 153c0ef4fa
commit 0bb470939f
2 changed files with 52 additions and 0 deletions

2
include/c64/reu.c Normal file
View File

@ -0,0 +1,2 @@
#include "reu.h"

50
include/c64/reu.h Normal file
View File

@ -0,0 +1,50 @@
#ifndef C64_REU_H
#define C64_REU_H
#include "types.h"
#define REU_STAT_IRQ 0x80
#define REU_STAT_EOB 0x40
#define REU_STAT_FAULT 0x20
#define REU_STAT_SIZE 0x10
#define REU_STAT_VERSION 0x0f
#define REU_CTRL_FIXL 0x80
#define REU_CTRL_FIXR 0x40
#define REU_CTRL_INCL 0x00
#define REU_CTRL_INCR 0x00
#define REU_IRQ_ENABLE 0x80
#define REU_IRQ_EOB 0x40
#define REU_IRQ_FAULT 0x20
#define REU_CMD_EXEC 0x80
#define REU_CMD_AUTO 0x20
#define REU_CMD_FF00 0x10
#define REU_CMD_STORE 0x00
#define REU_CMD_LOAD 0x01
#define REU_CMD_SWAP 0x02
#define REU_CMD_VERIFY 0x03
struct REU
{
volatile byte status;
volatile byte cmd;
volatile word laddr;
volatile word raddr;
volatile byte rbank;
volatile word length;
volatile byte irqmask;
volatile byte ctrl;
};
#define reu (*((struct REU *)0xdf00))
#pragma compile("reu.c")
#endif