comparison genesis.c @ 1904:8312e574100a

Implement selectable YM2612/YM3834 invalid status port behavior
author Michael Pavone <pavone@retrodev.com>
date Wed, 26 Feb 2020 22:40:37 -0800
parents 32a3aa7b4a45
children 2d462aa78349
comparison
equal deleted inserted replaced
1903:62166274e6c0 1904:8312e574100a
873 location &= 0x7FFF; 873 location &= 0x7FFF;
874 if (location < 0x4000) { 874 if (location < 0x4000) {
875 value = gen->zram[location & 0x1FFF]; 875 value = gen->zram[location & 0x1FFF];
876 } else if (location < 0x6000) { 876 } else if (location < 0x6000) {
877 sync_sound(gen, context->current_cycle); 877 sync_sound(gen, context->current_cycle);
878 value = ym_read_status(gen->ym, context->current_cycle); 878 value = ym_read_status(gen->ym, context->current_cycle, location);
879 } else { 879 } else {
880 value = 0xFF; 880 value = 0xFF;
881 } 881 }
882 } else { 882 } else {
883 value = 0xFF; 883 value = 0xFF;
986 static uint8_t z80_read_ym(uint32_t location, void * vcontext) 986 static uint8_t z80_read_ym(uint32_t location, void * vcontext)
987 { 987 {
988 z80_context * context = vcontext; 988 z80_context * context = vcontext;
989 genesis_context * gen = context->system; 989 genesis_context * gen = context->system;
990 sync_sound(gen, context->Z80_CYCLE); 990 sync_sound(gen, context->Z80_CYCLE);
991 return ym_read_status(gen->ym, context->Z80_CYCLE); 991 return ym_read_status(gen->ym, context->Z80_CYCLE, location);
992 } 992 }
993 993
994 static uint8_t z80_read_bank(uint32_t location, void * vcontext) 994 static uint8_t z80_read_bank(uint32_t location, void * vcontext)
995 { 995 {
996 z80_context * context = vcontext; 996 z80_context * context = vcontext;
1418 gen->int_latency_prev2 = MCLKS_PER_68K * 16; 1418 gen->int_latency_prev2 = MCLKS_PER_68K * 16;
1419 1419
1420 render_set_video_standard((gen->version_reg & HZ50) ? VID_PAL : VID_NTSC); 1420 render_set_video_standard((gen->version_reg & HZ50) ? VID_PAL : VID_NTSC);
1421 1421
1422 gen->ym = malloc(sizeof(ym2612_context)); 1422 gen->ym = malloc(sizeof(ym2612_context));
1423 char *fm = tern_find_ptr_default(model, "fm", "discrete 2612");
1424 if (!strcmp(fm + strlen(fm) -4, "3834")) {
1425 system_opts |= YM_OPT_3834;
1426 }
1423 ym_init(gen->ym, gen->master_clock, MCLKS_PER_YM, system_opts); 1427 ym_init(gen->ym, gen->master_clock, MCLKS_PER_YM, system_opts);
1424 1428
1425 gen->psg = malloc(sizeof(psg_context)); 1429 gen->psg = malloc(sizeof(psg_context));
1426 psg_init(gen->psg, gen->master_clock, MCLKS_PER_PSG); 1430 psg_init(gen->psg, gen->master_clock, MCLKS_PER_PSG);
1427 1431