Previous 15994 Revisions Next

r1827 Sunday 2nd March, 2008 at 15:50:49 UTC by Wilbert Pol
[SVI318] Updated to use the new 6845 device core.
[src/mess/drivers]svi318.c
[src/mess/includes]svi318.h
[src/mess/machine]svi318.c

src/mess/includes/svi318.h
r1826r1827
4545WRITE8_HANDLER( svi318_fdc_density_side_w );
4646DEVICE_LOAD( svi318_floppy );
4747
48MC6845_UPDATE_ROW( svi806_crtc6845_update_row );
4849READ8_HANDLER( svi806_r );
4950WRITE8_HANDLER( svi806_w );
5051WRITE8_HANDLER( svi806_ram_enable_w );
52VIDEO_START( svi328_806 );
5153VIDEO_UPDATE( svi328_806 );
5254MACHINE_RESET( svi328_806 );
5355
src/mess/machine/svi318.c
r1826r1827
1111#include "driver.h"
1212#include "deprecat.h"
1313#include "mslegacy.h"
14#include "video/mc6845.h"
1415#include "includes/svi318.h"
1516#include "cpu/z80/z80.h"
16#include "video/mc6845.h"
1717#include "video/tms9928a.h"
1818#include "machine/8255ppi.h"
1919#include "machine/uart8250.h"
r1826r1827
6060static SVI_318 svi;
6161static UINT8 *pcart;
6262static UINT32 pcart_rom_size;
63static mc6845_t   *mc6845;
6364
6465static void svi318_set_banks (void);
6566
r1826r1827
429430   return INIT_PASS;
430431}
431432
432static MC6845_UPDATE_ROW( svi806_crtc6845_update_row )
433MC6845_UPDATE_ROW( svi806_crtc6845_update_row )
433434{
434435   int i;
435436
r1826r1827
446447   }
447448}
448449
449static const mc6845_interface svi806_crtc6845_interface = {
450   1,
451   3579545 /*?*/,
452   8 /*?*/,
453   NULL,
454   svi806_crtc6845_update_row,
455   NULL,
456   NULL
457};
458
459450static void svi806_set_crtc_register(UINT8 reg, UINT8 data) {
460   crtc6845_0_address_w(0, reg);
461   crtc6845_0_register_w(0, data);
451   mc6845_address_w(mc6845, reg);
452   mc6845_register_w(mc6845, data);
462453}
463454
464/* 80 column card init */
465static void svi318_80col_init(void)
466{
467   /* 2K RAM, but allocating 4KB to make banking easier */
468   /* The upper 2KB will be set to FFs and will never be written to */
469   svi.svi806_ram = new_memory_region( Machine, REGION_GFX2, 0x1000, 0 );
470   memset( svi.svi806_ram, 0x00, 0x800 );
471   memset( svi.svi806_ram + 0x800, 0xFF, 0x800 );
472   svi.svi806_gfx = memory_region(REGION_GFX1);
473   /* initialise 6845 */
474   crtc6845_config( 0, &svi806_crtc6845_interface);
455static TIMER_CALLBACK(svi318_80col_init_registers) {
456   cpuintrf_push_context( 0 );
475457   /* set some default values for the 6845 controller */
476458   svi806_set_crtc_register(  0, 109 );
477459   svi806_set_crtc_register(  1,  80 );
r1826r1827
489471   svi806_set_crtc_register( 13,   0 );
490472   svi806_set_crtc_register( 14,   0 );
491473   svi806_set_crtc_register( 15,   0 );
474   cpuintrf_pop_context();
492475}
493476
477/* 80 column card init */
478static void svi318_80col_init(void)
479{
480   /* 2K RAM, but allocating 4KB to make banking easier */
481   /* The upper 2KB will be set to FFs and will never be written to */
482   svi.svi806_ram = new_memory_region( Machine, REGION_GFX2, 0x1000, 0 );
483   memset( svi.svi806_ram, 0x00, 0x800 );
484   memset( svi.svi806_ram + 0x800, 0xFF, 0x800 );
485   svi.svi806_gfx = memory_region(REGION_GFX1);
486
487   timer_set( attotime_zero, NULL, 0, svi318_80col_init_registers );
488}
489
494490READ8_HANDLER( svi806_r )
495491{
496   return crtc6845_0_register_r( offset );
492   return mc6845_register_r( mc6845 );
497493}
498494
499495WRITE8_HANDLER( svi806_w )
500496{
501497   switch( offset ) {
502498   case 0:
503      crtc6845_0_address_w( offset, data );
499      mc6845_address_w( mc6845, data );
504500      break;
505501   case 1:
506      crtc6845_0_register_w( offset, data );
502      mc6845_register_w( mc6845, data );
507503      break;
508504   }
509505}
r1826r1827
514510   svi318_set_banks();
515511}
516512
513VIDEO_START( svi328_806 ) {
514   VIDEO_START_CALL(tms9928a);
515   mc6845 = devtag_get_token(machine, MC6845, "crtc");
516}
517
517518VIDEO_UPDATE( svi328_806 )
518519{
519520   if ( screen == 0 )
520521      VIDEO_UPDATE_CALL(tms9928a);
521   if ( screen == 1 )
522      VIDEO_UPDATE_CALL(crtc6845);
522   if ( screen == 1 ) {
523      mc6845_update(mc6845, bitmap, cliprect);
524   }
523525   return 0;
524526}
525527
src/mess/drivers/svi318.c
r1826r1827
1010*/
1111
1212#include "driver.h"
13#include "video/mc6845.h"
1314#include "includes/svi318.h"
1415#include "video/tms9928a.h"
1516#include "machine/8255ppi.h"
r1826r1827
352353   MDRV_MACHINE_RESET( svi318 )
353354MACHINE_DRIVER_END
354355
356static const mc6845_interface svi806_crtc6845_interface = {
357   1,
358   3579545 /*?*/,
359   8 /*?*/,
360   NULL,
361   svi806_crtc6845_update_row,
362   NULL,
363   NULL,
364   NULL,
365   NULL
366};
367
355368static MACHINE_DRIVER_START( svi328_806 )
356369   /* Basic machine hardware */
357370   MDRV_CPU_ADD_TAG( "main", Z80, 3579545 )   /* 3.579545 Mhz */
r1826r1827
379392   MDRV_SCREEN_SIZE(640, 400)
380393   MDRV_SCREEN_VISIBLE_AREA(0,640-1, 0, 400-1)
381394
395   MDRV_DEVICE_ADD("crtc", MC6845)
396   MDRV_DEVICE_CONFIG( svi806_crtc6845_interface )
397
398   MDRV_VIDEO_START( svi328_806 )
382399   MDRV_VIDEO_UPDATE( svi328_806 )
383400
384401   /* Sound hardware */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team