comparison jaguar.c @ 1087:6433d4d05934

Added placeholder code for video output hardware/object processor
author Michael Pavone <pavone@retrodev.com>
date Fri, 07 Oct 2016 18:27:38 -0700
parents bc86eaf6699d
children c0a026e974f4
comparison
equal deleted inserted replaced
1086:f0a1e0a2263c 1087:6433d4d05934
100 break; 100 break;
101 } 101 }
102 } else if (address < 0x100800) { 102 } else if (address < 0x100800) {
103 //CLUT 103 //CLUT
104 address = address >> 1 & 255; 104 address = address >> 1 & 255;
105 system->clut[address] = value; 105 system->video->clut[address] = value;
106 } else { 106 } else {
107 //Line buffer A 107 //Line buffer A
108 address = address >> 1 & 0x3FF; 108 address = address >> 1 & 0x3FF;
109 if (address < LINEBUFFER_WORDS) { 109 if (address < LINEBUFFER_WORDS) {
110 system->line_buffer_a[address] = value; 110 system->video->line_buffer_a[address] = value;
111 } 111 }
112 } 112 }
113 } else if (address < 0x101800) { 113 } else if (address < 0x101800) {
114 //Line buffer B 114 //Line buffer B
115 address = address >> 1 & 0x3FF; 115 address = address >> 1 & 0x3FF;
116 if (address < LINEBUFFER_WORDS) { 116 if (address < LINEBUFFER_WORDS) {
117 system->line_buffer_b[address] = value; 117 system->video->line_buffer_b[address] = value;
118 } 118 }
119 } else if (address < 0x102100) { 119 } else if (address < 0x102100) {
120 //Write Line Buffer 120 //Write Line Buffer
121 address = address >> 1 & 0x3FF; 121 address = address >> 1 & 0x3FF;
122 if (address < LINEBUFFER_WORDS) { 122 if (address < LINEBUFFER_WORDS) {
123 system->write_line_buffer[address] = value; 123 system->video->write_line_buffer[address] = value;
124 } 124 }
125 } else { 125 } else {
126 //GPU/Blitter registers 126 //GPU/Blitter registers
127 fprintf(stderr, "Unhandled write to GPU/Blitter registers %X: %X\n", address, value); 127 fprintf(stderr, "Unhandled write to GPU/Blitter registers %X: %X\n", address, value);
128 } 128 }
178 //Video mode / Memory control registers 178 //Video mode / Memory control registers
179 fprintf(stderr, "Unhandled read from video mode/memory control registers - %X\n", address); 179 fprintf(stderr, "Unhandled read from video mode/memory control registers - %X\n", address);
180 } else if (address < 0x100800) { 180 } else if (address < 0x100800) {
181 //CLUT 181 //CLUT
182 address = address >> 1 & 255; 182 address = address >> 1 & 255;
183 return system->clut[address]; 183 return system->video->clut[address];
184 } else { 184 } else {
185 //Line buffer A 185 //Line buffer A
186 address = address >> 1 & 0x3FF; 186 address = address >> 1 & 0x3FF;
187 if (address < LINEBUFFER_WORDS) { 187 if (address < LINEBUFFER_WORDS) {
188 return system->line_buffer_a[address]; 188 return system->video->line_buffer_a[address];
189 } 189 }
190 } 190 }
191 } else if (address < 0x101800) { 191 } else if (address < 0x101800) {
192 //Line buffer B 192 //Line buffer B
193 address = address >> 1 & 0x3FF; 193 address = address >> 1 & 0x3FF;
194 if (address < LINEBUFFER_WORDS) { 194 if (address < LINEBUFFER_WORDS) {
195 return system->line_buffer_b[address]; 195 return system->video->line_buffer_b[address];
196 } 196 }
197 } else if (address < 0x102100) { 197 } else if (address < 0x102100) {
198 //Write Line Buffer 198 //Write Line Buffer
199 address = address >> 1 & 0x3FF; 199 address = address >> 1 & 0x3FF;
200 if (address < LINEBUFFER_WORDS) { 200 if (address < LINEBUFFER_WORDS) {
201 return system->write_line_buffer[address]; 201 return system->video->write_line_buffer[address];
202 } 202 }
203 } else { 203 } else {
204 //GPU/Blitter registers 204 //GPU/Blitter registers
205 fprintf(stderr, "Unhandled read from GPU/Blitter registers %X\n", address); 205 fprintf(stderr, "Unhandled read from GPU/Blitter registers %X\n", address);
206 } 206 }
268 return value >> 8; 268 return value >> 8;
269 } 269 }
270 270
271 m68k_context * sync_components(m68k_context * context, uint32_t address) 271 m68k_context * sync_components(m68k_context * context, uint32_t address)
272 { 272 {
273 jaguar_context *system = context->system;
274 jag_video_run(system->video, context->current_cycle);
273 if (context->current_cycle > 0x10000000) { 275 if (context->current_cycle > 0x10000000) {
274 context->current_cycle -= 0x10000000; 276 context->current_cycle -= 0x10000000;
277 system->video->cycles -= 0x10000000;
275 } 278 }
276 return context; 279 return context;
277 } 280 }
278 281
279 m68k_context *handle_m68k_reset(m68k_context *context) 282 m68k_context *handle_m68k_reset(m68k_context *context)
307 } 310 }
308 m68k_options *opts = malloc(sizeof(m68k_options)); 311 m68k_options *opts = malloc(sizeof(m68k_options));
309 init_m68k_opts(opts, jag_m68k_map, 8, 2); 312 init_m68k_opts(opts, jag_m68k_map, 8, 2);
310 system->m68k = init_68k_context(opts, handle_m68k_reset); 313 system->m68k = init_68k_context(opts, handle_m68k_reset);
311 system->m68k->system = system; 314 system->m68k->system = system;
315 system->video = jag_video_init();
312 return system; 316 return system;
313 } 317 }
314 318
315 //modified copy of the version in blastem.c 319 //modified copy of the version in blastem.c
316 uint16_t *load_rom(char * filename, uint32_t *size) 320 uint16_t *load_rom(char * filename, uint32_t *size)