trunk/src/emu/video/pc_vga.c
| r18236 | r18237 | |
| 103 | 103 | #define LOG_ACCESSES 0 |
| 104 | 104 | #define LOG_REGISTERS 0 |
| 105 | 105 | |
| 106 | | #define LOG_8514 0 |
| 106 | #define LOG_8514 1 |
| 107 | 107 | |
| 108 | 108 | /*************************************************************************** |
| 109 | 109 | |
| r18236 | r18237 | |
| 144 | 144 | { |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | | s3_vga_device::s3_vga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) |
| 148 | | : svga_device(mconfig, type, name, tag, owner, clock) |
| 149 | | { |
| 150 | | } |
| 151 | | |
| 152 | 147 | s3_vga_device::s3_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 153 | | : svga_device(mconfig, S3_VGA, "S3_VGA", tag, owner, clock) |
| 148 | : ati_vga_device(mconfig, S3_VGA, "S3_VGA", tag, owner, clock) |
| 154 | 149 | { |
| 155 | 150 | } |
| 156 | 151 | |
| r18236 | r18237 | |
| 160 | 155 | } |
| 161 | 156 | |
| 162 | 157 | ati_vga_device::ati_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 163 | | : s3_vga_device(mconfig, ATI_VGA, "ATI_VGA", tag, owner, clock) |
| 158 | : svga_device(mconfig, ATI_VGA, "ATI_VGA", tag, owner, clock) |
| 164 | 159 | { |
| 165 | 160 | } |
| 161 | |
| 162 | ati_vga_device::ati_vga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) |
| 163 | : svga_device(mconfig, type, name, tag, owner, clock) |
| 164 | { |
| 165 | } |
| 166 | |
| 166 | 167 | cirrus_vga_device::cirrus_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 167 | 168 | : svga_device(mconfig, CIRRUS_VGA, "CIRRUS_VGA", tag, owner, clock) |
| 168 | 169 | { |
| r18236 | r18237 | |
| 2670 | 2671 | { |
| 2671 | 2672 | ibm8514.state = IBM8514_IDLE; |
| 2672 | 2673 | ibm8514.gpbusy = false; |
| 2673 | | s3.write_count = 0; |
| 2674 | 2674 | } |
| 2675 | 2675 | break; |
| 2676 | 2676 | /* |
| r18236 | r18237 | |
| 2972 | 2972 | |
| 2973 | 2973 | /* accelerated ports, TBD ... */ |
| 2974 | 2974 | |
| 2975 | | void s3_vga_device::s3_write_fg(UINT32 offset) |
| 2975 | void ati_vga_device::ibm8514_write_fg(UINT32 offset) |
| 2976 | 2976 | { |
| 2977 | 2977 | UINT8 dst = vga.memory[offset]; |
| 2978 | 2978 | UINT8 src = 0; |
| 2979 | 2979 | |
| 2980 | 2980 | // check clipping rectangle |
| 2981 | | if(ibm8514.curr_x < s3.scissors_left || ibm8514.curr_x > s3.scissors_right || ibm8514.curr_y < s3.scissors_top || ibm8514.curr_y > s3.scissors_bottom) |
| 2981 | if(ibm8514.curr_x < ibm8514.scissors_left || ibm8514.curr_x > ibm8514.scissors_right || ibm8514.curr_y < ibm8514.scissors_top || ibm8514.curr_y > ibm8514.scissors_bottom) |
| 2982 | 2982 | return; // do nothing |
| 2983 | 2983 | |
| 2984 | 2984 | // determine source |
| 2985 | | switch(s3.fgmix & 0x0060) |
| 2985 | switch(ibm8514.fgmix & 0x0060) |
| 2986 | 2986 | { |
| 2987 | 2987 | case 0x0000: |
| 2988 | | src = s3.bgcolour; |
| 2988 | src = ibm8514.bgcolour; |
| 2989 | 2989 | break; |
| 2990 | 2990 | case 0x0020: |
| 2991 | | src = s3.fgcolour; |
| 2991 | src = ibm8514.fgcolour; |
| 2992 | 2992 | break; |
| 2993 | 2993 | case 0x0040: |
| 2994 | | src = s3.pixel_xfer; |
| 2994 | src = ibm8514.pixel_xfer; |
| 2995 | 2995 | break; |
| 2996 | 2996 | case 0x0060: |
| 2997 | 2997 | // video memory - presume the memory is sourced from the current X/Y co-ords |
| r18236 | r18237 | |
| 3000 | 3000 | } |
| 3001 | 3001 | |
| 3002 | 3002 | // write the data |
| 3003 | | switch(s3.fgmix & 0x000f) |
| 3003 | switch(ibm8514.fgmix & 0x000f) |
| 3004 | 3004 | { |
| 3005 | 3005 | case 0x0000: |
| 3006 | 3006 | vga.memory[offset] = ~dst; |
| r18236 | r18237 | |
| 3053 | 3053 | } |
| 3054 | 3054 | } |
| 3055 | 3055 | |
| 3056 | | void s3_vga_device::s3_write_bg(UINT32 offset) |
| 3056 | void ati_vga_device::ibm8514_write_bg(UINT32 offset) |
| 3057 | 3057 | { |
| 3058 | 3058 | UINT8 dst = vga.memory[offset]; |
| 3059 | 3059 | UINT8 src = 0; |
| 3060 | 3060 | |
| 3061 | 3061 | // check clipping rectangle |
| 3062 | | if(ibm8514.curr_x < s3.scissors_left || ibm8514.curr_x > s3.scissors_right || ibm8514.curr_y < s3.scissors_top || ibm8514.curr_y > s3.scissors_bottom) |
| 3062 | if(ibm8514.curr_x < ibm8514.scissors_left || ibm8514.curr_x > ibm8514.scissors_right || ibm8514.curr_y < ibm8514.scissors_top || ibm8514.curr_y > ibm8514.scissors_bottom) |
| 3063 | 3063 | return; // do nothing |
| 3064 | 3064 | |
| 3065 | 3065 | // determine source |
| 3066 | | switch(s3.bgmix & 0x0060) |
| 3066 | switch(ibm8514.bgmix & 0x0060) |
| 3067 | 3067 | { |
| 3068 | 3068 | case 0x0000: |
| 3069 | | src = s3.bgcolour; |
| 3069 | src = ibm8514.bgcolour; |
| 3070 | 3070 | break; |
| 3071 | 3071 | case 0x0020: |
| 3072 | | src = s3.fgcolour; |
| 3072 | src = ibm8514.fgcolour; |
| 3073 | 3073 | break; |
| 3074 | 3074 | case 0x0040: |
| 3075 | | src = s3.pixel_xfer; |
| 3075 | src = ibm8514.pixel_xfer; |
| 3076 | 3076 | break; |
| 3077 | 3077 | case 0x0060: |
| 3078 | 3078 | // video memory - presume the memory is sourced from the current X/Y co-ords |
| r18236 | r18237 | |
| 3081 | 3081 | } |
| 3082 | 3082 | |
| 3083 | 3083 | // write the data |
| 3084 | | switch(s3.bgmix & 0x000f) |
| 3084 | switch(ibm8514.bgmix & 0x000f) |
| 3085 | 3085 | { |
| 3086 | 3086 | case 0x0000: |
| 3087 | 3087 | vga.memory[offset] = ~dst; |
| r18236 | r18237 | |
| 3134 | 3134 | } |
| 3135 | 3135 | } |
| 3136 | 3136 | |
| 3137 | | void s3_vga_device::s3_write(UINT32 offset, UINT32 src) |
| 3137 | void ati_vga_device::ibm8514_write(UINT32 offset, UINT32 src) |
| 3138 | 3138 | { |
| 3139 | 3139 | int data_size = 8; |
| 3140 | 3140 | UINT32 xfer = 0; |
| 3141 | 3141 | |
| 3142 | | switch(s3.pixel_control & 0x00c0) |
| 3142 | switch(ibm8514.pixel_control & 0x00c0) |
| 3143 | 3143 | { |
| 3144 | 3144 | case 0x0000: // Foreground Mix only |
| 3145 | 3145 | // check clipping rectangle |
| 3146 | | if(ibm8514.curr_x < s3.scissors_left || ibm8514.curr_x > s3.scissors_right || ibm8514.curr_y < s3.scissors_top || ibm8514.curr_y > s3.scissors_bottom) |
| 3146 | if(ibm8514.curr_x < ibm8514.scissors_left || ibm8514.curr_x > ibm8514.scissors_right || ibm8514.curr_y < ibm8514.scissors_top || ibm8514.curr_y > ibm8514.scissors_bottom) |
| 3147 | 3147 | return; // do nothing |
| 3148 | | s3_write_fg(offset); |
| 3148 | ibm8514_write_fg(offset); |
| 3149 | 3149 | break; |
| 3150 | 3150 | case 0x0040: // fixed pattern (?) |
| 3151 | 3151 | // TODO |
| 3152 | 3152 | break; |
| 3153 | 3153 | case 0x0080: // use pixel transfer register |
| 3154 | | if(s3.bus_size == 0) // 8-bit |
| 3154 | if(ibm8514.bus_size == 0) // 8-bit |
| 3155 | 3155 | data_size = 8; |
| 3156 | | if(s3.bus_size == 1) // 16-bit |
| 3156 | if(ibm8514.bus_size == 1) // 16-bit |
| 3157 | 3157 | data_size = 16; |
| 3158 | | if(s3.bus_size == 2) // 32-bit |
| 3158 | if(ibm8514.bus_size == 2) // 32-bit |
| 3159 | 3159 | data_size = 32; |
| 3160 | | if((s3.current_cmd & 0x1000) && (data_size != 8)) |
| 3160 | if((ibm8514.current_cmd & 0x1000) && (data_size != 8)) |
| 3161 | 3161 | { |
| 3162 | | xfer = ((s3.pixel_xfer & 0x000000ff) << 8) | ((s3.pixel_xfer & 0x0000ff00) >> 8) |
| 3163 | | | ((s3.pixel_xfer & 0x00ff0000) << 8) | ((s3.pixel_xfer & 0xff000000) >> 8); |
| 3162 | xfer = ((ibm8514.pixel_xfer & 0x000000ff) << 8) | ((ibm8514.pixel_xfer & 0x0000ff00) >> 8) |
| 3163 | | ((ibm8514.pixel_xfer & 0x00ff0000) << 8) | ((ibm8514.pixel_xfer & 0xff000000) >> 8); |
| 3164 | 3164 | } |
| 3165 | 3165 | else |
| 3166 | | xfer = s3.pixel_xfer; |
| 3167 | | if(s3.current_cmd & 0x0002) |
| 3166 | xfer = ibm8514.pixel_xfer; |
| 3167 | if(ibm8514.current_cmd & 0x0002) |
| 3168 | 3168 | { |
| 3169 | | if((xfer & ((1<<(data_size-1))>>s3.src_x)) != 0) |
| 3170 | | s3_write_fg(offset); |
| 3169 | if((xfer & ((1<<(data_size-1))>>ibm8514.src_x)) != 0) |
| 3170 | ibm8514_write_fg(offset); |
| 3171 | 3171 | else |
| 3172 | | s3_write_bg(offset); |
| 3172 | ibm8514_write_bg(offset); |
| 3173 | 3173 | } |
| 3174 | 3174 | else |
| 3175 | 3175 | { |
| 3176 | | s3_write_fg(offset); |
| 3176 | ibm8514_write_fg(offset); |
| 3177 | 3177 | } |
| 3178 | | s3.src_x++; |
| 3179 | | if(s3.src_x >= data_size) |
| 3180 | | s3.src_x = 0; |
| 3178 | ibm8514.src_x++; |
| 3179 | if(ibm8514.src_x >= data_size) |
| 3180 | ibm8514.src_x = 0; |
| 3181 | 3181 | break; |
| 3182 | 3182 | case 0x00c0: // use source plane |
| 3183 | 3183 | if(vga.memory[(src) % vga.svga_intf.vram_size] != 0x00) |
| 3184 | | s3_write_fg(offset); |
| 3184 | ibm8514_write_fg(offset); |
| 3185 | 3185 | else |
| 3186 | | s3_write_bg(offset); |
| 3186 | ibm8514_write_bg(offset); |
| 3187 | 3187 | break; |
| 3188 | 3188 | } |
| 3189 | 3189 | } |
| r18236 | r18237 | |
| 3198 | 3198 | the major or independent axis). |
| 3199 | 3199 | 0-13 (80x +) LINE PARAMETER/ERROR TERM. See above. |
| 3200 | 3200 | */ |
| 3201 | | READ16_MEMBER(s3_vga_device::s3_line_error_r) |
| 3201 | READ16_MEMBER(ati_vga_device::ibm8514_line_error_r) |
| 3202 | 3202 | { |
| 3203 | 3203 | return ibm8514.line_errorterm; |
| 3204 | 3204 | } |
| 3205 | 3205 | |
| 3206 | | WRITE16_MEMBER(s3_vga_device::s3_line_error_w) |
| 3206 | WRITE16_MEMBER(ati_vga_device::ibm8514_line_error_w) |
| 3207 | 3207 | { |
| 3208 | 3208 | ibm8514.line_errorterm = data; |
| 3209 | | if(LOG_8514) logerror("S3: Line Parameter/Error Term write %04x\n",data); |
| 3209 | if(LOG_8514) logerror("8514/A: Line Parameter/Error Term write %04x\n",data); |
| 3210 | 3210 | } |
| 3211 | 3211 | |
| 3212 | 3212 | /* |
| r18236 | r18237 | |
| 3230 | 3230 | available, Fh for 9 words, 7 for 10 words, 3 for 11 words, 1 for |
| 3231 | 3231 | 12 words and 0 for 13 words available. |
| 3232 | 3232 | */ |
| 3233 | | READ16_MEMBER(s3_vga_device::ibm8514_gpstatus_r) |
| 3233 | READ16_MEMBER(ati_vga_device::ibm8514_gpstatus_r) |
| 3234 | 3234 | { |
| 3235 | 3235 | UINT16 ret = 0x0000; |
| 3236 | 3236 | |
| r18236 | r18237 | |
| 3242 | 3242 | return ret; |
| 3243 | 3243 | } |
| 3244 | 3244 | |
| 3245 | | void s3_vga_device::ibm8514_draw_vector(UINT8 len, UINT8 dir, bool draw) |
| 3245 | void ati_vga_device::ibm8514_draw_vector(UINT8 len, UINT8 dir, bool draw) |
| 3246 | 3246 | { |
| 3247 | 3247 | UINT32 offset; |
| 3248 | 3248 | int x = 0; |
| r18236 | r18237 | |
| 3251 | 3251 | { |
| 3252 | 3252 | offset = (ibm8514.curr_y * VGA_LINE_LENGTH) + ibm8514.curr_x; |
| 3253 | 3253 | if(draw) |
| 3254 | | s3_write(offset,offset); |
| 3254 | ibm8514_write(offset,offset); |
| 3255 | 3255 | switch(dir) |
| 3256 | 3256 | { |
| 3257 | 3257 | case 0: // 0 degrees |
| r18236 | r18237 | |
| 3387 | 3387 | rectangle, which is copied repeatably to the destination |
| 3388 | 3388 | rectangle. |
| 3389 | 3389 | */ |
| 3390 | | WRITE16_MEMBER(s3_vga_device::ibm8514_cmd_w) |
| 3390 | WRITE16_MEMBER(ati_vga_device::ibm8514_cmd_w) |
| 3391 | 3391 | { |
| 3392 | 3392 | int x,y; |
| 3393 | 3393 | int pattern_x,pattern_y; |
| 3394 | 3394 | UINT32 off,src; |
| 3395 | 3395 | |
| 3396 | | s3.current_cmd = data; |
| 3397 | | s3.src_x = 0; |
| 3398 | | s3.src_y = 0; |
| 3399 | | s3.bus_size = (data & 0x0600) >> 9; |
| 3396 | ibm8514.current_cmd = data; |
| 3397 | ibm8514.src_x = 0; |
| 3398 | ibm8514.src_y = 0; |
| 3399 | ibm8514.bus_size = (data & 0x0600) >> 9; |
| 3400 | 3400 | switch(data & 0xe000) |
| 3401 | 3401 | { |
| 3402 | 3402 | case 0x0000: // NOP (for "Short Stroke Vectors") |
| 3403 | 3403 | ibm8514.state = IBM8514_IDLE; |
| 3404 | 3404 | ibm8514.gpbusy = false; |
| 3405 | | if(LOG_8514) logerror("S3: Command (%04x) - NOP (Short Stroke Vector)\n",s3.current_cmd); |
| 3405 | if(LOG_8514) logerror("S3: Command (%04x) - NOP (Short Stroke Vector)\n",ibm8514.current_cmd); |
| 3406 | 3406 | break; |
| 3407 | 3407 | case 0x2000: // Line |
| 3408 | 3408 | ibm8514.state = IBM8514_IDLE; |
| r18236 | r18237 | |
| 3413 | 3413 | { |
| 3414 | 3414 | ibm8514.state = IBM8514_DRAWING_LINE; |
| 3415 | 3415 | ibm8514.data_avail = true; |
| 3416 | | if(LOG_8514) logerror("S3: Command (%04x) - Vector Line (WAIT) %i,%i \n",s3.current_cmd,ibm8514.curr_x,ibm8514.curr_y); |
| 3416 | if(LOG_8514) logerror("S3: Command (%04x) - Vector Line (WAIT) %i,%i \n",ibm8514.current_cmd,ibm8514.curr_x,ibm8514.curr_y); |
| 3417 | 3417 | } |
| 3418 | 3418 | else |
| 3419 | 3419 | { |
| 3420 | | ibm8514_draw_vector(s3.rect_width,(data & 0x00e0) >> 5,(data & 0010) ? true : false); |
| 3421 | | if(LOG_8514) logerror("S3: Command (%04x) - Vector Line - %i,%i \n",s3.current_cmd,ibm8514.curr_x,ibm8514.curr_y); |
| 3420 | ibm8514_draw_vector(ibm8514.rect_width,(data & 0x00e0) >> 5,(data & 0010) ? true : false); |
| 3421 | if(LOG_8514) logerror("S3: Command (%04x) - Vector Line - %i,%i \n",ibm8514.current_cmd,ibm8514.curr_x,ibm8514.curr_y); |
| 3422 | 3422 | } |
| 3423 | 3423 | } |
| 3424 | 3424 | else |
| 3425 | 3425 | { |
| 3426 | 3426 | // Not perfect, but will do for now. |
| 3427 | | INT16 dx = s3.rect_width; |
| 3427 | INT16 dx = ibm8514.rect_width; |
| 3428 | 3428 | INT16 dy = ibm8514.line_axial_step >> 1; |
| 3429 | 3429 | INT16 err = ibm8514.line_errorterm; |
| 3430 | 3430 | int sx = (data & 0x0020) ? 1 : -1; |
| r18236 | r18237 | |
| 3432 | 3432 | int count = 0; |
| 3433 | 3433 | INT16 temp; |
| 3434 | 3434 | |
| 3435 | | if(LOG_8514) logerror("S3: Command (%04x) - Line (Bresenham) - %i,%i Axial %i, Diagonal %i, Error %i, Major Axis %i, Minor Axis %i\n",s3.current_cmd, |
| 3436 | | ibm8514.curr_x,ibm8514.curr_y,ibm8514.line_axial_step,ibm8514.line_diagonal_step,ibm8514.line_errorterm,s3.rect_width,s3.rect_height); |
| 3435 | if(LOG_8514) logerror("S3: Command (%04x) - Line (Bresenham) - %i,%i Axial %i, Diagonal %i, Error %i, Major Axis %i, Minor Axis %i\n",ibm8514.current_cmd, |
| 3436 | ibm8514.curr_x,ibm8514.curr_y,ibm8514.line_axial_step,ibm8514.line_diagonal_step,ibm8514.line_errorterm,ibm8514.rect_width,ibm8514.rect_height); |
| 3437 | 3437 | |
| 3438 | 3438 | if((data & 0x0040)) |
| 3439 | 3439 | { |
| r18236 | r18237 | |
| 3441 | 3441 | } |
| 3442 | 3442 | for(;;) |
| 3443 | 3443 | { |
| 3444 | | s3_write(ibm8514.curr_x + (ibm8514.curr_y * VGA_LINE_LENGTH),ibm8514.curr_x + (ibm8514.curr_y * VGA_LINE_LENGTH)); |
| 3445 | | if (count > s3.rect_width) break; |
| 3444 | ibm8514_write(ibm8514.curr_x + (ibm8514.curr_y * VGA_LINE_LENGTH),ibm8514.curr_x + (ibm8514.curr_y * VGA_LINE_LENGTH)); |
| 3445 | if (count > ibm8514.rect_width) break; |
| 3446 | 3446 | count++; |
| 3447 | 3447 | if((err*2) > -dy) |
| 3448 | 3448 | { |
| r18236 | r18237 | |
| 3462 | 3462 | { |
| 3463 | 3463 | ibm8514.state = IBM8514_DRAWING_RECT; |
| 3464 | 3464 | //ibm8514.gpbusy = true; // DirectX 5 keeps waiting for the busy bit to be clear... |
| 3465 | | s3.bus_size = (data & 0x0600) >> 9; |
| 3465 | ibm8514.bus_size = (data & 0x0600) >> 9; |
| 3466 | 3466 | ibm8514.data_avail = true; |
| 3467 | | if(LOG_8514) logerror("S3: Command (%04x) - Rectangle Fill (WAIT) %i,%i Width: %i Height: %i Colour: %08x\n",s3.current_cmd,ibm8514.curr_x, |
| 3468 | | ibm8514.curr_y,s3.rect_width,s3.rect_height,s3.fgcolour); |
| 3467 | if(LOG_8514) logerror("S3: Command (%04x) - Rectangle Fill (WAIT) %i,%i Width: %i Height: %i Colour: %08x\n",ibm8514.current_cmd,ibm8514.curr_x, |
| 3468 | ibm8514.curr_y,ibm8514.rect_width,ibm8514.rect_height,ibm8514.fgcolour); |
| 3469 | 3469 | break; |
| 3470 | 3470 | } |
| 3471 | | if(LOG_8514) logerror("S3: Command (%04x) - Rectangle Fill %i,%i Width: %i Height: %i Colour: %08x\n",s3.current_cmd,ibm8514.curr_x, |
| 3472 | | ibm8514.curr_y,s3.rect_width,s3.rect_height,s3.fgcolour); |
| 3471 | if(LOG_8514) logerror("S3: Command (%04x) - Rectangle Fill %i,%i Width: %i Height: %i Colour: %08x\n",ibm8514.current_cmd,ibm8514.curr_x, |
| 3472 | ibm8514.curr_y,ibm8514.rect_width,ibm8514.rect_height,ibm8514.fgcolour); |
| 3473 | 3473 | off = 0; |
| 3474 | 3474 | off += (VGA_LINE_LENGTH * ibm8514.curr_y); |
| 3475 | 3475 | off += ibm8514.curr_x; |
| 3476 | | for(y=0;y<=s3.rect_height;y++) |
| 3476 | for(y=0;y<=ibm8514.rect_height;y++) |
| 3477 | 3477 | { |
| 3478 | | for(x=0;x<=s3.rect_width;x++) |
| 3478 | for(x=0;x<=ibm8514.rect_width;x++) |
| 3479 | 3479 | { |
| 3480 | 3480 | if(data & 0x0020) // source pattern is always based on current X/Y? |
| 3481 | | s3_write((off+x) % vga.svga_intf.vram_size,(off+x) % vga.svga_intf.vram_size); |
| 3481 | ibm8514_write((off+x) % vga.svga_intf.vram_size,(off+x) % vga.svga_intf.vram_size); |
| 3482 | 3482 | else |
| 3483 | | s3_write((off-x) % vga.svga_intf.vram_size,(off-x) % vga.svga_intf.vram_size); |
| 3484 | | if(s3.current_cmd & 0x0020) |
| 3483 | ibm8514_write((off-x) % vga.svga_intf.vram_size,(off-x) % vga.svga_intf.vram_size); |
| 3484 | if(ibm8514.current_cmd & 0x0020) |
| 3485 | 3485 | { |
| 3486 | 3486 | ibm8514.curr_x++; |
| 3487 | | if(ibm8514.curr_x > ibm8514.prev_x + s3.rect_width) |
| 3487 | if(ibm8514.curr_x > ibm8514.prev_x + ibm8514.rect_width) |
| 3488 | 3488 | { |
| 3489 | 3489 | ibm8514.curr_x = ibm8514.prev_x; |
| 3490 | | s3.src_x = 0; |
| 3491 | | if(s3.current_cmd & 0x0080) |
| 3490 | ibm8514.src_x = 0; |
| 3491 | if(ibm8514.current_cmd & 0x0080) |
| 3492 | 3492 | ibm8514.curr_y++; |
| 3493 | 3493 | else |
| 3494 | 3494 | ibm8514.curr_y--; |
| r18236 | r18237 | |
| 3497 | 3497 | else |
| 3498 | 3498 | { |
| 3499 | 3499 | ibm8514.curr_x--; |
| 3500 | | if(ibm8514.curr_x < ibm8514.prev_x - s3.rect_width) |
| 3500 | if(ibm8514.curr_x < ibm8514.prev_x - ibm8514.rect_width) |
| 3501 | 3501 | { |
| 3502 | 3502 | ibm8514.curr_x = ibm8514.prev_x; |
| 3503 | | s3.src_x = 0; |
| 3504 | | if(s3.current_cmd & 0x0080) |
| 3503 | ibm8514.src_x = 0; |
| 3504 | if(ibm8514.current_cmd & 0x0080) |
| 3505 | 3505 | ibm8514.curr_y++; |
| 3506 | 3506 | else |
| 3507 | 3507 | ibm8514.curr_y--; |
| r18236 | r18237 | |
| 3517 | 3517 | ibm8514.gpbusy = false; |
| 3518 | 3518 | break; |
| 3519 | 3519 | case 0xc000: // BitBLT |
| 3520 | | if(LOG_8514) logerror("S3: Command (%04x) - BitBLT from %i,%i to %i,%i Width: %i Height: %i\n",s3.current_cmd, |
| 3521 | | ibm8514.curr_x,ibm8514.curr_y,ibm8514.dest_x,ibm8514.dest_y,s3.rect_width,s3.rect_height); |
| 3520 | if(LOG_8514) logerror("S3: Command (%04x) - BitBLT from %i,%i to %i,%i Width: %i Height: %i\n",ibm8514.current_cmd, |
| 3521 | ibm8514.curr_x,ibm8514.curr_y,ibm8514.dest_x,ibm8514.dest_y,ibm8514.rect_width,ibm8514.rect_height); |
| 3522 | 3522 | off = 0; |
| 3523 | 3523 | off += (VGA_LINE_LENGTH * ibm8514.dest_y); |
| 3524 | 3524 | off += ibm8514.dest_x; |
| 3525 | 3525 | src = 0; |
| 3526 | 3526 | src += (VGA_LINE_LENGTH * ibm8514.curr_y); |
| 3527 | 3527 | src += ibm8514.curr_x; |
| 3528 | | for(y=0;y<=s3.rect_height;y++) |
| 3528 | for(y=0;y<=ibm8514.rect_height;y++) |
| 3529 | 3529 | { |
| 3530 | | for(x=0;x<=s3.rect_width;x++) |
| 3530 | for(x=0;x<=ibm8514.rect_width;x++) |
| 3531 | 3531 | { |
| 3532 | 3532 | if(data & 0x0020) |
| 3533 | 3533 | vga.memory[(off+x) % vga.svga_intf.vram_size] = vga.memory[(src+x) % vga.svga_intf.vram_size]; |
| 3534 | 3534 | else |
| 3535 | 3535 | vga.memory[(off-x) % vga.svga_intf.vram_size] = vga.memory[(src-x) % vga.svga_intf.vram_size]; |
| 3536 | | if(s3.current_cmd & 0x0020) |
| 3536 | if(ibm8514.current_cmd & 0x0020) |
| 3537 | 3537 | { |
| 3538 | 3538 | ibm8514.curr_x++; |
| 3539 | | if(ibm8514.curr_x > ibm8514.prev_x + s3.rect_width) |
| 3539 | if(ibm8514.curr_x > ibm8514.prev_x + ibm8514.rect_width) |
| 3540 | 3540 | { |
| 3541 | 3541 | ibm8514.curr_x = ibm8514.prev_x; |
| 3542 | | s3.src_x = 0; |
| 3543 | | if(s3.current_cmd & 0x0080) |
| 3542 | ibm8514.src_x = 0; |
| 3543 | if(ibm8514.current_cmd & 0x0080) |
| 3544 | 3544 | ibm8514.curr_y++; |
| 3545 | 3545 | else |
| 3546 | 3546 | ibm8514.curr_y--; |
| r18236 | r18237 | |
| 3549 | 3549 | else |
| 3550 | 3550 | { |
| 3551 | 3551 | ibm8514.curr_x--; |
| 3552 | | if(ibm8514.curr_x < ibm8514.prev_x - s3.rect_width) |
| 3552 | if(ibm8514.curr_x < ibm8514.prev_x - ibm8514.rect_width) |
| 3553 | 3553 | { |
| 3554 | 3554 | ibm8514.curr_x = ibm8514.prev_x; |
| 3555 | | s3.src_x = 0; |
| 3556 | | if(s3.current_cmd & 0x0080) |
| 3555 | ibm8514.src_x = 0; |
| 3556 | if(ibm8514.current_cmd & 0x0080) |
| 3557 | 3557 | ibm8514.curr_y++; |
| 3558 | 3558 | else |
| 3559 | 3559 | ibm8514.curr_y--; |
| r18236 | r18237 | |
| 3575 | 3575 | ibm8514.gpbusy = false; |
| 3576 | 3576 | break; |
| 3577 | 3577 | case 0xe000: // Pattern Fill |
| 3578 | | if(LOG_8514) logerror("S3: Command (%04x) - Pattern Fill - source %i,%i dest %i,%i Width: %i Height: %i\n",s3.current_cmd, |
| 3579 | | ibm8514.curr_x,ibm8514.curr_y,ibm8514.dest_x,ibm8514.dest_y,s3.rect_width,s3.rect_height); |
| 3578 | if(LOG_8514) logerror("S3: Command (%04x) - Pattern Fill - source %i,%i dest %i,%i Width: %i Height: %i\n",ibm8514.current_cmd, |
| 3579 | ibm8514.curr_x,ibm8514.curr_y,ibm8514.dest_x,ibm8514.dest_y,ibm8514.rect_width,ibm8514.rect_height); |
| 3580 | 3580 | off = 0; |
| 3581 | 3581 | off += (VGA_LINE_LENGTH * ibm8514.dest_y); |
| 3582 | 3582 | off += ibm8514.dest_x; |
| r18236 | r18237 | |
| 3592 | 3592 | else |
| 3593 | 3593 | pattern_y = 7; |
| 3594 | 3594 | |
| 3595 | | for(y=0;y<=s3.rect_height;y++) |
| 3595 | for(y=0;y<=ibm8514.rect_height;y++) |
| 3596 | 3596 | { |
| 3597 | | for(x=0;x<=s3.rect_width;x++) |
| 3597 | for(x=0;x<=ibm8514.rect_width;x++) |
| 3598 | 3598 | { |
| 3599 | 3599 | if(data & 0x0020) |
| 3600 | 3600 | { |
| 3601 | | s3_write(off+x,src+pattern_x); |
| 3601 | ibm8514_write(off+x,src+pattern_x); |
| 3602 | 3602 | pattern_x++; |
| 3603 | 3603 | if(pattern_x >= 8) |
| 3604 | 3604 | pattern_x = 0; |
| 3605 | 3605 | } |
| 3606 | 3606 | else |
| 3607 | 3607 | { |
| 3608 | | s3_write(off-x,src-pattern_x); |
| 3608 | ibm8514_write(off-x,src-pattern_x); |
| 3609 | 3609 | pattern_x--; |
| 3610 | 3610 | if(pattern_x < 0) |
| 3611 | 3611 | pattern_x = 7; |
| r18236 | r18237 | |
| 3667 | 3667 | 0-13 (80 x+) LINE PARAMETER AXIAL STEP CONSTANT. Se above |
| 3668 | 3668 | |
| 3669 | 3669 | */ |
| 3670 | | READ16_MEMBER(s3_vga_device::ibm8514_desty_r) |
| 3670 | READ16_MEMBER(ati_vga_device::ibm8514_desty_r) |
| 3671 | 3671 | { |
| 3672 | 3672 | return ibm8514.line_axial_step; |
| 3673 | 3673 | } |
| 3674 | 3674 | |
| 3675 | | WRITE16_MEMBER(s3_vga_device::ibm8514_desty_w) |
| 3675 | WRITE16_MEMBER(ati_vga_device::ibm8514_desty_w) |
| 3676 | 3676 | { |
| 3677 | 3677 | ibm8514.line_axial_step = data; |
| 3678 | 3678 | ibm8514.dest_y = data; |
| r18236 | r18237 | |
| 3692 | 3692 | 0-13 (80x +) LINE PARAMETER DIAGONAL STEP CONSTANT. Se above |
| 3693 | 3693 | |
| 3694 | 3694 | */ |
| 3695 | | READ16_MEMBER(s3_vga_device::ibm8514_destx_r) |
| 3695 | READ16_MEMBER(ati_vga_device::ibm8514_destx_r) |
| 3696 | 3696 | { |
| 3697 | 3697 | return ibm8514.line_diagonal_step; |
| 3698 | 3698 | } |
| 3699 | 3699 | |
| 3700 | | WRITE16_MEMBER(s3_vga_device::ibm8514_destx_w) |
| 3700 | WRITE16_MEMBER(ati_vga_device::ibm8514_destx_w) |
| 3701 | 3701 | { |
| 3702 | 3702 | ibm8514.line_diagonal_step = data; |
| 3703 | 3703 | ibm8514.dest_x = data; |
| r18236 | r18237 | |
| 3726 | 3726 | 9EE9h before execution starts. A single 16bit write will do. |
| 3727 | 3727 | If only one SSV is desired the other byte can be set to 0. |
| 3728 | 3728 | */ |
| 3729 | | void s3_vga_device::ibm8514_wait_draw_ssv() |
| 3729 | void ati_vga_device::ibm8514_wait_draw_ssv() |
| 3730 | 3730 | { |
| 3731 | 3731 | UINT8 len = ibm8514.wait_vector_len; |
| 3732 | 3732 | UINT8 dir = ibm8514.wait_vector_dir; |
| r18236 | r18237 | |
| 3736 | 3736 | int x; |
| 3737 | 3737 | int data_size; |
| 3738 | 3738 | |
| 3739 | | switch(s3.bus_size) |
| 3739 | switch(ibm8514.bus_size) |
| 3740 | 3740 | { |
| 3741 | 3741 | case 0: |
| 3742 | 3742 | data_size = 8; |
| r18236 | r18237 | |
| 3778 | 3778 | { |
| 3779 | 3779 | offset = (ibm8514.curr_y * VGA_LINE_LENGTH) + ibm8514.curr_x; |
| 3780 | 3780 | if(draw) |
| 3781 | | s3_write(offset,offset); |
| 3781 | ibm8514_write(offset,offset); |
| 3782 | 3782 | switch(dir) |
| 3783 | 3783 | { |
| 3784 | 3784 | case 0: // 0 degrees |
| r18236 | r18237 | |
| 3814 | 3814 | } |
| 3815 | 3815 | } |
| 3816 | 3816 | |
| 3817 | | void s3_vga_device::ibm8514_draw_ssv(UINT8 data) |
| 3817 | void ati_vga_device::ibm8514_draw_ssv(UINT8 data) |
| 3818 | 3818 | { |
| 3819 | 3819 | UINT8 len = data & 0x0f; |
| 3820 | 3820 | UINT8 dir = (data & 0xe0) >> 5; |
| r18236 | r18237 | |
| 3823 | 3823 | ibm8514_draw_vector(len,dir,draw); |
| 3824 | 3824 | } |
| 3825 | 3825 | |
| 3826 | | READ16_MEMBER(s3_vga_device::ibm8514_ssv_r) |
| 3826 | READ16_MEMBER(ati_vga_device::ibm8514_ssv_r) |
| 3827 | 3827 | { |
| 3828 | 3828 | return ibm8514.ssv; |
| 3829 | 3829 | } |
| 3830 | 3830 | |
| 3831 | | WRITE16_MEMBER(s3_vga_device::ibm8514_ssv_w) |
| 3831 | WRITE16_MEMBER(ati_vga_device::ibm8514_ssv_w) |
| 3832 | 3832 | { |
| 3833 | 3833 | ibm8514.ssv = data; |
| 3834 | 3834 | |
| 3835 | | if(s3.current_cmd & 0x0100) |
| 3835 | if(ibm8514.current_cmd & 0x0100) |
| 3836 | 3836 | { |
| 3837 | 3837 | ibm8514.state = IBM8514_DRAWING_SSV_1; |
| 3838 | 3838 | ibm8514.data_avail = true; |
| r18236 | r18237 | |
| 3843 | 3843 | return; |
| 3844 | 3844 | } |
| 3845 | 3845 | |
| 3846 | | if(s3.current_cmd & 0x1000) // byte sequence |
| 3846 | if(ibm8514.current_cmd & 0x1000) // byte sequence |
| 3847 | 3847 | { |
| 3848 | 3848 | ibm8514_draw_ssv(data & 0xff); |
| 3849 | 3849 | ibm8514_draw_ssv(data >> 8); |
| r18236 | r18237 | |
| 3856 | 3856 | if(LOG_8514) logerror("8514/A: Short Stroke Vector write %04x\n",data); |
| 3857 | 3857 | } |
| 3858 | 3858 | |
| 3859 | | void s3_vga_device::ibm8514_wait_draw_vector() |
| 3859 | void ati_vga_device::ibm8514_wait_draw_vector() |
| 3860 | 3860 | { |
| 3861 | 3861 | UINT8 len = ibm8514.wait_vector_len; |
| 3862 | 3862 | UINT8 dir = ibm8514.wait_vector_dir; |
| r18236 | r18237 | |
| 3866 | 3866 | UINT8 data_size = 0; |
| 3867 | 3867 | int x; |
| 3868 | 3868 | |
| 3869 | | if(s3.bus_size == 0) // 8-bit |
| 3869 | if(ibm8514.bus_size == 0) // 8-bit |
| 3870 | 3870 | data_size = 8; |
| 3871 | | if(s3.bus_size == 1) // 16-bit |
| 3871 | if(ibm8514.bus_size == 1) // 16-bit |
| 3872 | 3872 | data_size = 16; |
| 3873 | | if(s3.bus_size == 2) // 32-bit |
| 3873 | if(ibm8514.bus_size == 2) // 32-bit |
| 3874 | 3874 | data_size = 32; |
| 3875 | 3875 | |
| 3876 | 3876 | for(x=0;x<data_size;x++) |
| r18236 | r18237 | |
| 3890 | 3890 | { |
| 3891 | 3891 | offset = (ibm8514.curr_y * VGA_LINE_LENGTH) + ibm8514.curr_x; |
| 3892 | 3892 | if(draw) |
| 3893 | | s3_write(offset,offset); |
| 3893 | ibm8514_write(offset,offset); |
| 3894 | 3894 | switch(dir) |
| 3895 | 3895 | { |
| 3896 | 3896 | case 0: // 0 degrees |
| r18236 | r18237 | |
| 3935 | 3935 | independent axis). Must be positive. |
| 3936 | 3936 | 0-11 (80x +) RECTANGLE WIDTH/LINE PARAMETER MAX. See above |
| 3937 | 3937 | */ |
| 3938 | | READ16_MEMBER(s3_vga_device::s3_width_r) |
| 3938 | READ16_MEMBER(ati_vga_device::ibm8514_width_r) |
| 3939 | 3939 | { |
| 3940 | | return s3.rect_width; |
| 3940 | return ibm8514.rect_width; |
| 3941 | 3941 | } |
| 3942 | 3942 | |
| 3943 | | WRITE16_MEMBER(s3_vga_device::s3_width_w) |
| 3943 | WRITE16_MEMBER(ati_vga_device::ibm8514_width_w) |
| 3944 | 3944 | { |
| 3945 | | s3.rect_width = data & 0x1fff; |
| 3945 | ibm8514.rect_width = data & 0x1fff; |
| 3946 | 3946 | if(LOG_8514) logerror("S3: Major Axis Pixel Count / Rectangle Width write %04x\n",data); |
| 3947 | 3947 | } |
| 3948 | 3948 | |
| 3949 | | READ16_MEMBER(s3_vga_device::ibm8514_currentx_r) |
| 3949 | READ16_MEMBER(ati_vga_device::ibm8514_currentx_r) |
| 3950 | 3950 | { |
| 3951 | 3951 | return ibm8514.curr_x; |
| 3952 | 3952 | } |
| 3953 | 3953 | |
| 3954 | | WRITE16_MEMBER(s3_vga_device::ibm8514_currentx_w) |
| 3954 | WRITE16_MEMBER(ati_vga_device::ibm8514_currentx_w) |
| 3955 | 3955 | { |
| 3956 | 3956 | ibm8514.curr_x = data; |
| 3957 | 3957 | ibm8514.prev_x = data; |
| 3958 | 3958 | if(LOG_8514) logerror("8514/A: Current X set to %04x (%i)\n",data,ibm8514.curr_x); |
| 3959 | 3959 | } |
| 3960 | 3960 | |
| 3961 | | READ16_MEMBER(s3_vga_device::ibm8514_currenty_r) |
| 3961 | READ16_MEMBER(ati_vga_device::ibm8514_currenty_r) |
| 3962 | 3962 | { |
| 3963 | 3963 | return ibm8514.curr_y; |
| 3964 | 3964 | } |
| 3965 | 3965 | |
| 3966 | | WRITE16_MEMBER(s3_vga_device::ibm8514_currenty_w) |
| 3966 | WRITE16_MEMBER(ati_vga_device::ibm8514_currenty_w) |
| 3967 | 3967 | { |
| 3968 | 3968 | ibm8514.curr_y = data; |
| 3969 | 3969 | ibm8514.prev_y = data; |
| 3970 | 3970 | if(LOG_8514) logerror("8514/A: Current Y set to %04x (%i)\n",data,ibm8514.curr_y); |
| 3971 | 3971 | } |
| 3972 | 3972 | |
| 3973 | | READ16_MEMBER(s3_vga_device::s3_fgcolour_r) |
| 3973 | READ16_MEMBER(ati_vga_device::ibm8514_fgcolour_r) |
| 3974 | 3974 | { |
| 3975 | | return s3.fgcolour; |
| 3975 | return ibm8514.fgcolour; |
| 3976 | 3976 | } |
| 3977 | 3977 | |
| 3978 | | WRITE16_MEMBER(s3_vga_device::s3_fgcolour_w) |
| 3978 | WRITE16_MEMBER(ati_vga_device::ibm8514_fgcolour_w) |
| 3979 | 3979 | { |
| 3980 | | s3.fgcolour = data; |
| 3980 | ibm8514.fgcolour = data; |
| 3981 | 3981 | if(LOG_8514) logerror("S3: Foreground Colour write %04x\n",data); |
| 3982 | 3982 | } |
| 3983 | 3983 | |
| 3984 | | READ16_MEMBER(s3_vga_device::s3_bgcolour_r) |
| 3984 | READ16_MEMBER(ati_vga_device::ibm8514_bgcolour_r) |
| 3985 | 3985 | { |
| 3986 | | return s3.bgcolour; |
| 3986 | return ibm8514.bgcolour; |
| 3987 | 3987 | } |
| 3988 | 3988 | |
| 3989 | | WRITE16_MEMBER(s3_vga_device::s3_bgcolour_w) |
| 3989 | WRITE16_MEMBER(ati_vga_device::ibm8514_bgcolour_w) |
| 3990 | 3990 | { |
| 3991 | | s3.bgcolour = data; |
| 3991 | ibm8514.bgcolour = data; |
| 3992 | 3992 | if(LOG_8514) logerror("S3: Background Colour write %04x\n",data); |
| 3993 | 3993 | } |
| 3994 | 3994 | |
| 3995 | | READ16_MEMBER(s3_vga_device::s3_multifunc_r ) |
| 3995 | READ16_MEMBER(ati_vga_device::ibm8514_multifunc_r ) |
| 3996 | 3996 | { |
| 3997 | | switch(s3.multifunc_sel) |
| 3997 | switch(ibm8514.multifunc_sel) |
| 3998 | 3998 | { |
| 3999 | 3999 | case 0: |
| 4000 | | return s3.rect_height; |
| 4000 | return ibm8514.rect_height; |
| 4001 | 4001 | case 1: |
| 4002 | | return s3.scissors_top; |
| 4002 | return ibm8514.scissors_top; |
| 4003 | 4003 | case 2: |
| 4004 | | return s3.scissors_left; |
| 4004 | return ibm8514.scissors_left; |
| 4005 | 4005 | case 3: |
| 4006 | | return s3.scissors_bottom; |
| 4006 | return ibm8514.scissors_bottom; |
| 4007 | 4007 | case 4: |
| 4008 | | return s3.scissors_right; |
| 4008 | return ibm8514.scissors_right; |
| 4009 | 4009 | // TODO: remaining functions |
| 4010 | 4010 | default: |
| 4011 | | if(LOG_8514) logerror("S3: Unimplemented multifunction register %i selected\n",s3.multifunc_sel); |
| 4011 | if(LOG_8514) logerror("8514/A: Unimplemented multifunction register %i selected\n",ibm8514.multifunc_sel); |
| 4012 | 4012 | return 0xff; |
| 4013 | 4013 | } |
| 4014 | 4014 | } |
| 4015 | 4015 | |
| 4016 | | WRITE16_MEMBER(s3_vga_device::s3_multifunc_w ) |
| 4016 | WRITE16_MEMBER(ati_vga_device::ibm8514_multifunc_w ) |
| 4017 | 4017 | { |
| 4018 | 4018 | switch(data & 0xf000) |
| 4019 | 4019 | { |
| r18236 | r18237 | |
| 4024 | 4024 | 0-11 (80x +) Rectangle Height. See above |
| 4025 | 4025 | */ |
| 4026 | 4026 | case 0x0000: |
| 4027 | | s3.rect_height = data & 0x0fff; |
| 4028 | | if(LOG_8514) logerror("S3: Minor Axis Pixel Count / Rectangle Height write %04x\n",data); |
| 4027 | ibm8514.rect_height = data & 0x0fff; |
| 4028 | if(LOG_8514) logerror("8514/A: Minor Axis Pixel Count / Rectangle Height write %04x\n",data); |
| 4029 | 4029 | break; |
| 4030 | 4030 | /* |
| 4031 | 4031 | BEE8h index 01h W(R/W): Top Scissors Register (SCISSORS_T). |
| r18236 | r18237 | |
| 4049 | 4049 | 0-11 (80x +) Clipping Bottom Limit. See above. |
| 4050 | 4050 | */ |
| 4051 | 4051 | case 0x1000: |
| 4052 | | s3.scissors_top = data & 0x0fff; |
| 4052 | ibm8514.scissors_top = data & 0x0fff; |
| 4053 | 4053 | if(LOG_8514) logerror("S3: Scissors Top write %04x\n",data); |
| 4054 | 4054 | break; |
| 4055 | 4055 | case 0x2000: |
| 4056 | | s3.scissors_left = data & 0x0fff; |
| 4056 | ibm8514.scissors_left = data & 0x0fff; |
| 4057 | 4057 | if(LOG_8514) logerror("S3: Scissors Left write %04x\n",data); |
| 4058 | 4058 | break; |
| 4059 | 4059 | case 0x3000: |
| 4060 | | s3.scissors_bottom = data & 0x0fff; |
| 4060 | ibm8514.scissors_bottom = data & 0x0fff; |
| 4061 | 4061 | if(LOG_8514) logerror("S3: Scissors Bottom write %04x\n",data); |
| 4062 | 4062 | break; |
| 4063 | 4063 | case 0x4000: |
| 4064 | | s3.scissors_right = data & 0x0fff; |
| 4064 | ibm8514.scissors_right = data & 0x0fff; |
| 4065 | 4065 | if(LOG_8514) logerror("S3: Scissors Right write %04x\n",data); |
| 4066 | 4066 | break; |
| 4067 | 4067 | /* |
| r18236 | r18237 | |
| 4075 | 4075 | 3 Video memory determines the Mix register used. |
| 4076 | 4076 | */ |
| 4077 | 4077 | case 0xa000: |
| 4078 | | s3.pixel_control = data; |
| 4078 | ibm8514.pixel_control = data; |
| 4079 | 4079 | if(LOG_8514) logerror("S3: Pixel control write %04x\n",data); |
| 4080 | 4080 | break; |
| 4081 | 4081 | /* |
| r18236 | r18237 | |
| 4097 | 4097 | 10: Read will return contents of BEE8h index 0Dh |
| 4098 | 4098 | */ |
| 4099 | 4099 | case 0xf000: |
| 4100 | | s3.multifunc_sel = data & 0x000f; |
| 4100 | ibm8514.multifunc_sel = data & 0x000f; |
| 4101 | 4101 | if(LOG_8514) logerror("S3: Multifunction select write %04x\n",data); |
| 4102 | 4102 | default: |
| 4103 | 4103 | if(LOG_8514) logerror("S3: Unimplemented multifunction register %i write %03x\n",data >> 12,data & 0x0fff); |
| 4104 | 4104 | } |
| 4105 | 4105 | } |
| 4106 | 4106 | |
| 4107 | | void s3_vga_device::s3_wait_draw() |
| 4107 | void ati_vga_device::ibm8514_wait_draw() |
| 4108 | 4108 | { |
| 4109 | 4109 | int x, data_size = 8; |
| 4110 | 4110 | UINT32 off; |
| 4111 | 4111 | |
| 4112 | 4112 | // the data in the pixel transfer register or written to VRAM masks the rectangle output |
| 4113 | | if(s3.bus_size == 0) // 8-bit |
| 4113 | if(ibm8514.bus_size == 0) // 8-bit |
| 4114 | 4114 | data_size = 8; |
| 4115 | | if(s3.bus_size == 1) // 16-bit |
| 4115 | if(ibm8514.bus_size == 1) // 16-bit |
| 4116 | 4116 | data_size = 16; |
| 4117 | | if(s3.bus_size == 2) // 32-bit |
| 4117 | if(ibm8514.bus_size == 2) // 32-bit |
| 4118 | 4118 | data_size = 32; |
| 4119 | 4119 | off = 0; |
| 4120 | 4120 | off += (VGA_LINE_LENGTH * ibm8514.curr_y); |
| 4121 | 4121 | off += ibm8514.curr_x; |
| 4122 | | if(s3.current_cmd & 0x02) // "across plane mode" |
| 4122 | if(ibm8514.current_cmd & 0x02) // "across plane mode" |
| 4123 | 4123 | { |
| 4124 | 4124 | for(x=0;x<data_size;x++) |
| 4125 | 4125 | { |
| 4126 | | s3_write(off % vga.svga_intf.vram_size,off % vga.svga_intf.vram_size); |
| 4127 | | if(s3.current_cmd & 0x0020) |
| 4126 | ibm8514_write(off % vga.svga_intf.vram_size,off % vga.svga_intf.vram_size); |
| 4127 | if(ibm8514.current_cmd & 0x0020) |
| 4128 | 4128 | { |
| 4129 | 4129 | off++; |
| 4130 | 4130 | ibm8514.curr_x++; |
| 4131 | | if(ibm8514.curr_x > ibm8514.prev_x + s3.rect_width) |
| 4131 | if(ibm8514.curr_x > ibm8514.prev_x + ibm8514.rect_width) |
| 4132 | 4132 | { |
| 4133 | 4133 | ibm8514.curr_x = ibm8514.prev_x; |
| 4134 | | s3.src_x = 0; |
| 4135 | | if(s3.current_cmd & 0x0080) |
| 4134 | ibm8514.src_x = 0; |
| 4135 | if(ibm8514.current_cmd & 0x0080) |
| 4136 | 4136 | { |
| 4137 | 4137 | ibm8514.curr_y++; |
| 4138 | | if(ibm8514.curr_y > ibm8514.prev_y + s3.rect_height) |
| 4138 | if(ibm8514.curr_y > ibm8514.prev_y + ibm8514.rect_height) |
| 4139 | 4139 | { |
| 4140 | 4140 | ibm8514.state = IBM8514_IDLE; |
| 4141 | 4141 | ibm8514.data_avail = false; |
| r18236 | r18237 | |
| 4145 | 4145 | else |
| 4146 | 4146 | { |
| 4147 | 4147 | ibm8514.curr_y--; |
| 4148 | | if(ibm8514.curr_y < ibm8514.prev_y - s3.rect_height) |
| 4148 | if(ibm8514.curr_y < ibm8514.prev_y - ibm8514.rect_height) |
| 4149 | 4149 | { |
| 4150 | 4150 | ibm8514.state = IBM8514_IDLE; |
| 4151 | 4151 | ibm8514.data_avail = false; |
| r18236 | r18237 | |
| 4159 | 4159 | { |
| 4160 | 4160 | off--; |
| 4161 | 4161 | ibm8514.curr_x--; |
| 4162 | | if(ibm8514.curr_x < ibm8514.prev_x - s3.rect_width) |
| 4162 | if(ibm8514.curr_x < ibm8514.prev_x - ibm8514.rect_width) |
| 4163 | 4163 | { |
| 4164 | 4164 | ibm8514.curr_x = ibm8514.prev_x; |
| 4165 | | s3.src_x = 0; |
| 4166 | | if(s3.current_cmd & 0x0080) |
| 4165 | ibm8514.src_x = 0; |
| 4166 | if(ibm8514.current_cmd & 0x0080) |
| 4167 | 4167 | { |
| 4168 | 4168 | ibm8514.curr_y++; |
| 4169 | | if(ibm8514.curr_y > ibm8514.prev_y + s3.rect_height) |
| 4169 | if(ibm8514.curr_y > ibm8514.prev_y + ibm8514.rect_height) |
| 4170 | 4170 | { |
| 4171 | 4171 | ibm8514.state = IBM8514_IDLE; |
| 4172 | 4172 | ibm8514.gpbusy = false; |
| r18236 | r18237 | |
| 4176 | 4176 | else |
| 4177 | 4177 | { |
| 4178 | 4178 | ibm8514.curr_y--; |
| 4179 | | if(ibm8514.curr_y < ibm8514.prev_y - s3.rect_height) |
| 4179 | if(ibm8514.curr_y < ibm8514.prev_y - ibm8514.rect_height) |
| 4180 | 4180 | { |
| 4181 | 4181 | ibm8514.state = IBM8514_IDLE; |
| 4182 | 4182 | ibm8514.gpbusy = false; |
| r18236 | r18237 | |
| 4193 | 4193 | // "through plane" mode (single pixel) |
| 4194 | 4194 | for(x=0;x<data_size;x+=8) |
| 4195 | 4195 | { |
| 4196 | | s3_write(off % vga.svga_intf.vram_size,off % vga.svga_intf.vram_size); |
| 4196 | ibm8514_write(off % vga.svga_intf.vram_size,off % vga.svga_intf.vram_size); |
| 4197 | 4197 | |
| 4198 | | if(s3.current_cmd & 0x0020) |
| 4198 | if(ibm8514.current_cmd & 0x0020) |
| 4199 | 4199 | { |
| 4200 | 4200 | off++; |
| 4201 | 4201 | ibm8514.curr_x++; |
| 4202 | | if(ibm8514.curr_x > ibm8514.prev_x + s3.rect_width) |
| 4202 | if(ibm8514.curr_x > ibm8514.prev_x + ibm8514.rect_width) |
| 4203 | 4203 | { |
| 4204 | 4204 | ibm8514.curr_x = ibm8514.prev_x; |
| 4205 | | s3.src_x = 0; |
| 4206 | | if(s3.current_cmd & 0x0080) |
| 4205 | ibm8514.src_x = 0; |
| 4206 | if(ibm8514.current_cmd & 0x0080) |
| 4207 | 4207 | { |
| 4208 | 4208 | ibm8514.curr_y++; |
| 4209 | | if(ibm8514.curr_y > ibm8514.prev_y + s3.rect_height) |
| 4209 | if(ibm8514.curr_y > ibm8514.prev_y + ibm8514.rect_height) |
| 4210 | 4210 | { |
| 4211 | 4211 | ibm8514.state = IBM8514_IDLE; |
| 4212 | 4212 | ibm8514.gpbusy = false; |
| r18236 | r18237 | |
| 4216 | 4216 | else |
| 4217 | 4217 | { |
| 4218 | 4218 | ibm8514.curr_y--; |
| 4219 | | if(ibm8514.curr_y < ibm8514.prev_y - s3.rect_height) |
| 4219 | if(ibm8514.curr_y < ibm8514.prev_y - ibm8514.rect_height) |
| 4220 | 4220 | { |
| 4221 | 4221 | ibm8514.state = IBM8514_IDLE; |
| 4222 | 4222 | ibm8514.gpbusy = false; |
| r18236 | r18237 | |
| 4230 | 4230 | { |
| 4231 | 4231 | off--; |
| 4232 | 4232 | ibm8514.curr_x--; |
| 4233 | | if(ibm8514.curr_x < ibm8514.prev_x - s3.rect_width) |
| 4233 | if(ibm8514.curr_x < ibm8514.prev_x - ibm8514.rect_width) |
| 4234 | 4234 | { |
| 4235 | 4235 | ibm8514.curr_x = ibm8514.prev_x; |
| 4236 | | s3.src_x = 0; |
| 4237 | | if(s3.current_cmd & 0x0080) |
| 4236 | ibm8514.src_x = 0; |
| 4237 | if(ibm8514.current_cmd & 0x0080) |
| 4238 | 4238 | { |
| 4239 | 4239 | ibm8514.curr_y++; |
| 4240 | | if(ibm8514.curr_y > ibm8514.prev_y + s3.rect_height) |
| 4240 | if(ibm8514.curr_y > ibm8514.prev_y + ibm8514.rect_height) |
| 4241 | 4241 | { |
| 4242 | 4242 | ibm8514.state = IBM8514_IDLE; |
| 4243 | 4243 | ibm8514.gpbusy = false; |
| r18236 | r18237 | |
| 4247 | 4247 | else |
| 4248 | 4248 | { |
| 4249 | 4249 | ibm8514.curr_y--; |
| 4250 | | if(ibm8514.curr_y < ibm8514.prev_y - s3.rect_height) |
| 4250 | if(ibm8514.curr_y < ibm8514.prev_y - ibm8514.rect_height) |
| 4251 | 4251 | { |
| 4252 | 4252 | ibm8514.state = IBM8514_IDLE; |
| 4253 | 4253 | ibm8514.gpbusy = false; |
| r18236 | r18237 | |
| 4288 | 4288 | 2 BSS is Pixel Data from the PIX_TRANS register (E2E8h) |
| 4289 | 4289 | 3 BSS is Bitmap Data (Source data from display buffer). |
| 4290 | 4290 | */ |
| 4291 | | READ16_MEMBER(s3_vga_device::s3_backmix_r) |
| 4291 | READ16_MEMBER(ati_vga_device::ibm8514_backmix_r) |
| 4292 | 4292 | { |
| 4293 | | return s3.bgmix; |
| 4293 | return ibm8514.bgmix; |
| 4294 | 4294 | } |
| 4295 | 4295 | |
| 4296 | | WRITE16_MEMBER(s3_vga_device::s3_backmix_w) |
| 4296 | WRITE16_MEMBER(ati_vga_device::ibm8514_backmix_w) |
| 4297 | 4297 | { |
| 4298 | | s3.bgmix = data; |
| 4299 | | if(LOG_8514) logerror("S3: BG Mix write %04x\n",data); |
| 4298 | ibm8514.bgmix = data; |
| 4299 | if(LOG_8514) logerror("8514/A: BG Mix write %04x\n",data); |
| 4300 | 4300 | } |
| 4301 | 4301 | |
| 4302 | | READ16_MEMBER(s3_vga_device::s3_foremix_r) |
| 4302 | READ16_MEMBER(ati_vga_device::ibm8514_foremix_r) |
| 4303 | 4303 | { |
| 4304 | | return s3.fgmix; |
| 4304 | return ibm8514.fgmix; |
| 4305 | 4305 | } |
| 4306 | 4306 | |
| 4307 | | WRITE16_MEMBER(s3_vga_device::s3_foremix_w) |
| 4307 | WRITE16_MEMBER(ati_vga_device::ibm8514_foremix_w) |
| 4308 | 4308 | { |
| 4309 | | s3.fgmix = data; |
| 4310 | | if(LOG_8514) logerror("S3: FG Mix write %04x\n",data); |
| 4309 | ibm8514.fgmix = data; |
| 4310 | if(LOG_8514) logerror("8514/A: FG Mix write %04x\n",data); |
| 4311 | 4311 | } |
| 4312 | 4312 | |
| 4313 | | READ16_MEMBER(s3_vga_device::s3_pixel_xfer_r) |
| 4313 | READ16_MEMBER(ati_vga_device::ibm8514_pixel_xfer_r) |
| 4314 | 4314 | { |
| 4315 | 4315 | if(offset == 1) |
| 4316 | | return (s3.pixel_xfer & 0xffff0000) >> 16; |
| 4316 | return (ibm8514.pixel_xfer & 0xffff0000) >> 16; |
| 4317 | 4317 | else |
| 4318 | | return s3.pixel_xfer & 0x0000ffff; |
| 4318 | return ibm8514.pixel_xfer & 0x0000ffff; |
| 4319 | 4319 | } |
| 4320 | 4320 | |
| 4321 | | WRITE16_MEMBER(s3_vga_device::s3_pixel_xfer_w) |
| 4321 | WRITE16_MEMBER(ati_vga_device::ibm8514_pixel_xfer_w) |
| 4322 | 4322 | { |
| 4323 | 4323 | if(offset == 1) |
| 4324 | | s3.pixel_xfer = (s3.pixel_xfer & 0x0000ffff) | (data << 16); |
| 4324 | ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0x0000ffff) | (data << 16); |
| 4325 | 4325 | else |
| 4326 | | s3.pixel_xfer = (s3.pixel_xfer & 0xffff0000) | data; |
| 4326 | ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xffff0000) | data; |
| 4327 | 4327 | |
| 4328 | 4328 | if(ibm8514.state == IBM8514_DRAWING_RECT) |
| 4329 | | s3_wait_draw(); |
| 4329 | ibm8514_wait_draw(); |
| 4330 | 4330 | |
| 4331 | 4331 | if(ibm8514.state == IBM8514_DRAWING_SSV_1 || ibm8514.state == IBM8514_DRAWING_SSV_2) |
| 4332 | 4332 | ibm8514_wait_draw_ssv(); |
| r18236 | r18237 | |
| 4334 | 4334 | if(ibm8514.state == IBM8514_DRAWING_LINE) |
| 4335 | 4335 | ibm8514_wait_draw_vector(); |
| 4336 | 4336 | |
| 4337 | | if(LOG_8514) logerror("S3: Pixel Transfer = %08x\n",s3.pixel_xfer); |
| 4337 | if(LOG_8514) logerror("S3: Pixel Transfer = %08x\n",ibm8514.pixel_xfer); |
| 4338 | 4338 | } |
| 4339 | 4339 | |
| 4340 | 4340 | READ8_MEMBER(s3_vga_device::mem_r) |
| r18236 | r18237 | |
| 4371 | 4371 | if(offset < 0x8000) |
| 4372 | 4372 | { |
| 4373 | 4373 | // pass through to the pixel transfer register (DirectX 5 wants this) |
| 4374 | | if(s3.bus_size == 0) |
| 4374 | if(ibm8514.bus_size == 0) |
| 4375 | 4375 | { |
| 4376 | | s3.pixel_xfer = (s3.pixel_xfer & 0xffffff00) | data; |
| 4377 | | s3_wait_draw(); |
| 4376 | ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xffffff00) | data; |
| 4377 | ibm8514_wait_draw(); |
| 4378 | 4378 | } |
| 4379 | | if(s3.bus_size == 1) |
| 4379 | if(ibm8514.bus_size == 1) |
| 4380 | 4380 | { |
| 4381 | 4381 | switch(offset & 0x0001) |
| 4382 | 4382 | { |
| 4383 | 4383 | case 0: |
| 4384 | 4384 | default: |
| 4385 | | s3.pixel_xfer = (s3.pixel_xfer & 0xffffff00) | data; |
| 4385 | ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xffffff00) | data; |
| 4386 | 4386 | break; |
| 4387 | 4387 | case 1: |
| 4388 | | s3.pixel_xfer = (s3.pixel_xfer & 0xffff00ff) | (data << 8); |
| 4389 | | s3_wait_draw(); |
| 4388 | ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xffff00ff) | (data << 8); |
| 4389 | ibm8514_wait_draw(); |
| 4390 | 4390 | break; |
| 4391 | 4391 | } |
| 4392 | 4392 | } |
| 4393 | | if(s3.bus_size == 2) |
| 4393 | if(ibm8514.bus_size == 2) |
| 4394 | 4394 | { |
| 4395 | 4395 | switch(offset & 0x0003) |
| 4396 | 4396 | { |
| 4397 | 4397 | case 0: |
| 4398 | 4398 | default: |
| 4399 | | s3.pixel_xfer = (s3.pixel_xfer & 0xffffff00) | data; |
| 4399 | ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xffffff00) | data; |
| 4400 | 4400 | break; |
| 4401 | 4401 | case 1: |
| 4402 | | s3.pixel_xfer = (s3.pixel_xfer & 0xffff00ff) | (data << 8); |
| 4402 | ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xffff00ff) | (data << 8); |
| 4403 | 4403 | break; |
| 4404 | 4404 | case 2: |
| 4405 | | s3.pixel_xfer = (s3.pixel_xfer & 0xff00ffff) | (data << 16); |
| 4405 | ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xff00ffff) | (data << 16); |
| 4406 | 4406 | break; |
| 4407 | 4407 | case 3: |
| 4408 | | s3.pixel_xfer = (s3.pixel_xfer & 0x00ffffff) | (data << 24); |
| 4409 | | s3_wait_draw(); |
| 4408 | ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0x00ffffff) | (data << 24); |
| 4409 | ibm8514_wait_draw(); |
| 4410 | 4410 | break; |
| 4411 | 4411 | } |
| 4412 | 4412 | } |
| r18236 | r18237 | |
| 4465 | 4465 | break; |
| 4466 | 4466 | case 0x8120: |
| 4467 | 4467 | case 0xa2e8: |
| 4468 | | s3.bgcolour = (s3.bgcolour & 0xff00) | data; |
| 4468 | ibm8514.bgcolour = (ibm8514.bgcolour & 0xff00) | data; |
| 4469 | 4469 | break; |
| 4470 | 4470 | case 0x8121: |
| 4471 | 4471 | case 0xa2e9: |
| 4472 | | s3.bgcolour = (s3.bgcolour & 0x00ff) | (data << 8); |
| 4472 | ibm8514.bgcolour = (ibm8514.bgcolour & 0x00ff) | (data << 8); |
| 4473 | 4473 | break; |
| 4474 | 4474 | case 0x8124: |
| 4475 | 4475 | case 0xa6e8: |
| 4476 | | s3.fgcolour = (s3.fgcolour & 0xff00) | data; |
| 4476 | ibm8514.fgcolour = (ibm8514.fgcolour & 0xff00) | data; |
| 4477 | 4477 | break; |
| 4478 | 4478 | case 0x8125: |
| 4479 | 4479 | case 0xa6e9: |
| 4480 | | s3.fgcolour = (s3.fgcolour & 0x00ff) | (data << 8); |
| 4480 | ibm8514.fgcolour = (ibm8514.fgcolour & 0x00ff) | (data << 8); |
| 4481 | 4481 | break; |
| 4482 | 4482 | case 0xb6e8: |
| 4483 | 4483 | case 0x8134: |
| 4484 | | s3.bgmix = (s3.bgmix & 0xff00) | data; |
| 4484 | ibm8514.bgmix = (ibm8514.bgmix & 0xff00) | data; |
| 4485 | 4485 | break; |
| 4486 | 4486 | case 0x8135: |
| 4487 | 4487 | case 0xb6e9: |
| 4488 | | s3.bgmix = (s3.bgmix & 0x00ff) | (data << 8); |
| 4488 | ibm8514.bgmix = (ibm8514.bgmix & 0x00ff) | (data << 8); |
| 4489 | 4489 | break; |
| 4490 | 4490 | case 0x8136: |
| 4491 | 4491 | case 0xbae8: |
| 4492 | | s3.fgmix = (s3.fgmix & 0xff00) | data; |
| 4492 | ibm8514.fgmix = (ibm8514.fgmix & 0xff00) | data; |
| 4493 | 4493 | break; |
| 4494 | 4494 | case 0x8137: |
| 4495 | 4495 | case 0xbae9: |
| 4496 | | s3.fgmix = (s3.fgmix & 0x00ff) | (data << 8); |
| 4496 | ibm8514.fgmix = (ibm8514.fgmix & 0x00ff) | (data << 8); |
| 4497 | 4497 | break; |
| 4498 | 4498 | case 0x8138: |
| 4499 | | s3.scissors_top = (s3.scissors_top & 0xff00) | data; |
| 4499 | ibm8514.scissors_top = (ibm8514.scissors_top & 0xff00) | data; |
| 4500 | 4500 | break; |
| 4501 | 4501 | case 0x8139: |
| 4502 | | s3.scissors_top = (s3.scissors_top & 0x00ff) | (data << 8); |
| 4502 | ibm8514.scissors_top = (ibm8514.scissors_top & 0x00ff) | (data << 8); |
| 4503 | 4503 | break; |
| 4504 | 4504 | case 0x813a: |
| 4505 | | s3.scissors_left = (s3.scissors_left & 0xff00) | data; |
| 4505 | ibm8514.scissors_left = (ibm8514.scissors_left & 0xff00) | data; |
| 4506 | 4506 | break; |
| 4507 | 4507 | case 0x813b: |
| 4508 | | s3.scissors_left = (s3.scissors_left & 0x00ff) | (data << 8); |
| 4508 | ibm8514.scissors_left = (ibm8514.scissors_left & 0x00ff) | (data << 8); |
| 4509 | 4509 | break; |
| 4510 | 4510 | case 0x813c: |
| 4511 | | s3.scissors_bottom = (s3.scissors_bottom & 0xff00) | data; |
| 4511 | ibm8514.scissors_bottom = (ibm8514.scissors_bottom & 0xff00) | data; |
| 4512 | 4512 | break; |
| 4513 | 4513 | case 0x813d: |
| 4514 | | s3.scissors_bottom = (s3.scissors_bottom & 0x00ff) | (data << 8); |
| 4514 | ibm8514.scissors_bottom = (ibm8514.scissors_bottom & 0x00ff) | (data << 8); |
| 4515 | 4515 | break; |
| 4516 | 4516 | case 0x813e: |
| 4517 | | s3.scissors_right = (s3.scissors_right & 0xff00) | data; |
| 4517 | ibm8514.scissors_right = (ibm8514.scissors_right & 0xff00) | data; |
| 4518 | 4518 | break; |
| 4519 | 4519 | case 0x813f: |
| 4520 | | s3.scissors_right = (s3.scissors_right & 0x00ff) | (data << 8); |
| 4520 | ibm8514.scissors_right = (ibm8514.scissors_right & 0x00ff) | (data << 8); |
| 4521 | 4521 | break; |
| 4522 | 4522 | case 0x8140: |
| 4523 | | s3.pixel_control = (s3.pixel_control & 0xff00) | data; |
| 4523 | ibm8514.pixel_control = (ibm8514.pixel_control & 0xff00) | data; |
| 4524 | 4524 | break; |
| 4525 | 4525 | case 0x8141: |
| 4526 | | s3.pixel_control = (s3.pixel_control & 0x00ff) | (data << 8); |
| 4526 | ibm8514.pixel_control = (ibm8514.pixel_control & 0x00ff) | (data << 8); |
| 4527 | 4527 | break; |
| 4528 | 4528 | case 0x8146: |
| 4529 | | s3.multifunc_sel = (s3.multifunc_sel & 0xff00) | data; |
| 4529 | ibm8514.multifunc_sel = (ibm8514.multifunc_sel & 0xff00) | data; |
| 4530 | 4530 | break; |
| 4531 | 4531 | case 0x8148: |
| 4532 | | s3.rect_height = (s3.rect_height & 0xff00) | data; |
| 4532 | ibm8514.rect_height = (ibm8514.rect_height & 0xff00) | data; |
| 4533 | 4533 | break; |
| 4534 | 4534 | case 0x8149: |
| 4535 | | s3.rect_height = (s3.rect_height & 0x00ff) | (data << 8); |
| 4535 | ibm8514.rect_height = (ibm8514.rect_height & 0x00ff) | (data << 8); |
| 4536 | 4536 | break; |
| 4537 | 4537 | case 0x814a: |
| 4538 | | s3.rect_width = (s3.rect_width & 0xff00) | data; |
| 4538 | ibm8514.rect_width = (ibm8514.rect_width & 0xff00) | data; |
| 4539 | 4539 | break; |
| 4540 | 4540 | case 0x814b: |
| 4541 | | s3.rect_width = (s3.rect_width & 0x00ff) | (data << 8); |
| 4541 | ibm8514.rect_width = (ibm8514.rect_width & 0x00ff) | (data << 8); |
| 4542 | 4542 | break; |
| 4543 | 4543 | case 0x8150: |
| 4544 | | s3.pixel_xfer = (s3.pixel_xfer & 0xffffff00) | data; |
| 4544 | ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xffffff00) | data; |
| 4545 | 4545 | if(ibm8514.state == IBM8514_DRAWING_RECT) |
| 4546 | | s3_wait_draw(); |
| 4546 | ibm8514_wait_draw(); |
| 4547 | 4547 | break; |
| 4548 | 4548 | case 0x8151: |
| 4549 | | s3.pixel_xfer = (s3.pixel_xfer & 0xffff00ff) | (data << 8); |
| 4549 | ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xffff00ff) | (data << 8); |
| 4550 | 4550 | if(ibm8514.state == IBM8514_DRAWING_RECT) |
| 4551 | | s3_wait_draw(); |
| 4551 | ibm8514_wait_draw(); |
| 4552 | 4552 | break; |
| 4553 | 4553 | case 0x8152: |
| 4554 | | s3.pixel_xfer = (s3.pixel_xfer & 0xff00ffff) | (data << 16); |
| 4554 | ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0xff00ffff) | (data << 16); |
| 4555 | 4555 | if(ibm8514.state == IBM8514_DRAWING_RECT) |
| 4556 | | s3_wait_draw(); |
| 4556 | ibm8514_wait_draw(); |
| 4557 | 4557 | break; |
| 4558 | 4558 | case 0x8153: |
| 4559 | | s3.pixel_xfer = (s3.pixel_xfer & 0x00ffffff) | (data << 24); |
| 4559 | ibm8514.pixel_xfer = (ibm8514.pixel_xfer & 0x00ffffff) | (data << 24); |
| 4560 | 4560 | if(ibm8514.state == IBM8514_DRAWING_RECT) |
| 4561 | | s3_wait_draw(); |
| 4561 | ibm8514_wait_draw(); |
| 4562 | 4562 | break; |
| 4563 | 4563 | case 0xbee8: |
| 4564 | 4564 | s3.mmio_bee8 = (s3.mmio_bee8 & 0xff00) | data; |
| 4565 | 4565 | break; |
| 4566 | 4566 | case 0xbee9: |
| 4567 | 4567 | s3.mmio_bee8 = (s3.mmio_bee8 & 0x00ff) | (data << 8); |
| 4568 | | s3_multifunc_w(space,0,s3.mmio_bee8,0xffff); |
| 4568 | ibm8514_multifunc_w(space,0,s3.mmio_bee8,0xffff); |
| 4569 | 4569 | break; |
| 4570 | 4570 | default: |
| 4571 | 4571 | if(LOG_8514) logerror("S3: MMIO offset %05x write %02x\n",offset+0xa0000,data); |
| r18236 | r18237 | |
| 5058 | 5058 | |
| 5059 | 5059 | READ16_MEMBER(ati_vga_device::mach8_bresenham_count_r) |
| 5060 | 5060 | { |
| 5061 | | return s3.rect_width & 0x1fff; |
| 5061 | return ibm8514.rect_width & 0x1fff; |
| 5062 | 5062 | } |
| 5063 | 5063 | |
| 5064 | 5064 | WRITE16_MEMBER(ati_vga_device::mach8_bresenham_count_w) |
| 5065 | 5065 | { |
| 5066 | | s3.rect_width = data & 0x1fff; |
| 5066 | ibm8514.rect_width = data & 0x1fff; |
| 5067 | 5067 | if(LOG_8514) logerror("Mach8: Bresenham count write %04x\n",data); |
| 5068 | 5068 | } |
| 5069 | 5069 | |
trunk/src/emu/video/pc_vga.h
| r18236 | r18237 | |
| 287 | 287 | extern const device_type TRIDENT_VGA; |
| 288 | 288 | |
| 289 | 289 | |
| 290 | | // ======================> s3_vga_device |
| 290 | // ======================> ati_vga_device |
| 291 | 291 | |
| 292 | | class s3_vga_device : public svga_device |
| 292 | class ati_vga_device : public svga_device |
| 293 | 293 | { |
| 294 | 294 | public: |
| 295 | 295 | // construction/destruction |
| 296 | | s3_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 297 | | s3_vga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); |
| 296 | ati_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 297 | ati_vga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); |
| 298 | 298 | |
| 299 | | virtual READ8_MEMBER(port_03b0_r); |
| 300 | | virtual WRITE8_MEMBER(port_03b0_w); |
| 301 | | virtual READ8_MEMBER(port_03c0_r); |
| 302 | | virtual WRITE8_MEMBER(port_03c0_w); |
| 303 | | virtual READ8_MEMBER(port_03d0_r); |
| 304 | | virtual WRITE8_MEMBER(port_03d0_w); |
| 305 | 299 | virtual READ8_MEMBER(mem_r); |
| 306 | 300 | virtual WRITE8_MEMBER(mem_w); |
| 307 | | |
| 308 | | virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 309 | | |
| 310 | | READ16_MEMBER(s3_line_error_r); |
| 311 | | WRITE16_MEMBER(s3_line_error_w); |
| 301 | |
| 302 | // VGA registers |
| 303 | virtual READ8_MEMBER(port_03c0_r); |
| 304 | READ8_MEMBER(ati_port_ext_r); |
| 305 | WRITE8_MEMBER(ati_port_ext_w); |
| 306 | |
| 307 | // TODO: move 8514/A registers to their own device |
| 312 | 308 | READ16_MEMBER(ibm8514_gpstatus_r); |
| 313 | | READ16_MEMBER(s3_gpstatus_r); |
| 314 | 309 | WRITE16_MEMBER(ibm8514_cmd_w); |
| 315 | | WRITE16_MEMBER(s3_cmd_w); |
| 310 | READ16_MEMBER(ibm8514_line_error_r); |
| 311 | WRITE16_MEMBER(ibm8514_line_error_w); |
| 312 | READ16_MEMBER(ibm8514_status_r); |
| 313 | WRITE16_MEMBER(ibm8514_htotal_w); |
| 314 | READ16_MEMBER(ibm8514_substatus_r); |
| 315 | WRITE16_MEMBER(ibm8514_subcontrol_w); |
| 316 | READ16_MEMBER(ibm8514_subcontrol_r); |
| 317 | READ16_MEMBER(ibm8514_htotal_r); |
| 318 | READ16_MEMBER(ibm8514_vtotal_r); |
| 319 | WRITE16_MEMBER(ibm8514_vtotal_w); |
| 320 | READ16_MEMBER(ibm8514_vdisp_r); |
| 321 | WRITE16_MEMBER(ibm8514_vdisp_w); |
| 322 | READ16_MEMBER(ibm8514_vsync_r); |
| 323 | WRITE16_MEMBER(ibm8514_vsync_w); |
| 316 | 324 | READ16_MEMBER(ibm8514_desty_r); |
| 317 | 325 | WRITE16_MEMBER(ibm8514_desty_w); |
| 318 | 326 | READ16_MEMBER(ibm8514_destx_r); |
| 319 | 327 | WRITE16_MEMBER(ibm8514_destx_w); |
| 320 | 328 | READ16_MEMBER(ibm8514_ssv_r); |
| 321 | 329 | WRITE16_MEMBER(ibm8514_ssv_w); |
| 322 | | READ16_MEMBER(s3_width_r); |
| 323 | | WRITE16_MEMBER(s3_width_w); |
| 324 | 330 | READ16_MEMBER(ibm8514_currentx_r); |
| 325 | 331 | WRITE16_MEMBER(ibm8514_currentx_w); |
| 326 | 332 | READ16_MEMBER(ibm8514_currenty_r); |
| 327 | 333 | WRITE16_MEMBER(ibm8514_currenty_w); |
| 328 | | READ16_MEMBER(s3_fgcolour_r); |
| 329 | | WRITE16_MEMBER(s3_fgcolour_w); |
| 330 | | READ16_MEMBER(s3_bgcolour_r); |
| 331 | | WRITE16_MEMBER(s3_bgcolour_w); |
| 332 | | READ16_MEMBER(s3_multifunc_r); |
| 333 | | WRITE16_MEMBER(s3_multifunc_w); |
| 334 | | READ16_MEMBER(s3_backmix_r); |
| 335 | | WRITE16_MEMBER(s3_backmix_w); |
| 336 | | READ16_MEMBER(s3_foremix_r); |
| 337 | | WRITE16_MEMBER(s3_foremix_w); |
| 338 | | READ16_MEMBER(s3_pixel_xfer_r); |
| 339 | | WRITE16_MEMBER(s3_pixel_xfer_w); |
| 340 | | |
| 334 | READ16_MEMBER(ibm8514_width_r); |
| 335 | WRITE16_MEMBER(ibm8514_width_w); |
| 336 | READ16_MEMBER(ibm8514_fgcolour_r); |
| 337 | WRITE16_MEMBER(ibm8514_fgcolour_w); |
| 338 | READ16_MEMBER(ibm8514_bgcolour_r); |
| 339 | WRITE16_MEMBER(ibm8514_bgcolour_w); |
| 340 | READ16_MEMBER(ibm8514_multifunc_r); |
| 341 | WRITE16_MEMBER(ibm8514_multifunc_w); |
| 342 | READ16_MEMBER(ibm8514_backmix_r); |
| 343 | WRITE16_MEMBER(ibm8514_backmix_w); |
| 344 | READ16_MEMBER(ibm8514_foremix_r); |
| 345 | WRITE16_MEMBER(ibm8514_foremix_w); |
| 346 | READ16_MEMBER(ibm8514_pixel_xfer_r); |
| 347 | WRITE16_MEMBER(ibm8514_pixel_xfer_w); |
| 348 | |
| 349 | // extra registers for the Mach8 |
| 350 | READ16_MEMBER(mach8_ec0_r); |
| 351 | WRITE16_MEMBER(mach8_ec0_w); |
| 352 | READ16_MEMBER(mach8_ec1_r); |
| 353 | WRITE16_MEMBER(mach8_ec1_w); |
| 354 | READ16_MEMBER(mach8_ec2_r); |
| 355 | WRITE16_MEMBER(mach8_ec2_w); |
| 356 | READ16_MEMBER(mach8_ec3_r); |
| 357 | WRITE16_MEMBER(mach8_ec3_w); |
| 358 | READ16_MEMBER(mach8_ext_fifo_r); |
| 359 | WRITE16_MEMBER(mach8_linedraw_index_w); |
| 360 | READ16_MEMBER(mach8_bresenham_count_r); |
| 361 | WRITE16_MEMBER(mach8_bresenham_count_w); |
| 362 | WRITE16_MEMBER(mach8_linedraw_w); |
| 363 | READ16_MEMBER(mach8_scratch0_r); |
| 364 | WRITE16_MEMBER(mach8_scratch0_w); |
| 365 | READ16_MEMBER(mach8_scratch1_r); |
| 366 | WRITE16_MEMBER(mach8_scratch1_w); |
| 367 | READ16_MEMBER(mach8_config1_r); |
| 368 | READ16_MEMBER(mach8_config2_r); |
| 341 | 369 | protected: |
| 342 | | // device-level overrides |
| 343 | | virtual void device_start(); |
| 344 | | |
| 370 | virtual machine_config_constructor device_mconfig_additions() const; |
| 371 | void ibm8514_wait_draw(); |
| 345 | 372 | struct |
| 346 | 373 | { |
| 347 | | UINT8 memory_config; |
| 348 | | UINT8 ext_misc_ctrl_2; |
| 349 | | UINT8 crt_reg_lock; |
| 350 | | UINT8 reg_lock1; |
| 351 | | UINT8 reg_lock2; |
| 352 | | UINT8 enable_8514; |
| 353 | | UINT8 cr53; |
| 354 | | UINT16 current_cmd; |
| 355 | | UINT16 src_x; |
| 356 | | UINT16 src_y; |
| 357 | | UINT16 rect_width; |
| 358 | | UINT16 rect_height; |
| 359 | | UINT32 fgcolour; |
| 360 | | UINT32 bgcolour; |
| 361 | | UINT16 fgmix; |
| 362 | | UINT16 bgmix; |
| 363 | | UINT32 pixel_xfer; |
| 364 | | INT16 scissors_left; |
| 365 | | INT16 scissors_right; |
| 366 | | INT16 scissors_top; |
| 367 | | INT16 scissors_bottom; |
| 368 | | UINT16 pixel_control; |
| 369 | | UINT8 bus_size; |
| 370 | | UINT8 multifunc_sel; |
| 371 | | UINT8 write_count; |
| 372 | | |
| 373 | | // data for memory-mapped I/O |
| 374 | | UINT16 mmio_9ae8; |
| 375 | | UINT16 mmio_bee8; |
| 376 | | |
| 377 | | // hardware graphics cursor |
| 378 | | UINT8 cursor_mode; |
| 379 | | UINT16 cursor_x; |
| 380 | | UINT16 cursor_y; |
| 381 | | UINT16 cursor_start_addr; |
| 382 | | UINT8 cursor_pattern_x; // cursor pattern origin |
| 383 | | UINT8 cursor_pattern_y; |
| 384 | | UINT8 cursor_fg[4]; |
| 385 | | UINT8 cursor_bg[4]; |
| 386 | | UINT8 cursor_fg_ptr; |
| 387 | | UINT8 cursor_bg_ptr; |
| 388 | | UINT8 extended_dac_ctrl; |
| 389 | | } s3; |
| 390 | | struct |
| 391 | | { |
| 392 | 374 | UINT16 htotal; // Horizontal total (9 bits) |
| 393 | 375 | UINT16 vtotal; // Vertical total adjust (3 bits), Vertical total base (9 bit) |
| 394 | 376 | UINT16 vdisp; |
| r18236 | r18237 | |
| 411 | 393 | INT16 line_axial_step; |
| 412 | 394 | INT16 line_diagonal_step; |
| 413 | 395 | INT16 line_errorterm; |
| 396 | UINT16 current_cmd; |
| 397 | UINT16 src_x; |
| 398 | UINT16 src_y; |
| 399 | INT16 scissors_left; |
| 400 | INT16 scissors_right; |
| 401 | INT16 scissors_top; |
| 402 | INT16 scissors_bottom; |
| 403 | UINT16 rect_width; |
| 404 | UINT16 rect_height; |
| 405 | UINT32 fgcolour; |
| 406 | UINT32 bgcolour; |
| 407 | UINT16 fgmix; |
| 408 | UINT16 bgmix; |
| 409 | UINT32 pixel_xfer; |
| 410 | UINT16 pixel_control; |
| 411 | UINT8 bus_size; |
| 412 | UINT8 multifunc_sel; |
| 413 | |
| 414 | 414 | int state; |
| 415 | | |
| 416 | 415 | UINT8 wait_vector_len; |
| 417 | 416 | UINT8 wait_vector_dir; |
| 418 | 417 | bool wait_vector_draw; |
| r18236 | r18237 | |
| 420 | 419 | |
| 421 | 420 | } ibm8514; |
| 422 | 421 | private: |
| 423 | | UINT8 s3_crtc_reg_read(UINT8 index); |
| 424 | | void s3_define_video_mode(void); |
| 425 | | void s3_crtc_reg_write(UINT8 index, UINT8 data); |
| 426 | | void s3_write_fg(UINT32 offset); |
| 427 | | void s3_write_bg(UINT32 offset); |
| 428 | | void s3_write(UINT32 offset, UINT32 src); |
| 422 | void ati_define_video_mode(); |
| 429 | 423 | void ibm8514_draw_vector(UINT8 len, UINT8 dir, bool draw); |
| 430 | 424 | void ibm8514_wait_draw_ssv(); |
| 431 | 425 | void ibm8514_draw_ssv(UINT8 data); |
| 432 | 426 | void ibm8514_wait_draw_vector(); |
| 433 | | void s3_wait_draw(); |
| 427 | struct |
| 428 | { |
| 429 | UINT8 ext_reg[64]; |
| 430 | UINT8 ext_reg_select; |
| 431 | UINT16 scratch0; |
| 432 | UINT16 scratch1; |
| 433 | UINT16 linedraw; |
| 434 | } ati; |
| 435 | void ibm8514_write_fg(UINT32 offset); |
| 436 | void ibm8514_write_bg(UINT32 offset); |
| 437 | void ibm8514_write(UINT32 offset, UINT32 src); |
| 434 | 438 | }; |
| 435 | 439 | |
| 436 | | |
| 437 | 440 | // device type definition |
| 438 | | extern const device_type S3_VGA; |
| 441 | extern const device_type ATI_VGA; |
| 439 | 442 | |
| 440 | 443 | |
| 441 | | // ======================> gamtor_vga_device |
| 444 | // ======================> s3_vga_device |
| 442 | 445 | |
| 443 | | class gamtor_vga_device : public svga_device |
| 446 | class s3_vga_device : public ati_vga_device |
| 444 | 447 | { |
| 445 | 448 | public: |
| 446 | 449 | // construction/destruction |
| 447 | | gamtor_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 450 | s3_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 448 | 451 | |
| 449 | | |
| 450 | 452 | virtual READ8_MEMBER(port_03b0_r); |
| 451 | 453 | virtual WRITE8_MEMBER(port_03b0_w); |
| 452 | 454 | virtual READ8_MEMBER(port_03c0_r); |
| r18236 | r18237 | |
| 456 | 458 | virtual READ8_MEMBER(mem_r); |
| 457 | 459 | virtual WRITE8_MEMBER(mem_w); |
| 458 | 460 | |
| 461 | virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 462 | |
| 463 | READ16_MEMBER(s3_gpstatus_r); |
| 464 | WRITE16_MEMBER(s3_cmd_w); |
| 465 | |
| 459 | 466 | protected: |
| 467 | // device-level overrides |
| 468 | virtual void device_start(); |
| 469 | struct |
| 470 | { |
| 471 | UINT8 memory_config; |
| 472 | UINT8 ext_misc_ctrl_2; |
| 473 | UINT8 crt_reg_lock; |
| 474 | UINT8 reg_lock1; |
| 475 | UINT8 reg_lock2; |
| 476 | UINT8 enable_8514; |
| 477 | UINT8 cr53; |
| 478 | |
| 479 | // data for memory-mapped I/O |
| 480 | UINT16 mmio_9ae8; |
| 481 | UINT16 mmio_bee8; |
| 482 | |
| 483 | // hardware graphics cursor |
| 484 | UINT8 cursor_mode; |
| 485 | UINT16 cursor_x; |
| 486 | UINT16 cursor_y; |
| 487 | UINT16 cursor_start_addr; |
| 488 | UINT8 cursor_pattern_x; // cursor pattern origin |
| 489 | UINT8 cursor_pattern_y; |
| 490 | UINT8 cursor_fg[4]; |
| 491 | UINT8 cursor_bg[4]; |
| 492 | UINT8 cursor_fg_ptr; |
| 493 | UINT8 cursor_bg_ptr; |
| 494 | UINT8 extended_dac_ctrl; |
| 495 | } s3; |
| 460 | 496 | private: |
| 497 | UINT8 s3_crtc_reg_read(UINT8 index); |
| 498 | void s3_define_video_mode(void); |
| 499 | void s3_crtc_reg_write(UINT8 index, UINT8 data); |
| 461 | 500 | }; |
| 462 | 501 | |
| 463 | 502 | |
| 464 | 503 | // device type definition |
| 465 | | extern const device_type GAMTOR_VGA; |
| 504 | extern const device_type S3_VGA; |
| 466 | 505 | |
| 467 | | // ======================> ati_vga_device |
| 468 | 506 | |
| 469 | | class ati_vga_device : public s3_vga_device |
| 507 | // ======================> gamtor_vga_device |
| 508 | |
| 509 | class gamtor_vga_device : public svga_device |
| 470 | 510 | { |
| 471 | 511 | public: |
| 472 | 512 | // construction/destruction |
| 473 | | ati_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 513 | gamtor_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 474 | 514 | |
| 515 | |
| 516 | virtual READ8_MEMBER(port_03b0_r); |
| 517 | virtual WRITE8_MEMBER(port_03b0_w); |
| 518 | virtual READ8_MEMBER(port_03c0_r); |
| 519 | virtual WRITE8_MEMBER(port_03c0_w); |
| 520 | virtual READ8_MEMBER(port_03d0_r); |
| 521 | virtual WRITE8_MEMBER(port_03d0_w); |
| 475 | 522 | virtual READ8_MEMBER(mem_r); |
| 476 | 523 | virtual WRITE8_MEMBER(mem_w); |
| 477 | | virtual READ8_MEMBER(port_03c0_r); |
| 478 | | READ8_MEMBER(ati_port_ext_r); |
| 479 | | WRITE8_MEMBER(ati_port_ext_w); |
| 480 | | READ16_MEMBER(ibm8514_status_r); |
| 481 | | WRITE16_MEMBER(ibm8514_htotal_w); |
| 482 | | READ16_MEMBER(ibm8514_substatus_r); |
| 483 | | WRITE16_MEMBER(ibm8514_subcontrol_w); |
| 484 | | READ16_MEMBER(ibm8514_subcontrol_r); |
| 485 | | READ16_MEMBER(ibm8514_htotal_r); |
| 486 | | READ16_MEMBER(ibm8514_vtotal_r); |
| 487 | | WRITE16_MEMBER(ibm8514_vtotal_w); |
| 488 | | READ16_MEMBER(ibm8514_vdisp_r); |
| 489 | | WRITE16_MEMBER(ibm8514_vdisp_w); |
| 490 | | READ16_MEMBER(ibm8514_vsync_r); |
| 491 | | WRITE16_MEMBER(ibm8514_vsync_w); |
| 492 | | READ16_MEMBER(mach8_ec0_r); |
| 493 | | WRITE16_MEMBER(mach8_ec0_w); |
| 494 | | READ16_MEMBER(mach8_ec1_r); |
| 495 | | WRITE16_MEMBER(mach8_ec1_w); |
| 496 | | READ16_MEMBER(mach8_ec2_r); |
| 497 | | WRITE16_MEMBER(mach8_ec2_w); |
| 498 | | READ16_MEMBER(mach8_ec3_r); |
| 499 | | WRITE16_MEMBER(mach8_ec3_w); |
| 500 | | READ16_MEMBER(mach8_ext_fifo_r); |
| 501 | | WRITE16_MEMBER(mach8_linedraw_index_w); |
| 502 | | READ16_MEMBER(mach8_bresenham_count_r); |
| 503 | | WRITE16_MEMBER(mach8_bresenham_count_w); |
| 504 | | WRITE16_MEMBER(mach8_linedraw_w); |
| 505 | | READ16_MEMBER(mach8_scratch0_r); |
| 506 | | WRITE16_MEMBER(mach8_scratch0_w); |
| 507 | | READ16_MEMBER(mach8_scratch1_r); |
| 508 | | WRITE16_MEMBER(mach8_scratch1_w); |
| 509 | | READ16_MEMBER(mach8_config1_r); |
| 510 | | READ16_MEMBER(mach8_config2_r); |
| 524 | |
| 511 | 525 | protected: |
| 512 | | virtual machine_config_constructor device_mconfig_additions() const; |
| 513 | 526 | private: |
| 514 | | void ati_define_video_mode(); |
| 515 | | struct |
| 516 | | { |
| 517 | | UINT8 ext_reg[64]; |
| 518 | | UINT8 ext_reg_select; |
| 519 | | UINT16 scratch0; |
| 520 | | UINT16 scratch1; |
| 521 | | UINT16 linedraw; |
| 522 | | } ati; |
| 523 | 527 | }; |
| 524 | 528 | |
| 525 | 529 | |
| 526 | 530 | // device type definition |
| 527 | | extern const device_type ATI_VGA; |
| 531 | extern const device_type GAMTOR_VGA; |
| 528 | 532 | |
| 529 | 533 | // ======================> cirrus_vga_device |
| 530 | 534 | |