src/mess/drivers/pasopia.c
| r9016 | r9017 | |
| 113 | 113 | keyb_press(KEYCODE_COMMA, ','); |
| 114 | 114 | keyb_shift_press(KEYCODE_COMMA, ';'); |
| 115 | 115 | keyb_press(KEYCODE_MINUS_PAD, '-'); |
| 116 | | |
| 116 | keyb_press(KEYCODE_PLUS_PAD, '+'); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | | static VIDEO_UPDATE( paso7 ) |
| 119 | static void draw_cg4_screen(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int width) |
| 120 | 120 | { |
| 121 | | static UINT8 *vram = memory_region(screen->machine, "vram"); |
| 121 | static UINT8 *vram = memory_region(machine, "vram"); |
| 122 | 122 | int x,y,xi,yi; |
| 123 | 123 | int count; |
| 124 | | int width; |
| 125 | 124 | |
| 126 | | bitmap_fill(bitmap, cliprect, screen->machine->pens[0]); |
| 127 | | |
| 128 | | fake_keyboard_data(screen->machine); |
| 129 | | |
| 130 | | width = x_width ? 80 : 40; |
| 131 | | |
| 132 | 125 | for(yi=0;yi<8;yi++) |
| 133 | 126 | { |
| 134 | 127 | count = yi; |
| r9016 | r9017 | |
| 146 | 139 | |
| 147 | 140 | color = pen_g<<2 | pen_r<<1 | pen_b<<0; |
| 148 | 141 | |
| 149 | | *BITMAP_ADDR16(bitmap, y+yi, x+xi) = screen->machine->pens[color+0x20]; |
| 142 | *BITMAP_ADDR16(bitmap, y+yi, x+xi) = machine->pens[color+0x20]; |
| 150 | 143 | } |
| 151 | 144 | count+=8; |
| 152 | 145 | } |
| 153 | 146 | } |
| 154 | 147 | } |
| 148 | } |
| 155 | 149 | |
| 150 | static void draw_tv_screen(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int width) |
| 151 | { |
| 152 | static UINT8 *vram = memory_region(machine, "vram"); |
| 153 | int x,y/*,xi,yi*/; |
| 154 | int count; |
| 155 | |
| 156 | 156 | count = 0x0000; |
| 157 | 157 | |
| 158 | 158 | for(y=0;y<25;y++) |
| r9016 | r9017 | |
| 160 | 160 | for(x=0;x<width;x++) |
| 161 | 161 | { |
| 162 | 162 | int tile = vram[count+0x8000]; |
| 163 | | int color = vram[count+0xc000]; |
| 163 | int attr = vram[count+0xc000]; |
| 164 | int color = attr & 7; |
| 164 | 165 | |
| 165 | | drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tile,color,0,0,x*8,y*8,0); |
| 166 | drawgfx_transpen(bitmap,cliprect,machine->gfx[0],tile,color & 7,0,0,x*8,y*8,0); |
| 166 | 167 | |
| 167 | 168 | // draw cursor |
| 168 | 169 | if(cursor_addr*8 == count) |
| r9016 | r9017 | |
| 174 | 175 | { |
| 175 | 176 | case 0x00: cursor_on = 1; break; //always on |
| 176 | 177 | case 0x20: cursor_on = 0; break; //always off |
| 177 | | case 0x40: if(screen->machine->primary_screen->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink |
| 178 | | case 0x60: if(screen->machine->primary_screen->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink |
| 178 | case 0x40: if(machine->primary_screen->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink |
| 179 | case 0x60: if(machine->primary_screen->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink |
| 179 | 180 | } |
| 180 | 181 | |
| 181 | 182 | if(cursor_on) |
| r9016 | r9017 | |
| 184 | 185 | { |
| 185 | 186 | for(xc=0;xc<8;xc++) |
| 186 | 187 | { |
| 187 | | *BITMAP_ADDR16(bitmap, y*8-yc+7, x*8+xc) = screen->machine->pens[0x27]; |
| 188 | *BITMAP_ADDR16(bitmap, y*8-yc+7, x*8+xc) = machine->pens[0x27]; |
| 188 | 189 | } |
| 189 | 190 | } |
| 190 | 191 | } |
| r9016 | r9017 | |
| 192 | 193 | count+=8; |
| 193 | 194 | } |
| 194 | 195 | } |
| 196 | } |
| 195 | 197 | |
| 198 | static void draw_mixed_screen(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect,int width) |
| 199 | { |
| 200 | static UINT8 *vram = memory_region(machine, "vram"); |
| 201 | static UINT8 *gfx_data = memory_region(machine,"font"); |
| 202 | int x,y,xi,yi; |
| 203 | int count; |
| 204 | |
| 205 | count = 0x0000; |
| 206 | |
| 207 | for(y=0;y<25;y++) |
| 208 | { |
| 209 | for(x=0;x<width;x++) |
| 210 | { |
| 211 | int tile = vram[count+0x8000]; |
| 212 | |
| 213 | for(yi=0;yi<8;yi++) |
| 214 | { |
| 215 | int attr = vram[count+0xc000+yi]; |
| 216 | |
| 217 | if(attr & 0x80) |
| 218 | { |
| 219 | for(xi=0;xi<8;xi++) |
| 220 | { |
| 221 | int pen,pen_b,pen_r,pen_g; |
| 222 | |
| 223 | pen_b = (vram[count+yi+0x0000]>>(7-xi)) & 1; |
| 224 | pen_r = (vram[count+yi+0x4000]>>(7-xi)) & 1; |
| 225 | pen_g = (vram[count+yi+0x8000]>>(7-xi)) & 1; |
| 226 | |
| 227 | pen = pen_g<<2 | pen_r<<1 | pen_b<<0; |
| 228 | |
| 229 | *BITMAP_ADDR16(bitmap, y*8+yi, x*8+xi) = machine->pens[pen+0x20]; |
| 230 | } |
| 231 | } |
| 232 | else |
| 233 | { |
| 234 | int color = attr & 7; |
| 235 | |
| 236 | for(xi=0;xi<8;xi++) |
| 237 | { |
| 238 | int pen; |
| 239 | pen = ((gfx_data[tile*8+yi]>>(7-xi)) & 1) ? color : 0; |
| 240 | |
| 241 | *BITMAP_ADDR16(bitmap, y*8+yi, x*8+xi) = machine->pens[pen+0x20]; |
| 242 | } |
| 243 | //drawgfx_transpen(bitmap,cliprect,machine->gfx[0],tile,color & 7,0,0,x*8,y*8,0); |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | // draw cursor |
| 248 | if(cursor_addr*8 == count) |
| 249 | { |
| 250 | int xc,yc,cursor_on; |
| 251 | |
| 252 | cursor_on = 0; |
| 253 | switch(cursor_raster & 0x60) |
| 254 | { |
| 255 | case 0x00: cursor_on = 1; break; //always on |
| 256 | case 0x20: cursor_on = 0; break; //always off |
| 257 | case 0x40: if(machine->primary_screen->frame_number() & 0x10) { cursor_on = 1; } break; //fast blink |
| 258 | case 0x60: if(machine->primary_screen->frame_number() & 0x20) { cursor_on = 1; } break; //slow blink |
| 259 | } |
| 260 | |
| 261 | if(cursor_on) |
| 262 | { |
| 263 | for(yc=0;yc<(8-(cursor_raster & 7));yc++) |
| 264 | { |
| 265 | for(xc=0;xc<8;xc++) |
| 266 | { |
| 267 | *BITMAP_ADDR16(bitmap, y*8-yc+7, x*8+xc) = machine->pens[0x27]; |
| 268 | } |
| 269 | } |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | count+=8; |
| 274 | } |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | static VIDEO_UPDATE( paso7 ) |
| 279 | { |
| 280 | int width; |
| 281 | |
| 282 | bitmap_fill(bitmap, cliprect, screen->machine->pens[0]); |
| 283 | |
| 284 | fake_keyboard_data(screen->machine); |
| 285 | |
| 286 | width = x_width ? 80 : 40; |
| 287 | |
| 288 | if(gfx_mode) |
| 289 | draw_mixed_screen(screen->machine,bitmap,cliprect,width); |
| 290 | else |
| 291 | { |
| 292 | draw_cg4_screen(screen->machine,bitmap,cliprect,width); |
| 293 | draw_tv_screen(screen->machine,bitmap,cliprect,width); |
| 294 | } |
| 295 | |
| 196 | 296 | return 0; |
| 197 | 297 | } |
| 198 | 298 | |
| r9016 | r9017 | |
| 578 | 678 | static WRITE8_DEVICE_HANDLER( video_attr_w ) |
| 579 | 679 | { |
| 580 | 680 | //printf("VIDEO ATTR %02x | TEXT_PAGE %02x\n",data & 0xf,data & 0x70); |
| 581 | | attr_data = data & 0xf; |
| 681 | attr_data = (data & 0x7) | ((data & 0x8)<<4); |
| 582 | 682 | } |
| 583 | 683 | |
| 584 | 684 | //#include "debugger.h" |