comparison src/main.c @ 11:04d8efe7a1f0

Initial stab at video output and background color rendering. Fixed address decoding in address port write handler.
author Michael Pavone <pavone@retrodev.com>
date Sun, 27 Mar 2016 17:36:02 -0700
parents 5176efdda5ae
children ae58e7c3c328
comparison
equal deleted inserted replaced
10:9f575f77a157 11:04d8efe7a1f0
2 #include <stdio.h> 2 #include <stdio.h>
3 #include <stdlib.h> 3 #include <stdlib.h>
4 #include <string.h> 4 #include <string.h>
5 #include "cpu.h" 5 #include "cpu.h"
6 #include "vdp.h" 6 #include "vdp.h"
7 #include "system.h"
7 8
8 #define CYCLES_PER_FRAME (832*262) 9 #define CYCLES_PER_FRAME (832*262)
9 10
10 uint8_t rom[48 * 1024]; 11 uint8_t rom[48 * 1024];
11 uint8_t ram[16 * 1024]; 12 uint8_t ram[16 * 1024];
138 context.proc->port_handlers[PORT_HORIZONTAL].write = horizontal_port_write; 139 context.proc->port_handlers[PORT_HORIZONTAL].write = horizontal_port_write;
139 context.proc->port_handlers[PORT_HORIZONTAL].read = horizontal_port_read; 140 context.proc->port_handlers[PORT_HORIZONTAL].read = horizontal_port_read;
140 context.proc->port_handlers[PORT_VRAM_ADDRESS].write = address_port_write; 141 context.proc->port_handlers[PORT_VRAM_ADDRESS].write = address_port_write;
141 context.proc->port_handlers[PORT_VRAM_ADDRESS].read = address_port_read; 142 context.proc->port_handlers[PORT_VRAM_ADDRESS].read = address_port_read;
142 context.proc->port_handlers[PORT_VRAM_DATA].write = data_port_write; 143 context.proc->port_handlers[PORT_VRAM_DATA].write = data_port_write;
144
145 if (!system_init(640, 480)) {
146 return 1;
147 }
148
143 run_console(&context); 149 run_console(&context);
144 return 0; 150 return 0;
145 } 151 }