Previous 15994 Revisions Next

r6822 Wednesday 30th December, 2009 at 08:12:57 UTC by Miodrag Milanović
[SPC1000] Fixed graphics issues on driver and MC6847 change [RetroPC]
[src/mess/drivers]spc1000.c
[src/mess/video]m6847.c

src/mess/video/m6847.c
r6821r6822
16691669            char_data = 0xff;
16701670         }
16711671      } else {
1672         if (mc6847->get_char_rom)
1672         if ((attr & M6847_INTEXT) && !(attr & M6847_AS) && mc6847->get_char_rom)
16731673            char_data = mc6847->get_char_rom(device->machine,byte,scanline % 12);
16741674         else
16751675            char_data = mc6847->fontdata[attr_index][byte][scanline % 12];
src/mess/drivers/spc1000.c
r6821r6822
7373{
7474   GMODE = data;
7575
76   // GMODE layout: CSS|NA|PS2|PS1|~A/G|GM0|GM1|NA
77   //   [PS2,PS1] is used to set screen 0/1 pages
7678   mc6847_gm1_w(device, BIT(data, 1));
77   mc6847_gm2_w(device, BIT(data, 2));
79   mc6847_gm0_w(device, BIT(data, 2));
7880   mc6847_ag_w(device, BIT(data, 3));
79   mc6847_gm0_w(device, BIT(data, 7));
81   mc6847_css_w(device, BIT(data, 7));   
8082}
8183
8284static READ8_DEVICE_HANDLER(spc1000_gmode_r)
r6821r6822
208210}
209211
210212static READ8_DEVICE_HANDLER( spc1000_mc6847_videoram_r )
213{   
214   // GMODE layout: CSS|NA|PS2|PS1|~A/G|GM0|GM1|NA
215   //   [PS2,PS1] is used to set screen 0/1 pages
216   if ( !BIT(GMODE, 3) ) {   // text mode (~A/G set to A)
217      unsigned int page = (BIT(GMODE, 5) << 1) | BIT(GMODE, 4);
218      mc6847_inv_w(device, BIT(spc1000_video_ram[offset+page*0x200+0x800], 0));
219      mc6847_css_w(device, BIT(spc1000_video_ram[offset+page*0x200+0x800], 1));
220      mc6847_as_w(device, BIT(spc1000_video_ram[offset+page*0x200+0x800], 2));
221      mc6847_intext_w(device, BIT(spc1000_video_ram[offset+page*0x200+0x800], 3));
222      return spc1000_video_ram[offset+page*0x200];
223   } else {   // graphics mode: uses full 6KB of VRAM
224      return spc1000_video_ram[offset];
225   }
226}
227
228
229static UINT8 spc1000_get_char_rom(running_machine *machine, UINT8 ch, int line)
211230{
212   mc6847_inv_w(device, BIT(spc1000_video_ram[offset], 7));
213
214   return spc1000_video_ram[offset];
231   return spc1000_video_ram[0x1000+(ch&0x7F)*16+line];
215232}
216233
217234static VIDEO_START( spc1000 )
r6821r6822
241258
242259static const mc6847_interface spc1000_mc6847_intf =
243260{
244   DEVCB_HANDLER(spc1000_mc6847_videoram_r),
245   DEVCB_NULL,
246   DEVCB_NULL,
247   DEVCB_NULL,
248   DEVCB_NULL,
249   DEVCB_NULL,
250   DEVCB_NULL,
251   DEVCB_NULL,
252   DEVCB_NULL,
253   DEVCB_NULL,
254   DEVCB_NULL,
255   DEVCB_NULL
261   DEVCB_HANDLER(spc1000_mc6847_videoram_r),   // data fetch
262   DEVCB_LINE_VCC,                        // GM2 [hardwired to 1]
263   DEVCB_NULL,                           // GM1
264   DEVCB_NULL,                           // GM0
265   DEVCB_NULL,                           // INVEXT
266   DEVCB_NULL,                           // INV
267   DEVCB_NULL,                           // ~A/S
268   DEVCB_NULL,                           // ~A/G
269   DEVCB_NULL,                           // CSS
270   DEVCB_NULL,                           // FS (output)
271   DEVCB_NULL,                           // HS (output)
272   DEVCB_NULL                           // RS (output)
256273};
257274
258275static MACHINE_DRIVER_START( spc1000 )
r6821r6822
274291   MDRV_VIDEO_UPDATE(spc1000)
275292
276293   MDRV_MC6847_ADD("mc6847", spc1000_mc6847_intf)
277   MDRV_MC6847_TYPE(M6847_VERSION_M6847T1_NTSC)
294   MDRV_MC6847_TYPE(M6847_VERSION_ORIGINAL_NTSC)
295   MDRV_MC6847_CHAR_ROM(spc1000_get_char_rom)
278296
279297   /* sound hardware */
280298   MDRV_SPEAKER_STANDARD_MONO("mono")

Previous 15994 Revisions Next


© 1998-2018 The MESS Team