Subversion Repositories Shiroi

Rev

Rev 6 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 nishi 1
/* $Id: shiroi_text_mk_i.c 3 2024-08-28 09:19:04Z nishi $ */
2
#include "shiroi_text_mk_i.h"
3
 
4
#include "shiroi.h"
5
 
6
#include <stdlib.h>
7
 
8
void shiroi_text_mk_i_install(shiroi_t* shiroi, int slot) {
9
	shiroi->cards[slot].type = SHIROI_TEXT_MARK_I;
10
	shiroi->cards[slot].textptr = &shiroi->cards[slot].text;
11
 
12
	shiroi->cards[slot].text.key = 0;
13
}
14
 
15
void shiroi_text_mk_i(shiroi_t* shiroi) {
16
	int i;
17
 
18
	uint16_t io = Z80_GET_ADDR(shiroi->z80_pins);
19
	uint16_t addr = io & 0xff;
20
	uint16_t data = (io >> 8) & 0xff;
21
 
22
	for(i = 0; i < 256 / SHIROI_IO_PORTS; i++) {
23
		if(shiroi->cards[i].type == SHIROI_TEXT_MARK_I) {
24
			if(shiroi->z80_pins & Z80_RD) {
25
				/* I/O Read */
26
				if(addr == 9) {
27
					Z80_SET_DATA(shiroi->z80_pins, shiroi->cards[i].text.key);
28
				} else if(addr == 11) {
29
					Z80_SET_DATA(shiroi->z80_pins, shiroi->cards[i].type);
30
				}
31
			} else if(shiroi->z80_pins & Z80_WR) {
32
				/* I/O Write */
33
			}
34
		}
35
	}
36
}
37
 
38
void shiroi_text_mk_i_tick(shiroi_t* shiroi) {}