Previous 15994 Revisions Next

r11784 Thursday 2nd June, 2011 at 20:25:49 UTC by Angelo Salese
Added h/v monitor dsw, kanji looks correct in the latter mode
[src/mess/drivers]pc100.c

src/mess/drivers/pc100.c
r11783r11784
44
55    TODO:
66    - kanji rom has offsetted data for whatever reason.
7    - i8259 is bugged, program flow eventually jumps to la-la-land
7    - there's a regression with push/pop sp, when it triggers an iret program
8      flow jumps to la-la-land
89
910****************************************************************************/
1011
r11783r11784
3031   struct{
3132      UINT8 shift;
3233      UINT16 mask;
34      UINT16 vstart;
35      UINT8 addr;
36      UINT8 reg[8];
3337   }m_crtc;
3438};
3539
r11783r11784
4650   int dot;
4751   int pen[4],pen_i;
4852
49   count = 0;
53   count = ((state->m_crtc.vstart + 0x20) * 0x40);
5054
5155   for(y=0;y<512;y++)
5256   {
57      count &= 0xffff;
58
5359      for(x=0;x<1024/16;x++)
5460      {
5561         for(xi=0;xi<16;xi++)
r11783r11784
128134static READ8_HANDLER( pc100_key_r )
129135{
130136   if(offset)
131      return 0x2d; // bit 5: horizontal/vertical monitor dsw
137      return input_port_read(space->machine(), "DSW"); // bit 5: horizontal/vertical monitor dsw
132138
133139   return 0;
134140}
r11783r11784
173179   state->m_crtc.shift = data & 0xf;
174180}
175181
182static READ8_HANDLER( pc100_vs_vreg_r )
183{
184   pc100_state *state = space->machine().driver_data<pc100_state>();
185
186   if(offset)
187      return state->m_crtc.vstart >> 8;
188
189   return state->m_crtc.vstart & 0xff;
190}
191
192static WRITE8_HANDLER( pc100_vs_vreg_w )
193{
194   pc100_state *state = space->machine().driver_data<pc100_state>();
195
196   if(offset)
197      state->m_crtc.vstart = (state->m_crtc.vstart & 0xff) | (data << 8);
198   else
199      state->m_crtc.vstart = (state->m_crtc.vstart & 0xff00) | (data & 0xff);
200}
201
202static WRITE8_HANDLER( pc100_crtc_addr_w )
203{
204   pc100_state *state = space->machine().driver_data<pc100_state>();
205
206   state->m_crtc.addr = data & 7;
207}
208
209static WRITE8_HANDLER( pc100_crtc_data_w )
210{
211   pc100_state *state = space->machine().driver_data<pc100_state>();
212
213   state->m_crtc.reg[state->m_crtc.addr] = data;
214}
215
216
176217/* everything is 8-bit bus wide */
177218static ADDRESS_MAP_START(pc100_io, AS_IO, 16)
178219   AM_RANGE(0x00, 0x03) AM_DEVREADWRITE8("pic8259", pic8259_r, pic8259_w, 0x00ff) // i8259
r11783r11784
184225   AM_RANGE(0x22, 0x25) AM_WRITE8(pc100_output_w,0x00ff) //i/o, keyboard, mouse
185226//   AM_RANGE(0x28, 0x2b) i8251
186227   AM_RANGE(0x30, 0x31) AM_READWRITE8(pc100_shift_r,pc100_shift_w,0x00ff) // crtc shift
187//   AM_RANGE(0x38, 0x39) crtc address reg
188//   AM_RANGE(0x3a, 0x3b) crtc data reg
189//   AM_RANGE(0x3c, 0x3f) crtc vertical start position
228   AM_RANGE(0x38, 0x39) AM_WRITE8(pc100_crtc_addr_w,0x00ff) //crtc address reg
229   AM_RANGE(0x3a, 0x3b) AM_WRITE8(pc100_crtc_data_w,0x00ff) //crtc data reg
230   AM_RANGE(0x3c, 0x3f) AM_READWRITE8(pc100_vs_vreg_r,pc100_vs_vreg_w,0x00ff) //crtc vertical start position
190231   AM_RANGE(0x40, 0x5f) AM_RAM_WRITE(pc100_paletteram_w) AM_BASE_MEMBER(pc100_state,m_palram)
191232//   AM_RANGE(0x60, 0x61) crtc command (16-bit wide)
192233   AM_RANGE(0x80, 0x81) AM_READWRITE(pc100_kanji_r,pc100_kanji_w)
r11783r11784
197238
198239/* Input ports */
199240static INPUT_PORTS_START( pc100 )
241   PORT_START("DSW")
242   PORT_DIPNAME( 0x01, 0x01, "DSW" )
243   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
244   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
245   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
246   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
247   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
248   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
249   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
250   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
251   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
252   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
253   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
254   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
255   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
256   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
257   PORT_DIPNAME( 0x20, 0x20, "Monitor" )
258   PORT_DIPSETTING(    0x20, "Horizontal" )
259   PORT_DIPSETTING(    0x00, "Vertical" )
260   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
261   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
262   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
263   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
264   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
265   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
200266INPUT_PORTS_END
201267
202268static const gfx_layout kanji_layout =

Previous 15994 Revisions Next


© 1998-2018 The MESS Team