src/mess/video/pc_t1t.c
| r2043 | r2044 | |
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | | #include "deprecat.h" |
| 13 | 12 | #include "pc_t1t.h" |
| 14 | 13 | #include "pc_cga.h" // cga monitor palette |
| 15 | | #include "pc_aga.h" //europc charset |
| 14 | #include "video/mc6845.h" |
| 16 | 15 | |
| 17 | | #include "includes/crtc6845.h" |
| 18 | 16 | |
| 19 | | |
| 20 | | UINT8 *dirtybuffer; |
| 21 | | |
| 22 | | |
| 23 | 17 | /*************************************************************************** |
| 24 | 18 | |
| 25 | 19 | Static declarations |
| r2043 | r2044 | |
| 28 | 22 | |
| 29 | 23 | static PALETTE_INIT( pcjr ); |
| 30 | 24 | static VIDEO_START( pc_t1t ); |
| 31 | | static pc_video_update_proc pc_t1t_choosevideomode(int *width, int *height, struct mscrtc6845 *crtc); |
| 25 | static VIDEO_UPDATE( mc6845_t1000 ); |
| 26 | static MC6845_UPDATE_ROW( t1000_update_row ); |
| 27 | static MC6845_ON_HSYNC_CHANGED( t1000_hsync_changed ); |
| 28 | static MC6845_ON_VSYNC_CHANGED( t1000_vsync_changed ); |
| 32 | 29 | |
| 33 | | /*************************************************************************** |
| 34 | | |
| 35 | | MachineDriver stuff |
| 36 | | |
| 37 | | **************************************************************************/ |
| 38 | | |
| 39 | | static const unsigned short pcjr_colortable[] = |
| 40 | | { |
| 41 | | 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0,10, 0,11, 0,12, 0,13, 0,14, 0,15, |
| 42 | | 1, 0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 6, 1, 7, 1, 8, 1, 9, 1,10, 1,11, 1,12, 1,13, 1,14, 1,15, |
| 43 | | 2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 8, 2, 9, 2,10, 2,11, 2,12, 2,13, 2,14, 2,15, |
| 44 | | 3, 0, 3, 1, 3, 2, 3, 3, 3, 4, 3, 5, 3, 6, 3, 7, 3, 8, 3, 9, 3,10, 3,11, 3,12, 3,13, 3,14, 3,15, |
| 45 | | 4, 0, 4, 1, 4, 2, 4, 3, 4, 4, 4, 5, 4, 6, 4, 7, 4, 8, 4, 9, 4,10, 4,11, 4,12, 4,13, 4,14, 4,15, |
| 46 | | 5, 0, 5, 1, 5, 2, 5, 3, 5, 4, 5, 5, 5, 6, 5, 7, 5, 8, 5, 9, 5,10, 5,11, 5,12, 5,13, 5,14, 5,15, |
| 47 | | 6, 0, 6, 1, 6, 2, 6, 3, 6, 4, 6, 5, 6, 6, 6, 7, 6, 8, 6, 9, 6,10, 6,11, 6,12, 6,13, 6,14, 6,15, |
| 48 | | 7, 0, 7, 1, 7, 2, 7, 3, 7, 4, 7, 5, 7, 6, 7, 7, 7, 8, 7, 9, 7,10, 7,11, 7,12, 7,13, 7,14, 7,15, |
| 49 | | /* flashing is done by dirtying the videoram buffer positions with attr bit #7 set */ |
| 50 | | 8, 0, 8, 1, 8, 2, 8, 3, 8, 4, 8, 5, 8, 6, 8, 7, 8, 8, 8, 9, 8,10, 8,11, 8,12, 8,13, 8,14, 8,15, |
| 51 | | 9, 0, 9, 1, 9, 2, 9, 3, 9, 4, 9, 5, 9, 6, 9, 7, 9, 8, 9, 9, 9,10, 9,11, 9,12, 9,13, 9,14, 9,15, |
| 52 | | 10, 0,10, 1,10, 2,10, 3,10, 4,10, 5,10, 6,10, 7,10, 8,10, 9,10,10,10,11,10,12,10,13,10,14,10,15, |
| 53 | | 11, 0,11, 1,11, 2,11, 3,11, 4,11, 5,11, 6,11, 7,11, 8,11, 9,11,10,11,11,11,12,11,13,11,14,11,15, |
| 54 | | 12, 0,12, 1,12, 2,12, 3,12, 4,12, 5,12, 6,12, 7,12, 8,12, 9,12,10,12,11,12,12,12,13,12,14,12,15, |
| 55 | | 13, 0,13, 1,13, 2,13, 3,13, 4,13, 5,13, 6,13, 7,13, 8,13, 9,13,10,13,11,13,12,13,13,13,14,13,15, |
| 56 | | 14, 0,14, 1,14, 2,14, 3,14, 4,14, 5,14, 6,14, 7,14, 8,14, 9,14,10,14,11,14,12,14,13,14,14,14,15, |
| 57 | | 15, 0,15, 1,15, 2,15, 3,15, 4,15, 5,15, 6,15, 7,15, 8,15, 9,15,10,15,11,15,12,15,13,15,14,15,15, |
| 58 | | /* the color sets for 1bpp graphics mode */ |
| 59 | | 0,0, 0,1, 0,2, 0,3, 0,4, 0,5, 0,6, 0,7, |
| 60 | | 0,8, 0,9, 0,10, 0,11, 0,12, 0,13, 0,14, 0,15, |
| 61 | | /* the color sets for 2bpp graphics mode */ |
| 62 | | /*0, 2, 4, 6,*/ 0,10,12,14, |
| 63 | | /*0, 3, 5, 7,*/ 0,11,13,15, // only 2 sets!? |
| 64 | | /* color sets for 4bpp graphics mode */ |
| 65 | | 0,1,2,3, 4,5,6,7, 8,9,0xa,0xb, 0xc,0xd,0xe,0xf |
| 30 | static const mc6845_interface mc6845_t1000_intf = { |
| 31 | T1000_SCREEN_NAME, /* screen number */ |
| 32 | XTAL_14_31818MHz/8, /* clock, needs verification */ |
| 33 | 8, /* numbers of pixels per video memory address */ |
| 34 | NULL, /* begin_update */ |
| 35 | t1000_update_row, /* update_row */ |
| 36 | NULL, /* end_update */ |
| 37 | NULL, /* on_de_chaged */ |
| 38 | t1000_hsync_changed, /* on_hsync_changed */ |
| 39 | t1000_vsync_changed /* on_vsync_changed */ |
| 66 | 40 | }; |
| 67 | 41 | |
| 68 | | static const gfx_layout t1t_gfxlayout_4bpp = |
| 69 | | { |
| 70 | | 2,1, /* 8 x 32 graphics */ |
| 71 | | 256, /* 256 codes */ |
| 72 | | 4, /* 4 bit per pixel */ |
| 73 | | { 0,1,2,3 }, /* adjacent bit planes */ |
| 74 | | /* x offsets */ |
| 75 | | { 0,4 }, |
| 76 | | /* y offsets (we only use one byte to build the block) */ |
| 77 | | { 0 }, |
| 78 | | 1*8 /* every code takes 1 byte */ |
| 79 | | }; |
| 80 | | |
| 81 | | static const gfx_layout t1t_charlayout = |
| 82 | | { |
| 83 | | 8,8, /* 8 x 8 characters */ |
| 84 | | 128, /* 128 characters */ |
| 85 | | 1, /* 1 bits per pixel */ |
| 86 | | { 0 }, /* no bitplanes; 1 bit per pixel */ |
| 87 | | /* x offsets */ |
| 88 | | { 0,1,2,3,4,5,6,7 }, |
| 89 | | /* y offsets */ |
| 90 | | { 0*8,1*8,2*8,3*8, |
| 91 | | 4*8,5*8,6*8,7*8 }, |
| 92 | | 8*8 /* every char takes 8 bytes */ |
| 93 | | }; |
| 94 | | |
| 95 | | static GFXDECODE_START( t1000hx ) |
| 96 | | GFXDECODE_ENTRY( REGION_CPU1, 0xffa6e, t1t_charlayout, 0, 128 ) /* single width */ |
| 97 | | GFXDECODE_ENTRY( REGION_CPU1, 0xfc0a8, t1t_charlayout, 0, 128 ) /* single width */ |
| 98 | | GFXDECODE_ENTRY( REGION_GFX1, 0x1000, t1t_gfxlayout_4bpp, 256*2+16*2+2*4, 16 ) /* 160x200 4bpp gfx */ |
| 99 | | GFXDECODE_END |
| 100 | | |
| 101 | | static GFXDECODE_START( t1000sx ) |
| 102 | | GFXDECODE_ENTRY( REGION_CPU1, 0xffa6e, t1t_charlayout, 0, 128 ) /* single width */ |
| 103 | | GFXDECODE_ENTRY( REGION_CPU1, 0xf40a3, t1t_charlayout, 0, 128 ) /* single width */ |
| 104 | | GFXDECODE_ENTRY( REGION_GFX1, 0x1000, t1t_gfxlayout_4bpp, 256*2+16*2+2*4, 16 ) /* 160x200 4bpp gfx */ |
| 105 | | GFXDECODE_END |
| 106 | | |
| 107 | | MACHINE_DRIVER_START( pcvideo_t1000hx ) |
| 108 | | MDRV_SCREEN_ADD("main", RASTER) |
| 42 | MACHINE_DRIVER_START( pcvideo_t1000 ) |
| 43 | MDRV_SCREEN_ADD(T1000_SCREEN_NAME, RASTER) |
| 109 | 44 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 110 | | MDRV_SCREEN_SIZE(80*8, 25*9) |
| 111 | | MDRV_SCREEN_VISIBLE_AREA(0,80*8-1, 0,25*9-1) |
| 112 | | MDRV_GFXDECODE(t1000hx) |
| 113 | | MDRV_PALETTE_LENGTH(sizeof(cga_palette) / sizeof(cga_palette[0])) |
| 45 | MDRV_SCREEN_RAW_PARAMS(XTAL_14_31818MHz,912,0,640,262,0,200) |
| 46 | MDRV_PALETTE_LENGTH( CGA_PALETTE_SETS * 16 ) |
| 114 | 47 | MDRV_PALETTE_INIT(pcjr) |
| 115 | 48 | |
| 49 | MDRV_DEVICE_ADD(T1000_MC6845_NAME, MC6845) |
| 50 | MDRV_DEVICE_CONFIG( mc6845_t1000_intf ) |
| 51 | |
| 116 | 52 | MDRV_VIDEO_START(pc_t1t) |
| 117 | | MDRV_VIDEO_UPDATE(pc_video) |
| 53 | MDRV_VIDEO_UPDATE( mc6845_t1000 ) |
| 118 | 54 | MACHINE_DRIVER_END |
| 119 | 55 | |
| 120 | | MACHINE_DRIVER_START( pcvideo_t1000sx ) |
| 121 | | MDRV_IMPORT_FROM( pcvideo_t1000hx ) |
| 122 | | MDRV_GFXDECODE( t1000sx ) |
| 123 | | MACHINE_DRIVER_END |
| 124 | 56 | |
| 125 | 57 | /*************************************************************************** |
| 126 | 58 | |
| r2043 | r2044 | |
| 132 | 64 | static PALETTE_INIT( pcjr ) |
| 133 | 65 | { |
| 134 | 66 | int i; |
| 135 | | for(i = 0; i < (sizeof(cga_palette) / 3); i++) |
| 67 | for(i = 0; i < CGA_PALETTE_SETS * 16; i++) |
| 136 | 68 | palette_set_color_rgb(machine, i, cga_palette[i][0], cga_palette[i][1], cga_palette[i][2]); |
| 137 | 69 | } |
| 138 | 70 | |
| r2043 | r2044 | |
| 140 | 72 | UINT8 mode_control, color_select; |
| 141 | 73 | UINT8 status; |
| 142 | 74 | |
| 143 | | int full_refresh; |
| 144 | | |
| 145 | 75 | // used in tandy1000hx; used in pcjr??? |
| 146 | 76 | struct { |
| 147 | 77 | UINT8 index; |
| r2043 | r2044 | |
| 158 | 88 | |
| 159 | 89 | UINT8 bank; |
| 160 | 90 | |
| 161 | | int pc_blink; |
| 162 | 91 | int pc_framecnt; |
| 163 | 92 | |
| 164 | 93 | UINT8 *displayram; |
| 94 | |
| 95 | UINT8 *chr_gen; |
| 96 | |
| 97 | mc6845_update_row_func update_row; |
| 98 | UINT8 hsync; |
| 99 | UINT8 vsync; |
| 165 | 100 | } pcjr = { 0 }; |
| 166 | 101 | |
| 167 | | /* crtc address line allow only decoding of 8kbyte memory |
| 168 | | so are in graphics mode 2 or 4 of such banks distinquished |
| 169 | | by line */ |
| 170 | 102 | |
| 171 | | void pc_t1t_reset(void) |
| 103 | static VIDEO_START( pc_t1t ) |
| 172 | 104 | { |
| 173 | | videoram=NULL; |
| 174 | | pcjr.bank=0; |
| 105 | pcjr.chr_gen = memory_region(REGION_GFX1); |
| 106 | pcjr.update_row = NULL; |
| 107 | pcjr.bank = 0x3F; |
| 108 | |
| 109 | videoram = &memory_region(REGION_CPU1)[0x80000 + ((pcjr.bank & 0x07) << 14)]; |
| 110 | videoram_size = 0x20000; |
| 111 | pcjr.displayram = &memory_region(REGION_CPU1)[0x80000 + ((pcjr.bank & 0x38) << (14-3))]; |
| 175 | 112 | } |
| 176 | 113 | |
| 177 | 114 | |
| 178 | | /*************************************************************************** |
| 179 | | Mark all text positions with attribute bit 7 set dirty |
| 180 | | ***************************************************************************/ |
| 181 | | static void pc_t1t_blink_textcolors(int on) |
| 182 | | { |
| 183 | | int i, offs, size; |
| 115 | static VIDEO_UPDATE( mc6845_t1000 ) { |
| 116 | device_config *devconf = (device_config *) device_list_find_by_tag(screen->machine->config->devicelist, MC6845, T1000_MC6845_NAME); |
| 117 | mc6845_update( devconf, bitmap, cliprect); |
| 118 | return 0; |
| 119 | } |
| 184 | 120 | |
| 185 | | if (!videoram) return; |
| 186 | | if (pcjr.pc_blink == on) return; |
| 187 | 121 | |
| 188 | | pcjr.pc_blink = on; |
| 189 | | offs = (mscrtc6845_get_start(mscrtc6845)* 2) % videoram_size; |
| 190 | | size = mscrtc6845_get_char_columns(mscrtc6845) * mscrtc6845_get_char_lines(mscrtc6845); |
| 122 | static MC6845_UPDATE_ROW( t1000_text_inten_update_row ) { |
| 123 | UINT16 *p = BITMAP_ADDR16(bitmap, y, 0); |
| 124 | int i; |
| 191 | 125 | |
| 192 | | if (dirtybuffer) |
| 193 | | { |
| 194 | | for (i = 0; i < size; i++) |
| 195 | | { |
| 196 | | if (videoram[offs+1] & 0x80) |
| 197 | | dirtybuffer[offs+1] = 1; |
| 198 | | if( (offs += 2) == videoram_size ) |
| 199 | | offs = 0; |
| 126 | if ( y == 0 ) logerror("t1000_text_inten_update_row\n"); |
| 127 | for ( i = 0; i < x_count; i++ ) { |
| 128 | UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; |
| 129 | UINT8 chr = pcjr.displayram[ offset ]; |
| 130 | UINT8 attr = pcjr.displayram[ offset +1 ]; |
| 131 | UINT8 data = pcjr.chr_gen[ chr * 16 + ra ]; |
| 132 | UINT16 fg = attr & 0x0F; |
| 133 | UINT16 bg = ( attr >> 4 ) & 0x07; |
| 134 | |
| 135 | if ( i == cursor_x ) { |
| 136 | data = 0xFF; |
| 200 | 137 | } |
| 138 | |
| 139 | *p = ( data & 0x80 ) ? fg : bg; p++; |
| 140 | *p = ( data & 0x40 ) ? fg : bg; p++; |
| 141 | *p = ( data & 0x20 ) ? fg : bg; p++; |
| 142 | *p = ( data & 0x10 ) ? fg : bg; p++; |
| 143 | *p = ( data & 0x08 ) ? fg : bg; p++; |
| 144 | *p = ( data & 0x04 ) ? fg : bg; p++; |
| 145 | *p = ( data & 0x02 ) ? fg : bg; p++; |
| 146 | *p = ( data & 0x01 ) ? fg : bg; p++; |
| 201 | 147 | } |
| 202 | 148 | } |
| 203 | 149 | |
| 204 | | void pc_t1t_timer(void) |
| 205 | | { |
| 206 | | if( ((++pcjr.pc_framecnt & 63) == 63) ) |
| 207 | | { |
| 208 | | pc_t1t_blink_textcolors(pcjr.pc_framecnt&64); |
| 150 | |
| 151 | static MC6845_UPDATE_ROW( t1000_text_blink_update_row ) { |
| 152 | UINT16 *p = BITMAP_ADDR16(bitmap, y, 0); |
| 153 | int i; |
| 154 | |
| 155 | for ( i = 0; i < x_count; i++ ) { |
| 156 | UINT16 offset = ( ( ma + i ) << 1 ) & 0x3fff; |
| 157 | UINT8 chr = pcjr.displayram[ offset ]; |
| 158 | UINT8 attr = pcjr.displayram[ offset +1 ]; |
| 159 | UINT8 data = pcjr.chr_gen[ chr * 16 + ra ]; |
| 160 | UINT16 fg = attr & 0x0F; |
| 161 | UINT16 bg = ( attr >> 4 ) & 0x07; |
| 162 | |
| 163 | if ( i == cursor_x ) { |
| 164 | data = 0xFF; |
| 165 | } else { |
| 166 | if ( ( attr & 0x80 ) && ( pcjr.pc_framecnt & 0x10 ) ) { |
| 167 | data = 0x00; |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | *p = ( data & 0x80 ) ? fg : bg; p++; |
| 172 | *p = ( data & 0x40 ) ? fg : bg; p++; |
| 173 | *p = ( data & 0x20 ) ? fg : bg; p++; |
| 174 | *p = ( data & 0x10 ) ? fg : bg; p++; |
| 175 | *p = ( data & 0x08 ) ? fg : bg; p++; |
| 176 | *p = ( data & 0x04 ) ? fg : bg; p++; |
| 177 | *p = ( data & 0x02 ) ? fg : bg; p++; |
| 178 | *p = ( data & 0x01 ) ? fg : bg; p++; |
| 209 | 179 | } |
| 210 | 180 | } |
| 211 | 181 | |
| 212 | | static void pc_t1t_cursor(struct mscrtc6845_cursor *cursor) |
| 213 | | { |
| 214 | | if (dirtybuffer) |
| 215 | | dirtybuffer[cursor->pos*2] = 1; |
| 182 | |
| 183 | static MC6845_UPDATE_ROW( t1000_gfx_4bpp_update_row ) { |
| 184 | UINT16 *p = BITMAP_ADDR16(bitmap, y, 0); |
| 185 | UINT8 *vid = pcjr.displayram + ( ra << 13 ); |
| 186 | int i; |
| 187 | |
| 188 | for ( i = 0; i < x_count; i++ ) { |
| 189 | UINT16 offset = ( ( ma + i ) << 1 ) & 0x1fff; |
| 190 | UINT8 data = vid[ offset ]; |
| 191 | |
| 192 | *p = pcjr.reg.data[0x10 + ( data >> 4 )]; p++; |
| 193 | *p = pcjr.reg.data[0x10 + ( data >> 4 )]; p++; |
| 194 | *p = pcjr.reg.data[0x10 + ( data & 0x0F )]; p++; |
| 195 | *p = pcjr.reg.data[0x10 + ( data & 0x0F )]; p++; |
| 196 | |
| 197 | data = vid[ offset + 1 ]; |
| 198 | |
| 199 | *p = pcjr.reg.data[0x10 + ( data >> 4 )]; p++; |
| 200 | *p = pcjr.reg.data[0x10 + ( data >> 4 )]; p++; |
| 201 | *p = pcjr.reg.data[0x10 + ( data & 0x0F )]; p++; |
| 202 | *p = pcjr.reg.data[0x10 + ( data & 0x0F )]; p++; |
| 203 | } |
| 216 | 204 | } |
| 217 | 205 | |
| 218 | | static const struct mscrtc6845_config config= { 14318180 /*?*/, pc_t1t_cursor }; |
| 219 | 206 | |
| 207 | static MC6845_UPDATE_ROW( t1000_gfx_2bpp_update_row ) { |
| 208 | UINT16 *p = BITMAP_ADDR16(bitmap, y, 0); |
| 209 | UINT8 *vid = pcjr.displayram + ( ra << 13 ); |
| 210 | int i; |
| 220 | 211 | |
| 221 | | static VIDEO_START( pc_t1t ) |
| 222 | | { |
| 223 | | dirtybuffer = auto_malloc(videoram_size); |
| 224 | | pc_video_start(&config, pc_t1t_choosevideomode, 0x8000); |
| 212 | if ( y == 0 ) logerror("t1000_gfx_2bpp_update_row\n"); |
| 213 | for ( i = 0; i < x_count; i++ ) { |
| 214 | UINT16 offset = ( ( ma + i ) << 1 ) & 0x1fff; |
| 215 | UINT8 data = vid[ offset ]; |
| 216 | |
| 217 | *p = pcjr.reg.data[ 0x10 + ( ( data >> 6 ) & 0x03 ) ]; p++; |
| 218 | *p = pcjr.reg.data[ 0x10 + ( ( data >> 4 ) & 0x03 ) ]; p++; |
| 219 | *p = pcjr.reg.data[ 0x10 + ( ( data >> 2 ) & 0x03 ) ]; p++; |
| 220 | *p = pcjr.reg.data[ 0x10 + ( data & 0x03 ) ]; p++; |
| 221 | |
| 222 | data = vid[ offset+1 ]; |
| 223 | |
| 224 | *p = pcjr.reg.data[ 0x10 + ( ( data >> 6 ) & 0x03 ) ]; p++; |
| 225 | *p = pcjr.reg.data[ 0x10 + ( ( data >> 4 ) & 0x03 ) ]; p++; |
| 226 | *p = pcjr.reg.data[ 0x10 + ( ( data >> 2 ) & 0x03 ) ]; p++; |
| 227 | *p = pcjr.reg.data[ 0x10 + ( data & 0x03 ) ]; p++; |
| 228 | } |
| 225 | 229 | } |
| 226 | 230 | |
| 231 | |
| 232 | static MC6845_UPDATE_ROW( t1000_gfx_1bpp_update_row ) { |
| 233 | UINT16 *p = BITMAP_ADDR16(bitmap, y, 0); |
| 234 | UINT8 *vid = pcjr.displayram + ( ra << 13 ); |
| 235 | UINT8 fg = pcjr.reg.data[0x11]; |
| 236 | UINT8 bg = pcjr.reg.data[0x10]; |
| 237 | int i; |
| 238 | |
| 239 | if ( y == 0 ) logerror("t1000_gfx_1bpp_update_row\n"); |
| 240 | for ( i = 0; i < x_count; i++ ) { |
| 241 | UINT16 offset = ( ( ma + i ) << 1 ) & 0x1fff; |
| 242 | UINT8 data = vid[ offset ]; |
| 243 | |
| 244 | *p = ( data & 0x80 ) ? fg : bg; p++; |
| 245 | *p = ( data & 0x40 ) ? fg : bg; p++; |
| 246 | *p = ( data & 0x20 ) ? fg : bg; p++; |
| 247 | *p = ( data & 0x10 ) ? fg : bg; p++; |
| 248 | *p = ( data & 0x08 ) ? fg : bg; p++; |
| 249 | *p = ( data & 0x04 ) ? fg : bg; p++; |
| 250 | *p = ( data & 0x02 ) ? fg : bg; p++; |
| 251 | *p = ( data & 0x01 ) ? fg : bg; p++; |
| 252 | |
| 253 | data = vid[ offset + 1 ]; |
| 254 | |
| 255 | *p = ( data & 0x80 ) ? fg : bg; p++; |
| 256 | *p = ( data & 0x80 ) ? fg : bg; p++; |
| 257 | *p = ( data & 0x80 ) ? fg : bg; p++; |
| 258 | *p = ( data & 0x80 ) ? fg : bg; p++; |
| 259 | *p = ( data & 0x80 ) ? fg : bg; p++; |
| 260 | *p = ( data & 0x80 ) ? fg : bg; p++; |
| 261 | *p = ( data & 0x80 ) ? fg : bg; p++; |
| 262 | *p = ( data & 0x80 ) ? fg : bg; p++; |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | static MC6845_UPDATE_ROW( t1000_update_row ) { |
| 267 | if ( pcjr.update_row ) { |
| 268 | pcjr.update_row( device, bitmap, cliprect, ma, ra, y, x_count, cursor_x, param ); |
| 269 | } |
| 270 | } |
| 271 | |
| 227 | 272 | READ8_HANDLER ( pc_t1t_videoram_r ) |
| 228 | 273 | { |
| 229 | 274 | int data = 0xff; |
| r2043 | r2044 | |
| 232 | 277 | return data; |
| 233 | 278 | } |
| 234 | 279 | |
| 280 | |
| 281 | static void pc_t1t_mode_switch( void ) { |
| 282 | switch( pcjr.mode_control & 0x3B ) { |
| 283 | case 0x08: case 0x09: |
| 284 | pcjr.update_row = t1000_text_inten_update_row; |
| 285 | break; |
| 286 | case 0x28: case 0x29: |
| 287 | pcjr.update_row = t1000_text_blink_update_row; |
| 288 | break; |
| 289 | case 0x0A: case 0x0B: case 0x2A: case 0x2B: |
| 290 | switch( pcjr.bank & 0xc0 ) { |
| 291 | case 0x00: |
| 292 | case 0x40: |
| 293 | //logerror("t1t_gfx_2bpp\n"); |
| 294 | pcjr.update_row = t1000_gfx_2bpp_update_row; |
| 295 | break; |
| 296 | case 0x80: |
| 297 | case 0xc0: |
| 298 | //logerror("t1t_gfx_4bpp\n"); |
| 299 | pcjr.update_row = t1000_gfx_4bpp_update_row; |
| 300 | break; |
| 301 | } |
| 302 | break; |
| 303 | case 0x18: case 0x19: case 0x1A: case 0x1B: |
| 304 | case 0x38: case 0x39: case 0x3A: case 0x3B: |
| 305 | switch( pcjr.bank & 0xc0 ) { |
| 306 | case 0x00: |
| 307 | case 0x40: |
| 308 | //logerror("t1t_gfx_1bpp\n"); |
| 309 | pcjr.update_row = t1000_gfx_1bpp_update_row; |
| 310 | break; |
| 311 | case 0x80: |
| 312 | case 0xc0: |
| 313 | //logerror("t1t_gfx_2bpp\n"); |
| 314 | pcjr.update_row = t1000_gfx_2bpp_update_row; |
| 315 | break; |
| 316 | } |
| 317 | break; |
| 318 | default: |
| 319 | pcjr.update_row = NULL; |
| 320 | break; |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | |
| 235 | 325 | /* |
| 236 | 326 | * 3d8 rW T1T mode control register (see #P138) |
| 237 | 327 | */ |
| 238 | 328 | static void pc_t1t_mode_control_w(int data) |
| 239 | 329 | { |
| 240 | | if( (pcjr.mode_control ^ data) & 0x3b ) /* text/gfx/width change */ |
| 241 | | pcjr.full_refresh=1; |
| 242 | 330 | pcjr.mode_control = data; |
| 331 | |
| 332 | pc_t1t_mode_switch(); |
| 243 | 333 | } |
| 244 | 334 | |
| 245 | 335 | static int pc_t1t_mode_control_r(void) |
| r2043 | r2044 | |
| 256 | 346 | if (pcjr.color_select == data) |
| 257 | 347 | return; |
| 258 | 348 | pcjr.color_select = data; |
| 259 | | pcjr.full_refresh=1; |
| 260 | 349 | } |
| 261 | 350 | |
| 262 | 351 | static int pc_t1t_color_select_r(void) |
| r2043 | r2044 | |
| 282 | 371 | */ |
| 283 | 372 | static int pc_t1t_status_r(void) |
| 284 | 373 | { |
| 285 | | int data = (readinputport(0) & 0x08) | pcjr.status; |
| 286 | | pcjr.status ^= 0x01; |
| 374 | int data = pcjr.vsync | pcjr.status | pcjr.hsync; |
| 287 | 375 | return data; |
| 288 | 376 | } |
| 289 | 377 | |
| r2043 | r2044 | |
| 326 | 414 | case 0x14: case 0x15: case 0x16: case 0x17: |
| 327 | 415 | case 0x18: case 0x19: case 0x1a: case 0x1b: |
| 328 | 416 | case 0x1c: case 0x1d: case 0x1e: case 0x1f: |
| 329 | | palette_set_color_rgb(Machine, pcjr.reg.index-0x10, |
| 330 | | cga_palette[data&0xf][0], |
| 331 | | cga_palette[data&0xf][1], |
| 332 | | cga_palette[data&0xf][2]); |
| 417 | pcjr.reg.data[pcjr.reg.index] = data & 0x0F; |
| 333 | 418 | break; |
| 334 | 419 | } |
| 335 | 420 | } |
| r2043 | r2044 | |
| 392 | 477 | #endif |
| 393 | 478 | videoram = &memory_region(REGION_CPU1)[vram]; |
| 394 | 479 | pcjr.displayram = &memory_region(REGION_CPU1)[dram]; |
| 395 | | if (dirtybuffer) |
| 396 | | memset(dirtybuffer, 1, videoram_size); |
| 397 | 480 | } |
| 481 | pc_t1t_mode_switch(); |
| 398 | 482 | } |
| 399 | 483 | |
| 400 | 484 | static int pc_t1t_bank_r(void) |
| r2043 | r2044 | |
| 411 | 495 | |
| 412 | 496 | WRITE8_HANDLER ( pc_T1T_w ) |
| 413 | 497 | { |
| 498 | device_config *devconf; |
| 499 | |
| 414 | 500 | switch( offset ) |
| 415 | 501 | { |
| 416 | 502 | case 0: case 2: case 4: case 6: |
| 417 | | mscrtc6845_port_w(mscrtc6845,0,data); |
| 503 | devconf = (device_config *) device_list_find_by_tag(machine->config->devicelist, MC6845, T1000_MC6845_NAME); |
| 504 | mc6845_address_w( devconf, offset, data ); |
| 418 | 505 | break; |
| 419 | 506 | case 1: case 3: case 5: case 7: |
| 420 | | mscrtc6845_port_w(mscrtc6845,1,data); |
| 507 | devconf = (device_config *) device_list_find_by_tag(machine->config->devicelist, MC6845, T1000_MC6845_NAME); |
| 508 | mc6845_register_w( devconf, offset, data ); |
| 421 | 509 | break; |
| 422 | 510 | case 8: |
| 423 | 511 | pc_t1t_mode_control_w(data); |
| r2043 | r2044 | |
| 446 | 534 | |
| 447 | 535 | READ8_HANDLER ( pc_T1T_r ) |
| 448 | 536 | { |
| 449 | | int data = 0xff; |
| 537 | device_config *devconf; |
| 538 | int data = 0xff; |
| 539 | |
| 450 | 540 | switch( offset ) |
| 451 | 541 | { |
| 452 | 542 | case 0: case 2: case 4: case 6: |
| 453 | | data = mscrtc6845_port_r(mscrtc6845,0); |
| 543 | /* return last written mc6845 address value here? */ |
| 454 | 544 | break; |
| 455 | 545 | |
| 456 | 546 | case 1: case 3: case 5: case 7: |
| 457 | | data = mscrtc6845_port_r(mscrtc6845,1); |
| 547 | devconf = (device_config *) device_list_find_by_tag(machine->config->devicelist, MC6845, T1000_MC6845_NAME); |
| 548 | data = mc6845_register_r( devconf, offset ); |
| 458 | 549 | break; |
| 459 | 550 | |
| 460 | 551 | case 8: |
| r2043 | r2044 | |
| 488 | 579 | return data; |
| 489 | 580 | } |
| 490 | 581 | |
| 491 | | /*************************************************************************** |
| 492 | | Plot single text character |
| 493 | | ***************************************************************************/ |
| 494 | 582 | |
| 495 | | static void t1t_plot_char(bitmap_t *bitmap, const rectangle *r, UINT8 ch, UINT8 attr) |
| 496 | | { |
| 497 | | int width; |
| 498 | | int height; |
| 499 | | int bgcolor; |
| 500 | | gfx_element *gfx; |
| 501 | | |
| 502 | | gfx = Machine->gfx[ch & 0x80 ? 1 : 0]; |
| 503 | | drawgfx(bitmap, gfx, ch & 0x7f, attr, |
| 504 | | 0, 0, r->min_x, r->min_y, r, TRANSPARENCY_NONE, 0); |
| 505 | | |
| 506 | | height = r->max_y - r->min_y + 1; |
| 507 | | width = r->max_x - r->min_x + 1; |
| 508 | | |
| 509 | | if (height > 8) |
| 510 | | { |
| 511 | | bgcolor = gfx->color_base + gfx->color_granularity * (attr % gfx->total_colors); |
| 512 | | plot_box(bitmap, r->min_x, r->min_y + 8, width, height - 8, bgcolor); |
| 513 | | } |
| 583 | static MC6845_ON_HSYNC_CHANGED( t1000_hsync_changed ) { |
| 584 | pcjr.hsync = hsync ? 0 : 1; |
| 514 | 585 | } |
| 515 | 586 | |
| 516 | 587 | |
| 517 | | |
| 518 | | /*************************************************************************** |
| 519 | | Draw text mode with 40x25 characters (default) with high intensity bg. |
| 520 | | ***************************************************************************/ |
| 521 | | |
| 522 | | static void t1t_text_inten(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 523 | | { |
| 524 | | int sx, sy; |
| 525 | | int offs = mscrtc6845_get_start(crtc)*2; |
| 526 | | int lines = mscrtc6845_get_char_lines(crtc); |
| 527 | | int height = mscrtc6845_get_char_height(crtc); |
| 528 | | int columns = mscrtc6845_get_char_columns(crtc); |
| 529 | | rectangle r; |
| 530 | | struct mscrtc6845_cursor cursor; |
| 531 | | |
| 532 | | mscrtc6845_time(crtc); |
| 533 | | mscrtc6845_get_cursor(crtc, &cursor); |
| 534 | | |
| 535 | | for (sy=0, r.min_y=0, r.max_y=height-1; sy<lines; sy++, r.min_y+=height,r.max_y+=height) { |
| 536 | | |
| 537 | | for (sx=0, r.min_x=0, r.max_x=7; sx<columns; |
| 538 | | sx++, offs=(offs+2)&0x3fff, r.min_x+=8, r.max_x+=8) |
| 539 | | { |
| 540 | | if (!dirtybuffer || dirtybuffer[offs] || dirtybuffer[offs+1]) |
| 541 | | { |
| 542 | | UINT8 ch = pcjr.displayram[offs]; |
| 543 | | UINT8 attr = pcjr.displayram[offs + 1]; |
| 544 | | |
| 545 | | t1t_plot_char(bitmap, &r, ch, attr); |
| 546 | | |
| 547 | | if (cursor.on && (pcjr.pc_framecnt & 32) && (offs == cursor.pos * 2)) |
| 548 | | { |
| 549 | | int k = height - cursor.top; |
| 550 | | rectangle rect2 = r; |
| 551 | | rect2.min_y += cursor.top; |
| 552 | | if (cursor.bottom<height) |
| 553 | | k=cursor.bottom-cursor.top+1; |
| 554 | | |
| 555 | | if (k>0) |
| 556 | | plot_box(bitmap, r.min_x, |
| 557 | | r.min_y+cursor.top, |
| 558 | | 8, k, Machine->pens[7]); |
| 559 | | } |
| 560 | | |
| 561 | | if (dirtybuffer) |
| 562 | | dirtybuffer[offs] = dirtybuffer[offs + 1] = 0; |
| 563 | | } |
| 564 | | } |
| 588 | static MC6845_ON_VSYNC_CHANGED( t1000_vsync_changed ) { |
| 589 | pcjr.vsync = vsync ? 8 : 0; |
| 590 | if ( vsync ) { |
| 591 | pcjr.pc_framecnt++; |
| 565 | 592 | } |
| 566 | 593 | } |
| 567 | 594 | |
| 568 | | |
| 569 | | |
| 570 | | /*************************************************************************** |
| 571 | | Draw text mode with 40x25 characters (default) and blinking colors. |
| 572 | | ***************************************************************************/ |
| 573 | | |
| 574 | | static void t1t_text_blink(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 575 | | { |
| 576 | | int sx, sy; |
| 577 | | int offs = mscrtc6845_get_start(crtc)*2; |
| 578 | | int lines = mscrtc6845_get_char_lines(crtc); |
| 579 | | int height = mscrtc6845_get_char_height(crtc); |
| 580 | | int columns = mscrtc6845_get_char_columns(crtc); |
| 581 | | rectangle r; |
| 582 | | struct mscrtc6845_cursor cursor; |
| 583 | | |
| 584 | | mscrtc6845_time(crtc); |
| 585 | | mscrtc6845_get_cursor(crtc, &cursor); |
| 586 | | |
| 587 | | for (sy=0, r.min_y=0, r.max_y=height-1; sy<lines; sy++, r.min_y+=height,r.max_y+=height) |
| 588 | | { |
| 589 | | for (sx=0, r.min_x=0, r.max_x=7; sx<columns; |
| 590 | | sx++, offs=(offs+2)&0x3fff, r.min_x+=8, r.max_x+=8) |
| 591 | | { |
| 592 | | if (!dirtybuffer || dirtybuffer[offs] || dirtybuffer[offs+1]) |
| 593 | | { |
| 594 | | UINT8 ch = pcjr.displayram[offs + 0]; |
| 595 | | UINT8 attr = pcjr.displayram[offs + 1]; |
| 596 | | |
| 597 | | if (attr & 0x80) /* blinking ? */ |
| 598 | | { |
| 599 | | if (pcjr.pc_blink) |
| 600 | | attr = (attr & 0x70) | ((attr & 0x70) >> 4); |
| 601 | | else |
| 602 | | attr = attr & 0x7f; |
| 603 | | } |
| 604 | | |
| 605 | | t1t_plot_char(bitmap, &r, ch, attr); |
| 606 | | |
| 607 | | if (cursor.on&& (pcjr.pc_framecnt & 32) && (offs == cursor.pos * 2)) |
| 608 | | { |
| 609 | | int k = height-cursor.top; |
| 610 | | rectangle rect2 = r; |
| 611 | | rect2.min_y += cursor.top; |
| 612 | | |
| 613 | | if (cursor.bottom < height) |
| 614 | | k = cursor.bottom - cursor.top + 1; |
| 615 | | |
| 616 | | if (k>0) |
| 617 | | plot_box(bitmap, r.min_x, |
| 618 | | r.min_y+cursor.top, |
| 619 | | 8, k, Machine->pens[7]); |
| 620 | | } |
| 621 | | |
| 622 | | if (dirtybuffer) |
| 623 | | dirtybuffer[offs] = dirtybuffer[offs + 1] = 0; |
| 624 | | } |
| 625 | | } |
| 626 | | } |
| 627 | | } |
| 628 | | |
| 629 | | |
| 630 | | |
| 631 | | /*************************************************************************** |
| 632 | | Draw graphics mode with 320x200 pixels (default) with 2 bits/pixel. |
| 633 | | The cell size is 2x1 (double width pixels, 1 scanline is the real |
| 634 | | default but up to 32 are possible). |
| 635 | | Even scanlines are from T1T_base + 0x0000, odd from T1T_base + 0x2000 |
| 636 | | ***************************************************************************/ |
| 637 | | |
| 638 | | static void t1t_gfx_2bpp(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 639 | | { |
| 640 | | static const UINT16 palette[] = |
| 641 | | { |
| 642 | | 0, 10, 12, 14, |
| 643 | | 0, 11, 13, 15 |
| 644 | | }; |
| 645 | | |
| 646 | | pc_render_gfx_2bpp(bitmap, crtc, pcjr.displayram, &palette[pcjr.color_select ? 4 : 0], 2); |
| 647 | | } |
| 648 | | |
| 649 | | |
| 650 | | |
| 651 | | /*************************************************************************** |
| 652 | | Draw graphics mode with 640x200 pixels (default). |
| 653 | | The cell size is 1x1 (1 scanline is the real default) |
| 654 | | Even scanlines are from T1T_base + 0x0000, odd from T1T_base + 0x2000 |
| 655 | | ***************************************************************************/ |
| 656 | | static void t1t_gfx_1bpp(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 657 | | { |
| 658 | | int i, sx, sy, sh; |
| 659 | | int offs = mscrtc6845_get_start(crtc)*2; |
| 660 | | int lines = mscrtc6845_get_char_lines(crtc); |
| 661 | | int height = mscrtc6845_get_char_height(crtc); |
| 662 | | int columns = mscrtc6845_get_char_columns(crtc)*2; |
| 663 | | |
| 664 | | for (sy=0; sy<lines; sy++,offs=(offs+columns)&0x1fff) { |
| 665 | | |
| 666 | | for (sh=0; sh<height; sh++, offs|=0x2000) { // char line 0 used as a12 line in graphic mode |
| 667 | | if (!(sh&1)) { // char line 0 used as a12 line in graphic mode |
| 668 | | for (i=offs, sx=0; sx<columns; sx++, i=(i+1)&0x1fff) { |
| 669 | | if (dirtybuffer[i]) { |
| 670 | | drawgfx(bitmap, Machine->gfx[2], pcjr.displayram[i], pcjr.color_select&0xf, 0,0,sx*8,sy*height+sh, |
| 671 | | 0,TRANSPARENCY_NONE,0); |
| 672 | | dirtybuffer[i]=0; |
| 673 | | } |
| 674 | | } |
| 675 | | } else { |
| 676 | | for (i=offs|0x2000, sx=0; sx<columns; sx++, i=((i+1)&0x1fff)|0x2000) { |
| 677 | | if (dirtybuffer[i]) { |
| 678 | | drawgfx(bitmap, Machine->gfx[2], pcjr.displayram[i], pcjr.color_select&0xf, 0,0,sx*8,sy*height+sh, |
| 679 | | 0,TRANSPARENCY_NONE,0); |
| 680 | | dirtybuffer[i]=0; |
| 681 | | } |
| 682 | | } |
| 683 | | } |
| 684 | | } |
| 685 | | } |
| 686 | | } |
| 687 | | |
| 688 | | |
| 689 | | |
| 690 | | /*************************************************************************** |
| 691 | | Draw graphics mode with 160x200 pixels (default) and 4 bits/pixel. |
| 692 | | The cell size is 4x1 (quadruple width pixels, 1 scanline is the real |
| 693 | | default but up to 32 are possible). |
| 694 | | Scanlines (scanline % 4) are from CGA_base + 0x0000, |
| 695 | | CGA_base + 0x2000 |
| 696 | | ***************************************************************************/ |
| 697 | | |
| 698 | | static void t1t_gfx_4bpp(bitmap_t *bitmap, struct mscrtc6845 *crtc) |
| 699 | | { |
| 700 | | pc_render_gfx_4bpp(bitmap, crtc, pcjr.displayram, NULL, 4); |
| 701 | | } |
| 702 | | |
| 703 | | |
| 704 | | |
| 705 | | /*************************************************************************** |
| 706 | | Choose the appropriate video mode |
| 707 | | ***************************************************************************/ |
| 708 | | |
| 709 | | static pc_video_update_proc pc_t1t_choosevideomode(int *width, int *height, struct mscrtc6845 *crtc) |
| 710 | | { |
| 711 | | int xfactor = 8; |
| 712 | | int yfactor = 1; |
| 713 | | pc_video_update_proc proc = NULL; |
| 714 | | |
| 715 | | switch( pcjr.mode_control & 0x3b ) { |
| 716 | | case 0x08: |
| 717 | | case 0x09: |
| 718 | | proc = t1t_text_inten; |
| 719 | | break; |
| 720 | | |
| 721 | | case 0x28: |
| 722 | | case 0x29: |
| 723 | | proc = t1t_text_blink; |
| 724 | | break; |
| 725 | | |
| 726 | | case 0x0a: case 0x0b: case 0x2a: case 0x2b: |
| 727 | | switch (pcjr.bank & 0xc0) { |
| 728 | | case 0x00: /* hmm.. text in graphics? */ |
| 729 | | case 0x40: |
| 730 | | proc = t1t_gfx_2bpp; |
| 731 | | break; |
| 732 | | |
| 733 | | case 0x80: |
| 734 | | proc = t1t_gfx_4bpp; |
| 735 | | xfactor = 4; |
| 736 | | break; |
| 737 | | |
| 738 | | case 0xc0: |
| 739 | | proc = t1t_gfx_4bpp; |
| 740 | | xfactor = 4; |
| 741 | | break; |
| 742 | | } |
| 743 | | break; |
| 744 | | |
| 745 | | case 0x18: case 0x19: case 0x1a: case 0x1b: |
| 746 | | case 0x38: case 0x39: case 0x3a: case 0x3b: |
| 747 | | switch (pcjr.bank & 0xc0) { |
| 748 | | case 0x00: /* hmm.. text in graphics? */ |
| 749 | | case 0x40: |
| 750 | | proc = t1t_gfx_1bpp; |
| 751 | | xfactor = 16; |
| 752 | | break; |
| 753 | | |
| 754 | | case 0x80: |
| 755 | | case 0xc0: |
| 756 | | proc = t1t_gfx_2bpp; |
| 757 | | break; |
| 758 | | } |
| 759 | | break; |
| 760 | | } |
| 761 | | |
| 762 | | *width *= xfactor; |
| 763 | | *height *= yfactor; |
| 764 | | return proc; |
| 765 | | } |
src/mess/drivers/pc.c
| r2043 | r2044 | |
| 15 | 15 | F0000-FDFFF NOP or ROM Basic + other Extensions |
| 16 | 16 | FE000-FFFFF ROM |
| 17 | 17 | |
| 18 | |
| 19 | Tandy 1000 (8086/8088) variations: |
| 20 | 1000 128KB-640KB RAM 4.77 MHz v01.00.00, v01.01.00 |
| 21 | 1000A/1000HD 128KB-640KB RAM 4.77 MHz v01.01.00 |
| 22 | 1000SX/1000AX 384KB-640KB RAM 7.16/4.77 MHz v01.02.00 |
| 23 | 1000EX 256KB-640KB RAM 7.16/4.77 MHz v01.02.00 |
| 24 | 1000HX 256KB-640KB RAM 7.16/4.77 MHz v02.00.00 |
| 25 | 1000SL/1000PC 384KB-640KB RAM 8.0/4.77 MHz v01.04.00, v01.04.01, v01.04.02, v02.00.01 |
| 26 | 1000SL/2 512KB-640KB RAM 8.0/4.77 MHz v01.04.04 |
| 27 | 1000RL/1000RL-HD 512KB-768KB RAM 9.44/4.77 MHz v02.00.00, v02.00.01 |
| 28 | |
| 29 | Tandy 1000 (80286) variations: |
| 30 | 1000TX 640KB-768KB RAM 8.0/4.77 MHz v01.03.00 |
| 31 | 1000TL 640KB-768KB RAM 8.0/4.77 MHz v01.04.00, v01.04.01, v01.04.02 |
| 32 | 1000TL/2 640KB-768KB RAM 8.0/4.77 MHz v02.00.00 |
| 33 | 1000TL/3 640KB-768KB RAM 10.0/5.0 MHz v02.00.00 |
| 34 | 1000RLX 512KB-1024KB RAM 10.0/5.0 MHz v02.00.00 |
| 35 | 1000RLX-HD 1024MB RAM 10.0/5.0 MHz v02.00.00 |
| 36 | |
| 37 | Tandy 1000 (80386) variations: |
| 38 | 1000RSX/1000RSX-HD 1M-9M RAM 25.0/8.0 MHz v01.10.00 |
| 39 | |
| 18 | 40 | ***************************************************************************/ |
| 19 | 41 | |
| 20 | 42 | |
| r2043 | r2044 | |
| 236 | 258 | AM_RANGE(0x00000, 0x9ffff) AM_RAMBANK(10) |
| 237 | 259 | AM_RANGE(0xa0000, 0xaffff) AM_RAM |
| 238 | 260 | AM_RANGE(0xb0000, 0xb7fff) AM_NOP |
| 239 | | AM_RANGE(0xb8000, 0xbffff) AM_READWRITE(pc_t1t_videoram_r, pc_video_videoram_w) AM_SIZE(&videoram_size) |
| 261 | AM_RANGE(0xb8000, 0xbffff) AM_READWRITE(pc_t1t_videoram_r, pc_video_videoram_w) |
| 240 | 262 | AM_RANGE(0xc0000, 0xc7fff) AM_NOP |
| 241 | 263 | AM_RANGE(0xc8000, 0xc9fff) AM_ROM |
| 242 | 264 | AM_RANGE(0xca000, 0xcffff) AM_NOP |
| r2043 | r2044 | |
| 1402 | 1424 | MDRV_MACHINE_RESET(pc_t1t) |
| 1403 | 1425 | |
| 1404 | 1426 | /* video hardware */ |
| 1405 | | MDRV_IMPORT_FROM( pcvideo_t1000hx ) |
| 1406 | | MDRV_SCREEN_MODIFY("main") |
| 1407 | | MDRV_SCREEN_REFRESH_RATE(60) |
| 1408 | | MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 1427 | MDRV_IMPORT_FROM( pcvideo_t1000 ) |
| 1409 | 1428 | |
| 1410 | 1429 | /* sound hardware */ |
| 1411 | 1430 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| r2043 | r2044 | |
| 1418 | 1437 | MDRV_NVRAM_HANDLER( tandy1000 ) |
| 1419 | 1438 | MACHINE_DRIVER_END |
| 1420 | 1439 | |
| 1421 | | static MACHINE_DRIVER_START( t1000sx ) |
| 1422 | | MDRV_IMPORT_FROM( t1000hx ) |
| 1423 | | MDRV_IMPORT_FROM( pcvideo_t1000sx ) |
| 1424 | | MACHINE_DRIVER_END |
| 1425 | 1440 | |
| 1426 | 1441 | #if 0 |
| 1427 | 1442 | //pcjr roms? (incomplete dump, most likely 64 kbyte) |
| r2043 | r2044 | |
| 1552 | 1567 | ROM_LOAD("cga.chr", 0x00000, 0x01000, CRC(42009069) SHA1(ed08559ce2d7f97f68b9f540bddad5b6295294dd)) |
| 1553 | 1568 | ROM_END |
| 1554 | 1569 | |
| 1570 | ROM_START( t1000 ) |
| 1571 | ROM_REGION(0x100000,REGION_CPU1, 0) |
| 1572 | ROM_LOAD("wdbios.rom", 0xc8000, 0x02000, CRC(8e9e2bd4) SHA1(601d7ceab282394ebab50763c267e915a6a2166a)) // not sure about this one |
| 1573 | // partlist says it has 1 128kbyte rom |
| 1574 | ROM_LOAD("t1000hx.e0", 0xe0000, 0x10000, CRC(61dbf242) SHA1(555b58d8aa8e0b0839259621c44b832d993beaef)) // not sure about this one |
| 1575 | ROM_SYSTEM_BIOS( 0, "v010000", "v010000" ) |
| 1576 | ROMX_LOAD("v010000.f0", 0xf0000, 0x10000, NO_DUMP, ROM_BIOS(1)) |
| 1577 | ROM_SYSTEM_BIOS( 1, "v010100", "v010100" ) |
| 1578 | ROMX_LOAD("v010100.f0", 0xf0000, 0x10000, CRC(b6760881) SHA1(8275e4c48ac09cf36685db227434ca438aebe0b9), ROM_BIOS(2)) |
| 1579 | ROM_REGION(0x08000,REGION_GFX1, 0) |
| 1580 | // expects 8x9 charset! |
| 1581 | ROM_LOAD("50146", 0x00000, 0x02000, BAD_DUMP CRC(1305dcf5) SHA1(aca488a16ae4ff05a1f4d14574379ff49cd48343)) //taken from europc, 9th blank |
| 1582 | ROM_END |
| 1583 | |
| 1584 | ROM_START( t1000a ) |
| 1585 | ROM_REGION(0x100000,REGION_CPU1, 0) |
| 1586 | ROM_LOAD("wdbios.rom", 0xc8000, 0x02000, CRC(8e9e2bd4) SHA1(601d7ceab282394ebab50763c267e915a6a2166a)) // not sure about this one |
| 1587 | // partlist says it has 1 128kbyte rom |
| 1588 | ROM_LOAD("t1000hx.e0", 0xe0000, 0x10000, CRC(61dbf242) SHA1(555b58d8aa8e0b0839259621c44b832d993beaef)) // not sure about this one |
| 1589 | ROM_LOAD("v010100.f0", 0xf0000, 0x10000, CRC(b6760881) SHA1(8275e4c48ac09cf36685db227434ca438aebe0b9)) |
| 1590 | ROM_REGION(0x08000,REGION_GFX1, 0) |
| 1591 | // expects 8x9 charset! |
| 1592 | ROM_LOAD("50146", 0x00000, 0x02000, BAD_DUMP CRC(1305dcf5) SHA1(aca488a16ae4ff05a1f4d14574379ff49cd48343)) //taken from europc, 9th blank |
| 1593 | ROM_END |
| 1594 | |
| 1595 | ROM_START( t1000ex ) |
| 1596 | ROM_REGION(0x100000,REGION_CPU1, 0) |
| 1597 | ROM_LOAD("wdbios.rom", 0xc8000, 0x02000, CRC(8e9e2bd4) SHA1(601d7ceab282394ebab50763c267e915a6a2166a)) // not sure about this one |
| 1598 | // partlist says it has 1 128kbyte rom |
| 1599 | ROM_LOAD("t1000hx.e0", 0xe0000, 0x10000, CRC(61dbf242) SHA1(555b58d8aa8e0b0839259621c44b832d993beaef)) // not sure about this one |
| 1600 | ROM_LOAD("v010200.f0", 0xf0000, 0x10000, CRC(0e016ecf) SHA1(2f5ac8921b7cba56b02122ef772f5f11bbf6d8a2)) |
| 1601 | ROM_REGION(0x08000,REGION_GFX1, 0) |
| 1602 | // expects 8x9 charset! |
| 1603 | ROM_LOAD("50146", 0x00000, 0x02000, BAD_DUMP CRC(1305dcf5) SHA1(aca488a16ae4ff05a1f4d14574379ff49cd48343)) //taken from europc, 9th blank |
| 1604 | ROM_END |
| 1605 | |
| 1555 | 1606 | ROM_START( t1000hx ) |
| 1556 | 1607 | ROM_REGION(0x100000,REGION_CPU1, 0) |
| 1557 | 1608 | ROM_LOAD("wdbios.rom", 0xc8000, 0x02000, CRC(8e9e2bd4) SHA1(601d7ceab282394ebab50763c267e915a6a2166a)) |
| 1558 | 1609 | // partlist says it has 1 128kbyte rom |
| 1559 | 1610 | ROM_LOAD("t1000hx.e0", 0xe0000, 0x10000, CRC(61dbf242) SHA1(555b58d8aa8e0b0839259621c44b832d993beaef)) |
| 1560 | | ROM_LOAD("tandy1t.rom", 0xf0000, 0x10000, CRC(d37a1d5f) SHA1(5ec031c31a7967cc3fd53a535d81833e4a1c385e)) |
| 1611 | ROM_LOAD("v020000.f0", 0xf0000, 0x10000, CRC(d37a1d5f) SHA1(5ec031c31a7967cc3fd53a535d81833e4a1c385e)) |
| 1561 | 1612 | ROM_REGION(0x08000,REGION_GFX1, 0) |
| 1562 | 1613 | // expects 8x9 charset! |
| 1563 | 1614 | ROM_LOAD("50146", 0x00000, 0x02000, BAD_DUMP CRC(1305dcf5) SHA1(aca488a16ae4ff05a1f4d14574379ff49cd48343)) //taken from europc, 9th blank |
| 1564 | 1615 | ROM_END |
| 1565 | 1616 | |
| 1617 | ROM_START( t1000sl ) |
| 1618 | ROM_REGION(0x100000,REGION_CPU1, 0) |
| 1619 | ROM_LOAD("wdbios.rom", 0xc8000, 0x02000, CRC(8e9e2bd4) SHA1(601d7ceab282394ebab50763c267e915a6a2166a)) // not sure about this one |
| 1620 | // partlist says it has 1 128kbyte rom |
| 1621 | ROM_LOAD("t1000hx.e0", 0xe0000, 0x10000, CRC(61dbf242) SHA1(555b58d8aa8e0b0839259621c44b832d993beaef)) // not sure about this one |
| 1622 | ROM_SYSTEM_BIOS( 0, "v010400", "v010400" ) |
| 1623 | ROMX_LOAD("v010400.f0", 0xf0000, 0x10000, NO_DUMP, ROM_BIOS(1) ) |
| 1624 | ROM_SYSTEM_BIOS( 1, "v010401", "v010401" ) |
| 1625 | ROMX_LOAD("v010401.f0", 0xf0000, 0x10000, NO_DUMP, ROM_BIOS(2) ) |
| 1626 | ROM_SYSTEM_BIOS( 2, "v010402", "v010402" ) |
| 1627 | ROMX_LOAD("v010402.f0", 0xf0000, 0x10000, NO_DUMP, ROM_BIOS(3) ) |
| 1628 | ROM_SYSTEM_BIOS( 3, "v020001", "v020001" ) |
| 1629 | ROMX_LOAD("v020001.f0", 0xf0000, 0x10000, NO_DUMP, ROM_BIOS(4) ) |
| 1630 | ROM_REGION(0x08000,REGION_GFX1, 0) |
| 1631 | // expects 8x9 charset! |
| 1632 | ROM_LOAD("50146", 0x00000, 0x02000, BAD_DUMP CRC(1305dcf5) SHA1(aca488a16ae4ff05a1f4d14574379ff49cd48343)) //taken from europc, 9th blank |
| 1633 | ROM_END |
| 1634 | |
| 1635 | ROM_START( t1000sl2 ) |
| 1636 | ROM_REGION(0x100000,REGION_CPU1, 0) |
| 1637 | ROM_LOAD("wdbios.rom", 0xc8000, 0x02000, CRC(8e9e2bd4) SHA1(601d7ceab282394ebab50763c267e915a6a2166a)) // not sure about this one |
| 1638 | // partlist says it has 1 128kbyte rom |
| 1639 | ROM_LOAD("t1000hx.e0", 0xe0000, 0x10000, CRC(61dbf242) SHA1(555b58d8aa8e0b0839259621c44b832d993beaef)) // not sure about this one |
| 1640 | ROM_LOAD("v010404.f0", 0xf0000, 0x10000, NO_DUMP ) |
| 1641 | ROM_REGION(0x08000,REGION_GFX1, 0) |
| 1642 | // expects 8x9 charset! |
| 1643 | ROM_LOAD("50146", 0x00000, 0x02000, BAD_DUMP CRC(1305dcf5) SHA1(aca488a16ae4ff05a1f4d14574379ff49cd48343)) //taken from europc, 9th blank |
| 1644 | ROM_END |
| 1645 | |
| 1566 | 1646 | ROM_START( t1000sx ) |
| 1567 | 1647 | ROM_REGION(0x100000,REGION_CPU1, 0) |
| 1568 | | ROM_LOAD("wdbios.rom", 0xc8000, 0x02000, CRC(8e9e2bd4) SHA1(601d7ceab282394ebab50763c267e915a6a2166a)) |
| 1648 | ROM_LOAD("wdbios.rom", 0xc8000, 0x02000, CRC(8e9e2bd4) SHA1(601d7ceab282394ebab50763c267e915a6a2166a)) // not sure about this one |
| 1569 | 1649 | // partlist says it has 1 128kbyte rom |
| 1570 | | ROM_LOAD("t1000hx.e0", 0xe0000, 0x10000, CRC(61dbf242) SHA1(555b58d8aa8e0b0839259621c44b832d993beaef)) |
| 1571 | | ROM_LOAD("t1000sx.f0", 0xf0000, 0x10000, CRC(0e016ecf) SHA1(2f5ac8921b7cba56b02122ef772f5f11bbf6d8a2)) |
| 1650 | ROM_LOAD("t1000hx.e0", 0xe0000, 0x10000, CRC(61dbf242) SHA1(555b58d8aa8e0b0839259621c44b832d993beaef)) // not sure about this one |
| 1651 | ROM_LOAD("v010200.f0", 0xf0000, 0x10000, CRC(0e016ecf) SHA1(2f5ac8921b7cba56b02122ef772f5f11bbf6d8a2)) |
| 1572 | 1652 | ROM_REGION(0x08000,REGION_GFX1, 0) |
| 1573 | 1653 | // expects 8x9 charset! |
| 1574 | 1654 | ROM_LOAD("50146", 0x00000, 0x02000, BAD_DUMP CRC(1305dcf5) SHA1(aca488a16ae4ff05a1f4d14574379ff49cd48343)) //taken from europc, 9th blank |
| 1575 | 1655 | ROM_END |
| 1576 | 1656 | |
| 1657 | ROM_START( t1000rl ) |
| 1658 | ROM_REGION(0x100000,REGION_CPU1, 0) |
| 1659 | ROM_LOAD("wdbios.rom", 0xc8000, 0x02000, CRC(8e9e2bd4) SHA1(601d7ceab282394ebab50763c267e915a6a2166a)) // not sure about this one |
| 1660 | // partlist says it has 1 128kbyte rom |
| 1661 | ROM_LOAD("t1000hx.e0", 0xe0000, 0x10000, CRC(61dbf242) SHA1(555b58d8aa8e0b0839259621c44b832d993beaef)) // not sure about this one |
| 1662 | ROM_SYSTEM_BIOS( 0, "v020000", "v020000" ) |
| 1663 | ROMX_LOAD("v020000.f0", 0xf0000, 0x10000, CRC(d37a1d5f) SHA1(5ec031c31a7967cc3fd53a535d81833e4a1c385e), ROM_BIOS(1) ) |
| 1664 | ROM_SYSTEM_BIOS( 1, "v020001", "v020001" ) |
| 1665 | ROMX_LOAD("v020001.f0", 0xf0000, 0x10000, NO_DUMP, ROM_BIOS(2) ) |
| 1666 | ROM_REGION(0x08000,REGION_GFX1, 0) |
| 1667 | // expects 8x9 charset! |
| 1668 | ROM_LOAD("50146", 0x00000, 0x02000, BAD_DUMP CRC(1305dcf5) SHA1(aca488a16ae4ff05a1f4d14574379ff49cd48343)) //taken from europc, 9th blank |
| 1669 | ROM_END |
| 1670 | |
| 1577 | 1671 | ROM_START( ibmxt ) |
| 1578 | 1672 | ROM_REGION16_LE(0x100000,REGION_CPU1, 0) |
| 1579 | 1673 | ROM_LOAD("wdbios.rom", 0xc8000, 0x02000, CRC(8e9e2bd4) SHA1(601d7ceab282394ebab50763c267e915a6a2166a)) |
| r2043 | r2044 | |
| 1735 | 1829 | ***************************************************************************/ |
| 1736 | 1830 | |
| 1737 | 1831 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME */ |
| 1738 | | COMP( 1982, ibmpc, 0, 0, pccga, pccga, pccga, ibmpc, "International Business Machines", "IBM PC 10/27/82" , 0) |
| 1832 | COMP( 1981, ibmpc, 0, 0, pccga, pccga, pccga, ibmpc, "International Business Machines", "IBM PC 5150" , 0) |
| 1739 | 1833 | COMP( 1982, ibmpca, ibmpc, 0, pccga, pccga, pccga, ibmpc, "International Business Machines", "IBM PC 08/16/82" , 0) |
| 1740 | 1834 | COMP( 1984, dgone, ibmpc, 0, pccga, pccga, pccga, ibmpc, "Data General", "Data General/One" , GAME_NOT_WORKING) /* CGA, 2x 3.5" disk drives */ |
| 1741 | 1835 | COMP( 1987, pc, ibmpc, 0, pccga, pccga, pccga, ibmpc, "", "PC (CGA)" , 0) |
| r2043 | r2044 | |
| 1745 | 1839 | // pcjr (better graphics, better sound) |
| 1746 | 1840 | COMP( 1983, ibmpcjr, ibmpc, 0, t1000hx, tandy1t, t1000hx, ibmpc, "International Business Machines", "IBM PC Jr", GAME_NOT_WORKING|GAME_IMPERFECT_COLORS ) |
| 1747 | 1841 | COMP( 1987, t1000hx, ibmpc, 0, t1000hx, tandy1t, t1000hx, ibmpc, "Tandy Radio Shack", "Tandy 1000HX", 0) |
| 1748 | | COMP( 1987, t1000sx, ibmpc, 0, t1000sx, tandy1t, t1000hx, ibmpc, "Tandy Radio Shack", "Tandy 1000SX", 0) |
| 1842 | COMP( 1987, t1000sx, ibmpc, 0, t1000hx, tandy1t, t1000hx, ibmpc, "Tandy Radio Shack", "Tandy 1000SX", 0) |
| 1749 | 1843 | |
| 1750 | 1844 | // xt class (pc but 8086) |
| 1751 | 1845 | COMP( 1986, ibmxt, ibmpc, 0, xtcga, xtcga, pccga, ibmpc, "International Business Machines", "IBM PC/XT (CGA)" , 0) |