/* Callbacks from piacore to store effective output, taking DDR into account */ static void store_pa(BYTE byte) { output_porta = byte; mem_bank = (byte & 0x07) << 10; hires_off = byte & 0x10; charrom_on = byte & 0x08; #if DWW_DEBUG_REG || DWW_DEBUG_RAM log_message(petdww_log, "mem_bank = %04x", mem_bank); #endif #if DWW_DEBUG_REG log_message(petdww_log, "hires_off = %04x", hires_off); log_message(petdww_log, "charrom_on = %04x", charrom_on); #endif if (hires_off) { if (charrom_on) { crtc_set_hires_draw_callback(NULL); } else { crtc_set_hires_draw_callback(petdww_DRAW_blank); } } else { if (petres.video == 80) { crtc_set_hires_draw_callback(petdww_DRAW_80); } else { crtc_set_hires_draw_callback(petdww_DRAW_40); } } }
void crtc_store_hre(WORD addr, BYTE value) { if (pethre_enabled) { /* printf("HRE: enabled... %4x %2x\n", addr, value); */ /* E888 is the usual address */ if (addr & 0x0008) { /* turn ROMs on or off */ if (value != reg_E888) { if (value == 0x0F) { /* ROMs on */ /* printf("HRE: ROMs on\n"); */ petmem_ramON = 0; petres.ramsel9 = 0; petres.ramselA = 0; ramsel_changed(); } else if (value == 0x83) { /* ROMs off */ /* printf("HRE: ROMs off\n"); */ petmem_ramON = 1; petres.ramsel9 = 0; petres.ramselA = 0; ramsel_changed(); } reg_E888 = value; } else { /* printf("HRE: $%04X <- %02X\n", addr, value); */ } } else if (addr & 0x0001) { /* * The register that contains the high byte of the screen * address is used to turn the hi-res graphics on or off. * In real hardware, this address line (MA12) goes to a * jumper which the HRE board spies on. */ if (crtc.regno == 0x0c) { if (value & CRTC_MA12) { /* off */ /* printf("HRE: Hi-Res off: start=%02X\n", value); */ crtc_set_hires_draw_callback(NULL); } else { /* on */ /* printf("HRE: Hi-Res on: start=%02X\n", value); */ crtc_set_hires_draw_callback(pethre_DRAW); } } } } else { /* printf("HRE: not enabled... %4x %2x\n", addr, value); */ } }