Subversion Repositories Shiroi

Rev

Rev 10 | Rev 12 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10 Rev 11
Line 1... Line 1...
1
/* $Id: shiroi.c 10 2024-08-29 01:39:27Z nishi $ */
1
/* $Id: shiroi.c 11 2024-08-29 02:49:47Z nishi $ */
2
 
2
 
3
#include "shiroi.h"
3
#include "shiroi.h"
4
 
4
 
5
#include "card/shiroi_video_mk_i.h"
5
#include "card/shiroi_video_mk_i.h"
6
#include "card/shiroi_video_mk_ii.h"
6
#include "card/shiroi_video_mk_ii.h"
Line 110... Line 110...
110
}
110
}
111
 
111
 
112
void shiroi_loop(shiroi_t* shiroi) {
112
void shiroi_loop(shiroi_t* shiroi) {
113
	int x = 0;
113
	int x = 0;
114
	int y = 0;
114
	int y = 0;
115
	while(!shiroi->stop) {
115
	while(!shiroi->stop || shiroi->reset) {
116
		if(shiroi->reset) {
116
		if(shiroi->reset) {
117
			z80_reset(&shiroi->z80);
117
			z80_reset(&shiroi->z80);
118
			int i;
118
			int i;
119
			for(i = 0; i < 256 / SHIROI_IO_PORTS; i++) {
119
			for(i = 0; i < 256 / SHIROI_IO_PORTS; i++) {
120
				shiroi_reset_card(shiroi, i);
120
				shiroi_reset_card(shiroi, i);
121
			}
121
			}
122
			shiroi->reset = false;
122
			shiroi->reset = false;
-
 
123
			incre = 0;
-
 
124
			for(i = 0; i < 480; i++) audio[i] = 0;
-
 
125
			continue;
123
		}
126
		}
124
		shiroi->z80_pins = z80_tick(&shiroi->z80, shiroi->z80_pins);
127
		shiroi->z80_pins = z80_tick(&shiroi->z80, shiroi->z80_pins);
125
		if(shiroi->z80_pins & Z80_MREQ) {
128
		if(shiroi->z80_pins & Z80_MREQ) {
126
			uint16_t addr = Z80_GET_ADDR(shiroi->z80_pins);
129
			uint16_t addr = Z80_GET_ADDR(shiroi->z80_pins);
127
			if(shiroi->z80_pins & Z80_RD) {
130
			if(shiroi->z80_pins & Z80_RD) {