Mercurial > repos > blastem
comparison genesis.c @ 1906:2d462aa78349
Make VDP VSRAM capacity respect model selection
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 27 Feb 2020 18:38:15 -0800 |
parents | 8312e574100a |
children | b021ca0bc375 |
comparison
equal
deleted
inserted
replaced
1905:1ec6931d0a49 | 1906:2d462aa78349 |
---|---|
1407 uint8_t tmss = !strcmp(tern_find_ptr_default(model, "tmss", "off"), "on"); | 1407 uint8_t tmss = !strcmp(tern_find_ptr_default(model, "tmss", "off"), "on"); |
1408 if (tmss) { | 1408 if (tmss) { |
1409 gen->version_reg |= 1; | 1409 gen->version_reg |= 1; |
1410 } | 1410 } |
1411 | 1411 |
1412 gen->vdp = init_vdp_context(gen->version_reg & 0x40); | 1412 uint8_t max_vsram = !strcmp(tern_find_ptr_default(model, "vsram", "40"), "64"); |
1413 gen->vdp = init_vdp_context(gen->version_reg & 0x40, max_vsram); | |
1413 gen->vdp->system = &gen->header; | 1414 gen->vdp->system = &gen->header; |
1414 gen->frame_end = vdp_cycles_to_frame_end(gen->vdp); | 1415 gen->frame_end = vdp_cycles_to_frame_end(gen->vdp); |
1415 char * config_cycles = tern_find_path(config, "clocks\0max_cycles\0", TVAL_PTR).ptrval; | 1416 char * config_cycles = tern_find_path(config, "clocks\0max_cycles\0", TVAL_PTR).ptrval; |
1416 gen->max_cycles = config_cycles ? atoi(config_cycles) : DEFAULT_SYNC_INTERVAL; | 1417 gen->max_cycles = config_cycles ? atoi(config_cycles) : DEFAULT_SYNC_INTERVAL; |
1417 gen->int_latency_prev1 = MCLKS_PER_68K * 32; | 1418 gen->int_latency_prev1 = MCLKS_PER_68K * 32; |
1472 } | 1473 } |
1473 for (int i = 0; i < CRAM_SIZE; i++) | 1474 for (int i = 0; i < CRAM_SIZE; i++) |
1474 { | 1475 { |
1475 write_cram_internal(gen->vdp, i, rand()); | 1476 write_cram_internal(gen->vdp, i, rand()); |
1476 } | 1477 } |
1477 for (int i = 0; i < VSRAM_SIZE; i++) | 1478 for (int i = 0; i < gen->vdp->vsram_size; i++) |
1478 { | 1479 { |
1479 gen->vdp->vsram[i] = rand(); | 1480 gen->vdp->vsram[i] = rand(); |
1480 } | 1481 } |
1481 } | 1482 } |
1482 setup_io_devices(config, rom, &gen->io); | 1483 setup_io_devices(config, rom, &gen->io); |