trunk/src/emu/bus/ieee488/c2040fdc.c
| r242315 | r242316 | |
| 9 | 9 | |
| 10 | 10 | **********************************************************************/ |
| 11 | 11 | |
| 12 | | /* |
| 13 | | |
| 14 | | TODO: |
| 15 | | |
| 16 | | - writing starts in the middle of a byte |
| 17 | | - 8050 PLL |
| 18 | | |
| 19 | | */ |
| 20 | | |
| 21 | 12 | #include "c2040fdc.h" |
| 22 | 13 | |
| 23 | 14 | |
| r242315 | r242316 | |
| 35 | 26 | //************************************************************************** |
| 36 | 27 | |
| 37 | 28 | const device_type C2040_FDC = &device_creator<c2040_fdc_t>; |
| 38 | | const device_type C8050_FDC = &device_creator<c8050_fdc_t>; |
| 39 | 29 | |
| 40 | 30 | |
| 41 | 31 | //------------------------------------------------- |
| r242315 | r242316 | |
| 67 | 57 | // c2040_fdc_t - constructor |
| 68 | 58 | //------------------------------------------------- |
| 69 | 59 | |
| 70 | | c2040_fdc_t::c2040_fdc_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : |
| 71 | | device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__), |
| 72 | | m_write_sync(*this), |
| 73 | | m_write_ready(*this), |
| 74 | | m_write_error(*this), |
| 75 | | m_gcr_rom(*this, "gcr"), |
| 76 | | m_floppy0(NULL), |
| 77 | | m_floppy1(NULL), |
| 78 | | m_mtr0(1), |
| 79 | | m_mtr1(1), |
| 80 | | m_stp0(0), |
| 81 | | m_stp1(0), |
| 82 | | m_ds(0), |
| 83 | | m_drv_sel(0), |
| 84 | | m_mode_sel(0), |
| 85 | | m_rw_sel(0), |
| 86 | | m_period(attotime::from_hz(clock)) |
| 87 | | { |
| 88 | | cur_live.tm = attotime::never; |
| 89 | | cur_live.state = IDLE; |
| 90 | | cur_live.next_state = -1; |
| 91 | | cur_live.write_position = 0; |
| 92 | | cur_live.write_start_time = attotime::never; |
| 93 | | } |
| 94 | | |
| 95 | 60 | c2040_fdc_t::c2040_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 96 | 61 | device_t(mconfig, C2040_FDC, "C2040 FDC", tag, owner, clock, "c2040fdc", __FILE__), |
| 97 | 62 | m_write_sync(*this), |
| r242315 | r242316 | |
| 118 | 83 | cur_live.drv_sel = m_drv_sel; |
| 119 | 84 | } |
| 120 | 85 | |
| 121 | | c8050_fdc_t::c8050_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 122 | | c2040_fdc_t(mconfig, C8050_FDC, "C8050 FDC", tag, owner, clock, "c8050fdc", __FILE__) { } |
| 123 | 86 | |
| 124 | 87 | |
| 125 | | |
| 126 | 88 | //------------------------------------------------- |
| 127 | 89 | // device_start - device-specific startup |
| 128 | 90 | //------------------------------------------------- |
| r242315 | r242316 | |
| 635 | 597 | m_floppy0 = floppy0; |
| 636 | 598 | m_floppy1 = floppy1; |
| 637 | 599 | } |
| 638 | | |
| 639 | | void c8050_fdc_t::live_start() |
| 640 | | { |
| 641 | | cur_live.tm = machine().time(); |
| 642 | | cur_live.state = RUNNING; |
| 643 | | cur_live.next_state = -1; |
| 644 | | |
| 645 | | cur_live.shift_reg = 0; |
| 646 | | cur_live.shift_reg_write = 0; |
| 647 | | cur_live.cycle_counter = 0; |
| 648 | | cur_live.cell_counter = 0; |
| 649 | | cur_live.bit_counter = 0; |
| 650 | | cur_live.ds = m_ds; |
| 651 | | cur_live.drv_sel = m_drv_sel; |
| 652 | | cur_live.mode_sel = m_mode_sel; |
| 653 | | cur_live.rw_sel = m_rw_sel; |
| 654 | | cur_live.pi = m_pi; |
| 655 | | |
| 656 | | pll_reset(cur_live.tm, attotime::from_double(0)); |
| 657 | | checkpoint_live = cur_live; |
| 658 | | pll_save_checkpoint(); |
| 659 | | |
| 660 | | live_run(); |
| 661 | | } |
| 662 | | |
| 663 | | void c8050_fdc_t::pll_reset(const attotime &when, const attotime clock) |
| 664 | | { |
| 665 | | cur_pll.reset(when); |
| 666 | | cur_pll.set_clock(clock); |
| 667 | | } |
| 668 | | |
| 669 | | void c8050_fdc_t::pll_save_checkpoint() |
| 670 | | { |
| 671 | | checkpoint_pll = cur_pll; |
| 672 | | } |
| 673 | | |
| 674 | | void c8050_fdc_t::pll_retrieve_checkpoint() |
| 675 | | { |
| 676 | | cur_pll = checkpoint_pll; |
| 677 | | } |
| 678 | | |
| 679 | | void c8050_fdc_t::checkpoint() |
| 680 | | { |
| 681 | | checkpoint_live = cur_live; |
| 682 | | pll_save_checkpoint(); |
| 683 | | } |
| 684 | | |
| 685 | | void c8050_fdc_t::rollback() |
| 686 | | { |
| 687 | | cur_live = checkpoint_live; |
| 688 | | pll_retrieve_checkpoint(); |
| 689 | | } |
| 690 | | |
| 691 | | void c8050_fdc_t::live_run(const attotime &limit) |
| 692 | | { |
| 693 | | if(cur_live.state == IDLE || cur_live.next_state != -1) |
| 694 | | return; |
| 695 | | |
| 696 | | for(;;) { |
| 697 | | switch(cur_live.state) { |
| 698 | | case RUNNING: { |
| 699 | | bool syncpoint = false; |
| 700 | | |
| 701 | | if (cur_live.tm > limit) |
| 702 | | return; |
| 703 | | |
| 704 | | int bit = get_next_bit(cur_live.tm, limit); |
| 705 | | if(bit < 0) |
| 706 | | return; |
| 707 | | |
| 708 | | if (syncpoint) { |
| 709 | | commit(cur_live.tm); |
| 710 | | |
| 711 | | cur_live.tm += m_period; |
| 712 | | live_delay(RUNNING_SYNCPOINT); |
| 713 | | return; |
| 714 | | } |
| 715 | | |
| 716 | | cur_live.tm += m_period; |
| 717 | | break; |
| 718 | | } |
| 719 | | |
| 720 | | case RUNNING_SYNCPOINT: { |
| 721 | | m_write_ready(cur_live.ready); |
| 722 | | m_write_sync(cur_live.sync); |
| 723 | | m_write_error(cur_live.error); |
| 724 | | |
| 725 | | cur_live.state = RUNNING; |
| 726 | | checkpoint(); |
| 727 | | break; |
| 728 | | } |
| 729 | | } |
| 730 | | } |
| 731 | | } |
| 732 | | |
| 733 | | int c8050_fdc_t::get_next_bit(attotime &tm, const attotime &limit) |
| 734 | | { |
| 735 | | return cur_pll.get_next_bit(tm, get_floppy(), limit); |
| 736 | | } |
| 737 | | |
| 738 | | void c8050_fdc_t::stp_w(floppy_image_device *floppy, int mtr, int &old_stp, int stp) |
| 739 | | { |
| 740 | | if (mtr) return; |
| 741 | | |
| 742 | | int tracks = 0; |
| 743 | | |
| 744 | | switch (old_stp) |
| 745 | | { |
| 746 | | case 0: if (stp == 1) tracks++; else if (stp == 2) tracks--; break; |
| 747 | | case 1: if (stp == 3) tracks++; else if (stp == 0) tracks--; break; |
| 748 | | case 2: if (stp == 0) tracks++; else if (stp == 3) tracks--; break; |
| 749 | | case 3: if (stp == 2) tracks++; else if (stp == 1) tracks--; break; |
| 750 | | } |
| 751 | | |
| 752 | | if (tracks == -1) |
| 753 | | { |
| 754 | | floppy->dir_w(1); |
| 755 | | floppy->stp_w(1); |
| 756 | | floppy->stp_w(0); |
| 757 | | } |
| 758 | | else if (tracks == 1) |
| 759 | | { |
| 760 | | floppy->dir_w(0); |
| 761 | | floppy->stp_w(1); |
| 762 | | floppy->stp_w(0); |
| 763 | | } |
| 764 | | |
| 765 | | old_stp = stp; |
| 766 | | } |
| 767 | | |
| 768 | | WRITE_LINE_MEMBER( c8050_fdc_t::odd_hd_w ) |
| 769 | | { |
| 770 | | if (m_odd_hd != state) |
| 771 | | { |
| 772 | | live_sync(); |
| 773 | | m_odd_hd = cur_live.odd_hd = state; |
| 774 | | if (LOG) logerror("%s ODD HD %u\n", machine().time().as_string(), state); |
| 775 | | m_floppy0->ss_w(!state); |
| 776 | | if (m_floppy1) m_floppy1->ss_w(!state); |
| 777 | | checkpoint(); |
| 778 | | live_run(); |
| 779 | | } |
| 780 | | } |
| 781 | | |
| 782 | | WRITE_LINE_MEMBER( c8050_fdc_t::pull_sync_w ) |
| 783 | | { |
| 784 | | // TODO |
| 785 | | if (LOG) logerror("%s PULL SYNC %u\n", machine().time().as_string(), state); |
| 786 | | } |
trunk/src/emu/bus/ieee488/c8050fdc.c
| r0 | r242316 | |
| 1 | // license:BSD-3-Clause |
| 2 | // copyright-holders:Curt Coder |
| 3 | /********************************************************************** |
| 4 | |
| 5 | Commodore 8050 floppy disk controller emulation |
| 6 | |
| 7 | Copyright MESS Team. |
| 8 | Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | |
| 10 | **********************************************************************/ |
| 11 | |
| 12 | #include "c8050fdc.h" |
| 13 | |
| 14 | |
| 15 | |
| 16 | //************************************************************************** |
| 17 | // MACROS / CONSTANTS |
| 18 | //************************************************************************** |
| 19 | |
| 20 | #define LOG 0 |
| 21 | |
| 22 | |
| 23 | |
| 24 | //************************************************************************** |
| 25 | // DEVICE DEFINITIONS |
| 26 | //************************************************************************** |
| 27 | |
| 28 | const device_type C8050_FDC = &device_creator<c8050_fdc_t>; |
| 29 | |
| 30 | |
| 31 | //------------------------------------------------- |
| 32 | // ROM( c8050_fdc ) |
| 33 | //------------------------------------------------- |
| 34 | |
| 35 | ROM_START( c8050_fdc ) |
| 36 | ROM_REGION( 0x800, "gcr", 0) |
| 37 | ROM_LOAD( "901467.uk6", 0x000, 0x800, CRC(a23337eb) SHA1(97df576397608455616331f8e837cb3404363fa2) ) |
| 38 | ROM_END |
| 39 | |
| 40 | |
| 41 | //------------------------------------------------- |
| 42 | // rom_region - device-specific ROM region |
| 43 | //------------------------------------------------- |
| 44 | |
| 45 | const rom_entry *c8050_fdc_t::device_rom_region() const |
| 46 | { |
| 47 | return ROM_NAME( c8050_fdc ); |
| 48 | } |
| 49 | |
| 50 | |
| 51 | |
| 52 | //************************************************************************** |
| 53 | // LIVE DEVICE |
| 54 | //************************************************************************** |
| 55 | |
| 56 | //------------------------------------------------- |
| 57 | // c8050_fdc_t - constructor |
| 58 | //------------------------------------------------- |
| 59 | |
| 60 | c8050_fdc_t::c8050_fdc_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 61 | device_t(mconfig, C8050_FDC, "C8050 FDC", tag, owner, clock, "c8050fdc", __FILE__), |
| 62 | m_write_sync(*this), |
| 63 | m_write_ready(*this), |
| 64 | m_write_error(*this), |
| 65 | m_gcr_rom(*this, "gcr"), |
| 66 | m_floppy0(NULL), |
| 67 | m_floppy1(NULL), |
| 68 | m_mtr0(1), |
| 69 | m_mtr1(1), |
| 70 | m_stp0(0), |
| 71 | m_stp1(0), |
| 72 | m_ds(0), |
| 73 | m_drv_sel(0), |
| 74 | m_mode_sel(0), |
| 75 | m_rw_sel(0), |
| 76 | m_period(attotime::from_hz(clock)) |
| 77 | { |
| 78 | cur_live.tm = attotime::never; |
| 79 | cur_live.state = IDLE; |
| 80 | cur_live.next_state = -1; |
| 81 | cur_live.drv_sel = m_drv_sel; |
| 82 | } |
| 83 | |
| 84 | |
| 85 | |
| 86 | //------------------------------------------------- |
| 87 | // device_start - device-specific startup |
| 88 | //------------------------------------------------- |
| 89 | |
| 90 | void c8050_fdc_t::device_start() |
| 91 | { |
| 92 | // resolve callbacks |
| 93 | m_write_sync.resolve_safe(); |
| 94 | m_write_ready.resolve_safe(); |
| 95 | m_write_error.resolve_safe(); |
| 96 | |
| 97 | // allocate timer |
| 98 | t_gen = timer_alloc(0); |
| 99 | |
| 100 | // register for state saving |
| 101 | save_item(NAME(m_mtr0)); |
| 102 | save_item(NAME(m_mtr1)); |
| 103 | save_item(NAME(m_stp0)); |
| 104 | save_item(NAME(m_stp1)); |
| 105 | save_item(NAME(m_ds)); |
| 106 | save_item(NAME(m_drv_sel)); |
| 107 | save_item(NAME(m_mode_sel)); |
| 108 | save_item(NAME(m_rw_sel)); |
| 109 | } |
| 110 | |
| 111 | |
| 112 | //------------------------------------------------- |
| 113 | // device_reset - device-specific reset |
| 114 | //------------------------------------------------- |
| 115 | |
| 116 | void c8050_fdc_t::device_reset() |
| 117 | { |
| 118 | live_abort(); |
| 119 | } |
| 120 | |
| 121 | |
| 122 | //------------------------------------------------- |
| 123 | // device_timer - handler timer events |
| 124 | //------------------------------------------------- |
| 125 | |
| 126 | void c8050_fdc_t::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 127 | { |
| 128 | live_sync(); |
| 129 | live_run(); |
| 130 | } |
| 131 | |
| 132 | floppy_image_device* c8050_fdc_t::get_floppy() |
| 133 | { |
| 134 | return cur_live.drv_sel ? m_floppy1 : m_floppy0; |
| 135 | } |
| 136 | |
| 137 | void c8050_fdc_t::stp_w(floppy_image_device *floppy, int mtr, int &old_stp, int stp) |
| 138 | { |
| 139 | if (mtr) return; |
| 140 | |
| 141 | int tracks = 0; |
| 142 | |
| 143 | switch (old_stp) |
| 144 | { |
| 145 | case 0: if (stp == 1) tracks++; else if (stp == 2) tracks--; break; |
| 146 | case 1: if (stp == 3) tracks++; else if (stp == 0) tracks--; break; |
| 147 | case 2: if (stp == 0) tracks++; else if (stp == 3) tracks--; break; |
| 148 | case 3: if (stp == 2) tracks++; else if (stp == 1) tracks--; break; |
| 149 | } |
| 150 | |
| 151 | if (tracks == -1) |
| 152 | { |
| 153 | floppy->dir_w(1); |
| 154 | floppy->stp_w(1); |
| 155 | floppy->stp_w(0); |
| 156 | } |
| 157 | else if (tracks == 1) |
| 158 | { |
| 159 | floppy->dir_w(0); |
| 160 | floppy->stp_w(1); |
| 161 | floppy->stp_w(0); |
| 162 | } |
| 163 | |
| 164 | old_stp = stp; |
| 165 | } |
| 166 | |
| 167 | void c8050_fdc_t::stp0_w(int stp) |
| 168 | { |
| 169 | if (m_stp0 != stp) |
| 170 | { |
| 171 | live_sync(); |
| 172 | this->stp_w(m_floppy0, m_mtr0, m_stp0, stp); |
| 173 | checkpoint(); |
| 174 | live_run(); |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | void c8050_fdc_t::stp1_w(int stp) |
| 179 | { |
| 180 | if (m_stp1 != stp) |
| 181 | { |
| 182 | live_sync(); |
| 183 | if (m_floppy1) this->stp_w(m_floppy1, m_mtr1, m_stp1, stp); |
| 184 | checkpoint(); |
| 185 | live_run(); |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | void c8050_fdc_t::ds_w(int ds) |
| 190 | { |
| 191 | if (m_ds != ds) |
| 192 | { |
| 193 | live_sync(); |
| 194 | m_ds = cur_live.ds = ds; |
| 195 | checkpoint(); |
| 196 | live_run(); |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | void c8050_fdc_t::set_floppy(floppy_image_device *floppy0, floppy_image_device *floppy1) |
| 201 | { |
| 202 | m_floppy0 = floppy0; |
| 203 | m_floppy1 = floppy1; |
| 204 | } |
| 205 | |
| 206 | void c8050_fdc_t::live_start() |
| 207 | { |
| 208 | cur_live.tm = machine().time(); |
| 209 | cur_live.state = RUNNING; |
| 210 | cur_live.next_state = -1; |
| 211 | |
| 212 | cur_live.shift_reg = 0; |
| 213 | cur_live.shift_reg_write = 0; |
| 214 | cur_live.cycle_counter = 0; |
| 215 | cur_live.cell_counter = 0; |
| 216 | cur_live.bit_counter = 0; |
| 217 | cur_live.ds = m_ds; |
| 218 | cur_live.drv_sel = m_drv_sel; |
| 219 | cur_live.mode_sel = m_mode_sel; |
| 220 | cur_live.rw_sel = m_rw_sel; |
| 221 | cur_live.pi = m_pi; |
| 222 | |
| 223 | pll_reset(cur_live.tm, attotime::from_double(0)); |
| 224 | checkpoint_live = cur_live; |
| 225 | pll_save_checkpoint(); |
| 226 | |
| 227 | live_run(); |
| 228 | } |
| 229 | |
| 230 | void c8050_fdc_t::pll_reset(const attotime &when, const attotime clock) |
| 231 | { |
| 232 | cur_pll.reset(when); |
| 233 | cur_pll.set_clock(clock); |
| 234 | } |
| 235 | |
| 236 | void c8050_fdc_t::pll_start_writing(const attotime &tm) |
| 237 | { |
| 238 | cur_pll.start_writing(tm); |
| 239 | } |
| 240 | |
| 241 | void c8050_fdc_t::pll_commit(floppy_image_device *floppy, const attotime &tm) |
| 242 | { |
| 243 | cur_pll.commit(floppy, tm); |
| 244 | } |
| 245 | |
| 246 | void c8050_fdc_t::pll_stop_writing(floppy_image_device *floppy, const attotime &tm) |
| 247 | { |
| 248 | cur_pll.stop_writing(floppy, tm); |
| 249 | } |
| 250 | |
| 251 | void c8050_fdc_t::pll_save_checkpoint() |
| 252 | { |
| 253 | checkpoint_pll = cur_pll; |
| 254 | } |
| 255 | |
| 256 | void c8050_fdc_t::pll_retrieve_checkpoint() |
| 257 | { |
| 258 | cur_pll = checkpoint_pll; |
| 259 | } |
| 260 | |
| 261 | int c8050_fdc_t::pll_get_next_bit(attotime &tm, floppy_image_device *floppy, const attotime &limit) |
| 262 | { |
| 263 | return cur_pll.get_next_bit(tm, floppy, limit); |
| 264 | } |
| 265 | |
| 266 | bool c8050_fdc_t::pll_write_next_bit(bool bit, attotime &tm, floppy_image_device *floppy, const attotime &limit) |
| 267 | { |
| 268 | return cur_pll.write_next_bit_prev_cell(bit, tm, floppy, limit); |
| 269 | } |
| 270 | |
| 271 | void c8050_fdc_t::checkpoint() |
| 272 | { |
| 273 | pll_commit(get_floppy(), cur_live.tm); |
| 274 | checkpoint_live = cur_live; |
| 275 | pll_save_checkpoint(); |
| 276 | } |
| 277 | |
| 278 | void c8050_fdc_t::rollback() |
| 279 | { |
| 280 | cur_live = checkpoint_live; |
| 281 | pll_retrieve_checkpoint(); |
| 282 | } |
| 283 | |
| 284 | void c8050_fdc_t::live_sync() |
| 285 | { |
| 286 | if(!cur_live.tm.is_never()) { |
| 287 | if(cur_live.tm > machine().time()) { |
| 288 | rollback(); |
| 289 | live_run(machine().time()); |
| 290 | pll_commit(get_floppy(), cur_live.tm); |
| 291 | } else { |
| 292 | pll_commit(get_floppy(), cur_live.tm); |
| 293 | if(cur_live.next_state != -1) { |
| 294 | cur_live.state = cur_live.next_state; |
| 295 | cur_live.next_state = -1; |
| 296 | } |
| 297 | if(cur_live.state == IDLE) { |
| 298 | pll_stop_writing(get_floppy(), cur_live.tm); |
| 299 | cur_live.tm = attotime::never; |
| 300 | } |
| 301 | } |
| 302 | cur_live.next_state = -1; |
| 303 | checkpoint(); |
| 304 | } |
| 305 | } |
| 306 | |
| 307 | void c8050_fdc_t::live_abort() |
| 308 | { |
| 309 | if(!cur_live.tm.is_never() && cur_live.tm > machine().time()) { |
| 310 | rollback(); |
| 311 | live_run(machine().time()); |
| 312 | } |
| 313 | |
| 314 | pll_stop_writing(get_floppy(), cur_live.tm); |
| 315 | |
| 316 | cur_live.tm = attotime::never; |
| 317 | cur_live.state = IDLE; |
| 318 | cur_live.next_state = -1; |
| 319 | |
| 320 | cur_live.ready = 1; |
| 321 | cur_live.sync = 1; |
| 322 | cur_live.error = 1; |
| 323 | } |
| 324 | |
| 325 | |
| 326 | void c8050_fdc_t::live_run(const attotime &limit) |
| 327 | { |
| 328 | if(cur_live.state == IDLE || cur_live.next_state != -1) |
| 329 | return; |
| 330 | |
| 331 | for(;;) { |
| 332 | switch(cur_live.state) { |
| 333 | case RUNNING: { |
| 334 | bool syncpoint = false; |
| 335 | |
| 336 | if (cur_live.tm > limit) |
| 337 | return; |
| 338 | |
| 339 | int bit = pll_get_next_bit(cur_live.tm, get_floppy(), limit); |
| 340 | if(bit < 0) |
| 341 | return; |
| 342 | |
| 343 | if (syncpoint) { |
| 344 | live_delay(RUNNING_SYNCPOINT); |
| 345 | return; |
| 346 | } |
| 347 | break; |
| 348 | } |
| 349 | |
| 350 | case RUNNING_SYNCPOINT: { |
| 351 | m_write_ready(cur_live.ready); |
| 352 | m_write_sync(cur_live.sync); |
| 353 | m_write_error(cur_live.error); |
| 354 | |
| 355 | cur_live.state = RUNNING; |
| 356 | checkpoint(); |
| 357 | break; |
| 358 | } |
| 359 | } |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | READ8_MEMBER( c8050_fdc_t::read ) |
| 364 | { |
| 365 | UINT8 e = checkpoint_live.e; |
| 366 | offs_t i = checkpoint_live.i; |
| 367 | |
| 368 | UINT8 data = (BIT(e, 6) << 7) | (BIT(i, 7) << 6) | (e & 0x33) | (BIT(e, 2) << 3) | (i & 0x04); |
| 369 | |
| 370 | if (LOG) logerror("%s VIA reads data %02x (%03x)\n", machine().time().as_string(), data, checkpoint_live.shift_reg); |
| 371 | |
| 372 | return data; |
| 373 | } |
| 374 | |
| 375 | WRITE8_MEMBER( c8050_fdc_t::write ) |
| 376 | { |
| 377 | if (m_pi != data) |
| 378 | { |
| 379 | live_sync(); |
| 380 | m_pi = cur_live.pi = data; |
| 381 | checkpoint(); |
| 382 | if (LOG) logerror("%s PI %02x\n", machine().time().as_string(), data); |
| 383 | live_run(); |
| 384 | } |
| 385 | } |
| 386 | |
| 387 | WRITE_LINE_MEMBER( c8050_fdc_t::drv_sel_w ) |
| 388 | { |
| 389 | if (m_drv_sel != state) |
| 390 | { |
| 391 | live_sync(); |
| 392 | m_drv_sel = cur_live.drv_sel = state; |
| 393 | checkpoint(); |
| 394 | if (LOG) logerror("%s DRV SEL %u\n", machine().time().as_string(), state); |
| 395 | live_run(); |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | WRITE_LINE_MEMBER( c8050_fdc_t::mode_sel_w ) |
| 400 | { |
| 401 | if (m_mode_sel != state) |
| 402 | { |
| 403 | live_sync(); |
| 404 | m_mode_sel = cur_live.mode_sel = state; |
| 405 | checkpoint(); |
| 406 | if (LOG) logerror("%s MODE SEL %u\n", machine().time().as_string(), state); |
| 407 | live_run(); |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | WRITE_LINE_MEMBER( c8050_fdc_t::rw_sel_w ) |
| 412 | { |
| 413 | if (m_rw_sel != state) |
| 414 | { |
| 415 | live_sync(); |
| 416 | m_rw_sel = cur_live.rw_sel = state; |
| 417 | checkpoint(); |
| 418 | if (LOG) logerror("%s RW SEL %u\n", machine().time().as_string(), state); |
| 419 | if (m_rw_sel) { |
| 420 | pll_stop_writing(get_floppy(), machine().time()); |
| 421 | } else { |
| 422 | pll_start_writing(machine().time()); |
| 423 | } |
| 424 | live_run(); |
| 425 | } |
| 426 | } |
| 427 | |
| 428 | WRITE_LINE_MEMBER( c8050_fdc_t::mtr0_w ) |
| 429 | { |
| 430 | if (m_mtr0 != state) |
| 431 | { |
| 432 | live_sync(); |
| 433 | m_mtr0 = state; |
| 434 | if (LOG) logerror("%s MTR0 %u\n", machine().time().as_string(), state); |
| 435 | m_floppy0->mon_w(state); |
| 436 | checkpoint(); |
| 437 | |
| 438 | if (!m_mtr0 || !m_mtr1) { |
| 439 | if(cur_live.state == IDLE) { |
| 440 | live_start(); |
| 441 | } |
| 442 | } else { |
| 443 | live_abort(); |
| 444 | } |
| 445 | |
| 446 | live_run(); |
| 447 | } |
| 448 | } |
| 449 | |
| 450 | WRITE_LINE_MEMBER( c8050_fdc_t::mtr1_w ) |
| 451 | { |
| 452 | if (m_mtr1 != state) |
| 453 | { |
| 454 | live_sync(); |
| 455 | m_mtr1 = state; |
| 456 | if (LOG) logerror("%s MTR1 %u\n", machine().time().as_string(), state); |
| 457 | if (m_floppy1) m_floppy1->mon_w(state); |
| 458 | checkpoint(); |
| 459 | |
| 460 | if (!m_mtr0 || !m_mtr1) { |
| 461 | if(cur_live.state == IDLE) { |
| 462 | live_start(); |
| 463 | } |
| 464 | } else { |
| 465 | live_abort(); |
| 466 | } |
| 467 | |
| 468 | live_run(); |
| 469 | } |
| 470 | } |
| 471 | |
| 472 | WRITE_LINE_MEMBER( c8050_fdc_t::odd_hd_w ) |
| 473 | { |
| 474 | if (m_odd_hd != state) |
| 475 | { |
| 476 | live_sync(); |
| 477 | m_odd_hd = cur_live.odd_hd = state; |
| 478 | if (LOG) logerror("%s ODD HD %u\n", machine().time().as_string(), state); |
| 479 | m_floppy0->ss_w(!state); |
| 480 | if (m_floppy1) m_floppy1->ss_w(!state); |
| 481 | checkpoint(); |
| 482 | live_run(); |
| 483 | } |
| 484 | } |
| 485 | |
| 486 | WRITE_LINE_MEMBER( c8050_fdc_t::pull_sync_w ) |
| 487 | { |
| 488 | // TODO |
| 489 | if (LOG) logerror("%s PULL SYNC %u\n", machine().time().as_string(), state); |
| 490 | } |
trunk/src/mame/drivers/viper.c
| r242315 | r242316 | |
| 16 | 16 | G?A30 2002 Tsurugi |
| 17 | 17 | GMA41 2001 Thrill Drive 2 |
| 18 | 18 | G?A45 2001 Boxing Mania |
| 19 | | GCB11 2001 Police 911 2 (USA) / Police 24/7 2 (World) / Keisatsukan Shinjuku 24ji 2 (Japan) |
| 19 | G*B11 2001 Police 911 2 (USA) / Police 24/7 2 (World) / Keisatsukan Shinjuku 24ji 2 (Japan) |
| 20 | 20 | G?B33 2001 Mocap Golf |
| 21 | 21 | G?B41 2001 Jurassic Park 3 |
| 22 | 22 | G?B4x 2002 Xtrial Racing |
| r242315 | r242316 | |
| 79 | 79 | ADC0838 - National Semiconductor ADC0838 Serial I/O 8-Bit A/D Converters with Multiplexer Options (SOIC20 @ U13) |
| 80 | 80 | DS2430 - Dallas DS2430 256-bits 1-Wire EEPROM. Has 256 bits x8 EEPROM (32 bytes), 64 bits x8 (8 bytes) |
| 81 | 81 | one-time programmable application register and unique factory-lasered and tested 64-bit |
| 82 | | registration number (8-bit family code + 48-bit serial number + 8-bit CRC tester) (TO-92 @ U37) |
| 83 | | It appears the DS2430 is not protected from reading but the unique silicon serial number isn't |
| 84 | | included in the 40 byte dump. |
| 82 | registration number (8-bit family code + 48-bit serial number + 8-bit CRC) (TO-92 @ U37) |
| 83 | The OTP application register on the common DS2430 and the Police 911 2 DS2430 are not programmed |
| 84 | (application register reads all 0xFF and the status register reads back 0xFF), so it's probably safe |
| 85 | to assume they're not used on any of them. |
| 86 | It appears the DS2430 is not protected from reading and the unique silicon serial number is |
| 87 | included in the 40 byte dump. In the Police 911 2 NVRAM dump the serial number is located at both 0x002A and 0x1026 |
| 88 | so that means it is tied to the DS2430. If the serial number in the NVRAM and DS2430 match then they are |
| 89 | paired. The same serial number is likely present in the CF card image and a compare is done there too. |
| 90 | If they don't match the game requires an external DS2430 (i.e. dongle) |
| 91 | When the lasered ROM is read from the DS2430, it comes out from LSB to MSB (family code, LSB of |
| 92 | S/N->MSB of S/N, CRC) |
| 93 | For Police 911 2 that is 0x14 0xB2 0xB7 0x4A 0x00 0x00 0x00 0x83 |
| 94 | Family code=0x14 |
| 95 | S/N=0x0000004AB7B2 |
| 96 | CRC=0x83 |
| 97 | In a DS2430 dump, the first 32 bytes is the EEPROM and the lasered ROM is 8 bytes and starts at 0x20h |
| 98 | For Police 911 2 that is.... |
| 99 | 00000000h CB 9B 56 EC A0 4C 87 53 51 46 28 E7 00 00 00 74 |
| 100 | 00000010h 30 A9 C7 76 B9 85 A3 43 87 53 50 42 1A E7 FA CF |
| 101 | 00000020h 14 B2 B7 4A 00 00 00 83 |
| 102 | It may be possible to hand craft a DS2430 for a dongle-protected version of a game simply by using |
| 103 | one of the existing DS2430 dumps and adjusting the serial number found in a dump of the NVRAM to pair them |
| 104 | or adjusting the serial number in the NVRAM to match the serial number found in one of the dumped DS2430s. |
| 85 | 105 | M48T58Y - ST Microelectronics M48T58Y Timekeeper RAM (DIP28 @ U39). When this dies (after 10 year lifespan) |
| 86 | 106 | the game will complain with error RTC BAD then reset. The data inside the RTC can not be hand created |
| 87 | 107 | (yet) so to revive the PCB the correct RTC data must be re-programmed to a new RTC and replaced |
| r242315 | r242316 | |
| 2299 | 2319 | ROM_START(p9112) /* dongle-protected version */ |
| 2300 | 2320 | VIPER_BIOS |
| 2301 | 2321 | |
| 2302 | | ROM_REGION(0x28, "ds2430", ROMREGION_ERASE00) /* plug-in male DIN5 dongle containing a DS2430 */ |
| 2322 | ROM_REGION(0x28, "ds2430", ROMREGION_ERASE00) /* plug-in male DIN5 dongle containing a DS2430. The sticker on the dongle says 'GCB11-UA' */ |
| 2303 | 2323 | ROM_LOAD("ds2430_p9112.u3", 0x00, 0x28, CRC(d745c6ee) SHA1(065C9D0DF1703B3BBB53A07F4923FDEE3B16F80E)) |
| 2304 | 2324 | |
| 2305 | 2325 | ROM_REGION(0x2000, "m48t58", ROMREGION_ERASE00) /* M48T58 Timekeeper NVRAM */ |
| r242315 | r242316 | |
| 2564 | 2584 | GAME(2001, p911kc, p911, viper, viper, viper_state, vipercf, ROT90, "Konami", "Police 911 (ver KAC)", GAME_NOT_WORKING|GAME_NO_SOUND) |
| 2565 | 2585 | GAME(2001, p911e, p911, viper, viper, viper_state, vipercf, ROT90, "Konami", "Police 24/7 (ver EAA)", GAME_NOT_WORKING|GAME_NO_SOUND) |
| 2566 | 2586 | GAME(2001, p911j, p911, viper, viper, viper_state, vipercf, ROT90, "Konami", "Keisatsukan Shinjuku 24ji (ver JAC)", GAME_NOT_WORKING|GAME_NO_SOUND) |
| 2567 | | GAME(2001, p9112, kviper, viper, viper, viper_state, vipercf, ROT90, "Konami", "Police 911 2 (ver UAD)", GAME_NOT_WORKING|GAME_NO_SOUND) |
| 2587 | GAME(2001, p9112, kviper, viper, viper, viper_state, vipercf, ROT90, "Konami", "Police 911 2 (VER. UAA:B)", GAME_NOT_WORKING|GAME_NO_SOUND) |
| 2568 | 2588 | GAME(2003, popn9, kviper, viper, viper, viper_state, vipercf, ROT0, "Konami", "Pop'n Music 9 (ver JAB)", GAME_NOT_WORKING|GAME_NO_SOUND) |
| 2569 | 2589 | GAME(2001, sscopex, kviper, viper, viper, viper_state, vipercf, ROT0, "Konami", "Silent Scope EX (ver UAA)", GAME_NOT_WORKING|GAME_NO_SOUND) |
| 2570 | 2590 | GAME(2001, sogeki, sscopex, viper, viper, viper_state, vipercf, ROT0, "Konami", "Sogeki (ver JAA)", GAME_NOT_WORKING|GAME_NO_SOUND) |
trunk/src/mess/drivers/excali64.c
| r242315 | r242316 | |
| 7 | 7 | Skeleton driver created on 2014-12-09. |
| 8 | 8 | |
| 9 | 9 | Chips: Z80A, 8251, 8253, 8255, 6845 |
| 10 | We have Basic 1.1. Other known versions are 1.01, 2.1 |
| 10 | 11 | |
| 12 | Control W then Enter will switch between 40 and 80 characters per line. |
| 13 | |
| 11 | 14 | ToDo: |
| 12 | 15 | - Some keys can be connected to more than one position in the matrix. Need to |
| 13 | 16 | determine the correct positions. |
| 14 | 17 | - The position of the "Line Insert" key is unknown. |
| 15 | | - The video section has attributes and colour, none of this is done. |
| 18 | - PCGEN command not working. |
| 19 | - Colours are wrong (colour prom needs to be dumped) |
| 16 | 20 | - Disk controller |
| 17 | 21 | - Banking |
| 18 | 22 | - The schematic shows the audio counter connected to 2MHz, but this produces |
| r242315 | r242316 | |
| 20 | 24 | - Serial |
| 21 | 25 | - Parallel / Centronics |
| 22 | 26 | - Need software |
| 27 | - Pasting can drop a character or two at the start of a line. |
| 28 | - Clock change for crtc |
| 23 | 29 | |
| 24 | 30 | ****************************************************************************/ |
| 25 | 31 | |
| r242315 | r242316 | |
| 45 | 51 | , m_palette(*this, "palette") |
| 46 | 52 | , m_maincpu(*this, "maincpu") |
| 47 | 53 | , m_cass(*this, "cassette") |
| 54 | , m_crtc(*this, "crtc") |
| 48 | 55 | , m_io_keyboard(*this, "KEY") |
| 49 | 56 | { } |
| 50 | 57 | |
| 51 | 58 | DECLARE_DRIVER_INIT(excali64); |
| 59 | DECLARE_PALETTE_INIT(excali64); |
| 52 | 60 | DECLARE_WRITE8_MEMBER(ppib_w); |
| 53 | 61 | DECLARE_READ8_MEMBER(ppic_r); |
| 54 | 62 | DECLARE_WRITE8_MEMBER(ppic_w); |
| r242315 | r242316 | |
| 71 | 79 | bool m_crtc_de; |
| 72 | 80 | required_device<cpu_device> m_maincpu; |
| 73 | 81 | required_device<cassette_image_device> m_cass; |
| 82 | required_device<mc6845_device> m_crtc; |
| 74 | 83 | required_ioport_array<8> m_io_keyboard; |
| 75 | 84 | }; |
| 76 | 85 | |
| r242315 | r242316 | |
| 96 | 105 | |
| 97 | 106 | /* Input ports */ |
| 98 | 107 | static INPUT_PORTS_START( excali64 ) |
| 99 | | //PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("LINEFEED") PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR(0x0a)//H |
| 100 | | //PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("REPT") PORT_CODE(KEYCODE_LALT)//0x11 |
| 101 | | //PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("(Down)") PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))//B |
| 102 | | //PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("(Up)") PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| 103 | | //PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("(Fire)") PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) |
| 104 | | //PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\\ |")PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') PORT_CHAR(0x1c) |
| 105 | | //PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("(Right)") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) |
| 106 | | //PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("BRK") PORT_CODE(KEYCODE_NUMLOCK) PORT_CHAR(0x03) |
| 107 | | //PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("(Left)") PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) |
| 108 | | |
| 109 | 108 | PORT_START("KEY.0") /* line 0 */ |
| 110 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR('R') PORT_CHAR(0x12) |
| 111 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR('W') PORT_CHAR(0x17) |
| 109 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') PORT_CHAR(0x12) |
| 110 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') PORT_CHAR(0x17) |
| 112 | 111 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 113 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR('E') PORT_CHAR(0x05) |
| 112 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') PORT_CHAR(0x05) |
| 114 | 113 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB) PORT_CHAR(0x09) |
| 115 | 114 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CAPSLOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE |
| 116 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('A') PORT_CHAR(0x01) |
| 117 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR('Q') PORT_CHAR(0x11) |
| 115 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') PORT_CHAR(0x01) |
| 116 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') PORT_CHAR(0x11) |
| 118 | 117 | |
| 119 | 118 | PORT_START("KEY.1") /* line 1 */ |
| 120 | 119 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F3") PORT_CODE(KEYCODE_F3) |
| 121 | 120 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) |
| 122 | 121 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F4") PORT_CODE(KEYCODE_F4) |
| 123 | 122 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 124 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_SHIFT_2)//= |
| 123 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_SHIFT_2) |
| 125 | 124 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) // space |
| 126 | 125 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) |
| 127 | 126 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) // F1 |
| 128 | 127 | |
| 129 | 128 | PORT_START("KEY.2") /* line 2 */ |
| 130 | 129 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(". >") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 131 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('M') PORT_CHAR(0x0d) |
| 130 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') PORT_CHAR(0x0d) |
| 132 | 131 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("/ ?") PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') |
| 133 | 132 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(", <") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 134 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('B') PORT_CHAR(0x02) |
| 133 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') PORT_CHAR(0x02) |
| 135 | 134 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) //B |
| 136 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('N') PORT_CHAR(0x0e) |
| 135 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') PORT_CHAR(0x0e) |
| 137 | 136 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) //N |
| 138 | 137 | |
| 139 | 138 | PORT_START("KEY.3") /* line 3 */ |
| 140 | 139 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("' \"") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(0x27) PORT_CHAR(0x22) PORT_CHAR(0x27) |
| 141 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('L') PORT_CHAR(0x0c) |
| 140 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') PORT_CHAR(0x0c) |
| 142 | 141 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(0x0d) |
| 143 | 142 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("; :") PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') |
| 144 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('J') PORT_CHAR(0x0a) |
| 145 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR('G') PORT_CHAR(0x07) |
| 146 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('K') PORT_CHAR(0x0b) |
| 147 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('H') PORT_CHAR(0x08) |
| 143 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') PORT_CHAR(0x0a) |
| 144 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') PORT_CHAR(0x07) |
| 145 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') PORT_CHAR(0x0b) |
| 146 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') PORT_CHAR(0x08) |
| 148 | 147 | |
| 149 | 148 | PORT_START("KEY.4") /* line 4 */ |
| 150 | 149 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 $") PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| r242315 | r242316 | |
| 158 | 157 | |
| 159 | 158 | PORT_START("KEY.5") /* line 5 */ |
| 160 | 159 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("[ {") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') PORT_CHAR(0x1b) |
| 161 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('O') PORT_CHAR(0x0f) |
| 160 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') PORT_CHAR(0x0f) |
| 162 | 161 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("] }") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') PORT_CHAR(0x1d) |
| 163 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('P') PORT_CHAR(0x10) |
| 164 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('U') PORT_CHAR(0x15) |
| 165 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR('T') PORT_CHAR(0x14) |
| 166 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('I') PORT_CHAR(0x09)//0x12 |
| 167 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('Y') PORT_CHAR(0x19)//0x14 |
| 162 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') PORT_CHAR(0x10) |
| 163 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') PORT_CHAR(0x15) |
| 164 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') PORT_CHAR(0x14) |
| 165 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') PORT_CHAR(0x09) |
| 166 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') PORT_CHAR(0x19) |
| 168 | 167 | |
| 169 | 168 | PORT_START("KEY.6") /* line 6 */ |
| 170 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR('F') PORT_CHAR(0x06) |
| 171 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('X') PORT_CHAR(0x18) |
| 172 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR('V') PORT_CHAR(0x16) |
| 173 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('C') PORT_CHAR(0x03) |
| 174 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR('D') PORT_CHAR(0x04) |
| 175 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('S') PORT_CHAR(0x13) |
| 176 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR('Z') PORT_CHAR(0x1a) |
| 169 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') PORT_CHAR(0x06) |
| 170 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') PORT_CHAR(0x18) |
| 171 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') PORT_CHAR(0x16) |
| 172 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') PORT_CHAR(0x03) |
| 173 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') PORT_CHAR(0x04) |
| 174 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') PORT_CHAR(0x13) |
| 175 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') PORT_CHAR(0x1a) |
| 177 | 176 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) //Z |
| 178 | 177 | |
| 179 | 178 | PORT_START("KEY.7") /* line 7 */ |
| r242315 | r242316 | |
| 234 | 233 | |
| 235 | 234 | /* |
| 236 | 235 | d0,1,2 : same as port50 |
| 237 | | d7 : 2nd col |
| 236 | d3 : 2nd colour set |
| 238 | 237 | */ |
| 239 | 238 | WRITE8_MEMBER( excali64_state::port70_w ) |
| 240 | 239 | { |
| 241 | 240 | m_sys_status = data; |
| 241 | m_crtc->set_unscaled_clock(BIT(data, 2) ? 2e6 : 1e6); |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | WRITE8_MEMBER( excali64_state::video_w ) |
| r242315 | r242316 | |
| 262 | 262 | m_p_videoram = memregion("videoram")->base(); |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | /* F4 Character Displayer */ |
| 266 | static const gfx_layout excali64_charlayout = |
| 267 | { |
| 268 | 8, 12, /* 8 x 12 characters */ |
| 269 | 256, /* 256 characters */ |
| 270 | 1, /* 1 bits per pixel */ |
| 271 | { 0 }, /* no bitplanes */ |
| 272 | /* x offsets */ |
| 273 | { 7, 6, 5, 4, 3, 2, 1, 0 }, |
| 274 | /* y offsets */ |
| 275 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8 }, |
| 276 | 8*16 /* every char takes 16 bytes */ |
| 277 | }; |
| 278 | |
| 279 | static GFXDECODE_START( excali64 ) |
| 280 | GFXDECODE_ENTRY( "chargen", 0x0000, excali64_charlayout, 0, 1 ) |
| 281 | GFXDECODE_END |
| 282 | |
| 283 | // The colour names in the comments are what's needed, the current rgb values are mostly wrong |
| 284 | PALETTE_INIT_MEMBER( excali64_state, excali64 ) |
| 285 | { |
| 286 | // Colour Menu A |
| 287 | palette.set_pen_color(0, 0x00, 0x00, 0x00); /* 0 Black */ |
| 288 | palette.set_pen_color(1, 0x7f, 0x00, 0x00); /* 1 Dark Red */ |
| 289 | palette.set_pen_color(2, 0xff, 0x00, 0x00); /* 2 Red */ |
| 290 | palette.set_pen_color(3, 0x00, 0x00, 0x00); /* 3 Pink */ |
| 291 | palette.set_pen_color(4, 0xbf, 0xbf, 0xbf); /* 4 Orange */ |
| 292 | palette.set_pen_color(5, 0x00, 0xff, 0xff); /* 5 Brown */ |
| 293 | palette.set_pen_color(6, 0xff, 0xff, 0x00); /* 6 Yellow */ |
| 294 | palette.set_pen_color(7, 0x7f, 0x7f, 0x00); /* 7 Dark Green */ |
| 295 | palette.set_pen_color(8, 0x00, 0x7f, 0x00); /* 8 Green */ |
| 296 | palette.set_pen_color(9, 0x00, 0xff, 0x00); /* 9 Bright Green */ |
| 297 | palette.set_pen_color(10, 0x00, 0x00, 0xff); /* 10 Light Blue */ |
| 298 | palette.set_pen_color(11, 0x00, 0x00, 0x7f); /* 11 Blue */ |
| 299 | palette.set_pen_color(12, 0xff, 0x00, 0xff); /* 12 Magenta */ |
| 300 | palette.set_pen_color(13, 0x7f, 0x00, 0x7f); /* 13 Purple */ |
| 301 | palette.set_pen_color(14, 0x80, 0x80, 0x80); /* 14 Dark Grey */ |
| 302 | palette.set_pen_color(15, 0xff, 0xff, 0xff); /* 15 White */ |
| 303 | // Colour Menu B |
| 304 | palette.set_pen_color(16, 0x00, 0x00, 0x00); /* 0 Black */ |
| 305 | palette.set_pen_color(17, 0x7f, 0x00, 0x00); /* 1 Dark Red */ |
| 306 | palette.set_pen_color(18, 0xff, 0x00, 0x00); /* 2 Red */ |
| 307 | palette.set_pen_color(19, 0x80, 0x80, 0x80); /* 3 Flesh */ |
| 308 | palette.set_pen_color(20, 0x00, 0x00, 0xff); /* 4 Pink */ |
| 309 | palette.set_pen_color(21, 0xff, 0xff, 0x80); /* 5 Yellow Brown */ |
| 310 | palette.set_pen_color(22, 0x00, 0x00, 0x00); /* 6 Dark Brown */ |
| 311 | palette.set_pen_color(23, 0x00, 0xff, 0x00); /* 7 Dark Purple */ |
| 312 | palette.set_pen_color(24, 0xff, 0x80, 0xff); /* 8 Very Dark Green */ |
| 313 | palette.set_pen_color(25, 0x00, 0xff, 0xff); /* 9 Yellow Green */ |
| 314 | palette.set_pen_color(26, 0xff, 0x40, 0x40); /* 10 Grey Blue */ |
| 315 | palette.set_pen_color(27, 0xff, 0x00, 0x00); /* 11 Sky Blue */ |
| 316 | palette.set_pen_color(28, 0x00, 0x80, 0x80); /* 12 Very Pale Blue */ |
| 317 | palette.set_pen_color(29, 0xff, 0x00, 0xff); /* 13 Dark Grey */ |
| 318 | palette.set_pen_color(30, 0x80, 0xff, 0x80); /* 14 Light Grey */ |
| 319 | palette.set_pen_color(31, 0xff, 0xff, 0xff); /* 15 White */ |
| 320 | // Background |
| 321 | palette.set_pen_color(32, 0x00, 0x00, 0x00); // 0 Black |
| 322 | palette.set_pen_color(33, 0xff, 0x00, 0x00); // 1 Red |
| 323 | palette.set_pen_color(34, 0x00, 0x00, 0xff); // 2 Blue |
| 324 | palette.set_pen_color(35, 0xff, 0x00, 0xff); // 3 Magenta |
| 325 | palette.set_pen_color(36, 0x00, 0xff, 0x00); // 4 Green |
| 326 | palette.set_pen_color(37, 0xff, 0xff, 0x00); // 5 Yellow |
| 327 | palette.set_pen_color(38, 0x00, 0xff, 0xff); // 6 Cyan |
| 328 | palette.set_pen_color(39, 0xff, 0xff, 0xff); // 7 White |
| 329 | |
| 330 | } |
| 331 | |
| 265 | 332 | MC6845_UPDATE_ROW( excali64_state::update_row ) |
| 266 | 333 | { |
| 267 | 334 | const rgb_t *palette = m_palette->palette()->entry_list_raw(); |
| 268 | | UINT8 chr,gfx; |
| 335 | UINT8 chr,gfx,col,bg,fg; |
| 269 | 336 | UINT16 mem,x; |
| 337 | UINT8 col_base = BIT(m_sys_status, 3) ? 16 : 0; |
| 270 | 338 | UINT32 *p = &bitmap.pix32(y); |
| 271 | 339 | |
| 272 | 340 | for (x = 0; x < x_count; x++) |
| 273 | 341 | { |
| 274 | | UINT8 inv=0; |
| 275 | | if (x == cursor_x) inv=0xff; |
| 276 | | mem = (ma + x) & 0xfff; |
| 342 | mem = (ma + x) & 0x7ff; |
| 277 | 343 | chr = m_p_videoram[mem]; |
| 278 | | gfx = m_p_chargen[(chr<<4) | ra] ^ inv; |
| 344 | col = m_p_videoram[mem+0x800]; |
| 345 | fg = col_base + (col >> 4); |
| 346 | bg = 32 + ((col >> 1) & 7); |
| 279 | 347 | |
| 348 | if (BIT(col, 0) & BIT(chr, 7)) |
| 349 | gfx = m_p_videoram[0x800 + (chr<<4) + ra]; // hires definition |
| 350 | else |
| 351 | gfx = m_p_chargen[(chr<<4) | ra]; // normal character |
| 352 | |
| 353 | gfx ^= ((x == cursor_x) ? 0xff : 0); |
| 354 | |
| 280 | 355 | /* Display a scanline of a character */ |
| 281 | | *p++ = palette[BIT(gfx, 0)]; |
| 282 | | *p++ = palette[BIT(gfx, 1)]; |
| 283 | | *p++ = palette[BIT(gfx, 2)]; |
| 284 | | *p++ = palette[BIT(gfx, 3)]; |
| 285 | | *p++ = palette[BIT(gfx, 4)]; |
| 286 | | *p++ = palette[BIT(gfx, 5)]; |
| 287 | | *p++ = palette[BIT(gfx, 6)]; |
| 288 | | *p++ = palette[BIT(gfx, 7)]; |
| 356 | *p++ = palette[BIT(gfx, 0) ? fg : bg]; |
| 357 | *p++ = palette[BIT(gfx, 1) ? fg : bg]; |
| 358 | *p++ = palette[BIT(gfx, 2) ? fg : bg]; |
| 359 | *p++ = palette[BIT(gfx, 3) ? fg : bg]; |
| 360 | *p++ = palette[BIT(gfx, 4) ? fg : bg]; |
| 361 | *p++ = palette[BIT(gfx, 5) ? fg : bg]; |
| 362 | *p++ = palette[BIT(gfx, 6) ? fg : bg]; |
| 363 | *p++ = palette[BIT(gfx, 7) ? fg : bg]; |
| 289 | 364 | } |
| 290 | 365 | } |
| 291 | 366 | |
| r242315 | r242316 | |
| 328 | 403 | MCFG_SCREEN_ADD("screen", RASTER) |
| 329 | 404 | MCFG_SCREEN_REFRESH_RATE(50) |
| 330 | 405 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 331 | | MCFG_SCREEN_SIZE(80*8, 25*10) |
| 332 | | MCFG_SCREEN_VISIBLE_AREA(0, 80*8-1, 0, 25*10-1) |
| 406 | MCFG_SCREEN_SIZE(80*8, 24*12) |
| 407 | MCFG_SCREEN_VISIBLE_AREA(0, 80*8-1, 0, 24*12-1) |
| 333 | 408 | MCFG_SCREEN_UPDATE_DEVICE("crtc", mc6845_device, screen_update) |
| 334 | | MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette") |
| 409 | MCFG_PALETTE_ADD("palette", 40) |
| 410 | MCFG_PALETTE_INIT_OWNER(excali64_state, excali64) |
| 411 | //MCFG_PALETTE_ADD_BLACK_AND_WHITE("palette") |
| 412 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", excali64) |
| 335 | 413 | MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_16MHz / 16) // 1MHz for lowres; 2MHz for highres |
| 336 | 414 | MCFG_MC6845_SHOW_BORDER_AREA(false) |
| 337 | 415 | MCFG_MC6845_CHAR_WIDTH(8) |
| r242315 | r242316 | |
| 346 | 424 | /* ROM definition */ |
| 347 | 425 | ROM_START( excali64 ) |
| 348 | 426 | ROM_REGION(0x10000, "maincpu", 0) |
| 349 | | ROM_LOAD( "rom_1.bin", 0x0000, 0x4000, CRC(e129a305) SHA1(e43ec7d040c2b2e548d22fd6bbc7df8b45a26e5a) ) |
| 350 | | ROM_LOAD( "rom_2.bin", 0x2000, 0x2000, CRC(916d9f5a) SHA1(91c527cce963481b7bebf077e955ca89578bb553) ) |
| 427 | ROM_LOAD( "rom_1.ic17", 0x0000, 0x4000, CRC(e129a305) SHA1(e43ec7d040c2b2e548d22fd6bbc7df8b45a26e5a) ) |
| 428 | ROM_LOAD( "rom_2.ic24", 0x2000, 0x2000, CRC(916d9f5a) SHA1(91c527cce963481b7bebf077e955ca89578bb553) ) |
| 429 | // fix a bug that causes screen to be filled with 'p' |
| 430 | ROM_FILL(0x4ee, 1, 0) |
| 431 | ROM_FILL(0x4ef, 1, 8) |
| 432 | ROM_FILL(0x4f6, 1, 0) |
| 433 | ROM_FILL(0x4f7, 1, 8) |
| 351 | 434 | |
| 352 | 435 | ROM_REGION(0x2000, "videoram", ROMREGION_ERASE00) |
| 353 | 436 | |
| 354 | 437 | ROM_REGION(0x1000, "chargen", 0) |
| 355 | | ROM_LOAD( "genex_3.bin", 0x0000, 0x1000, CRC(b91619a9) SHA1(2ced636cb7b94ba9d329868d7ecf79963cefe9d9) ) |
| 438 | ROM_LOAD( "genex_3.ic43", 0x0000, 0x1000, CRC(b91619a9) SHA1(2ced636cb7b94ba9d329868d7ecf79963cefe9d9) ) |
| 356 | 439 | ROM_END |
| 357 | 440 | |
| 358 | 441 | /* Driver */ |
| 359 | 442 | |
| 360 | 443 | /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ |
| 361 | | COMP( 1984, excali64, 0, 0, excali64, excali64, excali64_state, excali64, "BGR Computers", "Excalibur 64", GAME_IS_SKELETON ) |
| 444 | COMP( 1984, excali64, 0, 0, excali64, excali64, excali64_state, excali64, "BGR Computers", "Excalibur 64", GAME_NOT_WORKING ) |
trunk/src/mess/drivers/victor9k.c
| r242315 | r242316 | |
| 13 | 13 | |
| 14 | 14 | TODO: |
| 15 | 15 | |
| 16 | | - centronics |
| 16 | - keyboard |
| 17 | 17 | - expansion bus |
| 18 | 18 | - Z80 card |
| 19 | 19 | - Winchester DMA card (Xebec S1410 + Tandon TM502/TM603SE) |
| 20 | 20 | - RAM cards |
| 21 | 21 | - clock cards |
| 22 | 22 | - floppy 8048 |
| 23 | | - keyboard |
| 24 | 23 | - hires graphics |
| 25 | 24 | - brightness/contrast |
| 26 | 25 | - MC6852 |
| r242315 | r242316 | |
| 41 | 40 | //------------------------------------------------- |
| 42 | 41 | |
| 43 | 42 | static ADDRESS_MAP_START( victor9k_mem, AS_PROGRAM, 8, victor9k_state ) |
| 44 | | // AM_RANGE(0x00000, 0xdffff) AM_RAM |
| 43 | AM_RANGE(0x00000, 0x1ffff) AM_RAM |
| 45 | 44 | AM_RANGE(0x20000, 0xdffff) AM_NOP |
| 46 | | AM_RANGE(0xe0000, 0xe0001) AM_DEVREADWRITE(I8259A_TAG, pic8259_device, read, write) |
| 47 | | AM_RANGE(0xe0020, 0xe0023) AM_DEVREADWRITE(I8253_TAG, pit8253_device, read, write) |
| 48 | | AM_RANGE(0xe0040, 0xe0043) AM_DEVREADWRITE(UPD7201_TAG, upd7201_device, cd_ba_r, cd_ba_w) |
| 45 | AM_RANGE(0xe0000, 0xe0001) AM_MIRROR(0x7f00) AM_DEVREADWRITE(I8259A_TAG, pic8259_device, read, write) |
| 46 | AM_RANGE(0xe0020, 0xe0023) AM_MIRROR(0x7f00) AM_DEVREADWRITE(I8253_TAG, pit8253_device, read, write) |
| 47 | AM_RANGE(0xe0040, 0xe0043) AM_MIRROR(0x7f00) AM_DEVREADWRITE(UPD7201_TAG, upd7201_device, cd_ba_r, cd_ba_w) |
| 49 | 48 | AM_RANGE(0xe8000, 0xe8000) AM_MIRROR(0x7f00) AM_DEVREADWRITE(HD46505S_TAG, mc6845_device, status_r, address_w) |
| 50 | 49 | AM_RANGE(0xe8001, 0xe8001) AM_MIRROR(0x7f00) AM_DEVREADWRITE(HD46505S_TAG, mc6845_device, register_r, register_w) |
| 51 | 50 | AM_RANGE(0xe8020, 0xe802f) AM_MIRROR(0x7f00) AM_DEVREADWRITE(M6522_1_TAG, via6522_device, read, write) |
| r242315 | r242316 | |
| 56 | 55 | AM_RANGE(0xe80c0, 0xe80cf) AM_MIRROR(0x7f00) AM_DEVREADWRITE(FDC_TAG, victor_9000_fdc_t, cs6_r, cs6_w) |
| 57 | 56 | AM_RANGE(0xe80e0, 0xe80ef) AM_MIRROR(0x7f00) AM_DEVREADWRITE(FDC_TAG, victor_9000_fdc_t, cs7_r, cs7_w) |
| 58 | 57 | AM_RANGE(0xf0000, 0xf0fff) AM_MIRROR(0x1000) AM_RAM AM_SHARE("video_ram") |
| 59 | | AM_RANGE(0xfe000, 0xfffff) AM_ROM AM_REGION(I8088_TAG, 0) |
| 58 | AM_RANGE(0xf8000, 0xf9fff) AM_MIRROR(0x6000) AM_ROM AM_REGION(I8088_TAG, 0) |
| 60 | 59 | ADDRESS_MAP_END |
| 61 | 60 | |
| 62 | 61 | |
| r242315 | r242316 | |
| 169 | 168 | { |
| 170 | 169 | m_ssda_irq = state; |
| 171 | 170 | |
| 172 | | m_pic->ir3_w(m_ssda_irq || m_via1_irq || m_via2_irq || m_via3_irq || m_fdc_irq); |
| 171 | m_pic->ir3_w(m_ssda_irq || m_via1_irq || m_via3_irq || m_fdc_irq); |
| 173 | 172 | } |
| 174 | 173 | |
| 175 | 174 | |
| r242315 | r242316 | |
| 190 | 189 | |
| 191 | 190 | */ |
| 192 | 191 | |
| 192 | // centronics |
| 193 | m_centronics->write_data0(BIT(data, 0)); |
| 194 | m_centronics->write_data1(BIT(data, 1)); |
| 195 | m_centronics->write_data2(BIT(data, 2)); |
| 196 | m_centronics->write_data3(BIT(data, 3)); |
| 197 | m_centronics->write_data4(BIT(data, 4)); |
| 198 | m_centronics->write_data5(BIT(data, 5)); |
| 199 | m_centronics->write_data6(BIT(data, 6)); |
| 200 | m_centronics->write_data7(BIT(data, 7)); |
| 201 | |
| 202 | // IEEE-488 |
| 193 | 203 | m_ieee488->dio_w(data); |
| 194 | 204 | } |
| 195 | 205 | |
| r242315 | r242316 | |
| 211 | 221 | |
| 212 | 222 | bit description |
| 213 | 223 | |
| 214 | | PB0 DAV |
| 215 | | PB1 EOI |
| 224 | PB0 DAV / DATA STROBE |
| 225 | PB1 EOI / VFU? |
| 216 | 226 | PB2 REN |
| 217 | 227 | PB3 ATN |
| 218 | 228 | PB4 IFC |
| r242315 | r242316 | |
| 222 | 232 | |
| 223 | 233 | */ |
| 224 | 234 | |
| 235 | // centronics |
| 236 | m_centronics->write_strobe(BIT(data, 0)); |
| 237 | |
| 225 | 238 | // IEEE-488 |
| 226 | 239 | m_ieee488->dav_w(BIT(data, 0)); |
| 227 | 240 | m_ieee488->eoi_w(BIT(data, 1)); |
| r242315 | r242316 | |
| 241 | 254 | { |
| 242 | 255 | m_via1_irq = state; |
| 243 | 256 | |
| 244 | | m_pic->ir3_w(m_ssda_irq || m_via1_irq || m_via2_irq || m_via3_irq || m_fdc_irq); |
| 257 | m_pic->ir3_w(m_ssda_irq || m_via1_irq || m_via3_irq || m_fdc_irq); |
| 245 | 258 | } |
| 246 | 259 | |
| 247 | 260 | WRITE8_MEMBER( victor9k_state::via2_pa_w ) |
| r242315 | r242316 | |
| 304 | 317 | } |
| 305 | 318 | |
| 306 | 319 | |
| 307 | | WRITE_LINE_MEMBER( victor9k_state::via2_irq_w ) |
| 308 | | { |
| 309 | | m_via2_irq = state; |
| 310 | | |
| 311 | | m_pic->ir3_w(m_ssda_irq || m_via1_irq || m_via2_irq || m_via3_irq || m_fdc_irq); |
| 312 | | } |
| 313 | | |
| 314 | | |
| 315 | 320 | /* |
| 316 | 321 | bit description |
| 317 | 322 | |
| r242315 | r242316 | |
| 348 | 353 | { |
| 349 | 354 | m_via3_irq = state; |
| 350 | 355 | |
| 351 | | m_pic->ir3_w(m_ssda_irq || m_via1_irq || m_via2_irq || m_via3_irq || m_fdc_irq); |
| 356 | m_pic->ir3_w(m_ssda_irq || m_via1_irq || m_via3_irq || m_fdc_irq); |
| 352 | 357 | } |
| 353 | 358 | |
| 354 | 359 | |
| r242315 | r242316 | |
| 359 | 364 | WRITE_LINE_MEMBER( victor9k_state::kbrdy_w ) |
| 360 | 365 | { |
| 361 | 366 | //logerror("KBRDY %u\n", state); |
| 367 | |
| 362 | 368 | m_via2->write_cb1(state); |
| 363 | | |
| 364 | | m_pic->ir6_w(state ? CLEAR_LINE : ASSERT_LINE); |
| 365 | 369 | } |
| 366 | 370 | |
| 367 | 371 | WRITE_LINE_MEMBER( victor9k_state::kbdata_w ) |
| 368 | 372 | { |
| 369 | 373 | //logerror("KBDATA %u\n", state); |
| 374 | |
| 370 | 375 | m_via2->write_cb2(state); |
| 371 | 376 | m_via2->write_pa6(state); |
| 372 | 377 | } |
| r242315 | r242316 | |
| 376 | 381 | { |
| 377 | 382 | m_fdc_irq = state; |
| 378 | 383 | |
| 379 | | m_pic->ir3_w(m_ssda_irq || m_via1_irq || m_via2_irq || m_via3_irq || m_fdc_irq); |
| 384 | m_pic->ir3_w(m_ssda_irq || m_via1_irq || m_via3_irq || m_fdc_irq); |
| 380 | 385 | } |
| 381 | 386 | |
| 382 | 387 | |
| r242315 | r242316 | |
| 390 | 395 | save_item(NAME(m_brt)); |
| 391 | 396 | save_item(NAME(m_cont)); |
| 392 | 397 | save_item(NAME(m_via1_irq)); |
| 393 | | save_item(NAME(m_via2_irq)); |
| 394 | 398 | save_item(NAME(m_via3_irq)); |
| 395 | 399 | save_item(NAME(m_fdc_irq)); |
| 396 | 400 | save_item(NAME(m_ssda_irq)); |
| 397 | 401 | |
| 398 | | // memory banking |
| 399 | | address_space &program = m_maincpu->space(AS_PROGRAM); |
| 400 | | program.install_ram(0x00000, m_ram->size() - 1, m_ram->pointer()); |
| 401 | | |
| 402 | 402 | // patch out SCP self test |
| 403 | 403 | m_rom->base()[0x11ab] = 0xc3; |
| 404 | 404 | |
| r242315 | r242316 | |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | |
| 425 | |
| 425 | 426 | //************************************************************************** |
| 426 | 427 | // MACHINE CONFIGURATION |
| 427 | 428 | //************************************************************************** |
| r242315 | r242316 | |
| 446 | 447 | |
| 447 | 448 | MCFG_PALETTE_ADD_MONOCHROME_GREEN_HIGHLIGHT("palette") |
| 448 | 449 | |
| 449 | | MCFG_MC6845_ADD(HD46505S_TAG, HD6845, SCREEN_TAG, 1000000) // HD6845 == HD46505S |
| 450 | MCFG_MC6845_ADD(HD46505S_TAG, HD6845, SCREEN_TAG, XTAL_30MHz/11) // HD6845 == HD46505S |
| 450 | 451 | MCFG_MC6845_SHOW_BORDER_AREA(true) |
| 451 | 452 | MCFG_MC6845_CHAR_WIDTH(10) |
| 452 | 453 | MCFG_MC6845_UPDATE_ROW_CB(victor9k_state, crtc_update_row) |
| r242315 | r242316 | |
| 501 | 502 | MCFG_DEVICE_ADD(M6522_2_TAG, VIA6522, XTAL_30MHz/30) |
| 502 | 503 | MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(victor9k_state, via2_pa_w)) |
| 503 | 504 | MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(victor9k_state, via2_pb_w)) |
| 504 | | MCFG_VIA6522_IRQ_HANDLER(WRITELINE(victor9k_state, via2_irq_w)) |
| 505 | MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE(I8259A_TAG, pic8259_device, ir6_w)) |
| 505 | 506 | |
| 506 | 507 | MCFG_DEVICE_ADD(M6522_3_TAG, VIA6522, XTAL_30MHz/30) |
| 507 | 508 | MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(victor9k_state, via3_pb_w)) |
| 508 | 509 | MCFG_VIA6522_IRQ_HANDLER(WRITELINE(victor9k_state, via3_irq_w)) |
| 509 | 510 | |
| 511 | MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_devices, "printer") |
| 512 | MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb5)) |
| 513 | MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb6)) |
| 514 | MCFG_CENTRONICS_SELECT_HANDLER(DEVWRITELINE(M6522_1_TAG, via6522_device, write_pb7)) |
| 515 | |
| 510 | 516 | MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, NULL) |
| 511 | 517 | MCFG_RS232_RXD_HANDLER(DEVWRITELINE(UPD7201_TAG, z80dart_device, rxa_w)) |
| 512 | 518 | MCFG_RS232_DCD_HANDLER(DEVWRITELINE(UPD7201_TAG, z80dart_device, dcda_w)) |
| r242315 | r242316 | |
| 521 | 527 | MCFG_RS232_CTS_HANDLER(DEVWRITELINE(UPD7201_TAG, z80dart_device, ctsb_w)) |
| 522 | 528 | MCFG_RS232_DSR_HANDLER(DEVWRITELINE(M6522_2_TAG, via6522_device, write_pa5)) |
| 523 | 529 | |
| 524 | | MCFG_DEVICE_ADD(VICTOR9K_KEYBOARD_TAG, VICTOR9K_KEYBOARD, 0) |
| 530 | MCFG_DEVICE_ADD(KB_TAG, VICTOR9K_KEYBOARD, 0) |
| 525 | 531 | MCFG_VICTOR9K_KBRDY_HANDLER(WRITELINE(victor9k_state, kbrdy_w)) |
| 526 | 532 | MCFG_VICTOR9K_KBDATA_HANDLER(WRITELINE(victor9k_state, kbdata_w)) |
| 527 | 533 | |
| r242315 | r242316 | |
| 533 | 539 | // internal ram |
| 534 | 540 | MCFG_RAM_ADD(RAM_TAG) |
| 535 | 541 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 536 | | MCFG_RAM_EXTRA_OPTIONS("256K,384K,512K,640K,768K,896K") |
| 537 | 542 | |
| 538 | 543 | // software list |
| 539 | 544 | MCFG_SOFTWARE_LIST_ADD("flop_list", "victor9k_flop") |