Previous 15994 Revisions Next

r1885 Monday 10th March, 2008 at 04:05:55 UTC by Robbbert
[SUPER80] Changed "readinputport" to "readinputportbytag" for dips and configs.
[src/mess/drivers]super80.c

src/mess/drivers/super80.c
r1884r1885
198198   screen_state *state = &Machine->screen[0];
199199   rectangle visarea;
200200   UINT16 width, height, bytes;   
201   UINT8 dyn = readinputport(9) & 0x10;         // read dipswitch
201   UINT8 dyn = readinputportbytag("CONFIG") & 0x10;         // read dipswitch
202202   visarea.min_x = 0;
203203   visarea.max_x = SUPER80V_SCREEN_WIDTH-1;
204204   visarea.min_y = 0;
r1884r1885
242242static VIDEO_EOF( super80m )
243243{
244244   /* if we chose another palette or colour mode, enable it */
245   UINT8 chosen_palette = (readinputport(9) & 0x60)>>5;            // read colour dipswitches
245   UINT8 chosen_palette = (readinputportbytag("CONFIG") & 0x60)>>5;            // read colour dipswitches
246246
247247   if (chosen_palette != current_palette)                  // any changes?
248248   {
r1884r1885
259259   UINT8 x, y, code=32, screen_on=0;
260260   UINT8 mask = machine->gfx[0]->total_elements - 1;   /* 0x3F for super80; 0xFF for super80d & super80e */
261261
262   if ((super80_mhz == 1) || (!(readinputport(9) & 4)))   /* bit 2 of port F0 is high, OR user turned on config switch */
262   if ((super80_mhz == 1) || (!(readinputportbytag("CONFIG") & 4)))   /* bit 2 of port F0 is high, OR user turned on config switch */
263263      screen_on++;
264264
265265   /* display the picture */
r1884r1885
280280
281281static VIDEO_UPDATE( super80m )
282282{
283   UINT8 x, y, code=32, col=0, screen_on=0, options=readinputport(9);
283   UINT8 x, y, code=32, col=0, screen_on=0, options=readinputportbytag("CONFIG");
284284
285285   /* get selected character generator */
286286   UINT8 cgen = current_charset ^ ((options & 0x10)>>4);   /* bit 0 of port F1 and cgen config switch */
r1884r1885
322322   UINT8 speed = mc6845[10]&0x20, flash = mc6845[10]&0x40;            // cursor modes
323323   UINT16 cursor = (mc6845[14]<<8) | mc6845[15];               // get cursor position
324324   UINT16 screen_home = (mc6845[12]<<8) | mc6845[13];            // screen home offset (usually zero)
325   UINT8 options=readinputport(9);
325   UINT8 options=readinputportbytag("CONFIG");
326326   framecnt++;
327327
328328   /* Get the graphics of the character under the cursor, xor with the visible cursor scan lines,
r1884r1885
407407      cassette_change_state(image_from_devtype_and_index(IO_CASSETTE, 0), CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
408408
409409   /* does user want to hear the sound? */
410   if (readinputport(9) & 8)
410   if (readinputportbytag("CONFIG") & 8)
411411      cassette_change_state(image_from_devtype_and_index(IO_CASSETTE, 0), CASSETTE_SPEAKER_ENABLED, CASSETTE_MASK_SPEAKER);
412412   else
413413      cassette_change_state(image_from_devtype_and_index(IO_CASSETTE, 0), CASSETTE_SPEAKER_MUTED, CASSETTE_MASK_SPEAKER);
r1884r1885
465465
466466static READ8_HANDLER( super80_f2_r )
467467{
468   UINT8 data = readinputport(0) & 0xf0;   // dip switches on pcb
468   UINT8 data = readinputportbytag("DSW") & 0xf0;   // dip switches on pcb
469469   data |= cass_out;         // bit 0 = output of U1, bit 1 = current wave_state
470470   data |= 0x0c;            // bits 2,3 - not used
471471   return data;
r1884r1885
587587/**************************** DIPSWITCHES, KEYBOARD, HARDWARE CONFIGURATION ****************************************/
588588
589589static INPUT_PORTS_START( super80 )
590   PORT_START
590   PORT_START_TAG("DSW")
591591   PORT_BIT( 0xf, 0xf, IPT_UNUSED )
592592   PORT_DIPNAME( 0x10, 0x00, "Switch A") PORT_DIPLOCATION("SW1:1")
593593   PORT_DIPSETTING(    0x10, DEF_STR(Off))
r1884r1885
785785static TIMER_CALLBACK( super80_halfspeed )
786786{
787787   UINT8 go_fast = 0;
788   if ((super80_mhz == 2) || (!(readinputport(9) & 2)))   /* bit 2 of port F0 is low, OR user turned on config switch */
788   if ((super80_mhz == 2) || (!(readinputportbytag("CONFIG") & 2)))   /* bit 2 of port F0 is low, OR user turned on config switch */
789789      go_fast++;
790790
791791   /* code to slow down computer to 1mhz by halting cpu on every second frame */
r1884r1885
987987
988988static QUICKLOAD_LOAD( super80 )
989989{
990   UINT8 sw = readinputport(9) & 1;            /* reading the dipswitch: 1 = autorun */
990   UINT8 sw = readinputportbytag("CONFIG") & 1;            /* reading the dipswitch: 1 = autorun */
991991   UINT16 exec_addr;
992992   UINT64 return_info = z80bin_load_file( image, file_type );   /* load file */
993993

Previous 15994 Revisions Next


© 1998-2018 The MESS Team