src/mess/includes/cbmb.h
| r1136 | r1137 | |
| 228 | 228 | void cbm600hu_driver_init (void); |
| 229 | 229 | void cbm700_driver_init (void); |
| 230 | 230 | void cbmb_common_init_machine (void); |
| 231 | void cbm600_update_row(mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param); |
| 232 | void cbm700_update_row(mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param); |
| 231 | 233 | MACHINE_RESET( cbmb ); |
| 232 | 234 | |
| 233 | 235 | void cbmb_rom_load(void); |
| 234 | 236 | |
| 235 | 237 | void cbm600_vh_init(void); |
| 236 | 238 | void cbm700_vh_init(void); |
| 237 | | void cbmb_vh_cursor(struct mscrtc6845_cursor *cursor); |
| 238 | 239 | extern VIDEO_START( cbm700 ); |
| 239 | | extern VIDEO_UPDATE( cbmb ); |
| 240 | 240 | |
| 241 | 241 | void cbmb_vh_set_font(int font); |
| 242 | 242 | |
src/mess/video/cbmb.c
| r1136 | r1137 | |
| 7 | 7 | #include "driver.h" |
| 8 | 8 | |
| 9 | 9 | #include "video/generic.h" |
| 10 | | #include "includes/crtc6845.h" |
| 10 | #include "video/crtc6845.h" |
| 11 | 11 | #include "mscommon.h" |
| 12 | 12 | #include "includes/cbmb.h" |
| 13 | 13 | |
| r1136 | r1137 | |
| 57 | 57 | video_start_generic(machine); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | | void cbmb_vh_cursor(struct mscrtc6845_cursor *cursor) |
| 61 | | { |
| 62 | | dirtybuffer[cursor->pos]=1; |
| 63 | | } |
| 64 | | |
| 65 | 60 | void cbmb_vh_set_font(int font) |
| 66 | 61 | { |
| 67 | 62 | cbmb_font=font; |
| 68 | 63 | } |
| 69 | 64 | |
| 70 | | VIDEO_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; |
| 65 | void cbm600_update_row(mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param) { |
| 66 | int i; |
| 80 | 67 | |
| 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 ); |
| 85 | 70 | } |
| 71 | } |
| 86 | 72 | |
| 87 | | mscrtc6845_time(mscrtc6845); |
| 88 | | mscrtc6845_get_cursor(mscrtc6845, &cursor); |
| 73 | void cbm700_update_row(mame_bitmap *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param) { |
| 74 | int i; |
| 89 | 75 | |
| 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 ); |
| 112 | 78 | } |
| 113 | | return 0; |
| 114 | 79 | } |
| 115 | 80 | |
src/mess/machine/cbmb.c
| r1136 | r1137 | |
| 17 | 17 | #include "includes/vc20tape.h" |
| 18 | 18 | #include "includes/cbmieeeb.h" |
| 19 | 19 | #include "includes/vic6567.h" |
| 20 | | #include "includes/crtc6845.h" |
| 20 | #include "video/crtc6845.h" |
| 21 | 21 | #include "mscommon.h" |
| 22 | 22 | |
| 23 | 23 | #include "includes/cbmb.h" |
| r1136 | r1137 | |
| 244 | 244 | cbm_ieee_open(); |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | | static struct mscrtc6845_config cbm600_crtc= { 1600000 /*?*/, cbmb_vh_cursor }; |
| 247 | //static struct mscrtc6845_config cbm600_crtc= { 1600000 /*?*/, cbmb_vh_cursor }; |
| 248 | const static crtc6845_interface cbm600_crtc = { 0, 1600000 /*?*/, 8 /*?*/, NULL, cbm600_update_row, NULL, NULL }; |
| 248 | 249 | |
| 249 | 250 | void cbm600_driver_init (void) |
| 250 | 251 | { |
| 251 | 252 | cbmb_common_driver_init (); |
| 252 | 253 | cbm600_vh_init(); |
| 253 | | mscrtc6845_init(&cbm600_crtc); |
| 254 | crtc6845_config( 0, &cbm600_crtc); |
| 254 | 255 | } |
| 255 | 256 | |
| 256 | 257 | void cbm600pal_driver_init (void) |
| 257 | 258 | { |
| 258 | 259 | cbmb_common_driver_init (); |
| 259 | 260 | cbm600_vh_init(); |
| 260 | | mscrtc6845_init(&cbm600_crtc); |
| 261 | crtc6845_config( 0, &cbm600_crtc); |
| 261 | 262 | } |
| 262 | 263 | |
| 263 | 264 | void cbm600hu_driver_init (void) |
| 264 | 265 | { |
| 265 | 266 | cbmb_common_driver_init (); |
| 266 | | mscrtc6845_init(&cbm600_crtc); |
| 267 | crtc6845_config( 0, &cbm600_crtc); |
| 267 | 268 | } |
| 268 | 269 | |
| 269 | | static struct mscrtc6845_config cbm700_crtc= { 2000000 /*?*/, cbmb_vh_cursor }; |
| 270 | //static struct mscrtc6845_config cbm700_crtc= { 2000000 /*?*/, cbmb_vh_cursor }; |
| 271 | const static crtc6845_interface cbm700_crtc = { 0, 2000000 /*?*/, 9 /*?*/, NULL, cbm700_update_row, NULL, NULL }; |
| 270 | 272 | |
| 271 | 273 | void cbm700_driver_init (void) |
| 272 | 274 | { |
| 273 | 275 | cbmb_common_driver_init (); |
| 274 | 276 | cbm700_vh_init(); |
| 275 | | mscrtc6845_init(&cbm700_crtc); |
| 277 | crtc6845_config( 0, &cbm700_crtc); |
| 276 | 278 | } |
| 277 | 279 | |
| 278 | 280 | void cbm500_driver_init (void) |
src/mess/drivers/cbmb.c
| r1136 | r1137 | |
| 168 | 168 | #include "includes/cbm.h" |
| 169 | 169 | #include "includes/tpi6525.h" |
| 170 | 170 | #include "includes/vic6567.h" |
| 171 | | #include "includes/crtc6845.h" |
| 171 | #include "video/crtc6845.h" |
| 172 | 172 | #include "includes/cbmserb.h" |
| 173 | 173 | #include "includes/vc1541.h" |
| 174 | 174 | #include "includes/vc20tape.h" |
| r1136 | r1137 | |
| 234 | 234 | AM_RANGE(0xf8000, 0xfbfff) AM_READ( MRA8_ROM ) |
| 235 | 235 | /* {0xfc000, 0xfcfff, MRA8_ROM }, */ |
| 236 | 236 | 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 ) |
| 238 | 239 | /* disk units */ |
| 239 | 240 | AM_RANGE(0xfda00, 0xfdaff) AM_READ( sid6581_0_port_r ) |
| 240 | 241 | /* db00 coprocessor */ |
| r1136 | r1137 | |
| 300 | 301 | AM_RANGE(0xf6000, 0xf7fff) AM_WRITE( MWA8_ROM ) |
| 301 | 302 | AM_RANGE(0xf8000, 0xfbfff) AM_WRITE( MWA8_ROM) AM_BASE( &cbmb_basic ) |
| 302 | 303 | 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 ) |
| 304 | 306 | /* disk units */ |
| 305 | 307 | AM_RANGE(0xfda00, 0xfdaff) AM_WRITE( sid6581_0_port_w) |
| 306 | 308 | /* db00 coprocessor */ |
| r1136 | r1137 | |
| 881 | 883 | MDRV_PALETTE_INIT( cbm700 ) |
| 882 | 884 | |
| 883 | 885 | MDRV_VIDEO_START( generic ) |
| 884 | | MDRV_VIDEO_UPDATE( cbmb ) |
| 886 | MDRV_VIDEO_UPDATE( crtc6845 ) |
| 885 | 887 | |
| 886 | 888 | /* sound hardware */ |
| 887 | 889 | MDRV_SPEAKER_STANDARD_MONO("mono") |