src/mess/video/dgn_beta.c
| r1653 | r1654 | |
| 83 | 83 | #include "includes/dgn_beta.h" |
| 84 | 84 | #include "video/m6845.h" |
| 85 | 85 | |
| 86 | | #ifdef MAME_DEBUG |
| 86 | #ifdef ENABLE_DEBUGGER |
| 87 | 87 | #include "debug/debugcpu.h" |
| 88 | 88 | #include "debug/debugcon.h" |
| 89 | 89 | #endif |
| r1653 | r1654 | |
| 120 | 120 | |
| 121 | 121 | //static BETA_VID_MODES VIDMODE = TEXT_40x25; |
| 122 | 122 | |
| 123 | | #ifdef MAME_DEBUG |
| 123 | #ifdef ENABLE_DEBUGGER |
| 124 | 124 | static int LogRegWrites = 0; // Log register writes to debug console. |
| 125 | 125 | static int BoxColour = 1; |
| 126 | 126 | static int BoxMinX = 100; |
| r1653 | r1654 | |
| 131 | 131 | static int VSyncMin = 0; |
| 132 | 132 | static int DEPos = 0; |
| 133 | 133 | |
| 134 | | // Debugginc commands and handlers. |
| 134 | // Debugging commands and handlers. |
| 135 | 135 | static void ToggleRegLog(int ref, int params, const char *param[]); |
| 136 | 136 | static void RegLog(int offset, int data); |
| 137 | 137 | static void FillScreen(int ref, int params, const char *param[]); |
| r1653 | r1654 | |
| 139 | 139 | static void VidToggle(int ref, int params, const char *param[]); |
| 140 | 140 | static void ShowVidLimits(int ref, int params, const char *param[]); |
| 141 | 141 | static void SetClkMax(int ref, int params, const char *param[]); |
| 142 | | #endif /* MAME_DEBUG */ |
| 142 | #endif /* ENABLE_DEBUGGER */ |
| 143 | 143 | |
| 144 | 144 | static mame_bitmap *bit; |
| 145 | 145 | static int MinAddr = 0xFFFF; |
| r1653 | r1654 | |
| 151 | 151 | |
| 152 | 152 | static int VidAddr = 0; // Last address reg written |
| 153 | 153 | |
| 154 | | #ifdef MAME_DEBUG |
| 154 | #ifdef ENABLE_DEBUGGER |
| 155 | 155 | static int NoScreen = 0; |
| 156 | | #endif /* MAME_DEBUG */ |
| 156 | #endif /* ENABLE_DEBUGGER */ |
| 157 | 157 | |
| 158 | 158 | static void beta_Set_RA(int offset, int data); |
| 159 | 159 | static void beta_Set_HSync(int offset, int data); |
| r1653 | r1654 | |
| 225 | 225 | void vid_set_gctrl(int data) |
| 226 | 226 | { |
| 227 | 227 | GCtrl=data; |
| 228 | | #ifdef MAME_DEBUG |
| 228 | #ifdef ENABLE_DEBUGGER |
| 229 | 229 | if (LogRegWrites) |
| 230 | 230 | debug_console_printf("I28-PB=$%2X, %2X-%s-%s-%s-%s-%s-%s PC=%4X\n", |
| 231 | 231 | data, |
| r1653 | r1654 | |
| 272 | 272 | |
| 273 | 273 | //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))); |
| 274 | 274 | //debug_console_printf("Scanline=%d, row=%d\n",m6845_get_scanline_counter(),m6845_get_row_counter()); |
| 275 | | #ifdef MAME_DEBUG |
| 275 | #ifdef ENABLE_DEBUGGER |
| 276 | 276 | HSyncMin=beta_scr_x; |
| 277 | 277 | #endif |
| 278 | 278 | } |
| r1653 | r1654 | |
| 302 | 302 | Field=(Field+1) & 0x01; /* Invert field */ |
| 303 | 303 | // debug_console_printf("Invert field=%d\n",Field); |
| 304 | 304 | } |
| 305 | | #ifdef MAME_DEBUG |
| 305 | #ifdef ENABLE_DEBUGGER |
| 306 | 306 | VSyncMin=beta_scr_y; |
| 307 | 307 | #endif |
| 308 | 308 | } |
| r1653 | r1654 | |
| 314 | 314 | { |
| 315 | 315 | beta_DE = data; |
| 316 | 316 | |
| 317 | | #ifdef MAME_DEBUG |
| 317 | #ifdef ENABLE_DEBUGGER |
| 318 | 318 | if(beta_DE) |
| 319 | 319 | DEPos=beta_scr_x; |
| 320 | 320 | #endif |
| r1653 | r1654 | |
| 338 | 338 | DoubleY=1; |
| 339 | 339 | DrawInterlace=INTERLACE_OFF; /* No interlace by default */ |
| 340 | 340 | |
| 341 | | #ifdef MAME_DEBUG |
| 341 | #ifdef ENABLE_DEBUGGER |
| 342 | 342 | /* setup debug commands */ |
| 343 | 343 | if (machine->debug_mode) |
| 344 | 344 | { |
| r1653 | r1654 | |
| 350 | 350 | debug_console_register_command("beta_vid_clkmax", CMDFLAG_NONE, 0, 0, 1,SetClkMax); |
| 351 | 351 | } |
| 352 | 352 | LogRegWrites=0; |
| 353 | | #endif /* MAME_DEBUG */ |
| 353 | #endif /* ENABLE_DEBUGGER */ |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | /**************************/ |
| r1653 | r1654 | |
| 726 | 726 | m6845_address_w(offset,data); |
| 727 | 727 | VidAddr=data; /* Record reg being written to */ |
| 728 | 728 | } |
| 729 | | #ifdef MAME_DEBUG |
| 729 | #ifdef ENABLE_DEBUGGER |
| 730 | 730 | if (LogRegWrites) |
| 731 | 731 | RegLog(offset,data); |
| 732 | 732 | #endif |
| r1653 | r1654 | |
| 744 | 744 | * |
| 745 | 745 | *************************************/ |
| 746 | 746 | |
| 747 | | #ifdef MAME_DEBUG |
| 747 | #ifdef ENABLE_DEBUGGER |
| 748 | 748 | static void ToggleRegLog(int ref, int params, const char *param[]) |
| 749 | 749 | { |
| 750 | 750 | LogRegWrites=!LogRegWrites; |
src/mess/video/m6847.c
| r1653 | r1654 | |
| 67 | 67 | #include "m6847.h" |
| 68 | 68 | #include "deprecat.h" |
| 69 | 69 | |
| 70 | | #ifdef MAME_DEBUG |
| 70 | #ifdef ENABLE_DEBUGGER |
| 71 | 71 | #include "debug/debugcpu.h" |
| 72 | 72 | #include "debug/debugcon.h" |
| 73 | 73 | #endif |
| r1653 | r1654 | |
| 1456 | 1456 | } |
| 1457 | 1457 | |
| 1458 | 1458 | |
| 1459 | | #ifdef MAME_DEBUG |
| 1459 | #ifdef ENABLE_DEBUGGER |
| 1460 | 1460 | static int get_beamx(void) |
| 1461 | 1461 | { |
| 1462 | 1462 | attotime scanline_time; |
| r1653 | r1654 | |
| 1679 | 1679 | * |
| 1680 | 1680 | *************************************/ |
| 1681 | 1681 | |
| 1682 | | #ifdef MAME_DEBUG |
| 1682 | #ifdef ENABLE_DEBUGGER |
| 1683 | 1683 | |
| 1684 | 1684 | static void execute_dumpscanline(int ref, int params, const char **param) |
| 1685 | 1685 | { |
| r1653 | r1654 | |
| 1705 | 1705 | } |
| 1706 | 1706 | } |
| 1707 | 1707 | |
| 1708 | | #endif /* MAME_DEBUG */ |
| 1708 | #endif /* ENABLE_DEBUGGER */ |
| 1709 | 1709 | |
| 1710 | 1710 | |
| 1711 | 1711 | |
| r1653 | r1654 | |
| 1921 | 1921 | logerror("\n"); |
| 1922 | 1922 | } |
| 1923 | 1923 | |
| 1924 | | #ifdef MAME_DEBUG |
| 1924 | #ifdef ENABLE_DEBUGGER |
| 1925 | 1925 | /* setup debug commands */ |
| 1926 | 1926 | if (Machine->debug_mode) |
| 1927 | 1927 | debug_console_register_command("m6847_dumpscanline", CMDFLAG_NONE, 0, 0, 0, execute_dumpscanline); |
| 1928 | | #endif /* MAME_DEBUG */ |
| 1928 | #endif /* ENABLE_DEBUGGER */ |
| 1929 | 1929 | } |
| 1930 | 1930 | |
| 1931 | 1931 | |
src/mess/inputx.c
| r1653 | r1654 | |
| 14 | 14 | #include "inptport.h" |
| 15 | 15 | #include "mame.h" |
| 16 | 16 | |
| 17 | | #ifdef MAME_DEBUG |
| 17 | #ifdef ENABLE_DEBUGGER |
| 18 | 18 | #include "debug/debugcon.h" |
| 19 | | #endif /* MAME_DEBUG */ |
| 19 | #endif /* ENABLE_DEBUGGER */ |
| 20 | 20 | |
| 21 | 21 | #define NUM_SIMUL_KEYS (UCHAR_SHIFT_END - UCHAR_SHIFT_BEGIN + 1) |
| 22 | 22 | #define LOG_INPUTX 0 |
| r1653 | r1654 | |
| 593 | 593 | |
| 594 | 594 | |
| 595 | 595 | |
| 596 | | #ifdef MAME_DEBUG |
| 596 | #ifdef ENABLE_DEBUGGER |
| 597 | 597 | static void execute_input(int ref, int params, const char *param[]) |
| 598 | 598 | { |
| 599 | 599 | inputx_post_coded(param[0]); |
| 600 | 600 | } |
| 601 | | #endif /* MAME_DEBUG */ |
| 601 | #endif /* ENABLE_DEBUGGER */ |
| 602 | 602 | |
| 603 | 603 | |
| 604 | 604 | |
| r1653 | r1654 | |
| 646 | 646 | charqueue_empty = NULL; |
| 647 | 647 | keybuffer = NULL; |
| 648 | 648 | |
| 649 | | #ifdef MAME_DEBUG |
| 649 | #ifdef ENABLE_DEBUGGER |
| 650 | 650 | if (Machine->debug_mode) |
| 651 | 651 | debug_console_register_command("input", CMDFLAG_NONE, 0, 1, 1, execute_input); |
| 652 | | #endif /* MAME_DEBUG */ |
| 652 | #endif /* ENABLE_DEBUGGER */ |
| 653 | 653 | |
| 654 | 654 | /* posting keys directly only makes sense for a computer */ |
| 655 | 655 | if (Machine->gamedrv->flags & GAME_COMPUTER) |
src/mess/machine/dgn_beta.c
| r1653 | r1654 | |
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | |
| 90 | | #ifdef MAME_DEBUG |
| 90 | #ifdef ENABLE_DEBUGGER |
| 91 | 91 | #include "debug/debugcpu.h" |
| 92 | 92 | #include "debug/debugcon.h" |
| 93 | | #endif /* MAME_DEBUG */ |
| 93 | #endif /* ENABLE_DEBUGGER */ |
| 94 | 94 | |
| 95 | | #ifdef MAME_DEBUG |
| 95 | #ifdef ENABLE_DEBUGGER |
| 96 | 96 | static offs_t dgnbeta_dasm_override(char *buffer, offs_t pc, const UINT8 *oprom, const UINT8 *opram); |
| 97 | 97 | static void ToggleDatLog(int ref, int params, const char *param[]); |
| 98 | 98 | static void DumpKeys(int ref, int params, const char *param[]); |
| 99 | 99 | |
| 100 | 100 | static int LogDatWrites; |
| 101 | | #endif /* MAME_DEBUG */ |
| 101 | #endif /* ENABLE_DEBUGGER */ |
| 102 | 102 | |
| 103 | 103 | static READ8_HANDLER(d_pia0_pa_r); |
| 104 | 104 | static WRITE8_HANDLER(d_pia0_pa_w); |
| r1653 | r1654 | |
| 263 | 263 | if (!IsIOPage(Page)) |
| 264 | 264 | { |
| 265 | 265 | readbank = &mess_ram[MapPage*RamPageSize]; |
| 266 | | #ifdef MAME_DEBUG |
| 266 | #ifdef ENABLE_DEBUGGER |
| 267 | 267 | if(LogDatWrites) |
| 268 | 268 | debug_console_printf("Mapping page %X, pageno=%X, mess_ram[%X]\n",Page,MapPage,(MapPage*RamPageSize)); |
| 269 | 269 | #endif |
| r1653 | r1654 | |
| 309 | 309 | int Idx; |
| 310 | 310 | |
| 311 | 311 | LOG_DEFAULT_TASK(("SetDefaultTask()\n")); |
| 312 | | #ifdef MAME_DEBUG |
| 312 | #ifdef ENABLE_DEBUGGER |
| 313 | 313 | if (VERBOSE) debug_console_printf("Set Default task\n"); |
| 314 | 314 | #endif |
| 315 | 315 | |
| r1653 | r1654 | |
| 638 | 638 | RowShifter = (RowShifter<<1) | ((d_pia0_pb_last & KOutDat)>>4); |
| 639 | 639 | RowShifter &= 0x3FF; |
| 640 | 640 | LOG_KEYBOARD(("Rowshifter=$%02X Keyrow=$%02X\n",RowShifter,Keyrow)); |
| 641 | | #ifdef MAME_DEBUG |
| 641 | #ifdef ENABLE_DEBUGGER |
| 642 | 642 | if (VERBOSE) debug_console_printf("rowshifter clocked, value=%3X, RowNo=%d, Keyrow=%2X\n",RowShifter,RowNo,Keyrow); |
| 643 | 643 | #endif |
| 644 | 644 | } |
| r1653 | r1654 | |
| 1098 | 1098 | init_video(machine); |
| 1099 | 1099 | |
| 1100 | 1100 | wd17xx_init(WD_TYPE_179X,dgnbeta_fdc_callback, NULL); |
| 1101 | | #ifdef MAME_DEBUG |
| 1101 | #ifdef ENABLE_DEBUGGER |
| 1102 | 1102 | cpuintrf_set_dasm_override(0,dgnbeta_dasm_override); |
| 1103 | | #endif /* MAME_DEBUG */ |
| 1103 | #endif /* ENABLE_DEBUGGER */ |
| 1104 | 1104 | |
| 1105 | 1105 | add_reset_callback(machine, dgnbeta_reset); |
| 1106 | 1106 | dgnbeta_reset(machine); |
| 1107 | | #ifdef MAME_DEBUG |
| 1107 | #ifdef ENABLE_DEBUGGER |
| 1108 | 1108 | /* setup debug commands */ |
| 1109 | 1109 | if (machine->debug_mode) |
| 1110 | 1110 | { |
| r1653 | r1654 | |
| 1112 | 1112 | debug_console_register_command("beta_key_dump", CMDFLAG_NONE, 0, 0, 0,DumpKeys); |
| 1113 | 1113 | } |
| 1114 | 1114 | LogDatWrites=0; |
| 1115 | | #endif /* MAME_DEBUG */ |
| 1115 | #endif /* ENABLE_DEBUGGER */ |
| 1116 | 1116 | } |
| 1117 | 1117 | |
| 1118 | 1118 | |
| r1653 | r1654 | |
| 1121 | 1121 | OS9 Syscalls for disassembly |
| 1122 | 1122 | ****************************************************************************/ |
| 1123 | 1123 | |
| 1124 | | #ifdef MAME_DEBUG |
| 1124 | #ifdef ENABLE_DEBUGGER |
| 1125 | 1125 | |
| 1126 | 1126 | static const char *const os9syscalls[] = |
| 1127 | 1127 | { |
| r1653 | r1654 | |
| 1290 | 1290 | return result; |
| 1291 | 1291 | } |
| 1292 | 1292 | |
| 1293 | | #ifdef MAME_DEBUG |
| 1293 | #ifdef ENABLE_DEBUGGER |
| 1294 | 1294 | static void ToggleDatLog(int ref, int params, const char *param[]) |
| 1295 | 1295 | { |
| 1296 | 1296 | LogDatWrites=!LogDatWrites; |
| r1653 | r1654 | |
| 1309 | 1309 | } |
| 1310 | 1310 | #endif |
| 1311 | 1311 | |
| 1312 | | #endif /* MAME_DEBUG */ |
| 1312 | #endif /* ENABLE_DEBUGGER */ |