diff options
Diffstat (limited to 'src/mame/drivers/notetaker.cpp')
-rw-r--r-- | src/mame/drivers/notetaker.cpp | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/src/mame/drivers/notetaker.cpp b/src/mame/drivers/notetaker.cpp index 89b2ed4e811..abf39db27fb 100644 --- a/src/mame/drivers/notetaker.cpp +++ b/src/mame/drivers/notetaker.cpp @@ -282,28 +282,23 @@ uint32_t notetaker_state::screen_update(screen_device &screen, bitmap_ind16 &bit { // have to figure out what resolution we're drawing to here and draw appropriately to screen // code borrowed/stolen from video/mac.cpp - uint32_t video_base; - uint16_t word; - uint16_t *line; - int y, x, b; - - video_base = (m_DispAddr << 3)&0x1FFFF; + uint32_t const video_base = (m_DispAddr << 3) & 0x1ffff; #ifdef DEBUG_VIDEO logerror("Video Base = 0x%05x\n", video_base); #endif - const uint16_t *video_ram_field1 = &m_mainram[video_base/2]; - const uint16_t *video_ram_field2 = &m_mainram[(video_base+0x4B00)/2]; + uint16_t const *video_ram_field1 = &m_mainram[video_base / 2]; + uint16_t const *video_ram_field2 = &m_mainram[(video_base + 0x4b00) / 2]; - for (y = 0; y < 480; y++) + for (int y = 0; y < 480; y++) { - line = &bitmap.pix16(y); + uint16_t *const line = &bitmap.pix(y); - for (x = 0; x < 640; x += 16) + for (int x = 0; x < 640; x += 16) { - if ((y&1)==0) word = *(video_ram_field1++); else word = *(video_ram_field2++); - for (b = 0; b < 16; b++) + uint16_t const word = *((y & 1) ? video_ram_field2 : video_ram_field1)++; + for (int b = 0; b < 16; b++) { - line[x + b] = (word >> (15 - b)) & 0x0001; + line[x + b] = BIT(word, 15 - b); } } } @@ -312,15 +307,15 @@ uint32_t notetaker_state::screen_update(screen_device &screen, bitmap_ind16 &bit void notetaker_state::IPConReg_w(uint16_t data) { - m_BootSeqDone = (data&0x80)?1:0; - m_ProcLock = (data&0x40)?1:0; // bus lock for this processor (hold other processor in wait state) - m_CharCtr = (data&0x20)?1:0; // battery charge control (incorrectly called 'Char counter' in source code) - m_DisableROM = (data&0x10)?1:0; // disable rom at 0000-0fff - m_CorrOn_q = (data&0x08)?1:0; // CorrectionOn (ECC correction enabled); also LedInd5 - m_LedInd6 = (data&0x04)?1:0; - m_LedInd7 = (data&0x02)?1:0; - m_LedInd8 = (data&0x01)?1:0; - popmessage("LEDS: CR1: %d, CR2: %d, CR3: %d, CR4: %d", (data&0x04)>>2, (data&0x08)>>3, (data&0x02)>>1, (data&0x01)); // cr1 and 2 are in the reverse order as expected, according to the schematic + m_BootSeqDone = BIT(data, 7); + m_ProcLock = BIT(data, 6); // bus lock for this processor (hold other processor in wait state) + m_CharCtr = BIT(data, 5); // battery charge control (incorrectly called 'Char counter' in source code) + m_DisableROM = BIT(data, 4); // disable rom at 0000-0fff + m_CorrOn_q = BIT(data, 3); // CorrectionOn (ECC correction enabled); also LedInd5 + m_LedInd6 = BIT(data, 2); + m_LedInd7 = BIT(data, 1); + m_LedInd8 = BIT(data, 0); + popmessage("LEDS: CR1: %d, CR2: %d, CR3: %d, CR4: %d", BIT(data, 2), BIT(data, 3), BIT(data, 1), BIT(data, 0)); // cr1 and 2 are in the reverse order as expected, according to the schematic } /* handlers for the two system hd6402s (ay-5-1013 equivalent) */ |