Subversion Repositories Shiroi

Rev

Rev 27 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 27 Rev 32
Line 1... Line 1...
1
/* $Id: video.c 27 2024-08-31 12:38:59Z nishi $ */
1
/* $Id: video.c 32 2024-09-01 08:51:40Z nishi $ */
2
 
2
 
3
#include "video.h"
3
#include "video.h"
4
 
4
 
5
#include "math.h"
5
#include "math.h"
6
 
6
 
Line 51... Line 51...
51
		write_vram(addr);
51
		write_vram(addr);
52
	}
52
	}
53
#endif
53
#endif
54
}
54
}
55
 
55
 
-
 
56
void change_color(unsigned char color){
-
 
57
	if(vdp_addr != -1){
-
 
58
		outp(vdp_addr, color);
-
 
59
		outp(vdp_addr, 0x87);
-
 
60
		int i;
-
 
61
		write_vram(0x1400);
-
 
62
		for(i = 0; i < 0x10; i++) outp(vdp_data, color);
-
 
63
		write_vram(0x1400 + 0x10);
-
 
64
		for(i = 0; i < 0x10; i++) outp(vdp_data, ((i & 0xf) << 4) | 1);
-
 
65
	}
-
 
66
#ifndef ONLY_VDP
-
 
67
	else if(vdg_addr != -1){
-
 
68
	}
-
 
69
#endif
-
 
70
}
-
 
71
 
56
void setreadvramaddr(unsigned short addr){
72
void setreadvramaddr(unsigned short addr){
57
	if(vdp_addr != -1){
73
	if(vdp_addr != -1){
58
		read_vram(0x800 + addr);
74
		read_vram(0x800 + addr);
59
	}
75
	}
60
#ifndef ONLY_VDP
76
#ifndef ONLY_VDP
Line 153... Line 169...
153
		outp(vdp_addr, 0x29);
169
		outp(vdp_addr, 0x29);
154
		outp(vdp_addr, 0x85);
170
		outp(vdp_addr, 0x85);
155
	
171
	
156
		outp(vdp_addr, 0x03);
172
		outp(vdp_addr, 0x03);
157
		outp(vdp_addr, 0x86);
173
		outp(vdp_addr, 0x86);
158
	
-
 
159
		outp(vdp_addr, 0xe4);
-
 
160
		outp(vdp_addr, 0x87);
-
 
161
		
174
		
162
		/*
175
		/*
163
		 * VDP:
176
		 * VDP:
164
		 * 0x0000-0x0800: font
177
		 * 0x0000-0x0800: font
165
		 * 0x0800-0x1400: pattern
178
		 * 0x0800-0x1400: pattern
Line 168... Line 181...
168
		 * 0x1800-0x2000: sprite pattern
181
		 * 0x1800-0x2000: sprite pattern
169
		 */
182
		 */
170
	
183
	
171
		write_vram(0);
184
		write_vram(0);
172
		for(i = 0; i < 0x800; i++) outp(vdp_data, *((unsigned char*)(0x6000 - 2048 + i)));
185
		for(i = 0; i < 0x800; i++) outp(vdp_data, *((unsigned char*)(0x6000 - 2048 + i)));
173
	
186
 
174
		write_vram(0x1400);
187
		change_color(0xf4);
175
		for(i = 0; i < 0x20; i++) outp(vdp_data, 0xf0);
-
 
176
		write_vram(0x1400 + 0x10);
-
 
177
		for(i = 0; i < 0x10; i++) outp(vdp_data, ((i & 0xf) << 4) | 0);
-
 
178
	}
188
	}
179
#ifndef ONLY_VDP
189
#ifndef ONLY_VDP
180
	else if(vdg_addr != -1){
190
	else if(vdg_addr != -1){
181
		scrwidth = 32;
191
		scrwidth = 32;
182
		scrheight = 16;
192
		scrheight = 16;