src/mess/video/dgn_beta.c
| r2954 | r2955 | |
| 84 | 84 | #include "includes/dgn_beta.h" |
| 85 | 85 | #include "video/m6845.h" |
| 86 | 86 | |
| 87 | | #ifdef ENABLE_DEBUGGER |
| 88 | 87 | #include "debug/debugcpu.h" |
| 89 | 88 | #include "debug/debugcon.h" |
| 90 | | #endif |
| 91 | 89 | |
| 92 | 90 | //#define LOG_VIDEO |
| 93 | 91 | |
| r2954 | r2955 | |
| 121 | 119 | |
| 122 | 120 | //static BETA_VID_MODES VIDMODE = TEXT_40x25; |
| 123 | 121 | |
| 124 | | #ifdef ENABLE_DEBUGGER |
| 122 | /* Debugging variables */ |
| 125 | 123 | static int LogRegWrites = 0; // Log register writes to debug console. |
| 126 | 124 | static int BoxColour = 1; |
| 127 | 125 | static int BoxMinX = 100; |
| r2954 | r2955 | |
| 131 | 129 | static int HSyncMin = 0; |
| 132 | 130 | static int VSyncMin = 0; |
| 133 | 131 | static int DEPos = 0; |
| 132 | static int NoScreen = 0; |
| 134 | 133 | |
| 135 | | // Debugging commands and handlers. |
| 134 | /* Debugging commands and handlers. */ |
| 136 | 135 | static void ToggleRegLog(int ref, int params, const char *param[]); |
| 137 | 136 | static void RegLog(int offset, int data); |
| 138 | 137 | static void FillScreen(int ref, int params, const char *param[]); |
| r2954 | r2955 | |
| 140 | 139 | static void VidToggle(int ref, int params, const char *param[]); |
| 141 | 140 | static void ShowVidLimits(int ref, int params, const char *param[]); |
| 142 | 141 | static void SetClkMax(int ref, int params, const char *param[]); |
| 143 | | #endif /* ENABLE_DEBUGGER */ |
| 144 | 142 | |
| 145 | 143 | static bitmap_t *bit; |
| 146 | 144 | static int MinAddr = 0xFFFF; |
| r2954 | r2955 | |
| 152 | 150 | |
| 153 | 151 | static int VidAddr = 0; // Last address reg written |
| 154 | 152 | |
| 155 | | #ifdef ENABLE_DEBUGGER |
| 156 | | static int NoScreen = 0; |
| 157 | | #endif /* ENABLE_DEBUGGER */ |
| 158 | | |
| 159 | 153 | static void beta_Set_RA(int offset, int data); |
| 160 | 154 | static void beta_Set_HSync(int offset, int data); |
| 161 | 155 | static void beta_Set_VSync(int offset, int data); |
| r2954 | r2955 | |
| 226 | 220 | void vid_set_gctrl(int data) |
| 227 | 221 | { |
| 228 | 222 | GCtrl=data; |
| 229 | | #ifdef ENABLE_DEBUGGER |
| 230 | 223 | if (LogRegWrites) |
| 231 | 224 | debug_console_printf("I28-PB=$%2X, %2X-%s-%s-%s-%s-%s-%s PC=%4X\n", |
| 232 | 225 | data, |
| r2954 | r2955 | |
| 238 | 231 | data & GCtrlSWChar ? "C0" : "C1", |
| 239 | 232 | data & GCtrlWI ? "Wi" : " ", |
| 240 | 233 | activecpu_get_pc()); |
| 241 | | |
| 242 | | |
| 243 | | #endif |
| 244 | 234 | } |
| 245 | 235 | |
| 246 | 236 | // called when the 6845 changes the character row |
| r2954 | r2955 | |
| 273 | 263 | |
| 274 | 264 | //debug_console_printf("HT=%d, HS=%d, HW=%d, (HS+HW)=%d, HT-(HS+HW)=%d\n",HT,HS,HW,(HS+HW),(HT-(HS+HW))); |
| 275 | 265 | //debug_console_printf("Scanline=%d, row=%d\n",m6845_get_scanline_counter(),m6845_get_row_counter()); |
| 276 | | #ifdef ENABLE_DEBUGGER |
| 277 | 266 | HSyncMin=beta_scr_x; |
| 278 | | #endif |
| 279 | 267 | } |
| 280 | 268 | } |
| 281 | 269 | |
| r2954 | r2955 | |
| 303 | 291 | Field=(Field+1) & 0x01; /* Invert field */ |
| 304 | 292 | // debug_console_printf("Invert field=%d\n",Field); |
| 305 | 293 | } |
| 306 | | #ifdef ENABLE_DEBUGGER |
| 307 | 294 | VSyncMin=beta_scr_y; |
| 308 | | #endif |
| 309 | 295 | } |
| 310 | 296 | |
| 311 | 297 | dgn_beta_frame_interrupt(Machine, data); |
| r2954 | r2955 | |
| 315 | 301 | { |
| 316 | 302 | beta_DE = data; |
| 317 | 303 | |
| 318 | | #ifdef ENABLE_DEBUGGER |
| 319 | 304 | if(beta_DE) |
| 320 | 305 | DEPos=beta_scr_x; |
| 321 | | #endif |
| 322 | 306 | } |
| 323 | 307 | |
| 324 | 308 | /* Video init */ |
| r2954 | r2955 | |
| 339 | 323 | DoubleY=1; |
| 340 | 324 | DrawInterlace=INTERLACE_OFF; /* No interlace by default */ |
| 341 | 325 | |
| 342 | | #ifdef ENABLE_DEBUGGER |
| 343 | 326 | /* setup debug commands */ |
| 344 | | if (machine->debug_mode) |
| 327 | if (machine->debug_flags & DEBUG_FLAG_ENABLED) |
| 345 | 328 | { |
| 346 | 329 | debug_console_register_command("beta_vid_log", CMDFLAG_NONE, 0, 0, 0,ToggleRegLog); |
| 347 | 330 | debug_console_register_command("beta_vid_fill", CMDFLAG_NONE, 0, 0, 0,FillScreen); |
| r2954 | r2955 | |
| 351 | 334 | debug_console_register_command("beta_vid_clkmax", CMDFLAG_NONE, 0, 0, 1,SetClkMax); |
| 352 | 335 | } |
| 353 | 336 | LogRegWrites=0; |
| 354 | | #endif /* ENABLE_DEBUGGER */ |
| 355 | 337 | } |
| 356 | 338 | |
| 357 | 339 | /**************************/ |
| r2954 | r2955 | |
| 727 | 709 | m6845_address_w(offset,data); |
| 728 | 710 | VidAddr=data; /* Record reg being written to */ |
| 729 | 711 | } |
| 730 | | #ifdef ENABLE_DEBUGGER |
| 731 | 712 | if (LogRegWrites) |
| 732 | 713 | RegLog(offset,data); |
| 733 | | #endif |
| 734 | 714 | } |
| 735 | 715 | |
| 736 | 716 | /* Write handler for colour, pallate ram */ |
| r2954 | r2955 | |
| 745 | 725 | * |
| 746 | 726 | *************************************/ |
| 747 | 727 | |
| 748 | | #ifdef ENABLE_DEBUGGER |
| 749 | 728 | static void ToggleRegLog(int ref, int params, const char *param[]) |
| 750 | 729 | { |
| 751 | 730 | LogRegWrites=!LogRegWrites; |
| r2954 | r2955 | |
| 843 | 822 | { |
| 844 | 823 | if(params>0) sscanf(param[0],"%d",&ClkMax); |
| 845 | 824 | } |
| 846 | | |
| 847 | | #endif |
src/mess/machine/dgn_beta.c
| r2954 | r2955 | |
| 69 | 69 | #include "machine/wd17xx.h" |
| 70 | 70 | #include "includes/crtc6845.h" |
| 71 | 71 | |
| 72 | #include "debug/debugcpu.h" |
| 73 | #include "debug/debugcon.h" |
| 74 | |
| 72 | 75 | static UINT8 *system_rom; |
| 73 | 76 | |
| 74 | 77 | #define VERBOSE 0 |
| r2954 | r2955 | |
| 85 | 88 | #define LOG_INTS(x) do { if (VERBOSE) logerror x; } while (0) |
| 86 | 89 | |
| 87 | 90 | |
| 88 | | |
| 89 | | #ifdef ENABLE_DEBUGGER |
| 90 | | #include "debug/debugcpu.h" |
| 91 | | #include "debug/debugcon.h" |
| 92 | | #endif /* ENABLE_DEBUGGER */ |
| 93 | | |
| 94 | | #ifdef ENABLE_DEBUGGER |
| 91 | /* Debugging commands and handlers. */ |
| 95 | 92 | static offs_t dgnbeta_dasm_override(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); |
| 96 | 93 | static void ToggleDatLog(int ref, int params, const char *param[]); |
| 97 | 94 | static void DumpKeys(int ref, int params, const char *param[]); |
| 98 | 95 | |
| 96 | /* Debugging variables */ |
| 99 | 97 | static int LogDatWrites; |
| 100 | | #endif /* ENABLE_DEBUGGER */ |
| 101 | 98 | |
| 102 | 99 | static READ8_HANDLER(d_pia0_pa_r); |
| 103 | 100 | static WRITE8_HANDLER(d_pia0_pa_w); |
| r2954 | r2955 | |
| 262 | 259 | if (!IsIOPage(Page)) |
| 263 | 260 | { |
| 264 | 261 | readbank = &mess_ram[MapPage*RamPageSize]; |
| 265 | | #ifdef ENABLE_DEBUGGER |
| 266 | 262 | if(LogDatWrites) |
| 267 | 263 | debug_console_printf("Mapping page %X, pageno=%X, mess_ram[%X]\n",Page,MapPage,(MapPage*RamPageSize)); |
| 268 | | #endif |
| 269 | 264 | } |
| 270 | 265 | else |
| 271 | 266 | { |
| r2954 | r2955 | |
| 308 | 303 | int Idx; |
| 309 | 304 | |
| 310 | 305 | LOG_DEFAULT_TASK(("SetDefaultTask()\n")); |
| 311 | | #ifdef ENABLE_DEBUGGER |
| 312 | 306 | if (VERBOSE) debug_console_printf("Set Default task\n"); |
| 313 | | #endif |
| 314 | 307 | |
| 315 | 308 | TaskReg=NoPagingTask; |
| 316 | 309 | |
| r2954 | r2955 | |
| 627 | 620 | RowShifter = (RowShifter<<1) | ((d_pia0_pb_last & KOutDat)>>4); |
| 628 | 621 | RowShifter &= 0x3FF; |
| 629 | 622 | LOG_KEYBOARD(("Rowshifter=$%02X Keyrow=$%02X\n",RowShifter,Keyrow)); |
| 630 | | #ifdef ENABLE_DEBUGGER |
| 631 | 623 | if (VERBOSE) debug_console_printf("rowshifter clocked, value=%3X, RowNo=%d, Keyrow=%2X\n",RowShifter,RowNo,Keyrow); |
| 632 | | #endif |
| 633 | 624 | } |
| 634 | 625 | |
| 635 | 626 | d_pia0_cb2_last=data; |
| r2954 | r2955 | |
| 1083 | 1074 | init_video(machine); |
| 1084 | 1075 | |
| 1085 | 1076 | wd17xx_init(machine, WD_TYPE_179X,dgnbeta_fdc_callback, NULL); |
| 1086 | | #ifdef ENABLE_DEBUGGER |
| 1087 | 1077 | cpuintrf_set_dasm_override(0,dgnbeta_dasm_override); |
| 1088 | | #endif /* ENABLE_DEBUGGER */ |
| 1089 | 1078 | |
| 1090 | 1079 | add_reset_callback(machine, dgnbeta_reset); |
| 1091 | 1080 | dgnbeta_reset(machine); |
| 1092 | | #ifdef ENABLE_DEBUGGER |
| 1093 | 1081 | /* setup debug commands */ |
| 1094 | | if (machine->debug_mode) |
| 1082 | if (machine->debug_flags & DEBUG_FLAG_ENABLED) |
| 1095 | 1083 | { |
| 1096 | 1084 | debug_console_register_command("beta_dat_log", CMDFLAG_NONE, 0, 0, 0,ToggleDatLog); |
| 1097 | 1085 | debug_console_register_command("beta_key_dump", CMDFLAG_NONE, 0, 0, 0,DumpKeys); |
| 1098 | 1086 | } |
| 1099 | 1087 | LogDatWrites=0; |
| 1100 | | #endif /* ENABLE_DEBUGGER */ |
| 1101 | 1088 | } |
| 1102 | 1089 | |
| 1103 | 1090 | |
| r2954 | r2955 | |
| 1106 | 1093 | OS9 Syscalls for disassembly |
| 1107 | 1094 | ****************************************************************************/ |
| 1108 | 1095 | |
| 1109 | | #ifdef ENABLE_DEBUGGER |
| 1110 | 1096 | |
| 1111 | 1097 | static const char *const os9syscalls[] = |
| 1112 | 1098 | { |
| r2954 | r2955 | |
| 1275 | 1261 | return result; |
| 1276 | 1262 | } |
| 1277 | 1263 | |
| 1278 | | #ifdef ENABLE_DEBUGGER |
| 1279 | 1264 | static void ToggleDatLog(int ref, int params, const char *param[]) |
| 1280 | 1265 | { |
| 1281 | 1266 | LogDatWrites=!LogDatWrites; |
| r2954 | r2955 | |
| 1292 | 1277 | debug_console_printf("KeyRow[%d]=%2X\n",Idx,Keyboard[Idx]); |
| 1293 | 1278 | } |
| 1294 | 1279 | } |
| 1295 | | #endif |
| 1296 | | |
| 1297 | | #endif /* ENABLE_DEBUGGER */ |
src/mess/inputx.c
| r2954 | r2955 | |
| 13 | 13 | #include "inptport.h" |
| 14 | 14 | #include "mame.h" |
| 15 | 15 | |
| 16 | | #ifdef ENABLE_DEBUGGER |
| 17 | 16 | #include "deprecat.h" |
| 18 | 17 | #include "debug/debugcon.h" |
| 19 | | #endif /* ENABLE_DEBUGGER */ |
| 20 | 18 | |
| 21 | 19 | |
| 22 | 20 | |
| r2954 | r2955 | |
| 635 | 633 | static TIMER_CALLBACK(inputx_timerproc); |
| 636 | 634 | |
| 637 | 635 | |
| 638 | | |
| 639 | | #ifdef ENABLE_DEBUGGER |
| 636 | /* Debugging commands and handlers. */ |
| 640 | 637 | static void execute_input(int ref, int params, const char *param[]); |
| 641 | 638 | static void execute_dumpkbd(int ref, int params, const char *param[]); |
| 642 | | #endif /* ENABLE_DEBUGGER */ |
| 643 | 639 | |
| 644 | 640 | |
| 645 | 641 | |
| r2954 | r2955 | |
| 671 | 667 | charqueue_empty = NULL; |
| 672 | 668 | keybuffer = NULL; |
| 673 | 669 | |
| 674 | | #ifdef ENABLE_DEBUGGER |
| 675 | | if (machine->debug_mode) |
| 670 | if (machine->debug_flags & DEBUG_FLAG_ENABLED) |
| 676 | 671 | { |
| 677 | 672 | debug_console_register_command("input", CMDFLAG_NONE, 0, 1, 1, execute_input); |
| 678 | 673 | debug_console_register_command("dumpkbd", CMDFLAG_NONE, 0, 0, 1, execute_dumpkbd); |
| 679 | 674 | } |
| 680 | | #endif /* ENABLE_DEBUGGER */ |
| 681 | 675 | |
| 682 | 676 | /* posting keys directly only makes sense for a computer */ |
| 683 | 677 | if (machine->gamedrv->flags & GAME_COMPUTER) |
| r2954 | r2955 | |
| 1512 | 1506 | natural keyboard input |
| 1513 | 1507 | -------------------------------------------------*/ |
| 1514 | 1508 | |
| 1515 | | #ifdef ENABLE_DEBUGGER |
| 1516 | 1509 | static void execute_input(int ref, int params, const char *param[]) |
| 1517 | 1510 | { |
| 1518 | 1511 | inputx_post_coded(Machine, param[0]); |
| 1519 | 1512 | } |
| 1520 | | #endif /* ENABLE_DEBUGGER */ |
| 1521 | 1513 | |
| 1522 | 1514 | |
| 1523 | 1515 | |
| r2954 | r2955 | |
| 1526 | 1518 | keyboard codes |
| 1527 | 1519 | -------------------------------------------------*/ |
| 1528 | 1520 | |
| 1529 | | #ifdef ENABLE_DEBUGGER |
| 1530 | 1521 | static void execute_dumpkbd(int ref, int params, const char *param[]) |
| 1531 | 1522 | { |
| 1532 | 1523 | const char *filename; |
| r2954 | r2955 | |
| 1593 | 1584 | fclose(file); |
| 1594 | 1585 | |
| 1595 | 1586 | } |
| 1596 | | #endif /* ENABLE_DEBUGGER */ |