src/mess/machine/dgn_beta.c
| r9668 | r9669 | |
| 246 | 246 | // |
| 247 | 247 | // Each block of 16 page registers (1 for each task), is paged in at $FE00-$FE0F, the bottom |
| 248 | 248 | // 4 bits of the PIA register at $FCC0 seem to contain which task is active. |
| 249 | | // state->bit 6 of the same port seems to enable the memory paging |
| 249 | // bit 6 of the same port seems to enable the memory paging |
| 250 | 250 | // |
| 251 | 251 | // For the purpose of this driver any block that is not ram, and is not a known ROM block, |
| 252 | 252 | // is mapped to the first page of the boot rom, I do not know what happens in the real |
| r9668 | r9669 | |
| 525 | 525 | Found=1; /* Mark as found */ |
| 526 | 526 | } |
| 527 | 527 | Idx=Idx-1; /* Decrement row count */ |
| 528 | | Mask=Mask>>1; /* Select next state->bit */ |
| 528 | Mask=Mask>>1; /* Select next bit */ |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | return Row; |
| r9668 | r9669 | |
| 619 | 619 | InClkState = data & KInClk; |
| 620 | 620 | //OutClkState = data & KOutClk; |
| 621 | 621 | |
| 622 | | LOG_KEYBOARD(("InClkState=$%02X OldInClkState=$%02X state->Keyrow=$%02X ",InClkState,(state->d_pia0_pb_last & KInClk),state->Keyrow)); |
| 622 | LOG_KEYBOARD(("InClkState=$%02X OldInClkState=$%02X Keyrow=$%02X ",InClkState,(state->d_pia0_pb_last & KInClk),state->Keyrow)); |
| 623 | 623 | |
| 624 | | /* Input clock state->bit has changed state */ |
| 624 | /* Input clock bit has changed state */ |
| 625 | 625 | if ((InClkState) != (state->d_pia0_pb_last & KInClk)) |
| 626 | 626 | { |
| 627 | | /* Clock in state->bit */ |
| 627 | /* Clock in bit */ |
| 628 | 628 | if(InClkState) |
| 629 | 629 | { |
| 630 | 630 | state->KInDat_next=(~state->Keyrow & 0x40)>>6; |
| 631 | 631 | state->Keyrow = ((state->Keyrow<<1) | 0x01) & 0x7F ; |
| 632 | | LOG_KEYBOARD(("Keyrow=$%02X state->KInDat_next=%X\n",state->Keyrow,state->KInDat_next)); |
| 632 | LOG_KEYBOARD(("Keyrow=$%02X KInDat_next=%X\n",state->Keyrow,state->KInDat_next)); |
| 633 | 633 | } |
| 634 | 634 | } |
| 635 | 635 | |
| r9668 | r9669 | |
| 652 | 652 | /* In the beta the shift registers are a cmos 4015, and a cmos 4013 in series */ |
| 653 | 653 | state->RowShifter = (state->RowShifter<<1) | ((state->d_pia0_pb_last & KOutDat)>>4); |
| 654 | 654 | state->RowShifter &= 0x3FF; |
| 655 | | LOG_KEYBOARD(("Rowshifter=$%02X state->Keyrow=$%02X\n",state->RowShifter,state->Keyrow)); |
| 656 | | if (VERBOSE) debug_console_printf(device->machine, "rowshifter clocked, value=%3X, RowNo=%d, state->Keyrow=%2X\n",state->RowShifter,RowNo,state->Keyrow); |
| 655 | LOG_KEYBOARD(("Rowshifter=$%02X Keyrow=$%02X\n",state->RowShifter,state->Keyrow)); |
| 656 | if (VERBOSE) debug_console_printf(device->machine, "rowshifter clocked, value=%3X, RowNo=%d, Keyrow=%2X\n",state->RowShifter,RowNo,state->Keyrow); |
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | state->d_pia0_cb2_last=data; |
| r9668 | r9669 | |
| 691 | 691 | int HALT_DMA; |
| 692 | 692 | running_device *fdc = device->machine->device(FDC_TAG); |
| 693 | 693 | |
| 694 | | /* Only play with halt line if halt state->bit changed since last write */ |
| 694 | /* Only play with halt line if halt bit changed since last write */ |
| 695 | 695 | if((data & 0x80) != state->d_pia1_pa_last) |
| 696 | 696 | { |
| 697 | 697 | /* Bit 7 of $FF24, seems to control HALT on second CPU (through an inverter) */ |
| r9668 | r9669 | |
| 728 | 728 | dgn_beta_state *state = device->machine->driver_data<dgn_beta_state>(); |
| 729 | 729 | int HALT_CPU; |
| 730 | 730 | |
| 731 | | /* Only play with halt line if halt state->bit changed since last write */ |
| 731 | /* Only play with halt line if halt bit changed since last write */ |
| 732 | 732 | if((data & 0x02) != state->d_pia1_pb_last) |
| 733 | 733 | { |
| 734 | 734 | /* Bit 1 of $FF26, seems to control HALT on primary CPU */ |
| r9668 | r9669 | |
| 813 | 813 | OldTask = state->PIATaskReg; |
| 814 | 814 | state->PIATaskReg = data & 0x0F; |
| 815 | 815 | |
| 816 | | LOG_TASK(("OldTask=$%02X state->EnableMapRegs=%d OldEnableMap=%d\n", OldTask, state->EnableMapRegs, OldEnableMap)); |
| 816 | LOG_TASK(("OldTask=$%02X EnableMapRegs=%d OldEnableMap=%d\n", OldTask, state->EnableMapRegs, OldEnableMap)); |
| 817 | 817 | |
| 818 | 818 | // Maping was enabled or disabled, select apropreate task reg |
| 819 | 819 | // and map it in |
| r9668 | r9669 | |
| 835 | 835 | UpdateBanks(device->machine, 0, IOPage + 1); |
| 836 | 836 | } |
| 837 | 837 | } |
| 838 | | LOG_TASK(("TaskReg=$%02X state->PIATaskReg=$%02X\n", state->TaskReg, state->PIATaskReg)); |
| 838 | LOG_TASK(("TaskReg=$%02X PIATaskReg=$%02X\n", state->TaskReg, state->PIATaskReg)); |
| 839 | 839 | } |
| 840 | 840 | |
| 841 | 841 | static READ8_DEVICE_HANDLER(d_pia2_pb_r) |
| r9668 | r9669 | |
| 1092 | 1092 | state->d_pia0_pb_last = 0x00; /* Last byte output to pia0 port b */ |
| 1093 | 1093 | state->d_pia0_cb2_last = 0x00; /* Last state of CB2 */ |
| 1094 | 1094 | |
| 1095 | | state->KInDat_next = 0x00; /* Next data state->bit to input */ |
| 1095 | state->KInDat_next = 0x00; /* Next data bit to input */ |
| 1096 | 1096 | state->KAny_next = 0x00; /* Next value for KAny */ |
| 1097 | 1097 | |
| 1098 | 1098 | state->DMA_NMI_LAST = 0x80; /* start with DMA NMI inactive, as pulled up */ |
src/mess/machine/gamecom.c
| r9668 | r9669 | |
| 40 | 40 | } |
| 41 | 41 | else |
| 42 | 42 | { |
| 43 | | /* select state->cartridge bank */ |
| 43 | /* select cartridge bank */ |
| 44 | 44 | if ( state->cartridge ) |
| 45 | 45 | memory_set_bankptr( machine, bank, state->cartridge + ( data << 13 ) ); |
| 46 | 46 | } |
| r9668 | r9669 | |
| 168 | 168 | } |
| 169 | 169 | return; |
| 170 | 170 | case SM8521_P3: |
| 171 | | /* P3 bit7 clear, bit6 set -> enable state->cartridge port #0? */ |
| 172 | | /* P3 bit6 clear, bit7 set -> enable state->cartridge port #1? */ |
| 171 | /* P3 bit7 clear, bit6 set -> enable cartridge port #0? */ |
| 172 | /* P3 bit6 clear, bit7 set -> enable cartridge port #1? */ |
| 173 | 173 | switch( data & 0xc0 ) |
| 174 | 174 | { |
| 175 | 175 | case 0x40: state->cartridge = state->cartridge1; break; |
| r9668 | r9669 | |
| 585 | 585 | case 0x1c0000: load_offset = 0x040000; break; /* 1.8MB */ |
| 586 | 586 | case 0x200000: load_offset = 0; break; /* 2 MB */ |
| 587 | 587 | default: /* otherwise */ |
| 588 | | logerror("Error loading state->cartridge: Invalid file size 0x%X\n", filesize); |
| 588 | logerror("Error loading cartridge: Invalid file size 0x%X\n", filesize); |
| 589 | 589 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unhandled cart size"); |
| 590 | 590 | return IMAGE_INIT_FAIL; |
| 591 | 591 | } |
| r9668 | r9669 | |
| 632 | 632 | case 0x1c0000: load_offset = 0x040000; break; /* 1.8MB */ |
| 633 | 633 | case 0x200000: load_offset = 0; break; /* 2 MB */ |
| 634 | 634 | default: /* otherwise */ |
| 635 | | logerror("Error loading state->cartridge: Invalid file size 0x%X\n", filesize); |
| 635 | logerror("Error loading cartridge: Invalid file size 0x%X\n", filesize); |
| 636 | 636 | image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unhandled cart size"); |
| 637 | 637 | return IMAGE_INIT_FAIL; |
| 638 | 638 | } |
src/mess/machine/tx0.c
| r9668 | r9669 | |
| 112 | 112 | |
| 113 | 113 | /* restart reader IO when necessary */ |
| 114 | 114 | /* note that this function may be called before tx0_init_machine, therefore |
| 115 | | before state->tape_reader.timer is allocated. It does not matter, as the clutch is never |
| 115 | before tape_reader.timer is allocated. It does not matter, as the clutch is never |
| 116 | 116 | down at power-up, but we must not call timer_enable with a NULL parameter! */ |
| 117 | 117 | if (state->tape_reader.timer) |
| 118 | 118 | { |
| r9668 | r9669 | |
| 472 | 472 | |
| 473 | 473 | /* restart IO when necessary */ |
| 474 | 474 | /* note that this function may be called before tx0_init_machine, therefore |
| 475 | | before state->magtape.timer is allocated. We must not call timer_enable with a |
| 475 | before magtape.timer is allocated. We must not call timer_enable with a |
| 476 | 476 | NULL parameter! */ |
| 477 | 477 | if (state->magtape.timer) |
| 478 | 478 | { |
| r9668 | r9669 | |
| 828 | 828 | if (state->magtape.long_parity) |
| 829 | 829 | { |
| 830 | 830 | logerror("invalid longitudinal parity\n"); |
| 831 | | /* no idea if the original tx-0 state->magtape controller |
| 831 | /* no idea if the original tx-0 magtape controller |
| 832 | 832 | checks parity, but can't harm if we do */ |
| 833 | 833 | cpu_set_reg(device, TX0_PF, cpu_get_reg(device, TX0_PF) | PF_PC); |
| 834 | 834 | } |
src/mess/machine/odyssey2.c
| r9668 | r9669 | |
| 73 | 73 | { |
| 74 | 74 | odyssey2_state *state = space->machine->driver_data<odyssey2_state>(); |
| 75 | 75 | if ((state->p1 & (P1_VDC_COPY_MODE_ENABLE | P1_VDC_ENABLE)) == 0) |
| 76 | | return odyssey2_video_r(space, offset); /* seems to have higher priority than state->ram??? */ |
| 76 | return odyssey2_video_r(space, offset); /* seems to have higher priority than ram??? */ |
| 77 | 77 | |
| 78 | 78 | else if (!(state->p1 & P1_EXT_RAM_ENABLE)) |
| 79 | 79 | return state->ram[offset]; |
| r9668 | r9669 | |
| 88 | 88 | state->ram[offset] = data; |
| 89 | 89 | if ( offset & 0x80 ) { |
| 90 | 90 | if ( data & 0x20 ) { |
| 91 | | logerror("voice write %02X, data = %02X (state->p1 = %02X)\n", offset, data, state->p1 ); |
| 91 | logerror("voice write %02X, data = %02X (p1 = %02X)\n", offset, data, state->p1 ); |
| 92 | 92 | sp0256_ALD_w( space->machine->device("sp0256_speech"), 0, offset & 0x7F ); |
| 93 | 93 | } else { |
| 94 | 94 | /* TODO: Reset sp0256 in this case */ |
| r9668 | r9669 | |
| 104 | 104 | { |
| 105 | 105 | odyssey2_state *state = space->machine->driver_data<odyssey2_state>(); |
| 106 | 106 | if ((state->p1 & (P1_VDC_COPY_MODE_ENABLE | P1_VDC_ENABLE)) == 0) { |
| 107 | | return odyssey2_video_r(space, offset); /* seems to have higher priority than state->ram??? */ |
| 107 | return odyssey2_video_r(space, offset); /* seems to have higher priority than ram??? */ |
| 108 | 108 | } |
| 109 | 109 | else if (!(state->p1 & P1_EXT_RAM_ENABLE)) { |
| 110 | 110 | return state->ram[offset]; |
| r9668 | r9669 | |
| 135 | 135 | odyssey2_state *state = space->machine->driver_data<odyssey2_state>(); |
| 136 | 136 | UINT8 data = state->p1; |
| 137 | 137 | |
| 138 | | logerror("%.9f state->p1 read %.2x\n", attotime_to_double(timer_get_time(space->machine)), data); |
| 138 | logerror("%.9f p1 read %.2x\n", attotime_to_double(timer_get_time(space->machine)), data); |
| 139 | 139 | return data; |
| 140 | 140 | } |
| 141 | 141 | |
| r9668 | r9669 | |
| 148 | 148 | |
| 149 | 149 | odyssey2_lum_w ( space, 0, state->p1 >> 7 ); |
| 150 | 150 | |
| 151 | | logerror("%.6f state->p1 written %.2x\n", attotime_to_double(timer_get_time(space->machine)), data); |
| 151 | logerror("%.6f p1 written %.2x\n", attotime_to_double(timer_get_time(space->machine)), data); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | READ8_HANDLER( odyssey2_getp2 ) |
| r9668 | r9669 | |
| 183 | 183 | else |
| 184 | 184 | state->p2 = state->p2 | 0xF0; |
| 185 | 185 | |
| 186 | | logerror("%.6f state->p2 read %.2x\n", attotime_to_double(timer_get_time(space->machine)), state->p2); |
| 186 | logerror("%.6f p2 read %.2x\n", attotime_to_double(timer_get_time(space->machine)), state->p2); |
| 187 | 187 | return state->p2; |
| 188 | 188 | } |
| 189 | 189 | |
| r9668 | r9669 | |
| 192 | 192 | odyssey2_state *state = space->machine->driver_data<odyssey2_state>(); |
| 193 | 193 | state->p2 = data; |
| 194 | 194 | |
| 195 | | logerror("%.6f state->p2 written %.2x\n", attotime_to_double(timer_get_time(space->machine)), data); |
| 195 | logerror("%.6f p2 written %.2x\n", attotime_to_double(timer_get_time(space->machine)), data); |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | READ8_HANDLER( odyssey2_getbus ) |
src/mess/machine/cgenie.c
| r9668 | r9669 | |
| 144 | 144 | */ |
| 145 | 145 | // cpunum_set_clockscale(machine, 0, 0.80); |
| 146 | 146 | |
| 147 | | /* Initialize some patterns to be displayed in state->graphics mode */ |
| 147 | /* Initialize some patterns to be displayed in graphics mode */ |
| 148 | 148 | for( i = 0; i < 256; i++ ) |
| 149 | 149 | memset(gfx + i * 8, i, 8); |
| 150 | 150 | |
| r9668 | r9669 | |
| 168 | 168 | #define FF_CHR1 0x08 /* charset 0xc0 - 0xff 1:fixed 0:defined */ |
| 169 | 169 | #define FF_CHR0 0x10 /* charset 0x80 - 0xbf 1:fixed 0:defined */ |
| 170 | 170 | #define FF_CHR (FF_CHR0 | FF_CHR1) |
| 171 | | #define FF_FGR 0x20 /* 1: "hi" resolution state->graphics, 0: text mode */ |
| 171 | #define FF_FGR 0x20 /* 1: "hi" resolution graphics, 0: text mode */ |
| 172 | 172 | #define FF_BGD1 0x40 /* background color select 1 */ |
| 173 | 173 | #define FF_BGD2 0x80 /* background color select 2 */ |
| 174 | 174 | #define FF_BGD (FF_BGD0 | FF_BGD1 | FF_BGD2) |
| r9668 | r9669 | |
| 236 | 236 | state->font_offset[3] = (data & FF_CHR1) ? 0x00 : 0x80; |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | | /* state->graphics mode changed ? */ |
| 239 | /* graphics mode changed ? */ |
| 240 | 240 | if( port_ff_changed & FF_FGR ) |
| 241 | 241 | { |
| 242 | 242 | cgenie_mode_select(space->machine, data & FF_FGR); |
| r9668 | r9669 | |
| 472 | 472 | if( drive > 3 ) |
| 473 | 473 | return; |
| 474 | 474 | |
| 475 | | /* mask state->head select bit */ |
| 475 | /* mask head select bit */ |
| 476 | 476 | state->head = (data >> 4) & 1; |
| 477 | 477 | |
| 478 | 478 | /* currently selected drive */ |
src/mess/video/dgn_beta.c
| r9668 | r9669 | |
| 158 | 158 | #define GCtrlSWChar 0x02 /* Character set select */ |
| 159 | 159 | #define GCtrlHiLo 0x04 /* Hi/Lo res graphics, Hi=1, Lo=0 */ |
| 160 | 160 | #define GCtrlChrGfx 0x08 /* Character=1 / Graphics=0 */ |
| 161 | | #define GCtrlControl 0x10 /* Control state->bit, sets direct drive mode */ |
| 161 | #define GCtrlControl 0x10 /* Control bit, sets direct drive mode */ |
| 162 | 162 | #define GCtrlFS 0x20 /* labeled F/S, not yet sure of function Fast or Slow scan ? */ |
| 163 | 163 | #define GCtrlAddrLines 0xC0 /* Top two address lines for text mode */ |
| 164 | 164 | |
| 165 | 165 | #define IsTextMode (state->GCtrl & GCtrlChrGfx) ? 1 : 0 // Is this text mode ? |
| 166 | 166 | #define IsGfx16 ((~state->GCtrl & GCtrlChrGfx) && (~state->GCtrl & GCtrlControl)) ? 1 : 0 // is this 320x256x16bpp mode |
| 167 | 167 | #define IsGfx2 ((state->GCtrl & GCtrlHiLo) && (~state->GCtrl & GCtrlFS)) ? 1 : 0 // Is this a 2 colour mode |
| 168 | | #define SWChar (state->GCtrl & GCtrlSWChar)>>1 // Swchar state->bit |
| 168 | #define SWChar (state->GCtrl & GCtrlSWChar)>>1 // Swchar bit |
| 169 | 169 | |
| 170 | 170 | //static int beta_state; |
| 171 | 171 | |
| r9668 | r9669 | |
| 249 | 249 | if(state->FlashCount==10) |
| 250 | 250 | { |
| 251 | 251 | state->FlashCount=0; // Reset counter |
| 252 | | state->FlashBit=(!state->FlashBit) & 0x01; // Invert flash state->bit. |
| 252 | state->FlashBit=(!state->FlashBit) & 0x01; // Invert flash bit. |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | if (state->DrawInterlace==INTERLACE_AT_VS) |
| r9668 | r9669 | |
| 569 | 569 | Hi = videoram[Addr+1]; |
| 570 | 570 | Word = (Hi<<8) | Lo; |
| 571 | 571 | |
| 572 | | /* If contol is low then we are plotting 4 state->bit per pixel, 16 colour mode */ |
| 572 | /* If contol is low then we are plotting 4 bit per pixel, 16 colour mode */ |
| 573 | 573 | /* This directly drives the colour output lines, from the pixel value */ |
| 574 | | /* If Control is high, then we lookup the colour from the LS670 4x4 state->bit */ |
| 574 | /* If Control is high, then we lookup the colour from the LS670 4x4 bit */ |
| 575 | 575 | /* palate register */ |
| 576 | 576 | if (IsGfx16) |
| 577 | 577 | { |
| r9668 | r9669 | |
| 715 | 715 | WRITE8_HANDLER(dgnbeta_colour_ram_w) |
| 716 | 716 | { |
| 717 | 717 | dgn_beta_state *state = space->machine->driver_data<dgn_beta_state>(); |
| 718 | | state->ColourRAM[offset]=data&0x0f; /* Colour ram 4 state->bit and write only to CPU */ |
| 718 | state->ColourRAM[offset]=data&0x0f; /* Colour ram 4 bit and write only to CPU */ |
| 719 | 719 | } |
| 720 | 720 | |
| 721 | 721 | /************************************* |
| r9668 | r9669 | |
| 812 | 812 | debug_console_printf(machine, "Min X =$%4X, Max X =$%4X\n",state->MinX,state->MaxX); |
| 813 | 813 | debug_console_printf(machine, "Min Y =$%4X, Max Y =$%4X\n",state->MinY,state->MaxY); |
| 814 | 814 | debug_console_printf(machine, "MinVidAddr=$%5X, MaxVidAddr=$%5X\n",state->MinAddr,state->MaxAddr); |
| 815 | | debug_console_printf(machine, "HsyncMin =%d, state->VSyncMin=%d\n",state->HSyncMin, state->VSyncMin); |
| 815 | debug_console_printf(machine, "HsyncMin =%d, VSyncMin=%d\n",state->HSyncMin, state->VSyncMin); |
| 816 | 816 | debug_console_printf(machine, "Interlace =%d\n",state->DrawInterlace); |
| 817 | 817 | debug_console_printf(machine, "DEPos=%d\n",state->DEPos); |
| 818 | 818 | if (IsGfx16) |
src/mess/video/cgenie.c
| r9668 | r9669 | |
| 272 | 272 | |
| 273 | 273 | if( state->graphics ) |
| 274 | 274 | { |
| 275 | | /* get state->graphics code */ |
| 275 | /* get graphics code */ |
| 276 | 276 | code = videoram[i]; |
| 277 | 277 | drawgfx_opaque(bitmap, &r, machine->gfx[1], code, 0, |
| 278 | 278 | 0, 0, r.min_x, r.min_y); |
| r9668 | r9669 | |
| 325 | 325 | cgenie_state *state = machine->driver_data<cgenie_state>(); |
| 326 | 326 | UINT8 *videoram = state->videoram; |
| 327 | 327 | int i, address, offset, cursor, size, code, x, y; |
| 328 | | rectangle r; |
| 328 | rectangle r; |
| 329 | 329 | |
| 330 | 330 | bitmap_fill(machine->generic.tmpbitmap, cliprect, get_black_pen(machine)); |
| 331 | 331 | bitmap_fill(state->dlybitmap, cliprect, get_black_pen(machine)); |
| 332 | 332 | |
| 333 | | if(state->crt.vertical_displayed || state->crt.horizontal_displayed) |
| 333 | if(state->crt.vertical_displayed || state->crt.horizontal_displayed) |
| 334 | 334 | { |
| 335 | 335 | offset = 256 * state->crt.screen_address_hi + state->crt.screen_address_lo; |
| 336 | 336 | size = state->crt.horizontal_displayed * state->crt.vertical_displayed; |
| r9668 | r9669 | |
| 353 | 353 | |
| 354 | 354 | if( state->graphics ) |
| 355 | 355 | { |
| 356 | | /* get state->graphics code */ |
| 356 | /* get graphics code */ |
| 357 | 357 | code = videoram[i]; |
| 358 | 358 | drawgfx_opaque(machine->generic.tmpbitmap, &r, machine->gfx[1], code, 1, |
| 359 | 359 | 0, 0, r.min_x, r.min_y); |
src/mess/video/kaypro.c
| r9668 | r9669 | |
| 123 | 123 | kaypro_state *state = screen->machine->driver_data<kaypro_state>(); |
| 124 | 124 | state->framecnt++; |
| 125 | 125 | state->speed = state->mc6845_reg[10]&0x20; |
| 126 | | state->flash = state->mc6845_reg[10]&0x40; // state->cursor modes |
| 127 | | state->cursor = (state->mc6845_reg[14]<<8) | state->mc6845_reg[15]; // get state->cursor position |
| 126 | state->flash = state->mc6845_reg[10]&0x40; // cursor modes |
| 127 | state->cursor = (state->mc6845_reg[14]<<8) | state->mc6845_reg[15]; // get cursor position |
| 128 | 128 | mc6845_update(state->mc6845, bitmap, cliprect); |
| 129 | 129 | return 0; |
| 130 | 130 | } |
| r9668 | r9669 | |
| 185 | 185 | if ((attr & 4) && (state->framecnt & 8)) |
| 186 | 186 | fg = bg; |
| 187 | 187 | |
| 188 | | /* process state->cursor - remove when mame fixed */ |
| 188 | /* process cursor - remove when mame fixed */ |
| 189 | 189 | if ((((!state->flash) && (!state->speed)) || |
| 190 | 190 | ((state->flash) && (state->speed) && (state->framecnt & 0x10)) || |
| 191 | 191 | ((state->flash) && (!state->speed) && (state->framecnt & 8))) && |
| r9668 | r9669 | |
| 217 | 217 | { |
| 218 | 218 | UINT8 i,curs_type=0,r9,r10,r11; |
| 219 | 219 | |
| 220 | | /* curs_type holds the general state->cursor shape to be created |
| 221 | | 0 = no state->cursor |
| 222 | | 1 = partial state->cursor (only shows on a block of scan lines) |
| 223 | | 2 = full state->cursor |
| 224 | | 3 = two-part state->cursor (has a part at the top and bottom with the middle blank) */ |
| 220 | /* curs_type holds the general cursor shape to be created |
| 221 | 0 = no cursor |
| 222 | 1 = partial cursor (only shows on a block of scan lines) |
| 223 | 2 = full cursor |
| 224 | 3 = two-part cursor (has a part at the top and bottom with the middle blank) */ |
| 225 | 225 | |
| 226 | | for ( i = 0; i < ARRAY_LENGTH(state->mc6845_cursor); i++) state->mc6845_cursor[i] = 0; // prepare state->cursor by erasing old one |
| 226 | for ( i = 0; i < ARRAY_LENGTH(state->mc6845_cursor); i++) state->mc6845_cursor[i] = 0; // prepare cursor by erasing old one |
| 227 | 227 | |
| 228 | 228 | r9 = state->mc6845_reg[9]; // number of scan lines - 1 |
| 229 | | r10 = state->mc6845_reg[10] & 0x1f; // state->cursor start line = last 5 bits |
| 230 | | r11 = state->mc6845_reg[11]+1; // state->cursor end line incremented to suit for-loops below |
| 229 | r10 = state->mc6845_reg[10] & 0x1f; // cursor start line = last 5 bits |
| 230 | r11 = state->mc6845_reg[11]+1; // cursor end line incremented to suit for-loops below |
| 231 | 231 | |
| 232 | 232 | /* decide the curs_type by examining the registers */ |
| 233 | 233 | if (r10 < r11) curs_type=1; // start less than end, show start to end |
| 234 | 234 | else |
| 235 | | if (r10 == r11) curs_type=2; // if equal, show full state->cursor |
| 236 | | else curs_type=3; // if start greater than end, it's a two-part state->cursor |
| 235 | if (r10 == r11) curs_type=2; // if equal, show full cursor |
| 236 | else curs_type=3; // if start greater than end, it's a two-part cursor |
| 237 | 237 | |
| 238 | | if ((r11 - 1) > r9) curs_type=2; // if end greater than scan-lines, show full state->cursor |
| 239 | | if (r10 > r9) curs_type=0; // if start greater than scan-lines, then no state->cursor |
| 238 | if ((r11 - 1) > r9) curs_type=2; // if end greater than scan-lines, show full cursor |
| 239 | if (r10 > r9) curs_type=0; // if start greater than scan-lines, then no cursor |
| 240 | 240 | if (r11 > 16) r11=16; // truncate 5-bit register to fit our 4-bit hardware |
| 241 | 241 | |
| 242 | | /* create the new state->cursor */ |
| 243 | | if (curs_type > 1) for (i = 0;i < ARRAY_LENGTH(state->mc6845_cursor);i++) state->mc6845_cursor[i]=0xff; // turn on full state->cursor |
| 242 | /* create the new cursor */ |
| 243 | if (curs_type > 1) for (i = 0;i < ARRAY_LENGTH(state->mc6845_cursor);i++) state->mc6845_cursor[i]=0xff; // turn on full cursor |
| 244 | 244 | |
| 245 | 245 | if (curs_type == 1) for (i = r10;i < r11;i++) state->mc6845_cursor[i]=0xff; // for each line that should show, turn on that scan line |
| 246 | 246 | |
src/mess/drivers/cgenie.c
| r9668 | r9669 | |
| 269 | 269 | static const gfx_layout cgenie_gfxlayout = |
| 270 | 270 | { |
| 271 | 271 | 8,8, /* 4*8 characters */ |
| 272 | | 256, /* 256 state->graphics patterns */ |
| 272 | 256, /* 256 graphics patterns */ |
| 273 | 273 | 2, /* 2 bits per pixel */ |
| 274 | 274 | { 0, 1 }, /* two bitplanes; 2 bit per pixel */ |
| 275 | 275 | { 0, 0, 2, 2, 4, 4, 6, 6}, /* x offsets */ |
| r9668 | r9669 | |
| 437 | 437 | 0,41, 0,42, 0,43, 0,44, |
| 438 | 438 | 0,45, 0,46, 0,47, 0,48, |
| 439 | 439 | |
| 440 | | 0, 9, 7, 6, /* RGB monitor state->graphics colors */ |
| 441 | | 0, 25, 23, 22, /* TV set state->graphics colors: darker */ |
| 442 | | 0, 41, 39, 38, /* TV set state->graphics colors: a bit brighter */ |
| 440 | 0, 9, 7, 6, /* RGB monitor graphics colors */ |
| 441 | 0, 25, 23, 22, /* TV set graphics colors: darker */ |
| 442 | 0, 41, 39, 38, /* TV set graphics colors: a bit brighter */ |
| 443 | 443 | }; |
| 444 | 444 | |
| 445 | 445 | /* Initialise the palette */ |