Subversion Repositories Shiroi

Rev

Rev 7 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 nishi 1
/* $Id: shiroi_text_mk_i.c 10 2024-08-29 01:39:27Z 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;
6 nishi 13
	shiroi->cards[slot].text.caps = false;
3 nishi 14
}
15
 
10 nishi 16
void shiroi_text_mk_i_reset(shiroi_t* shiroi, int slot) {
17
	shiroi->cards[slot].text.key = 0;
18
	shiroi->cards[slot].text.caps = false;
19
}
20
 
3 nishi 21
void shiroi_text_mk_i(shiroi_t* shiroi) {
22
	int i;
23
 
24
	uint16_t io = Z80_GET_ADDR(shiroi->z80_pins);
25
	uint16_t addr = io & 0xff;
26
	uint16_t data = (io >> 8) & 0xff;
27
 
28
	for(i = 0; i < 256 / SHIROI_IO_PORTS; i++) {
29
		if(shiroi->cards[i].type == SHIROI_TEXT_MARK_I) {
30
			if(shiroi->z80_pins & Z80_RD) {
31
				/* I/O Read */
32
				if(addr == 9) {
33
					Z80_SET_DATA(shiroi->z80_pins, shiroi->cards[i].text.key);
7 nishi 34
					shiroi->cards[i].text.key = 0;
3 nishi 35
				} else if(addr == 11) {
36
					Z80_SET_DATA(shiroi->z80_pins, shiroi->cards[i].type);
37
				}
38
			} else if(shiroi->z80_pins & Z80_WR) {
39
				/* I/O Write */
40
			}
41
		}
42
	}
43
}
44
 
45
void shiroi_text_mk_i_tick(shiroi_t* shiroi) {}