dev_scc.cc Source File
Back to the index.
Go to the documentation of this file.
68 #define SCC_TICK_SHIFT 14
72 #define MAX_QUEUE_LEN 1024
128 fatal(
"warning: add_to_rx_queue(): rx_queue overrun!\n");
132 static int rx_avail(
struct scc_data *d,
int portnr)
139 static unsigned char rx_nextchar(
struct scc_data *d,
int portnr)
162 }
else if (d->
use_fb == 1)
245 size_t dma_len,
int tx)
249 unsigned char word[4];
267 addr +=
sizeof(word);
268 }
while ((
addr & 0xffc) != 0);
270 dev_scc_tick(
cpu, extra);
273 printf(
"dev_scc_dma_func(): addr = %08x, len = %i\n",
274 (
int)
addr, (
int)dma_len);
280 while (rx_avail(d, port)) {
281 word[0] = word[1] = word[2] = word[3] = 0;
282 word[0] = word[1] = word[2] = word[3] =
283 rx_nextchar(d, port);
288 addr +=
sizeof(word);
290 if ((
addr & 0x7fc) == 0)
293 dev_scc_tick(
cpu, extra);
302 uint64_t idata = 0, odata = 0;
315 if ((relative_addr & 0x0f) == 0xf) {
316 if (relative_addr == 0x0f)
322 port = relative_addr / 8;
325 dev_scc_tick(
cpu, extra);
331 if ((relative_addr == 0 || relative_addr == 4) && (idata & 0xff) == 0) {
337 switch (relative_addr) {
345 fatal(
"WARNING! scc channel B has "
355 fatal(
"[ scc: port %i, register %i, read value "
374 fatal(
"[ scc: port %i, register %i, write "
375 "value 0x%02x ]\n", port,
393 if (rx_avail(d, port))
394 odata = rx_nextchar(d, port);
430 dev_scc_tick(
cpu, extra);
435 debug(
"[ scc: (port %i) read from 0x%08lx ]\n",
436 port, (
long)relative_addr);
438 debug(
"[ scc: (port %i) write to 0x%08lx: 0x%08x ]\n",
439 port, (
long)relative_addr, (
int)idata);
443 if (ultrix_mode && writeflag ==
MEM_READ) {
467 memset(d, 0,
sizeof(
struct scc_data));
unsigned char scc_register_w[N_SCC_PORTS *N_SCC_REGS]
void lk201_init(struct lk201_data *d, int use_fb, void(*add_to_rx_queue)(void *, int, int), int console_handle, void *add_data)
int cur_rx_queue_pos_write[N_SCC_PORTS]
#define INTERRUPT_CONNECT(name, istruct)
#define INTERRUPT_ASSERT(istruct)
#define SCC_RR0_TX_UNDERRUN
void memory_device_register(struct memory *mem, const char *, uint64_t baseaddr, uint64_t len, int(*f)(struct cpu *, struct memory *, uint64_t, unsigned char *, size_t, int, void *), void *extra, int flags, unsigned char *dyntrans_data)
int register_selected[N_SCC_PORTS]
int console_charavail(int handle)
#define SCC_WR9_MASTER_IE
#define SCC_WR1_RXI_ALL_CHAR
void machine_add_tickfunction(struct machine *machine, void(*func)(struct cpu *, void *), void *extra, int clockshift)
unsigned char scc_register_r[N_SCC_PORTS *N_SCC_REGS]
void fatal(const char *fmt,...)
int dev_scc_dma_func(struct cpu *cpu, void *extra, uint64_t addr, size_t dma_len, int tx)
uint64_t memory_readmax64(struct cpu *cpu, unsigned char *buf, int len)
int console_readchar(int handle)
void dev_scc_add_to_rx_queue(void *e, int ch, int portnr)
int console_start_slave(struct machine *machine, const char *consolename, int use_for_input)
void * dev_scc_init(struct machine *machine, struct memory *mem, uint64_t baseaddr, char *irq_path, int use_fb, int scc_nr, int addrmul)
int cur_rx_queue_pos_read[N_SCC_PORTS]
void lk201_tick(struct machine *machine, struct lk201_data *d)
#define SCC_WR1_RXI_FIRST_CHAR
int register_select_in_progress[N_SCC_PORTS]
#define INTERRUPT_DEASSERT(istruct)
void memory_writemax64(struct cpu *cpu, unsigned char *buf, int len, uint64_t data)
int(* memory_rw)(struct cpu *cpu, struct memory *mem, uint64_t vaddr, unsigned char *data, size_t len, int writeflag, int cache_flags)
void lk201_tx_data(struct lk201_data *d, int port, int idata)
int dev_scc_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr, unsigned char *data, size_t len, int writeflag, void *)
#define SCC_WR14_LOCAL_LOOPB
unsigned char rx_queue_char[N_SCC_PORTS *MAX_QUEUE_LEN]
#define CHECK_ALLOCATION(ptr)
Generated on Tue Mar 24 2020 14:04:48 for GXemul by
1.8.17