src/mess/video/pc_vga.c
| r3892 | r3893 | |
| 29 | 29 | ***************************************************************************/ |
| 30 | 30 | |
| 31 | 31 | #include "driver.h" |
| 32 | | #include "deprecat.h" |
| 33 | 32 | #include "pc_vga.h" |
| 34 | 33 | #include "pc_video.h" |
| 35 | 34 | |
| r3892 | r3893 | |
| 52 | 51 | static VIDEO_RESET( ega ); |
| 53 | 52 | static VIDEO_RESET( vga ); |
| 54 | 53 | |
| 55 | | static pc_video_update_proc pc_vga_choosevideomode(int *width, int *height, struct mscrtc6845 *crtc); |
| 56 | | static pc_video_update_proc pc_ega_choosevideomode(int *width, int *height, struct mscrtc6845 *crtc); |
| 54 | static pc_video_update_proc pc_vga_choosevideomode(running_machine *machine, int *width, int *height, struct mscrtc6845 *crtc); |
| 55 | static pc_video_update_proc pc_ega_choosevideomode(running_machine *machine, int *width, int *height, struct mscrtc6845 *crtc); |
| 57 | 56 | |
| 58 | 57 | /*************************************************************************** |
| 59 | 58 | |
| r3892 | r3893 | |
| 1371 | 1370 | } |
| 1372 | 1371 | } |
| 1373 | 1372 | |
| 1374 | | static pc_video_update_proc pc_ega_choosevideomode(int *width, int *height, struct mscrtc6845 *crtc) |
| 1373 | static pc_video_update_proc pc_ega_choosevideomode(running_machine *machine, int *width, int *height, struct mscrtc6845 *crtc) |
| 1375 | 1374 | { |
| 1376 | 1375 | pc_video_update_proc proc = NULL; |
| 1377 | 1376 | int i; |
| r3892 | r3893 | |
| 1379 | 1378 | if (CRTC_ON) |
| 1380 | 1379 | { |
| 1381 | 1380 | for (i = 0; i < 16; i++) |
| 1382 | | vga.pens[i]=Machine->pens[i/*vga.attribute.data[i]&0x3f*/]; |
| 1381 | vga.pens[i]=machine->pens[i/*vga.attribute.data[i]&0x3f*/]; |
| 1383 | 1382 | |
| 1384 | 1383 | if (!GRAPHIC_MODE) |
| 1385 | 1384 | { |
| r3892 | r3893 | |
| 1397 | 1396 | return proc; |
| 1398 | 1397 | } |
| 1399 | 1398 | |
| 1400 | | static pc_video_update_proc pc_vga_choosevideomode(int *width, int *height, struct mscrtc6845 *crtc) |
| 1399 | static pc_video_update_proc pc_vga_choosevideomode(running_machine *machine, int *width, int *height, struct mscrtc6845 *crtc) |
| 1401 | 1400 | { |
| 1402 | 1401 | pc_video_update_proc proc = NULL; |
| 1403 | 1402 | int i; |
| r3892 | r3893 | |
| 1408 | 1407 | { |
| 1409 | 1408 | for (i=0; i<256;i++) |
| 1410 | 1409 | { |
| 1411 | | palette_set_color_rgb(Machine, i,(vga.dac.color[i].red & 0x3f) << 2, |
| 1410 | palette_set_color_rgb(machine, i,(vga.dac.color[i].red & 0x3f) << 2, |
| 1412 | 1411 | (vga.dac.color[i].green & 0x3f) << 2, |
| 1413 | 1412 | (vga.dac.color[i].blue & 0x3f) << 2); |
| 1414 | 1413 | } |
| r3892 | r3893 | |
| 1419 | 1418 | { |
| 1420 | 1419 | for (i=0; i<16;i++) |
| 1421 | 1420 | { |
| 1422 | | vga.pens[i] = Machine->pens[(vga.attribute.data[i]&0x0f) |
| 1421 | vga.pens[i] = machine->pens[(vga.attribute.data[i]&0x0f) |
| 1423 | 1422 | |((vga.attribute.data[0x14]&0xf)<<4)]; |
| 1424 | 1423 | } |
| 1425 | 1424 | } |
| r3892 | r3893 | |
| 1427 | 1426 | { |
| 1428 | 1427 | for (i=0; i<16;i++) |
| 1429 | 1428 | { |
| 1430 | | vga.pens[i]=Machine->pens[(vga.attribute.data[i]&0x3f) |
| 1429 | vga.pens[i]=machine->pens[(vga.attribute.data[i]&0x3f) |
| 1431 | 1430 | |((vga.attribute.data[0x14]&0xc)<<4)]; |
| 1432 | 1431 | } |
| 1433 | 1432 | } |
src/mess/video/pc_video.c
| r3892 | r3893 | |
| 19 | 19 | |
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | |
| 22 | | static pc_video_update_proc (*pc_choosevideomode)(int *width, int *height, struct mscrtc6845 *crtc); |
| 22 | static pc_video_update_proc (*pc_choosevideomode)(running_machine *machine, int *width, int *height, struct mscrtc6845 *crtc); |
| 23 | 23 | static struct mscrtc6845 *pc_crtc; |
| 24 | 24 | static int pc_anythingdirty; |
| 25 | 25 | static int pc_current_height; |
| r3892 | r3893 | |
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | struct mscrtc6845 *pc_video_start(running_machine *machine, const struct mscrtc6845_config *config, |
| 43 | | pc_video_update_proc (*choosevideomode)(int *width, int *height, struct mscrtc6845 *crtc), |
| 43 | pc_video_update_proc (*choosevideomode)(running_machine *machine, int *width, int *height, struct mscrtc6845 *crtc), |
| 44 | 44 | size_t vramsize) |
| 45 | 45 | { |
| 46 | 46 | pc_choosevideomode = choosevideomode; |
| r3892 | r3893 | |
| 82 | 82 | h = mscrtc6845_get_char_height(pc_crtc) * mscrtc6845_get_char_lines(pc_crtc); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | | video_update = pc_choosevideomode(&w, &h, pc_crtc); |
| 85 | video_update = pc_choosevideomode(screen->machine, &w, &h, pc_crtc); |
| 86 | 86 | |
| 87 | 87 | if (video_update) |
| 88 | 88 | { |
src/mess/video/pc_video.h
| r3892 | r3893 | |
| 16 | 16 | struct mscrtc6845 *crtc); |
| 17 | 17 | |
| 18 | 18 | struct mscrtc6845 *pc_video_start(running_machine *machine, const struct mscrtc6845_config *config, |
| 19 | | pc_video_update_proc (*choosevideomode)(int *width, int *height, struct mscrtc6845 *crtc), |
| 19 | pc_video_update_proc (*choosevideomode)(running_machine *machine, int *width, int *height, struct mscrtc6845 *crtc), |
| 20 | 20 | size_t vramsize); |
| 21 | 21 | |
| 22 | 22 | VIDEO_UPDATE( pc_video ); |