comparison blastem.c @ 492:dffc07104b09

Merged OpenGL branch
author Mike Pavone <pavone@retrodev.com>
date Sun, 27 Oct 2013 22:08:02 -0700
parents 32f053ad9b02
children 6fc71114d145
comparison
equal deleted inserted replaced
486:db5880d8ea03 492:dffc07104b09
276 context->int_ack = 0; 276 context->int_ack = 0;
277 } 277 }
278 adjust_int_cycle(context, v_context); 278 adjust_int_cycle(context, v_context);
279 if (address) { 279 if (address) {
280 if (break_on_sync) { 280 if (break_on_sync) {
281 break_on_sync = 0; 281 break_on_sync = 0;
282 debugger(context, address); 282 debugger(context, address);
283 } 283 }
284 if (save_state) { 284 if (save_state) {
285 save_state = 0; 285 save_state = 0;
286 while (!z_context->pc) 286 while (!z_context->pc)
287 { 287 {
288 sync_z80(z_context, z_context->current_cycle * MCLKS_PER_Z80 + MCLKS_PER_Z80); 288 sync_z80(z_context, z_context->current_cycle * MCLKS_PER_Z80 + MCLKS_PER_Z80);
1505 { 1505 {
1506 uint32_t old_clock = context->master_clock; 1506 uint32_t old_clock = context->master_clock;
1507 context->master_clock = ((uint64_t)context->normal_clock * (uint64_t)percent) / 100; 1507 context->master_clock = ((uint64_t)context->normal_clock * (uint64_t)percent) / 100;
1508 while (context->ym->current_cycle != context->psg->cycles) { 1508 while (context->ym->current_cycle != context->psg->cycles) {
1509 sync_sound(context, context->psg->cycles + MCLKS_PER_PSG); 1509 sync_sound(context, context->psg->cycles + MCLKS_PER_PSG);
1510 } 1510 }
1511 ym_adjust_master_clock(context->ym, context->master_clock); 1511 ym_adjust_master_clock(context->ym, context->master_clock);
1512 psg_adjust_master_clock(context->psg, context->master_clock); 1512 psg_adjust_master_clock(context->psg, context->master_clock);
1513 } 1513 }
1514 1514
1515 #define ROM_END 0x1A4 1515 #define ROM_END 0x1A4
1771 int loaded = 0; 1771 int loaded = 0;
1772 uint8_t force_version = 0; 1772 uint8_t force_version = 0;
1773 char * romfname = NULL; 1773 char * romfname = NULL;
1774 FILE *address_log = NULL; 1774 FILE *address_log = NULL;
1775 char * statefile = NULL; 1775 char * statefile = NULL;
1776 uint8_t fullscreen = 0; 1776 uint8_t fullscreen = 0, use_gl = 0;
1777 for (int i = 1; i < argc; i++) { 1777 for (int i = 1; i < argc; i++) {
1778 if (argv[i][0] == '-') { 1778 if (argv[i][0] == '-') {
1779 switch(argv[i][1]) { 1779 switch(argv[i][1]) {
1780 case 'd': 1780 case 'd':
1781 debug = 1; 1781 debug = 1;
1782 break; 1782 break;
1783 case 'f': 1783 case 'f':
1784 fullscreen = 1; 1784 fullscreen = 1;
1785 break;
1786 case 'g':
1787 use_gl = 1;
1785 break; 1788 break;
1786 case 'l': 1789 case 'l':
1787 address_log = fopen("address.log", "w"); 1790 address_log = fopen("address.log", "w");
1788 break; 1791 break;
1789 case 'v': 1792 case 'v':
1883 if (version_reg & 0x40) { 1886 if (version_reg & 0x40) {
1884 mclks_per_frame = MCLKS_LINE * LINES_PAL; 1887 mclks_per_frame = MCLKS_LINE * LINES_PAL;
1885 fps = 50; 1888 fps = 50;
1886 } 1889 }
1887 if (!headless) { 1890 if (!headless) {
1888 render_init(width, height, title, fps, fullscreen); 1891 render_init(width, height, title, fps, fullscreen, use_gl);
1889 } 1892 }
1890 vdp_context v_context; 1893 vdp_context v_context;
1891 genesis_context gen; 1894 genesis_context gen;
1892 memset(&gen, 0, sizeof(gen)); 1895 memset(&gen, 0, sizeof(gen));
1893 gen.master_clock = gen.normal_clock = fps == 60 ? MCLKS_NTSC : MCLKS_PAL; 1896 gen.master_clock = gen.normal_clock = fps == 60 ? MCLKS_NTSC : MCLKS_PAL;