Previous 15994 Revisions Next

r1137 Wednesday 17th October, 2007 at 19:06:10 UTC by Wilbert Pol
[CBMB] Updated to use mame's 6845 implementation. Cursor support is still missing.
[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
r1136r1137
228228void cbm600hu_driver_init (void);
229229void cbm700_driver_init (void);
230230void cbmb_common_init_machine (void);
231void cbm600_update_row(mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param);
232void cbm700_update_row(mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param);
231233MACHINE_RESET( cbmb );
232234
233235void cbmb_rom_load(void);
234236
235237void cbm600_vh_init(void);
236238void cbm700_vh_init(void);
237void cbmb_vh_cursor(struct mscrtc6845_cursor *cursor);
238239extern VIDEO_START( cbm700 );
239extern VIDEO_UPDATE( cbmb );
240240
241241void cbmb_vh_set_font(int font);
242242
src/mess/video/cbmb.c
r1136r1137
77#include "driver.h"
88
99#include "video/generic.h"
10#include "includes/crtc6845.h"
10#include "video/crtc6845.h"
1111#include "mscommon.h"
1212#include "includes/cbmb.h"
1313
r1136r1137
5757   video_start_generic(machine);
5858}
5959
60void cbmb_vh_cursor(struct mscrtc6845_cursor *cursor)
61{
62   dirtybuffer[cursor->pos]=1;
63}
64
6560void cbmb_vh_set_font(int font)
6661{
6762   cbmb_font=font;
6863}
6964
70VIDEO_UPDATE( cbmb )
71{
72   int x, y, i;
73   rectangle rect, rect2;
74   int w=mscrtc6845_get_char_columns(mscrtc6845);
75   int h=mscrtc6845_get_char_lines(mscrtc6845);
76   int height=mscrtc6845_get_char_height(mscrtc6845);
77   int start=mscrtc6845_get_start(mscrtc6845)&0x7ff;
78   struct mscrtc6845_cursor cursor;
79   int full_refresh = 1;
65void cbm600_update_row(mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param) {
66   int i;
8067
81   rect.min_x=Machine->screen[0].visarea.min_x;
82   rect.max_x=Machine->screen[0].visarea.max_x;
83   if (full_refresh) {
84      memset(dirtybuffer, 1, videoram_size);
68   for( i = 0; i < x_count; i++ ) {
69      drawgfx( bitmap, Machine->gfx[cbmb_font], videoram[(ma+i )& 0x7ff], 0, 0, 0, Machine->gfx[cbmb_font]->width * i, y-ra, cliprect, TRANSPARENCY_NONE, 0 );
8570   }
71}
8672
87   mscrtc6845_time(mscrtc6845);
88   mscrtc6845_get_cursor(mscrtc6845, &cursor);
73void cbm700_update_row(mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param) {
74   int i;
8975
90   for (y=0, rect.min_y=0, rect.max_y=height-1, i=start; y<h;
91       y++, rect.min_y+=height, rect.max_y+=height) {
92      for (x=0; x<w; x++, i=(i+1)&0x7ff) {
93         if (dirtybuffer[i]) {
94            drawgfx(bitmap,Machine->gfx[cbmb_font],
95                  videoram[i], 0, 0, 0, Machine->gfx[cbmb_font]->width*x,height*y,
96                  &rect,TRANSPARENCY_NONE,0);
97            if ((cursor.on)&&(i==cursor.pos)) {
98               int k=height-cursor.top;
99               rect2=rect;
100               rect2.min_y+=cursor.top;
101               if (cursor.bottom<height) k=cursor.bottom-cursor.top+1;
102
103               if (k>0)
104                  plot_box(bitmap, Machine->gfx[cbmb_font]->width*x,
105                         height*y+cursor.top,
106                         Machine->gfx[cbmb_font]->width, k, Machine->pens[1]);
107            }
108
109            dirtybuffer[i]=0;
110         }
111      }
76   for( i = 0; i < x_count; i++ ) {
77      drawgfx( bitmap, Machine->gfx[cbmb_font], videoram[(ma+i) & 0x7ff], 0, 0, 0, Machine->gfx[cbmb_font]->width * i, y-ra, cliprect, TRANSPARENCY_NONE, 0 );
11278   }
113   return 0;
11479}
11580
src/mess/machine/cbmb.c
r1136r1137
1717#include "includes/vc20tape.h"
1818#include "includes/cbmieeeb.h"
1919#include "includes/vic6567.h"
20#include "includes/crtc6845.h"
20#include "video/crtc6845.h"
2121#include "mscommon.h"
2222
2323#include "includes/cbmb.h"
r1136r1137
244244   cbm_ieee_open();
245245}
246246
247static struct mscrtc6845_config cbm600_crtc= { 1600000 /*?*/, cbmb_vh_cursor };
247//static struct mscrtc6845_config cbm600_crtc= { 1600000 /*?*/, cbmb_vh_cursor };
248const static crtc6845_interface cbm600_crtc = { 0, 1600000 /*?*/, 8 /*?*/, NULL, cbm600_update_row, NULL, NULL };
248249
249250void cbm600_driver_init (void)
250251{
251252   cbmb_common_driver_init ();
252253   cbm600_vh_init();
253   mscrtc6845_init(&cbm600_crtc);
254   crtc6845_config( 0, &cbm600_crtc);
254255}
255256
256257void cbm600pal_driver_init (void)
257258{
258259   cbmb_common_driver_init ();
259260   cbm600_vh_init();
260   mscrtc6845_init(&cbm600_crtc);
261   crtc6845_config( 0, &cbm600_crtc);
261262}
262263
263264void cbm600hu_driver_init (void)
264265{
265266   cbmb_common_driver_init ();
266   mscrtc6845_init(&cbm600_crtc);
267   crtc6845_config( 0, &cbm600_crtc);
267268}
268269
269static struct mscrtc6845_config cbm700_crtc= { 2000000 /*?*/, cbmb_vh_cursor };
270//static struct mscrtc6845_config cbm700_crtc= { 2000000 /*?*/, cbmb_vh_cursor };
271const static crtc6845_interface cbm700_crtc = { 0, 2000000 /*?*/, 9 /*?*/, NULL, cbm700_update_row, NULL, NULL };
270272
271273void cbm700_driver_init (void)
272274{
273275   cbmb_common_driver_init ();
274276   cbm700_vh_init();
275   mscrtc6845_init(&cbm700_crtc);
277   crtc6845_config( 0, &cbm700_crtc);
276278}
277279
278280void cbm500_driver_init (void)
src/mess/drivers/cbmb.c
r1136r1137
168168#include "includes/cbm.h"
169169#include "includes/tpi6525.h"
170170#include "includes/vic6567.h"
171#include "includes/crtc6845.h"
171#include "video/crtc6845.h"
172172#include "includes/cbmserb.h"
173173#include "includes/vc1541.h"
174174#include "includes/vc20tape.h"
r1136r1137
234234   AM_RANGE(0xf8000, 0xfbfff) AM_READ( MRA8_ROM )
235235   /*   {0xfc000, 0xfcfff, MRA8_ROM }, */
236236   AM_RANGE(0xfd000, 0xfd7ff) AM_READ( MRA8_ROM )
237   AM_RANGE(0xfd800, 0xfd8ff) AM_READ( mscrtc6845_0_port_r )
237//   AM_RANGE(0xfd800, 0xfd8ff)
238   AM_RANGE(0xfd801, 0xfd801) AM_MIRROR( 0xfe ) AM_READ( crtc6845_0_register_r )
238239   /* disk units */
239240   AM_RANGE(0xfda00, 0xfdaff) AM_READ( sid6581_0_port_r )
240241   /* db00 coprocessor */
r1136r1137
300301   AM_RANGE(0xf6000, 0xf7fff) AM_WRITE( MWA8_ROM )
301302   AM_RANGE(0xf8000, 0xfbfff) AM_WRITE( MWA8_ROM) AM_BASE( &cbmb_basic )
302303   AM_RANGE(0xfd000, 0xfd7ff) AM_WRITE( videoram_w) AM_BASE( &videoram) AM_SIZE(&videoram_size ) /* VIDEORAM */
303   AM_RANGE(0xfd800, 0xfd8ff) AM_WRITE( mscrtc6845_0_port_w )
304   AM_RANGE(0xfd800, 0xfd800) AM_MIRROR( 0xfe ) AM_WRITE( crtc6845_0_address_w )
305   AM_RANGE(0xfd801, 0xfd801) AM_MIRROR( 0xfe ) AM_WRITE( crtc6845_0_register_w )
304306   /* disk units */
305307   AM_RANGE(0xfda00, 0xfdaff) AM_WRITE( sid6581_0_port_w)
306308   /* db00 coprocessor */
r1136r1137
881883   MDRV_PALETTE_INIT( cbm700 )
882884
883885   MDRV_VIDEO_START( generic )
884   MDRV_VIDEO_UPDATE( cbmb )
886   MDRV_VIDEO_UPDATE( crtc6845 )
885887
886888   /* sound hardware */
887889   MDRV_SPEAKER_STANDARD_MONO("mono")

Previous 15994 Revisions Next


© 1998-2018 The MESS Team