/** * @brief initialize the display context to useful values * * Zap the display context. * Allocate a framebuf array to save updating the bitmap when * there is no change in the data word. */ void alto2_cpu_device::init_disp() { memset(&m_dsp, 0, sizeof(m_dsp)); save_item(NAME(m_dsp.state)); save_item(NAME(m_dsp.hlc)); save_item(NAME(m_dsp.setmode)); save_item(NAME(m_dsp.inverse)); save_item(NAME(m_dsp.halfclock)); save_item(NAME(m_dsp.fifo)); save_item(NAME(m_dsp.wa)); save_item(NAME(m_dsp.ra)); save_item(NAME(m_dsp.a63)); save_item(NAME(m_dsp.a66)); save_item(NAME(m_dsp.dht_blocks)); save_item(NAME(m_dsp.dwt_blocks)); save_item(NAME(m_dsp.curt_blocks)); save_item(NAME(m_dsp.curt_wakeup)); save_item(NAME(m_dsp.xpreg)); save_item(NAME(m_dsp.csr)); m_disp_a38 = prom_load(machine(), &pl_displ_a38, memregion("displ_a38")->base()); m_disp_a63 = prom_load(machine(), &pl_displ_a63, memregion("displ_a63")->base()); m_disp_a66 = prom_load(machine(), &pl_displ_a66, memregion("displ_a66")->base()); m_dsp.hlc = A2_DISP_HLC_START; m_dsp.framebuf = std::make_unique<uint16_t[]>(A2_DISP_TOTAL_HEIGHT * A2_DISP_SCANLINE_WORDS); m_dsp.patterns = auto_alloc_array(machine(), uint8_t, 65536 * 16); for (int y = 0; y < 65536; y++) { uint8_t* dst = m_dsp.patterns + y * 16; for (int x = 0; x < 16; x++) *dst++ = (~y >> (15 - x)) & 1; } // Allocate a bitmap including the V/H blank areas m_dsp.bitmap = std::make_unique<bitmap_ind16>(A2_DISP_TOTAL_WIDTH, A2_DISP_TOTAL_HEIGHT); m_dsp.state = 0; }
/** * @brief initialize the mouse context to useful values * * From the Alto Hardware Manual: * <PRE> * The mouse is a hand-held pointing device which contains two encoders * which digitize its position as it is rolled over a table-top. It also * has three buttons which may be read as the three low order bits of * memory location UTILIN (0177030), iin the manner of the keyboard. * The bit/button correspondence in UTILIN are (depressed keys * correspond to 0's in memory): * * UTILIN[13] TOP or LEFT button (RED) * UTILIN[14] BOTTOM or RIGHT button (BLUE) * UTILIN[15] MIDDLE button (YELLOW) * * The mouse coordinates are maintained by the MRT microcode in locations * MOUSELOC(0424)=X and MOUSELOC+1(0425)=Y in page one of the Alto memory. * These coordinates are relative, i.e., the hardware only increments and * decrements them. The resolution of the mouse is approximately 100 points * per inch. * </PRE> */ void alto2_cpu_device::init_mouse() { memset(&m_mouse, 0, sizeof(m_mouse)); m_madr_a32 = prom_load(machine(), &pl_madr_a32, memregion("madr_a32")->base()); }
/** * @brief clear all keys and install the mmio handler for KBDAD to KBDAD+3 */ void alto2_cpu_device::init_hw() { memset(&m_hw, 0, sizeof(m_hw)); m_madr_a64 = prom_load(machine(), &pl_madr_a64, memregion("madr_a64")->base()); m_madr_a65 = prom_load(machine(), &pl_madr_a65, memregion("madr_a65")->base()); }