Previous 15994 Revisions Next

r9669 Friday 26th November, 2010 at 15:09:26 UTC by Nathan Woods
Corrections to previous submission. [Atari Ace]
[src/mess/audio]channelf.c
[src/mess/drivers]cgenie.c gp2x.c
[src/mess/includes]pdp1.h
[src/mess/machine]3do.c a7800.c adam.c apple2gs.c apple3.c bbc.c cgenie.c dgn_beta.c gamecom.c nc.c odyssey2.c pdp1.c tx0.c
[src/mess/video]cgenie.c dgn_beta.c kaypro.c

src/mess/audio/channelf.c
r9668r9669
128128   /* This is the minimum forced ontime, in samples */
129129   state->min_ontime = rate/1000*2;  /* approx 2ms - estimated, not verified on HW */
130130
131   /* This was measured, decay state->envelope with half life of ~9ms */
131   /* This was measured, decay envelope with half life of ~9ms */
132132   /* (this is decay multiplier per sample) */
133133   state->decay_mult = exp((-0.693/9e-3)/rate);
134134
src/mess/machine/dgn_beta.c
r9668r9669
246246//
247247// Each block of 16 page registers (1 for each task), is paged in at $FE00-$FE0F, the bottom
248248// 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
250250//
251251// For the purpose of this driver any block that is not ram, and is not a known ROM block,
252252// is mapped to the first page of the boot rom, I do not know what happens in the real
r9668r9669
525525         Found=1;      /* Mark as found */
526526      }
527527      Idx=Idx-1;         /* Decrement row count */
528      Mask=Mask>>1;         /* Select next state->bit */
528      Mask=Mask>>1;         /* Select next bit */
529529   }
530530
531531   return Row;
r9668r9669
619619   InClkState   = data & KInClk;
620620   //OutClkState   = data & KOutClk;
621621
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));
623623
624   /* Input clock state->bit has changed state */
624   /* Input clock bit has changed state */
625625   if ((InClkState) != (state->d_pia0_pb_last & KInClk))
626626   {
627      /* Clock in state->bit */
627      /* Clock in bit */
628628      if(InClkState)
629629      {
630630         state->KInDat_next=(~state->Keyrow & 0x40)>>6;
631631         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));
633633      }
634634   }
635635
r9668r9669
652652      /* In the beta the shift registers are a cmos 4015, and a cmos 4013 in series */
653653      state->RowShifter = (state->RowShifter<<1) | ((state->d_pia0_pb_last & KOutDat)>>4);
654654      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);
657657   }
658658
659659   state->d_pia0_cb2_last=data;
r9668r9669
691691   int   HALT_DMA;
692692   running_device *fdc = device->machine->device(FDC_TAG);
693693
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 */
695695   if((data & 0x80) != state->d_pia1_pa_last)
696696   {
697697      /* Bit 7 of $FF24, seems to control HALT on second CPU (through an inverter) */
r9668r9669
728728   dgn_beta_state *state = device->machine->driver_data<dgn_beta_state>();
729729   int   HALT_CPU;
730730
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 */
732732   if((data & 0x02) != state->d_pia1_pb_last)
733733   {
734734      /* Bit 1 of $FF26, seems to control HALT on primary CPU */
r9668r9669
813813   OldTask = state->PIATaskReg;
814814   state->PIATaskReg = data & 0x0F;
815815
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));
817817
818818   // Maping was enabled or disabled, select apropreate task reg
819819   // and map it in
r9668r9669
835835         UpdateBanks(device->machine, 0, IOPage + 1);
836836      }
837837   }
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));
839839}
840840
841841static READ8_DEVICE_HANDLER(d_pia2_pb_r)
r9668r9669
10921092   state->d_pia0_pb_last = 0x00;      /* Last byte output to pia0 port b */
10931093   state->d_pia0_cb2_last = 0x00;      /* Last state of CB2 */
10941094
1095   state->KInDat_next = 0x00;         /* Next data state->bit to input */
1095   state->KInDat_next = 0x00;         /* Next data bit to input */
10961096   state->KAny_next = 0x00;         /* Next value for KAny */
10971097
10981098   state->DMA_NMI_LAST = 0x80;      /* start with DMA NMI inactive, as pulled up */
src/mess/machine/pdp1.c
r9668r9669
7171    emulated:
7272    * perforated tape reader
7373    * perforated tape punch
74    * state->typewriter output
74    * typewriter output
7575    * CRT display
7676    unemulated:
7777    * card punch (pac: 43)
r9668r9669
8787{
8888   io_st_pen = 0400000,   /* light pen: light has hit the pen */
8989   io_st_ptr = 0200000,   /* perforated tape reader: reader buffer full */
90   io_st_tyo = 0100000,   /* state->typewriter out: device ready */
91   io_st_tyi = 0040000,   /* state->typewriter in: new character in buffer */
90   io_st_tyo = 0100000,   /* typewriter out: device ready */
91   io_st_tyi = 0040000,   /* typewriter in: new character in buffer */
9292   io_st_ptp = 0020000      /* perforated tape punch: device ready */
9393};
9494
src/mess/machine/apple3.c
r9668r9669
331331
332332   if (LOG_MEMORY)
333333   {
334      logerror("apple3_update_memory(): state->via_0_b=0x%02x state->via_1_a=0x0x%02x\n", state->via_0_b, state->via_1_a);
334      logerror("apple3_update_memory(): via_0_b=0x%02x via_1_a=0x0x%02x\n", state->via_0_b, state->via_1_a);
335335   }
336336
337337   cputag_set_clock(machine, "maincpu", (state->via_0_a & 0x80) ? 1000000 : 2000000);
r9668r9669
546546      {
547547         if (state->last_n != n)
548548         {
549            logerror("indxaddr: state->zpa=0x%04x n=0x%02x\n", state->zpa, n);
549            logerror("indxaddr: zpa=0x%04x n=0x%02x\n", state->zpa, n);
550550            state->last_n = n;
551551         }
552552      }
src/mess/machine/3do.c
r9668r9669
965965   memset( &state->clio, 0, sizeof(CLIO) );
966966   state->clio.screen = screen;
967967   state->clio.revision = 0x02022000 /* 0x04000000 */;
968   state->clio.cstatbits = 0x01;   /* bit 0 = reset of state->clio caused by power on */
968   state->clio.cstatbits = 0x01;   /* bit 0 = reset of clio caused by power on */
969969   state->clio.unclerev = 0x03800000;
970970   state->clio.expctl = 0x80;   /* ARM has the expansion bus */
971971}
src/mess/machine/adam.c
r9668r9669
514514            ram[offset] = 0x82;
515515            //logerror("Synchronizing the Master 6801 clock\n");
516516            break;
517         case 3: /* Request to relocate state->pcb */
517         case 3: /* Request to relocate pcb */
518518            ram[offset] = 0x83; /* Must return 0x83 if success */
519519            //ram[offset] = 0x9B; /* Time Out */
520            logerror("Request to relocate state->pcb from %04Xh to %04Xh... not implemented... but returns OK\n", state->pcb, (ram[state->pcb+1]|ram[state->pcb+2]<<8));
520            logerror("Request to relocate pcb from %04Xh to %04Xh... not implemented... but returns OK\n", state->pcb, (ram[state->pcb+1]|ram[state->pcb+2]<<8));
521521            break;
522522      }
523523   }
524524
525   for(DCB_Num=1;DCB_Num<=ram[state->pcb+3];DCB_Num++) /* Test status of each DCB in state->pcb table */
525   for(DCB_Num=1;DCB_Num<=ram[state->pcb+3];DCB_Num++) /* Test status of each DCB in pcb table */
526526   {
527527      statusDCB = (state->pcb+4)+(DCB_Num-1)*21;
528528      if (offset==statusDCB)
src/mess/machine/gamecom.c
r9668r9669
4040   }
4141   else
4242   {
43      /* select state->cartridge bank */
43      /* select cartridge bank */
4444      if ( state->cartridge )
4545         memory_set_bankptr( machine, bank, state->cartridge + ( data << 13 ) );
4646   }
r9668r9669
168168            }
169169            return;
170170   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? */
173173            switch( data & 0xc0 )
174174            {
175175            case 0x40: state->cartridge = state->cartridge1; break;
r9668r9669
585585      case 0x1c0000: load_offset = 0x040000; break;  /* 1.8MB */
586586      case 0x200000: load_offset = 0;        break;  /* 2  MB */
587587      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);
589589         image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unhandled cart size");
590590         return IMAGE_INIT_FAIL;
591591   }
r9668r9669
632632      case 0x1c0000: load_offset = 0x040000; break;  /* 1.8MB */
633633      case 0x200000: load_offset = 0;        break;  /* 2  MB */
634634      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);
636636         image.seterror(IMAGE_ERROR_UNSPECIFIED, "Unhandled cart size");
637637         return IMAGE_INIT_FAIL;
638638   }
src/mess/machine/tx0.c
r9668r9669
112112
113113      /* restart reader IO when necessary */
114114      /* 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
116116        down at power-up, but we must not call timer_enable with a NULL parameter! */
117117      if (state->tape_reader.timer)
118118      {
r9668r9669
472472
473473   /* restart IO when necessary */
474474   /* 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
476476    NULL parameter! */
477477   if (state->magtape.timer)
478478   {
r9668r9669
828828               if (state->magtape.long_parity)
829829               {
830830                  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
832832                        checks parity, but can't harm if we do */
833833                  cpu_set_reg(device, TX0_PF, cpu_get_reg(device, TX0_PF) | PF_PC);
834834               }
src/mess/machine/a7800.c
r9668r9669
247247   {
248248      /* Super Cart */
249249
250      /* Extra state->ROM at $4000 */
250      /* Extra ROM at $4000 */
251251      if( state->cart_type & 0x08 )
252252      {
253253         image.fread(memory + 0x4000, 0x4000 );
src/mess/machine/odyssey2.c
r9668r9669
7373{
7474   odyssey2_state *state = space->machine->driver_data<odyssey2_state>();
7575    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??? */
7777
7878    else if (!(state->p1 & P1_EXT_RAM_ENABLE))
7979      return state->ram[offset];
r9668r9669
8888      state->ram[offset] = data;
8989      if ( offset & 0x80 ) {
9090         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 );
9292            sp0256_ALD_w( space->machine->device("sp0256_speech"), 0, offset & 0x7F );
9393         } else {
9494            /* TODO: Reset sp0256 in this case */
r9668r9669
104104{
105105   odyssey2_state *state = space->machine->driver_data<odyssey2_state>();
106106   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??? */
108108   }
109109   else if (!(state->p1 & P1_EXT_RAM_ENABLE)) {
110110      return state->ram[offset];
r9668r9669
135135   odyssey2_state *state = space->machine->driver_data<odyssey2_state>();
136136   UINT8 data = state->p1;
137137
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);
139139   return data;
140140}
141141
r9668r9669
148148
149149   odyssey2_lum_w ( space, 0, state->p1 >> 7 );
150150
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);
152152}
153153
154154READ8_HANDLER( odyssey2_getp2 )
r9668r9669
183183    else
184184        state->p2 = state->p2 | 0xF0;
185185
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);
187187    return state->p2;
188188}
189189
r9668r9669
192192   odyssey2_state *state = space->machine->driver_data<odyssey2_state>();
193193    state->p2 = data;
194194
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);
196196}
197197
198198READ8_HANDLER( odyssey2_getbus )
src/mess/machine/apple2gs.c
r9668r9669
147147   UINT8 operation;
148148   seconds_t current_interval;
149149
150   /* update state->clock_curtime */
150   /* update clock_curtime */
151151   current_interval = timer_get_time(machine).seconds;
152152   state->clock_curtime += current_interval - state->clock_curtime_interval;
153153   state->clock_curtime_interval = current_interval;
r9668r9669
415415
416416   state->adb_state = ADBSTATE_IDLE;
417417   if (LOG_ADB)
418      logerror("adb_do_command(): state->adb_command=0x%02x\n", state->adb_command);
418      logerror("adb_do_command(): adb_command=0x%02x\n", state->adb_command);
419419
420420   switch(state->adb_command)
421421   {
src/mess/machine/nc.c
r9668r9669
6060   int datasize;
6161   unsigned char *data;
6262
63   /* get state->file size */
63   /* get file size */
6464   datasize = image.length();
6565
6666   if (datasize!=0)
r9668r9669
7272      {
7373         state->card_size = datasize;
7474
75         /* read whole state->file */
75         /* read whole file */
7676         image.fread(data, datasize);
7777
7878         *ptr = data;
r9668r9669
107107   nc_state *state = image.device().machine->driver_data<nc_state>();
108108   /* filename specified */
109109
110   /* attempt to load state->file */
110   /* attempt to load file */
111111   if (nc_card_load(image, &state->card_ram))
112112   {
113113      if (state->card_ram!=NULL)
src/mess/machine/cgenie.c
r9668r9669
144144     */
145145//  cpunum_set_clockscale(machine, 0, 0.80);
146146
147   /* Initialize some patterns to be displayed in state->graphics mode */
147   /* Initialize some patterns to be displayed in graphics mode */
148148   for( i = 0; i < 256; i++ )
149149      memset(gfx + i * 8, i, 8);
150150
r9668r9669
168168#define FF_CHR1 0x08         /* charset 0xc0 - 0xff 1:fixed 0:defined */
169169#define FF_CHR0 0x10         /* charset 0x80 - 0xbf 1:fixed 0:defined */
170170#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 */
172172#define FF_BGD1 0x40         /* background color select 1 */
173173#define FF_BGD2 0x80         /* background color select 2 */
174174#define FF_BGD   (FF_BGD0 | FF_BGD1 | FF_BGD2)
r9668r9669
236236      state->font_offset[3] = (data & FF_CHR1) ? 0x00 : 0x80;
237237   }
238238
239   /* state->graphics mode changed ? */
239   /* graphics mode changed ? */
240240   if( port_ff_changed & FF_FGR )
241241   {
242242      cgenie_mode_select(space->machine, data & FF_FGR);
r9668r9669
472472   if( drive > 3 )
473473      return;
474474
475   /* mask state->head select bit */
475   /* mask head select bit */
476476      state->head = (data >> 4) & 1;
477477
478478   /* currently selected drive */
src/mess/machine/bbc.c
r9668r9669
425425      memory_set_bankptr( space->machine, "bank2", memory_region( space->machine, "maincpu" ) + 0x3000 );
426426   }
427427
428   /* state->ACCCON_TST controls paging of rom reads in the 0xFC00-0xFEFF reigon */
428   /* ACCCON_TST controls paging of rom reads in the 0xFC00-0xFEFF reigon */
429429   /* if 0 the I/O is paged for both reads and writes */
430430   /* if 1 the the ROM is paged in for reads but writes still go to I/O   */
431431   if (state->ACCCON_TST)
src/mess/video/dgn_beta.c
r9668r9669
158158#define GCtrlSWChar   0x02   /* Character set select */
159159#define GCtrlHiLo   0x04   /* Hi/Lo res graphics, Hi=1, Lo=0 */
160160#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 */
162162#define GCtrlFS      0x20   /* labeled F/S, not yet sure of function Fast or Slow scan ? */
163163#define GCtrlAddrLines   0xC0   /* Top two address lines for text mode */
164164
165165#define IsTextMode   (state->GCtrl & GCtrlChrGfx) ? 1 : 0               // Is this text mode ?
166166#define IsGfx16    ((~state->GCtrl & GCtrlChrGfx) && (~state->GCtrl & GCtrlControl)) ? 1 : 0   // is this 320x256x16bpp mode
167167#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
169169
170170//static int beta_state;
171171
r9668r9669
249249      if(state->FlashCount==10)
250250      {
251251         state->FlashCount=0;         // Reset counter
252         state->FlashBit=(!state->FlashBit) & 0x01;   // Invert flash state->bit.
252         state->FlashBit=(!state->FlashBit) & 0x01;   // Invert flash bit.
253253      }
254254
255255      if (state->DrawInterlace==INTERLACE_AT_VS)
r9668r9669
569569      Hi   = videoram[Addr+1];
570570      Word   = (Hi<<8) | Lo;
571571
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 */
573573      /* 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 */
575575      /* palate register */
576576      if (IsGfx16)
577577      {
r9668r9669
715715WRITE8_HANDLER(dgnbeta_colour_ram_w)
716716{
717717   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 */
719719}
720720
721721/*************************************
r9668r9669
812812   debug_console_printf(machine, "Min X     =$%4X, Max X     =$%4X\n",state->MinX,state->MaxX);
813813   debug_console_printf(machine, "Min Y     =$%4X, Max Y     =$%4X\n",state->MinY,state->MaxY);
814814   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);
816816   debug_console_printf(machine, "Interlace =%d\n",state->DrawInterlace);
817817   debug_console_printf(machine, "DEPos=%d\n",state->DEPos);
818818   if (IsGfx16)
src/mess/video/cgenie.c
r9668r9669
272272
273273         if( state->graphics )
274274         {
275            /* get state->graphics code */
275            /* get graphics code */
276276            code = videoram[i];
277277            drawgfx_opaque(bitmap, &r, machine->gfx[1], code, 0,
278278               0, 0, r.min_x, r.min_y);
r9668r9669
325325   cgenie_state *state = machine->driver_data<cgenie_state>();
326326   UINT8 *videoram = state->videoram;
327327   int i, address, offset, cursor, size, code, x, y;
328    rectangle r;
328   rectangle r;
329329
330330   bitmap_fill(machine->generic.tmpbitmap, cliprect, get_black_pen(machine));
331331   bitmap_fill(state->dlybitmap, cliprect, get_black_pen(machine));
332332
333    if(state->crt.vertical_displayed || state->crt.horizontal_displayed)
333   if(state->crt.vertical_displayed || state->crt.horizontal_displayed)
334334   {
335335      offset = 256 * state->crt.screen_address_hi + state->crt.screen_address_lo;
336336      size = state->crt.horizontal_displayed * state->crt.vertical_displayed;
r9668r9669
353353
354354         if( state->graphics )
355355         {
356            /* get state->graphics code */
356            /* get graphics code */
357357            code = videoram[i];
358358            drawgfx_opaque(machine->generic.tmpbitmap, &r, machine->gfx[1], code, 1,
359359               0, 0, r.min_x, r.min_y);
src/mess/video/kaypro.c
r9668r9669
123123   kaypro_state *state = screen->machine->driver_data<kaypro_state>();
124124   state->framecnt++;
125125   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
128128   mc6845_update(state->mc6845, bitmap, cliprect);
129129   return 0;
130130}
r9668r9669
185185      if ((attr & 4) && (state->framecnt & 8))
186186         fg = bg;
187187
188      /* process state->cursor - remove when mame fixed */
188      /* process cursor - remove when mame fixed */
189189      if ((((!state->flash) && (!state->speed)) ||
190190         ((state->flash) && (state->speed) && (state->framecnt & 0x10)) ||
191191         ((state->flash) && (!state->speed) && (state->framecnt & 8))) &&
r9668r9669
217217{
218218   UINT8 i,curs_type=0,r9,r10,r11;
219219
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) */
225225
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
227227
228228   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
231231
232232   /* decide the curs_type by examining the registers */
233233   if (r10 < r11) curs_type=1;            // start less than end, show start to end
234234   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
237237
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
240240   if (r11 > 16) r11=16;               // truncate 5-bit register to fit our 4-bit hardware
241241
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
244244
245245   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
246246
src/mess/includes/pdp1.h
r9668r9669
196196{
197197   device_image_interface *fd;   /* file descriptor of output image */
198198
199   int tb;         /* state->typewriter buffer */
199   int tb;         /* typewriter buffer */
200200
201201   emu_timer *tyo_timer;/* timer to generate completion pulses */
202202} typewriter_t;
src/mess/drivers/gp2x.c
r9668r9669
220220                     state->nand_ptr++;
221221                     return ret;
222222                  default:
223                     logerror("Bad state->nand_subword_stage = %d\n", state->nand_subword_stage);
223                     logerror("Bad nand_subword_stage = %d\n", state->nand_subword_stage);
224224                     break;
225225               }
226226            }
src/mess/drivers/cgenie.c
r9668r9669
269269static const gfx_layout cgenie_gfxlayout =
270270{
271271   8,8,         /* 4*8 characters */
272   256,         /* 256 state->graphics patterns */
272   256,         /* 256 graphics patterns */
273273   2,            /* 2 bits per pixel */
274274   { 0, 1 },      /* two bitplanes; 2 bit per pixel */
275275   { 0, 0, 2, 2, 4, 4, 6, 6}, /* x offsets */
r9668r9669
437437   0,41, 0,42, 0,43, 0,44,
438438   0,45, 0,46, 0,47, 0,48,
439439
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 */
443443};
444444
445445/* Initialise the palette */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team