Previous 15994 Revisions Next

r1820 Saturday 1st March, 2008 at 15:21:29 UTC by Wilbert Pol
[CBMB] Updated to use the new mc6845 device.
[src/mess/drivers]cbmb.c
[src/mess/includes]cbmb.h
[src/mess/machine]cbmb.c
[src/mess/video]cbmb.c

src/mess/includes/cbmb.h
r1819r1820
130130
131131/*----------- defined in video/cbmb.c -----------*/
132132
133READ8_HANDLER( cbmb_mc6845_register_r );
134WRITE8_HANDLER( cbmb_mc6845_register_w );
135WRITE8_HANDLER( cbmb_mc6845_address_w );
136VIDEO_START( cbmb_crtc );
137VIDEO_UPDATE( cbmb_crtc );
133138MC6845_UPDATE_ROW( cbm600_update_row );
134139MC6845_UPDATE_ROW( cbm700_update_row );
140void cbmb_display_enable_changed(running_machine *machine, mc6845_t *mc6845, int display_enabled);
135141
136142void cbm600_vh_init(void);
137143void cbm700_vh_init(void);
138extern VIDEO_START( cbm700 );
144VIDEO_START( cbm700 );
139145
140146void cbmb_vh_set_font(int font);
141147
src/mess/video/cbmb.c
r1819r1820
1111
1212
1313static int cbmb_font=0;
14static mc6845_t *mc6845;
1415
16VIDEO_START( cbmb_crtc ) {
17   mc6845 = devtag_get_token(machine, MC6845, "crtc");
18}
19
20VIDEO_UPDATE( cbmb_crtc ) {
21   mc6845_update(mc6845, bitmap, cliprect);
22   return 0;
23}
24
25READ8_HANDLER( cbmb_mc6845_register_r ) {
26   return mc6845_register_r( mc6845 );
27}
28
29WRITE8_HANDLER( cbmb_mc6845_register_w ) {
30   mc6845_register_w( mc6845, data );
31}
32
33WRITE8_HANDLER( cbmb_mc6845_address_w ) {
34   mc6845_address_w( mc6845, data );
35}
36
1537void cbm600_vh_init(void)
1638{
1739   UINT8 *gfx = memory_region(REGION_GFX1);
r1819r1820
4062{
4163   int i;
4264
65   mc6845 = devtag_get_token(machine, MC6845, "crtc");
66
4367    /* remove pixel column 9 for character codes 0 - 175 and 224 - 255 */
4468   for( i = 0; i < 256; i++)
4569   {
r1819r1820
85109   }
86110}
87111
112void cbmb_display_enable_changed(running_machine *machine, mc6845_t *mc6845, int display_enabled)
113{
114}
115
src/mess/machine/cbmb.c
r1819r1820
2020#include "includes/vc20tape.h"
2121#include "includes/cbmieeeb.h"
2222#include "video/vic6567.h"
23#include "video/mc6845.h"
2423
2524
2625static TIMER_CALLBACK(cbmb_frame_interrupt);
r1819r1820
249248   cbm_ieee_open();
250249}
251250
252static void cbmb_display_enable_changed(running_machine *machine, mc6845_t *mc6845, int display_enabled)
253{
254}
255
256//static const struct mscrtc6845_config cbm600_crtc= { 1600000 /*?*/, cbmb_vh_cursor };
257static const mc6845_interface cbm600_crtc = {
258   0,
259   1600000 /*?*/,
260   8 /*?*/,
261   NULL,
262   cbm600_update_row,
263   NULL,
264   cbmb_display_enable_changed
265};
266
267251void cbm600_driver_init (void)
268252{
269253   cbmb_common_driver_init ();
270254   cbm_ntsc = 1;
271255   cbm600_vh_init();
272   crtc6845_config( 0, &cbm600_crtc);
273256}
274257
275258void cbm600pal_driver_init (void)
r1819r1820
277260   cbmb_common_driver_init ();
278261   cbm_ntsc = 0;
279262   cbm600_vh_init();
280   crtc6845_config( 0, &cbm600_crtc);
281263}
282264
283265void cbm600hu_driver_init (void)
284266{
285267   cbmb_common_driver_init ();
286268   cbm_ntsc = 0;
287   crtc6845_config( 0, &cbm600_crtc);
288269}
289270
290//static const struct mscrtc6845_config cbm700_crtc= { 2000000 /*?*/, cbmb_vh_cursor };
291static const mc6845_interface cbm700_crtc = {
292   0,
293   2000000 /*?*/,
294   9 /*?*/,
295   NULL,
296   cbm700_update_row,
297   NULL,
298   cbmb_display_enable_changed
299};
300
301271void cbm700_driver_init (void)
302272{
303273   cbmb_common_driver_init ();
304274   cbm700 = 1;
305275   cbm_ntsc = 0;
306276   cbm700_vh_init();
307   crtc6845_config( 0, &cbm700_crtc);
308277}
309278
310279void cbm500_driver_init (void)
src/mess/drivers/cbmb.c
r1819r1820
187187   /*  {0xfc000, 0xfcfff, MRA8_ROM }, */
188188   AM_RANGE(0xfd000, 0xfd7ff) AM_READ( MRA8_ROM )
189189//  AM_RANGE(0xfd800, 0xfd8ff)
190   AM_RANGE(0xfd801, 0xfd801) AM_MIRROR( 0xfe ) AM_READ( crtc6845_0_register_r )
190   AM_RANGE(0xfd801, 0xfd801) AM_MIRROR( 0xfe ) AM_READ( cbmb_mc6845_register_r )
191191   /* disk units */
192192   AM_RANGE(0xfda00, 0xfdaff) AM_READ( sid6581_0_port_r )
193193   /* db00 coprocessor */
r1819r1820
209209   AM_RANGE(0xf6000, 0xf7fff) AM_WRITE( MWA8_ROM )
210210   AM_RANGE(0xf8000, 0xfbfff) AM_WRITE( MWA8_ROM) AM_BASE( &cbmb_basic )
211211   AM_RANGE(0xfd000, 0xfd7ff) AM_WRITE( MWA8_RAM) AM_BASE( &videoram) AM_SIZE(&videoram_size ) /* VIDEORAM */
212   AM_RANGE(0xfd800, 0xfd800) AM_MIRROR( 0xfe ) AM_WRITE( crtc6845_0_address_w )
213   AM_RANGE(0xfd801, 0xfd801) AM_MIRROR( 0xfe ) AM_WRITE( crtc6845_0_register_w )
212   AM_RANGE(0xfd800, 0xfd800) AM_MIRROR( 0xfe ) AM_WRITE( cbmb_mc6845_address_w )
213   AM_RANGE(0xfd801, 0xfd801) AM_MIRROR( 0xfe ) AM_WRITE( cbmb_mc6845_register_w )
214214   /* disk units */
215215   AM_RANGE(0xfda00, 0xfdaff) AM_WRITE( sid6581_0_port_w)
216216   /* db00 coprocessor */
r1819r1820
600600
601601#endif
602602
603static const mc6845_interface cbm600_crtc = {
604   0,
605   XTAL_18MHz / 8 /*?*/,   /*  I do not know if this is correct, please verify */
606   8 /*?*/,
607   NULL,
608   cbm600_update_row,
609   NULL,
610   cbmb_display_enable_changed,
611   NULL,
612   NULL
613};
603614
615static const mc6845_interface cbm700_crtc = {
616   0,
617   XTAL_18MHz / 8 /*?*/,   /* I do not know if this is correct, please verify */
618   9 /*?*/,
619   NULL,
620   cbm700_update_row,
621   NULL,
622   cbmb_display_enable_changed,
623   NULL,
624   NULL
625};
626
627
604628static MACHINE_DRIVER_START( cbm600 )
605629   /* basic machine hardware */
606630   MDRV_CPU_ADD_TAG("main", M6509, 7833600)        /* 7.8336 Mhz */
r1819r1820
620644   MDRV_PALETTE_LENGTH(sizeof (cbm700_palette) / sizeof (cbm700_palette[0]) / 3)
621645   MDRV_PALETTE_INIT( cbm700 )
622646
623   MDRV_VIDEO_UPDATE( crtc6845 )
647   MDRV_DEVICE_ADD("crtc", MC6845)
648   MDRV_DEVICE_CONFIG( cbm600_crtc )
624649
650   MDRV_VIDEO_START( cbmb_crtc )
651   MDRV_VIDEO_UPDATE( cbmb_crtc )
652
625653   /* sound hardware */
626654   MDRV_SPEAKER_STANDARD_MONO("mono")
627655   MDRV_SOUND_ADD(SID6581, 1000000)
r1819r1820
643671   MDRV_SCREEN_VISIBLE_AREA(0, 720 - 1, 0, 350 - 1)
644672   MDRV_GFXDECODE( cbm700 )
645673
674   MDRV_DEVICE_MODIFY("crtc", MC6845)
675   MDRV_DEVICE_CONFIG( cbm700_crtc )
676
646677   MDRV_VIDEO_START( cbm700 )
647678MACHINE_DRIVER_END
648679

Previous 15994 Revisions Next


© 1998-2018 The MESS Team