src/mess/video/dgn_beta.c
| r3914 | r3915 | |
| 80 | 80 | */ |
| 81 | 81 | |
| 82 | 82 | #include "driver.h" |
| 83 | | #include "deprecat.h" |
| 84 | 83 | #include "includes/dgn_beta.h" |
| 85 | 84 | #include "video/m6845.h" |
| 86 | 85 | |
| r3914 | r3915 | |
| 133 | 132 | |
| 134 | 133 | /* Debugging commands and handlers. */ |
| 135 | 134 | static void execute_beta_vid_log(running_machine *machine, int ref, int params, const char *param[]); |
| 136 | | static void RegLog(int offset, int data); |
| 135 | static void RegLog(running_machine *machine, int offset, int data); |
| 137 | 136 | static void execute_beta_vid_fill(running_machine *machine, int ref, int params, const char *param[]); |
| 138 | 137 | static void execute_beta_vid_box(running_machine *machine, int ref, int params, const char *param[]); |
| 139 | 138 | static void execute_beta_vid(running_machine *machine, int ref, int params, const char *param[]); |
| r3914 | r3915 | |
| 152 | 151 | |
| 153 | 152 | static void beta_Set_RA(int offset, int data); |
| 154 | 153 | static void beta_Set_HSync(running_machine *machine, int offset, int data); |
| 155 | | static void beta_Set_VSync(int offset, int data); |
| 154 | static void beta_Set_VSync(running_machine *machine, int offset, int data); |
| 156 | 155 | static void beta_Set_DE(int offset, int data); |
| 157 | 156 | |
| 158 | 157 | static const struct m6845_interface beta_m6845_interface = { |
| r3914 | r3915 | |
| 217 | 216 | /* 6821-I28, this allows the 6845 to access the full 64K address range, however */ |
| 218 | 217 | /* since the ram data is addressed as a 16bit wide unit, this allows the 6845 */ |
| 219 | 218 | /* access to the first 128K or ram. */ |
| 220 | | void vid_set_gctrl(int data) |
| 219 | void vid_set_gctrl(running_machine *machine, int data) |
| 221 | 220 | { |
| 222 | 221 | GCtrl=data; |
| 223 | 222 | if (LogRegWrites) |
| 224 | | debug_console_printf(Machine, "I28-PB=$%2X, %2X-%s-%s-%s-%s-%s-%s PC=%4X\n", |
| 223 | debug_console_printf(machine, "I28-PB=$%2X, %2X-%s-%s-%s-%s-%s-%s PC=%4X\n", |
| 225 | 224 | data, |
| 226 | 225 | data & GCtrlAddrLines, |
| 227 | 226 | data & GCtrlFS ? "FS" : " ", |
| r3914 | r3915 | |
| 230 | 229 | data & GCtrlHiLo ? "Hi" : "Lo", |
| 231 | 230 | data & GCtrlSWChar ? "C0" : "C1", |
| 232 | 231 | data & GCtrlWI ? "Wi" : " ", |
| 233 | | cpu_get_pc( Machine->cpu[0] )); |
| 232 | cpu_get_pc( machine->cpu[0] )); |
| 234 | 233 | } |
| 235 | 234 | |
| 236 | 235 | // called when the 6845 changes the character row |
| r3914 | r3915 | |
| 268 | 267 | } |
| 269 | 268 | |
| 270 | 269 | // called when the 6845 changes the VSync |
| 271 | | static void beta_Set_VSync(int offset, int data) |
| 270 | static void beta_Set_VSync(running_machine *machine, int offset, int data) |
| 272 | 271 | { |
| 273 | 272 | beta_VSync=data; |
| 274 | 273 | if (!beta_VSync) |
| r3914 | r3915 | |
| 294 | 293 | VSyncMin=beta_scr_y; |
| 295 | 294 | } |
| 296 | 295 | |
| 297 | | dgn_beta_frame_interrupt(Machine, data); |
| 296 | dgn_beta_frame_interrupt(machine, data); |
| 298 | 297 | } |
| 299 | 298 | |
| 300 | 299 | static void beta_Set_DE(int offset, int data) |
| r3914 | r3915 | |
| 710 | 709 | VidAddr=data; /* Record reg being written to */ |
| 711 | 710 | } |
| 712 | 711 | if (LogRegWrites) |
| 713 | | RegLog(offset,data); |
| 712 | RegLog(space->machine, offset,data); |
| 714 | 713 | } |
| 715 | 714 | |
| 716 | 715 | /* Write handler for colour, pallate ram */ |
| r3914 | r3915 | |
| 733 | 732 | } |
| 734 | 733 | |
| 735 | 734 | |
| 736 | | static void RegLog(int offset, int data) |
| 735 | static void RegLog(running_machine *machine, int offset, int data) |
| 737 | 736 | { |
| 738 | 737 | char RegName[16]; |
| 739 | 738 | |
| r3914 | r3915 | |
| 758 | 757 | } |
| 759 | 758 | |
| 760 | 759 | if(offset&0x1) |
| 761 | | debug_console_printf(Machine, "6845 write Reg %s Addr=%3d Data=%3d ($%2.2X) \n",RegName,VidAddr,data,data); |
| 760 | debug_console_printf(machine, "6845 write Reg %s Addr=%3d Data=%3d ($%2.2X) \n",RegName,VidAddr,data,data); |
| 762 | 761 | } |
| 763 | 762 | |
| 764 | 763 | static void execute_beta_vid_fill(running_machine *machine, int ref, int params, const char *param[]) |
src/mess/video/m6845.c
| r3914 | r3915 | |
| 9 | 9 | ************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "driver.h" |
| 12 | #include "deprecat.h" |
| 12 | 13 | #include "video/m6845.h" |
| 13 | 14 | |
| 14 | 15 | #define True 1 |
| r3914 | r3915 | |
| 485 | 486 | if (crtc.Character_Row_Counter==R7_vertical_sync_position) |
| 486 | 487 | { |
| 487 | 488 | crtc.VSYNC=True; |
| 488 | | if (crct6845_calls.out_VS_func) (crct6845_calls.out_VS_func)(0,crtc.VSYNC); /* call VS update */ |
| 489 | if (crct6845_calls.out_VS_func) (crct6845_calls.out_VS_func)(machine, 0,crtc.VSYNC); /* call VS update */ |
| 489 | 490 | } |
| 490 | 491 | |
| 491 | 492 | |
| r3914 | r3915 | |
| 499 | 500 | { |
| 500 | 501 | crtc.Vertical_Sync_Width_Counter=0; |
| 501 | 502 | crtc.VSYNC=False; |
| 502 | | if (crct6845_calls.out_VS_func) (crct6845_calls.out_VS_func)(0,crtc.VSYNC); /* call VS update */ |
| 503 | if (crct6845_calls.out_VS_func) (crct6845_calls.out_VS_func)(machine, 0,crtc.VSYNC); /* call VS update */ |
| 503 | 504 | } |
| 504 | 505 | } |
| 505 | 506 | |
| r3914 | r3915 | |
| 525 | 526 | if (crtc.Character_Row_Counter==R7_vertical_sync_position) |
| 526 | 527 | { |
| 527 | 528 | crtc.VSYNC=True; |
| 528 | | if (crct6845_calls.out_VS_func) (crct6845_calls.out_VS_func)(0,crtc.VSYNC); /* call VS update */ |
| 529 | if (crct6845_calls.out_VS_func) (crct6845_calls.out_VS_func)(machine,0,crtc.VSYNC); /* call VS update */ |
| 529 | 530 | } |
| 530 | 531 | } |
| 531 | 532 | } |
| r3914 | r3915 | |
| 837 | 838 | crtc.VSYNC = 0; |
| 838 | 839 | |
| 839 | 840 | /* call function to let emulation "know" */ |
| 840 | | if (crct6845_calls.out_VS_func) (crct6845_calls.out_VS_func)(0,crtc.VSYNC); /* call VS update */ |
| 841 | if (crct6845_calls.out_VS_func) (crct6845_calls.out_VS_func)(Machine,0,crtc.VSYNC); /* call VS update */ |
| 841 | 842 | |
| 842 | 843 | |
| 843 | 844 | /* if we got to here the vsync has just ended */ |
| r3914 | r3915 | |
| 857 | 858 | crtc.VSYNC = 1; |
| 858 | 859 | |
| 859 | 860 | /* call function to let emulation "know" */ |
| 860 | | if (crct6845_calls.out_VS_func) (crct6845_calls.out_VS_func)(0,crtc.VSYNC); /* call VS update */ |
| 861 | if (crct6845_calls.out_VS_func) (crct6845_calls.out_VS_func)(Machine,0,crtc.VSYNC); /* call VS update */ |
| 861 | 862 | |
| 862 | 863 | |
| 863 | 864 | /* if we got to here the vsync has just been set, and has just started */ |