Previous 15994 Revisions Next

r10691 Sunday 6th March, 2011 at 14:41:02 UTC by Angelo Salese
[PC-9801f]: Added some dipswitches, courtesy of Fujix
[src/mess/drivers]pc9801.c

src/mess/drivers/pc9801.c
r10690r10691
4848
4949   UINT8 vrtc_irq_mask;
5050   UINT8 video_ff[8];
51   UINT8 video_reg[6];
5152   UINT8 pal_clut[4];
5253
5354   UINT8 *tvram;
r10690r10691
128129   if(state->video_ff[DISPLAY_REG] == 0) //screen is off
129130      return;
130131
131   interlace_on = lr >= 16; /* TODO: check the proper condition (a bank signal I presume) */
132   interlace_on = state->video_reg[2] == 0x10; /* TODO: correct? */
132133   char_size = (interlace_on) ? 16 : 8;
133134
134135   for(x=0;x<pitch;x++)
r10690r10691
181182
182183            if(state->video_ff[WIDTH40_REG])
183184            {
184               if(res_x+1 > 640 || res_y > 200) //TODO
185               if(res_x+1 > 640 || res_y > char_size*25) //TODO
185186                  continue;
186187
187188               *BITMAP_ADDR16(bitmap, res_y, res_x+1) = pen;
r10690r10691
516517
517518static WRITE8_HANDLER( pc9801_70_w )
518519{
520   pc9801_state *state = space->machine->driver_data<pc9801_state>();
521
519522   if((offset & 1) == 0)
520523   {
521524      printf("Write to display register [%02x] %02x\n",offset+0x70,data);
525      state->video_reg[offset >> 1] = data;
522526   }
523527   else // odd
524528   {
r10690r10691
986990   PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(" un 7-8") PORT_IMPULSE(1) PORT_CHANGED(key_stroke, 0x7f) //PORT_CODE(KEYCODE_M) PORT_CHAR('M')
987991
988992   PORT_START("DSW1")
989   PORT_DIPNAME( 0x01, 0x01, "DSW1" ) //jumps to daa00 if off, presumably some card booting
993   PORT_DIPNAME( 0x01, 0x00, "DSW1" )
990994   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
991995   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
992   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
996   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) // error beep if OFF
993997   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
994998   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
995   PORT_DIPNAME( 0x04, 0x00, "Text width" )
996   PORT_DIPSETTING(    0x04, "40 chars/line" )
997   PORT_DIPSETTING(    0x00, "80 chars/line" )
998   PORT_DIPNAME( 0x08, 0x00, "Text height" )
999   PORT_DIPSETTING(    0x08, "20 lines/screen" )
1000   PORT_DIPSETTING(    0x00, "25 lines/screen" )
999   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1000   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1001   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1002   PORT_DIPNAME( 0x08, 0x08, "Display Type" ) PORT_DIPLOCATION("SW2:1")
1003   PORT_DIPSETTING(    0x00, "Normal Display" )
1004   PORT_DIPSETTING(    0x08, "Hi-Res Display" )
10011005   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
10021006   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
10031007   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r10690r10691
10121016   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
10131017
10141018   PORT_START("DSW2")
1015   PORT_DIPNAME( 0x01, 0x00, "DSW2" )
1019   PORT_DIPNAME( 0x01, 0x01, "System Specification" ) PORT_DIPLOCATION("SW1:1") //jumps to daa00 if off, presumably some card booting
10161020   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
10171021   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1018   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) // error beep if OFF
1022   PORT_DIPNAME( 0x02, 0x02, "Terminal Mode" ) PORT_DIPLOCATION("SW1:2")
10191023   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
10201024   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1021   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
1022   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
1023   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1024   PORT_DIPNAME( 0x08, 0x08, "Interlace mode" )
1025   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
1026   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
1027   PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) )
1028   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
1029   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1030   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
1031   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
1032   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1033   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
1034   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1035   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1036   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
1037   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1038   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1025   PORT_DIPNAME( 0x04, 0x00, "Text width" ) PORT_DIPLOCATION("SW1:3")
1026   PORT_DIPSETTING(    0x04, "40 chars/line" )
1027   PORT_DIPSETTING(    0x00, "80 chars/line" )
1028   PORT_DIPNAME( 0x08, 0x00, "Text height" ) PORT_DIPLOCATION("SW1:4")
1029   PORT_DIPSETTING(    0x08, "20 lines/screen" )
1030   PORT_DIPSETTING(    0x00, "25 lines/screen" )
1031   PORT_DIPNAME( 0x10, 0x00, "Memory Switch Init" ) PORT_DIPLOCATION("SW1:5")
1032   PORT_DIPSETTING(    0x00, DEF_STR( No ) ) //Fix memory switch condition
1033   PORT_DIPSETTING(    0x10, DEF_STR( Yes ) ) //Initialize Memory Switch with the system default
1034   PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW1:6" )
1035   PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW1:7" )
1036   PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW1:8" )
10391037
10401038   PORT_START("ROM_LOAD")
10411039   PORT_CONFNAME( 0x01, 0x01, "Load floppy 2dd BIOS" )
r10690r10691
12311229*
12321230****************************************/
12331231
1234static READ8_DEVICE_HANDLER( ppi_sys_porta_r ) { return input_port_read(device->machine,"DSW1"); }
1235static READ8_DEVICE_HANDLER( ppi_sys_portb_r ) { return input_port_read(device->machine,"DSW2"); }
1232static READ8_DEVICE_HANDLER( ppi_sys_porta_r ) { return input_port_read(device->machine,"DSW2"); }
1233static READ8_DEVICE_HANDLER( ppi_sys_portb_r ) { return input_port_read(device->machine,"DSW1"); }
12361234
12371235static WRITE8_DEVICE_HANDLER( ppi_sys_portc_w )
12381236{

Previous 15994 Revisions Next


© 1998-2018 The MESS Team