| Previous | 15994 Revisions | Next |
| r14370 Tuesday 7th February, 2012 at 07:28:39 UTC by Miodrag Milanović |
|---|
| Cleanup (nw) |
| [hash] | famicom_flop.xml |
| [src/emu/video] | pc_vga.c |
| [src/lib] | lib.mak |
| [src/mess/drivers] | at.c c64.c vic10.c x1.c |
| [src/mess/includes] | c64.h vic10.h |
| [src/mess/machine] | 3c503.c c64exp.c c64exp.h cbmipt.c cntr_covox.c cntr_covox.h docg3.h isa.c isa.h isa_aha1542.c isa_aha1542.h isa_ibm_mfc.c isa_ibm_mfc.h lynx.c pc_lpt.c pc_lpt.h svi318.c vic10exp.c vic10exp.h |
| [src/mess/machine/ti99] | evpc.c hsgpl.c |
| r14369 | r14370 | |
|---|---|---|
| 2 | 2 | <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> |
| 3 | 3 | <softwarelist name="famicom_flop" description="Nintendo Famicom Disk images"> |
| 4 | 4 | |
| 5 | <!-- | |
| 6 | Some disks are marked as bad dumps due to spurious data being present on the dump, | |
| 7 | e.g. because the disk was used on a system and data have been saved. In the case | |
| 5 | <!-- | |
| 6 | Some disks are marked as bad dumps due to spurious data being present on the dump, | |
| 7 | e.g. because the disk was used on a system and data have been saved. In the case | |
| 8 | 8 | of prototypes it's unlikely we will ever have access to a pristine disk, but still it is worth marking them. |
| 9 | 9 | Overall, anyway, all dumps are in .fds format which might be eventually replaced by a more |
| 10 | 10 | accurate format! |
| 11 | 11 | --> |
| 12 | 12 | |
| 13 | <!-- | |
| 13 | <!-- | |
| 14 | 14 | Undumped disks: |
| 15 | 15 | * Tanigawa Kouji no Shougi Shinan II - Tsumeshougi Ji no Itte ~ 谷川浩司の将棋指南II 詰め将棋・次の一手 (19880810, Pony Canyon, PNF-SH2) |
| 16 | 16 | |
| r14369 | r14370 | |
| 19 | 19 | * Konamic Ice Hockey ~ コナミック アイスホッケー 書き換え版 (19880909, Konami, KDS-HOC) |
| 20 | 20 | --> |
| 21 | 21 | |
| 22 | <!-- | |
| 22 | <!-- | |
| 23 | 23 | WARNING: These disks do not contain the 0x10 header some emulator expects!!! |
| 24 | 24 | To use them in such emulators, you have to open the image with an hex editor and add |
| 25 | 25 | at the beginning of the file the following string (in hex): |
| r14369 | r14370 | |
|---|---|---|
| 1268 | 1268 | vga.gc.read_mode = (data & 8) >> 3; |
| 1269 | 1269 | vga.gc.write_mode = data & 3; |
| 1270 | 1270 | //if(data & 0x10 && vga.gc.alpha_dis) |
| 1271 | // | |
| 1271 | // popmessage("Host O/E enabled, contact MAMEdev"); | |
| 1272 | 1272 | break; |
| 1273 | 1273 | case 0x06: |
| 1274 | 1274 | vga.gc.memory_map_sel = (data & 0xc) >> 2; |
| 1275 | 1275 | vga.gc.chain_oe = (data & 2) >> 1; |
| 1276 | 1276 | vga.gc.alpha_dis = (data & 1); |
| 1277 | 1277 | //if(data & 2 && vga.gc.alpha_dis) |
| 1278 | // | |
| 1278 | // popmessage("Chain O/E enabled, contact MAMEdev"); | |
| 1279 | 1279 | break; |
| 1280 | 1280 | case 0x07: |
| 1281 | 1281 | vga.gc.color_dont_care = data & 0xf; |
| r14369 | r14370 | |
|---|---|---|
| 307 | 307 | # $(OBJ)/libflac++.a: $(LIBFLACPPOBJS) |
| 308 | 308 | |
| 309 | 309 | # $(LIBOBJ)/libflacpp/%.o: $(LIBSRC)/libflac/libflac++/%.cpp | $(OSPREBUILD) |
| 310 | # | |
| 310 | # | |
| 311 | 311 | # $(CC) $(CDEFS) $(FLACOPTS) $(CPPONLYFLAGS) -I$(LIBSRC)/libflac/include -c $< -o $@ |
| r14369 | r14370 | |
|---|---|---|
| 1141 | 1141 | SLOT_INTERFACE_START( vic10_expansion_cards ) |
| 1142 | 1142 | SLOT_INTERFACE("standard", VIC10_STD) |
| 1143 | 1143 | SLOT_INTERFACE_END |
| 1144 | ||
| 1144 | ||
| 1145 | 1145 | SLOT_INTERFACE_START( c64_expansion_cards ) |
| 1146 | 1146 | SLOT_INTERFACE("standard", C64_STD) |
| 1147 | 1147 | SLOT_INTERFACE("xl80", C64_XL80) |
| r14369 | r14370 | |
|---|---|---|
| 38 | 38 | set_isa_device(); |
| 39 | 39 | m_isa->install_device(0x0300, 0x030f, 0, 0, read8_delegate(FUNC(el2_3c503_device::el2_3c503_loport_r), this), write8_delegate(FUNC(el2_3c503_device::el2_3c503_loport_w), this)); |
| 40 | 40 | m_isa->install_device(0x0700, 0x070f, 0, 0, read8_delegate(FUNC(el2_3c503_device::el2_3c503_hiport_r), this), write8_delegate(FUNC(el2_3c503_device::el2_3c503_hiport_w), this)); |
| 41 | ||
| 41 | ||
| 42 | 42 | // TODO: This is wrong, fix if anything actually uses it |
| 43 | 43 | // DMA can change in runtime |
| 44 | 44 | int chan = 0, idcfr = m_regs.idcfr & 0x0f; |
| r14369 | r14370 | |
|---|---|---|
| 782 | 782 | |
| 783 | 783 | switch( offset ) |
| 784 | 784 | { |
| 785 | case 0x12: | |
| 785 | case 0x12: | |
| 786 | 786 | data = 0xfe | centronics->busy_r(); |
| 787 | 787 | break; |
| 788 | 788 |
| r14369 | r14370 | |
|---|---|---|
| 23 | 23 | public: |
| 24 | 24 | // construction/destruction |
| 25 | 25 | diskonchip_g3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 26 | ||
| 26 | ||
| 27 | 27 | void set_size(int _size) { m_size = _size; } |
| 28 | 28 | protected: |
| 29 | 29 | // device-level overrides |
| r14369 | r14370 | |
| 76 | 76 | void sec_2_write8(UINT32 offset, UINT8 data); |
| 77 | 77 | |
| 78 | 78 | int m_size; |
| 79 | ||
| 79 | ||
| 80 | 80 | UINT32 m_planes; |
| 81 | 81 | UINT32 m_blocks; |
| 82 | 82 | UINT32 m_pages; |
| r14369 | r14370 | |
| 94 | 94 | UINT32 m_plane; |
| 95 | 95 | UINT32 m_transfersize; |
| 96 | 96 | UINT8 m_test; |
| 97 | UINT32 m_address_count; | |
| 97 | UINT32 m_address_count; | |
| 98 | 98 | }; |
| 99 | 99 | |
| 100 | 100 | // device type definition |
| 101 | extern const device_type DISKONCHIP_G3; | |
| 101 | extern const device_type DISKONCHIP_G3; | |
| 102 | 102 | |
| 103 | 103 | #endif /* __DOCG3_H__ */ |
| r14369 | r14370 | |
|---|---|---|
| 29 | 29 | devcb_resolved_write_line out_irq_func; |
| 30 | 30 | |
| 31 | 31 | UINT8 data; |
| 32 | ||
| 32 | ||
| 33 | 33 | int ack; |
| 34 | 34 | |
| 35 | 35 | /* control latch */ |
| r14369 | r14370 | |
| 100 | 100 | device->save_item(NAME(lpt->autofd)); |
| 101 | 101 | device->save_item(NAME(lpt->init)); |
| 102 | 102 | device->save_item(NAME(lpt->select)); |
| 103 | device->save_item(NAME(lpt->irq_enabled)); | |
| 103 | device->save_item(NAME(lpt->irq_enabled)); | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | static DEVICE_RESET( pc_lpt ) |
| r14369 | r14370 | |
| 211 | 211 | { |
| 212 | 212 | pc_lpt_state *lpt = get_safe_token(device); |
| 213 | 213 | |
| 214 | // | |
| 214 | // logerror("pc_lpt_control_w: 0x%02x\n", data); | |
| 215 | 215 | |
| 216 | 216 | /* save to latch */ |
| 217 | 217 | lpt->strobe = BIT(data, 0); |
| r14369 | r14370 | |
| 260 | 260 | isa8_lpt_device *lpt = downcast<isa8_lpt_device *>(device->owner()); |
| 261 | 261 | if (lpt->is_primary()) |
| 262 | 262 | lpt->m_isa->irq7_w(state); |
| 263 | else | |
| 263 | else | |
| 264 | 264 | lpt->m_isa->irq5_w(state); |
| 265 | 265 | } |
| 266 | 266 | static const pc_lpt_interface pc_lpt_config = |
| r14369 | r14370 | |
|---|---|---|
| 66 | 66 | // optional information overrides |
| 67 | 67 | virtual machine_config_constructor device_mconfig_additions() const; |
| 68 | 68 | virtual ioport_constructor device_input_ports() const; |
| 69 | ||
| 69 | ||
| 70 | 70 | bool is_primary() { return m_is_primary; } |
| 71 | 71 | protected: |
| 72 | 72 | // device-level overrides |
| r14369 | r14370 | |
|---|---|---|
| 109 | 109 | { |
| 110 | 110 | if (m_strobe) dac_w(m_dac_left, 0, data); |
| 111 | 111 | if (m_auto_fd) dac_w(m_dac_right, 0, data); |
| 112 | } | |
| No newline at end of file | ||
| 112 | } |
| r14369 | r14370 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | // optional information overrides |
| 23 | 23 | virtual machine_config_constructor device_mconfig_additions() const; |
| 24 | ||
| 24 | ||
| 25 | 25 | virtual void write(UINT8 data); |
| 26 | 26 | protected: |
| 27 | 27 | // device-level overrides |
| r14369 | r14370 | |
| 44 | 44 | |
| 45 | 45 | // optional information overrides |
| 46 | 46 | virtual machine_config_constructor device_mconfig_additions() const; |
| 47 | ||
| 47 | ||
| 48 | 48 | virtual void write(UINT8 data); |
| 49 | 49 | protected: |
| 50 | 50 | // device-level overrides |
| r14369 | r14370 | |
|---|---|---|
| 632 | 632 | /* |
| 633 | 633 | static DEVICE_NVRAM( hsgpl ) |
| 634 | 634 | { |
| 635 | // Called between START and RESET | |
| 636 | hsgpl_state *card = get_safe_token(device); | |
| 637 | astring hsname(device->machine().system().name, PATH_SEPARATOR, "hsgpl.nv"); | |
| 638 | file_error filerr; | |
| 635 | // Called between START and RESET | |
| 636 | hsgpl_state *card = get_safe_token(device); | |
| 637 | astring hsname(device->machine().system().name, PATH_SEPARATOR, "hsgpl.nv"); | |
| 638 | file_error filerr; | |
| 639 | 639 | |
| 640 | if (read_or_write==0) | |
| 641 | { | |
| 642 | logerror("hsgpl: device nvram load %s\n", hsname.cstr()); | |
| 640 | if (read_or_write==0) | |
| 641 | { | |
| 642 | logerror("hsgpl: device nvram load %s\n", hsname.cstr()); | |
| 643 | 643 | |
| 644 | emu_file nvfile(device->machine().options().nvram_directory(), OPEN_FLAG_READ); | |
| 645 | filerr = nvfile.open(hsname.cstr()); | |
| 646 | if (filerr != FILERR_NONE) | |
| 647 | { | |
| 648 | logerror("hsgpl: Could not restore NVRAM\n"); | |
| 649 | return; | |
| 650 | } | |
| 644 | emu_file nvfile(device->machine().options().nvram_directory(), OPEN_FLAG_READ); | |
| 645 | filerr = nvfile.open(hsname.cstr()); | |
| 646 | if (filerr != FILERR_NONE) | |
| 647 | { | |
| 648 | logerror("hsgpl: Could not restore NVRAM\n"); | |
| 649 | return; | |
| 650 | } | |
| 651 | 651 | |
| 652 | if (nvfile.read(card->flashrom, FLROMSIZE) != FLROMSIZE) | |
| 653 | { | |
| 654 | logerror("hsgpl: Error loading NVRAM; unexpected EOF\n"); | |
| 655 | return; | |
| 656 | } | |
| 652 | if (nvfile.read(card->flashrom, FLROMSIZE) != FLROMSIZE) | |
| 653 | { | |
| 654 | logerror("hsgpl: Error loading NVRAM; unexpected EOF\n"); | |
| 655 | return; | |
| 656 | } | |
| 657 | 657 | |
| 658 | if (card->flashrom[0] != NVVERSION) | |
| 659 | { | |
| 660 | logerror("hsgpl: Wrong NVRAM image version: %d\n", card->flashrom[0]); | |
| 661 | return; | |
| 662 | } | |
| 663 | } | |
| 664 | else | |
| 665 | { | |
| 666 | logerror("hsgpl: device nvram save %s\n", hsname.cstr()); | |
| 667 | // Check dirty flags | |
| 668 | if (at29c040a_is_dirty(card->dsr) || | |
| 669 | at29c040a_is_dirty(card->rom6) || | |
| 670 | at29c040a_is_dirty(card->groma) || | |
| 671 | at29c040a_is_dirty(card->gromb)) | |
| 672 | { | |
| 673 | card->flashrom[0] = NVVERSION; | |
| 658 | if (card->flashrom[0] != NVVERSION) | |
| 659 | { | |
| 660 | logerror("hsgpl: Wrong NVRAM image version: %d\n", card->flashrom[0]); | |
| 661 | return; | |
| 662 | } | |
| 663 | } | |
| 664 | else | |
| 665 | { | |
| 666 | logerror("hsgpl: device nvram save %s\n", hsname.cstr()); | |
| 667 | // Check dirty flags | |
| 668 | if (at29c040a_is_dirty(card->dsr) || | |
| 669 | at29c040a_is_dirty(card->rom6) || | |
| 670 | at29c040a_is_dirty(card->groma) || | |
| 671 | at29c040a_is_dirty(card->gromb)) | |
| 672 | { | |
| 673 | card->flashrom[0] = NVVERSION; | |
| 674 | 674 | |
| 675 | emu_file nvfile(device->machine().options().nvram_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); | |
| 676 | filerr = nvfile.open(hsname.cstr()); | |
| 677 | if (filerr != FILERR_NONE) | |
| 678 | { | |
| 679 | logerror("hsgpl: Could not save NVRAM\n"); | |
| 680 | } | |
| 681 | else | |
| 682 | { | |
| 683 | if (nvfile.write(card->flashrom, FLROMSIZE) != FLROMSIZE) | |
| 684 | { | |
| 685 | logerror("hsgpl: Error while saving contents of NVRAM.\n"); | |
| 686 | } | |
| 687 | } | |
| 688 | return; | |
| 689 | } | |
| 690 | else | |
| 691 | { | |
| 692 | logerror("hsgpl: No changes on card, leaving nvram file unchanged.\n"); | |
| 693 | } | |
| 694 | } | |
| 675 | emu_file nvfile(device->machine().options().nvram_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); | |
| 676 | filerr = nvfile.open(hsname.cstr()); | |
| 677 | if (filerr != FILERR_NONE) | |
| 678 | { | |
| 679 | logerror("hsgpl: Could not save NVRAM\n"); | |
| 680 | } | |
| 681 | else | |
| 682 | { | |
| 683 | if (nvfile.write(card->flashrom, FLROMSIZE) != FLROMSIZE) | |
| 684 | { | |
| 685 | logerror("hsgpl: Error while saving contents of NVRAM.\n"); | |
| 686 | } | |
| 687 | } | |
| 688 | return; | |
| 689 | } | |
| 690 | else | |
| 691 | { | |
| 692 | logerror("hsgpl: No changes on card, leaving nvram file unchanged.\n"); | |
| 693 | } | |
| 694 | } | |
| 695 | 695 | } |
| 696 | 696 | */ |
| 697 | 697 | /* |
| r14369 | r14370 | |
|---|---|---|
| 370 | 370 | /* |
| 371 | 371 | static DEVICE_NVRAM( ti99_evpc ) |
| 372 | 372 | { |
| 373 | // Called between START and RESET | |
| 374 | ti99_evpc_state *card = get_safe_token(device); | |
| 375 | astring hsname(device->machine().system().name, PATH_SEPARATOR, "evpc.nv"); | |
| 376 | file_error filerr; | |
| 373 | // Called between START and RESET | |
| 374 | ti99_evpc_state *card = get_safe_token(device); | |
| 375 | astring hsname(device->machine().system().name, PATH_SEPARATOR, "evpc.nv"); | |
| 376 | file_error filerr; | |
| 377 | 377 | |
| 378 | if (read_or_write==0) | |
| 379 | { | |
| 380 | logerror("evpc: device nvram load %s\n", hsname.cstr()); | |
| 378 | if (read_or_write==0) | |
| 379 | { | |
| 380 | logerror("evpc: device nvram load %s\n", hsname.cstr()); | |
| 381 | 381 | |
| 382 | emu_file nvfile(device->machine().options().nvram_directory(), OPEN_FLAG_READ); | |
| 383 | filerr = nvfile.open(hsname.cstr()); | |
| 384 | if (filerr == FILERR_NONE) | |
| 385 | { | |
| 386 | if (nvfile.read(card->novram, 256) != 256) | |
| 387 | logerror("evpc: NOVRAM load error\n"); | |
| 388 | } | |
| 389 | } | |
| 390 | else | |
| 391 | { | |
| 392 | logerror("evpc: device nvram save %s\n", hsname.cstr()); | |
| 393 | emu_file nvfile(device->machine().options().nvram_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); | |
| 394 | filerr = nvfile.open(hsname.cstr()); | |
| 382 | emu_file nvfile(device->machine().options().nvram_directory(), OPEN_FLAG_READ); | |
| 383 | filerr = nvfile.open(hsname.cstr()); | |
| 384 | if (filerr == FILERR_NONE) | |
| 385 | { | |
| 386 | if (nvfile.read(card->novram, 256) != 256) | |
| 387 | logerror("evpc: NOVRAM load error\n"); | |
| 388 | } | |
| 389 | } | |
| 390 | else | |
| 391 | { | |
| 392 | logerror("evpc: device nvram save %s\n", hsname.cstr()); | |
| 393 | emu_file nvfile(device->machine().options().nvram_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); | |
| 394 | filerr = nvfile.open(hsname.cstr()); | |
| 395 | 395 | |
| 396 | if (filerr == FILERR_NONE) | |
| 397 | { | |
| 398 | if (nvfile.write(card->novram, 256) != 256) | |
| 399 | logerror("evpc: NOVRAM save error\n"); | |
| 400 | } | |
| 401 | } | |
| 396 | if (filerr == FILERR_NONE) | |
| 397 | { | |
| 398 | if (nvfile.write(card->novram, 256) != 256) | |
| 399 | logerror("evpc: NOVRAM save error\n"); | |
| 400 | } | |
| 401 | } | |
| 402 | 402 | } |
| 403 | 403 | */ |
| 404 | 404 | MACHINE_CONFIG_FRAGMENT( ti99_evpc ) |
| r14369 | r14370 | |
|---|---|---|
| 771 | 771 | state->m_blitter.sprite_collide = !(state->m_blitter.spr_coll & 0x20); |
| 772 | 772 | state->m_blitter.spritenr = state->m_blitter.spr_coll & 0x0f; |
| 773 | 773 | state->m_blitter.fred = 0; |
| 774 | ||
| 774 | ||
| 775 | 775 | /* Draw Sprite */ |
| 776 | 776 | lynx_blit_lines(state); |
| 777 | ||
| 777 | ||
| 778 | 778 | if (state->m_blitter.sprite_collide && !(state->m_blitter.no_collide)) |
| 779 | 779 | { |
| 780 | 780 | switch (state->m_blitter.mode) |
| r14369 | r14370 | |
| 788 | 788 | break; |
| 789 | 789 | } |
| 790 | 790 | } |
| 791 | ||
| 791 | ||
| 792 | 792 | if (state->m_suzy.data[SPRGO] & 0x04) // Everon enabled |
| 793 | 793 | { |
| 794 | 794 | coldep = lynx_read_ram(state, state->m_blitter.colpos); |
| r14369 | r14370 | |
| 1223 | 1223 | break; |
| 1224 | 1224 | case MATH_D: |
| 1225 | 1225 | /* Documentation states that writing to the MATH_D will set MATH_C to zero but not update the sign flag. |
| 1226 | Implementing the sign detection as described in the documentation causes Stun Runners to not work. | |
| 1227 | Either the sign error in the docs is not as described or writing to the lower byte does update the sign flag. | |
| 1228 | Here I assume the sign flag gets updated. */ | |
| 1226 | Implementing the sign detection as described in the documentation causes Stun Runners to not work. | |
| 1227 | Either the sign error in the docs is not as described or writing to the lower byte does update the sign flag. | |
| 1228 | Here I assume the sign flag gets updated. */ | |
| 1229 | 1229 | if (data) |
| 1230 | 1230 | state->m_sign_CD = 1; |
| 1231 | 1231 | break; |
| r14369 | r14370 | |
| 1644 | 1644 | state->m_mikey.data[0x81] |= 0x10; |
| 1645 | 1645 | cputag_set_input_line(machine, "maincpu", M65SC02_IRQ_LINE, ASSERT_LINE); |
| 1646 | 1646 | } |
| 1647 | } | |
| 1647 | } | |
| 1648 | 1648 | |
| 1649 | 1649 | if (state->m_uart.serctl & 0x80) |
| 1650 | 1650 | { |
| r14369 | r14370 | |
|---|---|---|
| 331 | 331 | if (machine().region("isa")) { |
| 332 | 332 | dest = machine().region("isa")->base() + start - 0xc0000; |
| 333 | 333 | } |
| 334 | memcpy(dest,src, end - start + 1); | |
| 334 | memcpy(dest,src, end - start + 1); | |
| 335 | 335 | /*address_space *space = m_maincpu->memory().space(AS_PROGRAM); |
| 336 | space->install_read_bank(start, end, mask, mirror, tag); | |
| 337 | space->unmap_write(start, end, mask, mirror); | |
| 338 | memory_set_bankptr(machine(), tag, machine().region(dev->subtag(tempstring, region))->base());*/ | |
| 336 | space->install_read_bank(start, end, mask, mirror, tag); | |
| 337 | space->unmap_write(start, end, mask, mirror); | |
| 338 | memory_set_bankptr(machine(), tag, machine().region(dev->subtag(tempstring, region))->base());*/ | |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | void isa8_device::unmap_rom(offs_t start, offs_t end, offs_t mask, offs_t mirror) |
| r14369 | r14370 | |
| 359 | 359 | |
| 360 | 360 | UINT8 isa8_device::dack_r(int line) |
| 361 | 361 | { |
| 362 | if (m_dma_device[line]) | |
| 363 | return m_dma_device[line]->dack_r(line); | |
| 362 | if (m_dma_device[line]) | |
| 363 | return m_dma_device[line]->dack_r(line); | |
| 364 | 364 | return 0xff; |
| 365 | 365 | } |
| 366 | 366 | |
| r14369 | r14370 | |
| 373 | 373 | void isa8_device::eop_w(int state) |
| 374 | 374 | { |
| 375 | 375 | for (int i=0;i<8;i++) { |
| 376 | if (m_dma_eop[i]==TRUE && m_dma_device[i]) | |
| 376 | if (m_dma_eop[i]==TRUE && m_dma_device[i]) | |
| 377 | 377 | m_dma_device[i]->eop_w(state); |
| 378 | 378 | } |
| 379 | 379 | } |
| r14369 | r14370 | |
|---|---|---|
| 175 | 175 | UINT8 dack_r(int line); |
| 176 | 176 | void dack_w(int line,UINT8 data); |
| 177 | 177 | void eop_w(int state); |
| 178 | ||
| 178 | ||
| 179 | 179 | void set_dma_channel(UINT8 channel, device_isa8_card_interface *dev, bool do_eop); |
| 180 | 180 | protected: |
| 181 | 181 | // device-level overrides |
| r14369 | r14370 | |
|---|---|---|
| 7 | 7 | * |
| 8 | 8 | **********************************************************************/ |
| 9 | 9 | |
| 10 | /* | |
| 10 | /* | |
| 11 | 11 | PCB layout |
| 12 | 12 | ---------- |
| 13 | 13 | Floppy SCSI |
| 14 | +-----------+ +------------------+ +- | |
| 14 | +-----------+ +------------------+ +- | |
| 15 | 15 | +-----+-----------+-+------------------+--+ |
| 16 | 16 | | | |
| 17 | 17 | | DIPSW DS1 |\ |
| r14369 | r14370 | |
| 28 | 28 | ||||||||| ||||||||||||||||||||||||| | |
| 29 | 29 | |
| 30 | 30 | |
| 31 | DIPSW sw1 - sw8 | |
| 32 | U3 Intel chip labelled "AHA-1542CF/552800-01 D/9346", probably FDC (82077) | |
| 33 | U5 Z84C0010VEC | |
| 34 | U8 EEPROM(?) labelled 545120A | |
| 35 | U13 CXK5864CM-10LL (64kbit SRAM) | |
| 36 | U15 M27C256B labelled "ADAPTEC INC/553801-00 C/MCODE 563D/(C) 1993" | |
| 37 | U16 M27C256B labelled "ADAPTEC INC/553601-00 C/BIOS C38D/(C) 1993" | |
| 38 | U17 AIC-7970Q | |
| 39 | Y1 XTAL SRX4054 93-38 | |
| 40 | Y2 XTAL SRX4053 93-40 | |
| 41 | TRM Dallas DS2107AS (SCSI termination) | |
| 42 | DS1 LED | |
| 31 | DIPSW sw1 - sw8 | |
| 32 | U3 Intel chip labelled "AHA-1542CF/552800-01 D/9346", probably FDC (82077) | |
| 33 | U5 Z84C0010VEC | |
| 34 | U8 EEPROM(?) labelled 545120A | |
| 35 | U13 CXK5864CM-10LL (64kbit SRAM) | |
| 36 | U15 M27C256B labelled "ADAPTEC INC/553801-00 C/MCODE 563D/(C) 1993" | |
| 37 | U16 M27C256B labelled "ADAPTEC INC/553601-00 C/BIOS C38D/(C) 1993" | |
| 38 | U17 AIC-7970Q | |
| 39 | Y1 XTAL SRX4054 93-38 | |
| 40 | Y2 XTAL SRX4053 93-40 | |
| 41 | TRM Dallas DS2107AS (SCSI termination) | |
| 42 | DS1 LED | |
| 43 | 43 | |
| 44 | 44 | */ |
| 45 | 45 | |
| 46 | 46 | /* |
| 47 | 47 | * The PCB has a couple of DIP switches: |
| 48 | 48 | * |
| 49 | * sw1 on enable termination | |
| 50 | * off software-controlled termination | |
| 49 | * sw1 on enable termination | |
| 50 | * off software-controlled termination | |
| 51 | 51 | * |
| 52 | * sw2 sw3 sw4 I/O Port | |
| 53 | * off off off 0x330 - 0x333 (default) | |
| 54 | * on off off 0x334 - 0x337 | |
| 55 | * off on off 0x230 - 0x233 | |
| 56 | * on on off 0x234 - 0x237 | |
| 57 | * off off on 0x130 - 0x133 | |
| 58 | * on off on 0x134 - 0x137 | |
| 59 | * off on on reserved | |
| 60 | * on on on reserved | |
| 52 | * sw2 sw3 sw4 I/O Port | |
| 53 | * off off off 0x330 - 0x333 (default) | |
| 54 | * on off off 0x334 - 0x337 | |
| 55 | * off on off 0x230 - 0x233 | |
| 56 | * on on off 0x234 - 0x237 | |
| 57 | * off off on 0x130 - 0x133 | |
| 58 | * on off on 0x134 - 0x137 | |
| 59 | * off on on reserved | |
| 60 | * on on on reserved | |
| 61 | 61 | * |
| 62 | * sw5 on disable floppy interface | |
| 63 | * off enable floppy interface | |
| 62 | * sw5 on disable floppy interface | |
| 63 | * off enable floppy interface | |
| 64 | 64 | * |
| 65 | * sw6 sw7 sw8 BIOS base address | |
| 66 | * off off off 0xdc000 (default) | |
| 67 | * on off off 0xd8000 | |
| 68 | * off on off 0xd4000 | |
| 69 | * on on off 0xd0000 | |
| 70 | * off off on 0xcc000 | |
| 71 | * on off on 0xc8000 | |
| 72 | * off on on reserved | |
| 73 | * on on on BIOS disabled | |
| 65 | * sw6 sw7 sw8 BIOS base address | |
| 66 | * off off off 0xdc000 (default) | |
| 67 | * on off off 0xd8000 | |
| 68 | * off on off 0xd4000 | |
| 69 | * on on off 0xd0000 | |
| 70 | * off off on 0xcc000 | |
| 71 | * on off on 0xc8000 | |
| 72 | * off on on reserved | |
| 73 | * on on on BIOS disabled | |
| 74 | 74 | * |
| 75 | 75 | * source: http://download.adaptec.com/pdfs/installation_guides/1540cfig.pdf |
| 76 | 76 | */ |
| r14369 | r14370 | |
| 152 | 152 | //------------------------------------------------- |
| 153 | 153 | // ROM( aha1542 ) |
| 154 | 154 | //------------------------------------------------- |
| 155 | ||
| 155 | ||
| 156 | 156 | ROM_START( aha1542 ) |
| 157 | 157 | ROM_REGION( 0x8000, "aha1542", 0 ) |
| 158 | 158 | ROM_LOAD( "553601-00.u16", 0x0000, 0x8000, CRC(AB22FC02) SHA1(f9f783e0272fc14ba3de32316997f1f6cadc67d0) ) /* Adaptec 1540CF/1542CF BIOS v2.01 */ |
| r14369 | r14370 | |
| 190 | 190 | { |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | void aha1542_device::device_config_complete() | |
| 193 | void aha1542_device::device_config_complete() | |
| 194 | 194 | { |
| 195 | 195 | m_shortname = "aha1542"; |
| 196 | 196 | } |
| 197 | ||
| 197 | ||
| 198 | 198 | void aha1542_device::device_start() |
| 199 | 199 | { |
| 200 | 200 | set_isa_device(); |
| 201 | 201 | m_isa->install_rom(this, 0xdc000, 0xdffff, 0, 0, "aha1542", "aha1542"); |
| 202 | m_isa->install_device(0x330, 0x333, 0, 0, read8_delegate(FUNC( aha1542_device::aha1542_r ), this), | |
| 202 | m_isa->install_device(0x330, 0x333, 0, 0, read8_delegate(FUNC( aha1542_device::aha1542_r ), this), | |
| 203 | 203 | write8_delegate(FUNC( aha1542_device::aha1542_w ), this) ); |
| 204 | 204 | } |
| 205 | 205 |
| r14369 | r14370 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | DECLARE_READ8_MEMBER( aha1542_r ); |
| 43 | 43 | DECLARE_WRITE8_MEMBER( aha1542_w ); |
| 44 | ||
| 44 | ||
| 45 | 45 | protected: |
| 46 | 46 | // device-level overrides |
| 47 | 47 | virtual void device_start(); |
| r14369 | r14370 | |
| 49 | 49 | virtual void device_config_complete(); |
| 50 | 50 | |
| 51 | 51 | // device_isa16_card_interface |
| 52 | ||
| 52 | ||
| 53 | 53 | private: |
| 54 | 54 | // internal state |
| 55 | 55 | }; |
| r14369 | r14370 | |
|---|---|---|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | // set brief and instance name |
| 99 | update_names(); | |
| 99 | update_names(); | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | |
| r14369 | r14370 | |
| 134 | 134 | { |
| 135 | 135 | fread(m_cart->c64_roml_pointer(), 0x2000); |
| 136 | 136 | m_cart->c64_exrom_w(0); |
| 137 | ||
| 137 | ||
| 138 | 138 | if (size == 0x4000) |
| 139 | 139 | { |
| 140 | 140 | fread(m_cart->c64_romh_pointer(), 0x2000); |
| r14369 | r14370 | |
| 151 | 151 | else if (!mame_stricmp(filetype(), "e0")) |
| 152 | 152 | { |
| 153 | 153 | fread(m_cart->c64_romh_pointer(), size); |
| 154 | ||
| 154 | ||
| 155 | 155 | m_cart->c64_game_w(0); |
| 156 | 156 | } |
| 157 | 157 | } |
| r14369 | r14370 | |
| 167 | 167 | size = get_software_region_length("romh"); |
| 168 | 168 | if (size) memcpy(m_cart->c64_romh_pointer(), get_software_region("romh"), size); |
| 169 | 169 | break; |
| 170 | ||
| 170 | ||
| 171 | 171 | case 0x4000: |
| 172 | 172 | memcpy(m_cart->c64_roml_pointer(), get_software_region("roml"), 0x2000); |
| 173 | 173 | memcpy(m_cart->c64_romh_pointer(), get_software_region("roml") + 0x2000, 0x2000); |
| 174 | 174 | break; |
| 175 | ||
| 175 | ||
| 176 | 176 | default: |
| 177 | 177 | return IMAGE_INIT_FAIL; |
| 178 | 178 | } |
| r14369 | r14370 | |
|---|---|---|
| 172 | 172 | |
| 173 | 173 | protected: |
| 174 | 174 | c64_expansion_slot_device *m_slot; |
| 175 | ||
| 175 | ||
| 176 | 176 | int m_game; |
| 177 | 177 | int m_exrom; |
| 178 | 178 | }; |
| r14369 | r14370 | |
|---|---|---|
| 43 | 43 | PC_IRQ_TIMERA, |
| 44 | 44 | PC_IRQ_TIMERB, |
| 45 | 45 | PC_IRQ_RXRDY, |
| 46 | PC_IRQ_TXRDY, | |
| 46 | PC_IRQ_TXRDY, | |
| 47 | 47 | }; |
| 48 | 48 | |
| 49 | 49 | enum |
| r14369 | r14370 | |
| 73 | 73 | m_pc_irq_state |= 1 << src; |
| 74 | 74 | else |
| 75 | 75 | m_pc_irq_state &= ~(1 << src); |
| 76 | ||
| 76 | ||
| 77 | 77 | update_pc_interrupts(); |
| 78 | 78 | } |
| 79 | 79 | |
| r14369 | r14370 | |
| 85 | 85 | // IRQs unmasked? |
| 86 | 86 | if (m_tcr & TCR_TMSK) |
| 87 | 87 | { |
| 88 | m_isa->irq3_w(m_pc_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 88 | m_isa->irq3_w(m_pc_irq_state ? ASSERT_LINE : CLEAR_LINE); | |
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | } |
| r14369 | r14370 | |
| 96 | 96 | m_z80_irq_state |= 1 << src; |
| 97 | 97 | else |
| 98 | 98 | m_z80_irq_state &= ~(1 << src); |
| 99 | ||
| 99 | ||
| 100 | 100 | update_z80_interrupts(); |
| 101 | 101 | } |
| 102 | 102 | |
| r14369 | r14370 | |
| 234 | 234 | |
| 235 | 235 | set_z80_interrupt(Z80_IRQ_TXRDY, BIT(data, 3)); |
| 236 | 236 | set_z80_interrupt(Z80_IRQ_RXRDY, BIT(data, 0)); |
| 237 | ||
| 237 | ||
| 238 | 238 | m_z80_ppi_c = data; |
| 239 | 239 | } |
| 240 | 240 | |
| r14369 | r14370 | |
| 378 | 378 | val = m_d71055c_0->read(space, offset); |
| 379 | 379 | break; |
| 380 | 380 | } |
| 381 | ||
| 381 | ||
| 382 | 382 | case 0xc: |
| 383 | 383 | case 0xd: |
| 384 | 384 | case 0xe: |
| 385 | 385 | case 0xf: |
| 386 | 386 | { |
| 387 | val = (m_pc_irq_state ? 0x80 : 0) | (m_pc_irq_state & 3); | |
| 387 | val = (m_pc_irq_state ? 0x80 : 0) | (m_pc_irq_state & 3); | |
| 388 | 388 | break; |
| 389 | 389 | } |
| 390 | 390 | |
| r14369 | r14370 | |
| 393 | 393 | fatalerror("Unhandled IBM MFC read from %d\n", offset); |
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | ||
| 396 | ||
| 397 | 397 | return val; |
| 398 | 398 | } |
| 399 | 399 | |
| r14369 | r14370 | |
| 535 | 535 | m_tcr = 0; |
| 536 | 536 | m_pc_irq_state = 0; |
| 537 | 537 | m_z80_irq_state = 0; |
| 538 | } | |
| No newline at end of file | ||
| 538 | } |
| r14369 | r14370 | |
|---|---|---|
| 43 | 43 | |
| 44 | 44 | DECLARE_WRITE8_MEMBER( ppi1_o_a ); |
| 45 | 45 | DECLARE_READ8_MEMBER( ppi1_i_b ); |
| 46 | ||
| 46 | ||
| 47 | 47 | DECLARE_WRITE8_MEMBER( ppi1_o_c ); |
| 48 | ||
| 48 | ||
| 49 | 49 | DECLARE_READ8_MEMBER( ibm_mfc_r ); |
| 50 | 50 | DECLARE_WRITE8_MEMBER( ibm_mfc_w ); |
| 51 | ||
| 51 | ||
| 52 | 52 | DECLARE_READ_LINE_MEMBER( d70151_dsr_r ); |
| 53 | ||
| 53 | ||
| 54 | 54 | DECLARE_WRITE_LINE_MEMBER( d8253_clk0_out ); |
| 55 | 55 | DECLARE_WRITE_LINE_MEMBER( d8253_clk1_out ); |
| 56 | DECLARE_WRITE_LINE_MEMBER( d8253_clk2_out ); | |
| 57 | ||
| 56 | DECLARE_WRITE_LINE_MEMBER( d8253_clk2_out ); | |
| 57 | ||
| 58 | 58 | void set_z80_interrupt(int src, int state); |
| 59 | 59 | |
| 60 | 60 | protected: |
| r14369 | r14370 | |
|---|---|---|
| 131 | 131 | if (!mame_stricmp(filetype(), "80")) |
| 132 | 132 | { |
| 133 | 133 | fread(m_cart->vic10_lorom_pointer(), 0x2000); |
| 134 | ||
| 134 | ||
| 135 | 135 | if (size == 0x4000) |
| 136 | 136 | { |
| 137 | 137 | fread(m_cart->vic10_uprom_pointer(), 0x2000); |
| r14369 | r14370 | |
| 146 | 146 | |
| 147 | 147 | size = get_software_region_length("uprom"); |
| 148 | 148 | if (size) memcpy(m_cart->vic10_uprom_pointer(), get_software_region("uprom"), size); |
| 149 | ||
| 149 | ||
| 150 | 150 | size = get_software_region_length("exram"); |
| 151 | 151 | if (size) m_cart->vic10_exram_pointer(); |
| 152 | 152 | } |
| r14369 | r14370 | |
|---|---|---|
| 156 | 156 | virtual UINT8* vic10_exram_pointer() { return NULL; } |
| 157 | 157 | virtual UINT8 vic10_exram_r(address_space &space, offs_t offset) { return 0; }; |
| 158 | 158 | virtual void vic10_exram_w(address_space &space, offs_t offset, UINT8 data) { }; |
| 159 | ||
| 159 | ||
| 160 | 160 | // ROM |
| 161 | 161 | virtual UINT8* vic10_lorom_pointer() { return NULL; } |
| 162 | 162 | virtual UINT8 vic10_lorom_r(address_space &space, offs_t offset) { return 0; }; |
| r14369 | r14370 | |
|---|---|---|
| 73 | 73 | |
| 74 | 74 | virtual void machine_start(); |
| 75 | 75 | virtual UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 76 | ||
| 76 | ||
| 77 | 77 | void check_interrupts(); |
| 78 | 78 | void bankswitch(offs_t offset, offs_t va, int rw, int aec, int ba, int cas, int *casram, int *basic, int *kernal, int *charom, int *grw, int *io, int *roml, int *romh); |
| 79 | 79 | UINT8 read_memory(address_space &space, offs_t offset, int casram, int basic, int kernal, int charom, int io, int roml, int romh); |
| 80 | ||
| 80 | ||
| 81 | 81 | DECLARE_READ8_MEMBER( read ); |
| 82 | 82 | DECLARE_WRITE8_MEMBER( write ); |
| 83 | 83 | |
| r14369 | r14370 | |
| 100 | 100 | DECLARE_WRITE_LINE_MEMBER( iec_srq_w ); |
| 101 | 101 | DECLARE_WRITE_LINE_MEMBER( exp_irq_w ); |
| 102 | 102 | DECLARE_WRITE_LINE_MEMBER( exp_nmi_w ); |
| 103 | ||
| 103 | ||
| 104 | 104 | // memory state |
| 105 | 105 | int m_loram; |
| 106 | 106 | int m_hiram; |
| r14369 | r14370 | |
| 108 | 108 | UINT8 *m_basic; |
| 109 | 109 | UINT8 *m_kernal; |
| 110 | 110 | UINT8 *m_charom; |
| 111 | ||
| 111 | ||
| 112 | 112 | // video state |
| 113 | 113 | UINT8 *m_color_ram; |
| 114 | 114 | int m_va14; |
| 115 | 115 | int m_va15; |
| 116 | ||
| 116 | ||
| 117 | 117 | // interrupt state |
| 118 | 118 | int m_cia1_irq; |
| 119 | 119 | int m_cia2_irq; |
| r14369 | r14370 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | virtual void machine_start(); |
| 52 | 52 | virtual UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 53 | ||
| 53 | ||
| 54 | 54 | void check_interrupts(); |
| 55 | ||
| 55 | ||
| 56 | 56 | DECLARE_READ8_MEMBER( vic_lightpen_x_cb ); |
| 57 | 57 | DECLARE_READ8_MEMBER( vic_lightpen_y_cb ); |
| 58 | 58 | DECLARE_READ8_MEMBER( vic_lightpen_button_cb ); |
| r14369 | r14370 | |
| 67 | 67 | DECLARE_READ8_MEMBER( cpu_r ); |
| 68 | 68 | DECLARE_WRITE8_MEMBER( cpu_w ); |
| 69 | 69 | DECLARE_WRITE_LINE_MEMBER( exp_irq_w ); |
| 70 | ||
| 70 | ||
| 71 | 71 | // video state |
| 72 | 72 | UINT8 *m_color_ram; |
| 73 | ||
| 73 | ||
| 74 | 74 | // interrupt state |
| 75 | 75 | int m_cia_irq; |
| 76 | 76 | int m_vic_irq; |
| r14369 | r14370 | |
|---|---|---|
| 1640 | 1640 | |
| 1641 | 1641 | WRITE8_MEMBER( x1_state::x1_io_w ) |
| 1642 | 1642 | { |
| 1643 | if(m_io_bank_mode == 1) | |
| 1643 | if(m_io_bank_mode == 1) | |
| 1644 | 1644 | // TODO: user could install ym2151 on plain X1 too |
| 1645 | 1645 | //0x700, 0x701 |
| 1646 | 1646 | // else if(offset >= 0x0704 && offset <= 0x0707) { z80ctc_w(m_ctc, offset-0x0704,data); } |
| r14369 | r14370 | |
|---|---|---|
| 395 | 395 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 396 | 396 | MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0) |
| 397 | 397 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 398 | ||
| 398 | ||
| 399 | 399 | /* video hardware */ |
| 400 | 400 | MCFG_PALETTE_LENGTH( 256 ) |
| 401 | 401 | MACHINE_CONFIG_END |
| r14369 | r14370 | |
|---|---|---|
| 1 | 1 | /* |
| 2 | 2 | |
| 3 | TODO: | |
| 4 | ||
| 5 | - 64C PLA dump | |
| 6 | - cartridge loading | |
| 3 | TODO: | |
| 7 | 4 | |
| 5 | - 64C PLA dump | |
| 6 | - cartridge loading | |
| 7 | ||
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | #include "includes/c64.h" |
| r14369 | r14370 | |
| 35 | 35 | void c64_state::check_interrupts() |
| 36 | 36 | { |
| 37 | 37 | int restore = BIT(input_port_read(machine(), "SPECIAL"), 7); |
| 38 | ||
| 38 | ||
| 39 | 39 | m_maincpu->set_input_line(INPUT_LINE_IRQ0, m_cia1_irq | m_vic_irq | m_exp_irq); |
| 40 | 40 | m_maincpu->set_input_line(INPUT_LINE_NMI, m_cia2_irq | restore | m_exp_nmi); |
| 41 | ||
| 41 | ||
| 42 | 42 | mos6526_flag_w(m_cia1, m_cass_rd & m_iec_srq); |
| 43 | 43 | } |
| 44 | 44 | |
| r14369 | r14370 | |
| 59 | 59 | |
| 60 | 60 | UINT16 input = VA12 << 15 | VA13 << 14 | game << 13 | exrom << 12 | rw << 11 | aec << 10 | ba << 9 | A12 << 8 | A13 << 7 | A14 << 6 | A15 << 5 | m_va14 << 4 | m_charen << 3 | m_hiram << 2 | m_loram << 1 | cas; |
| 61 | 61 | UINT8 data = m_pla->read(input); |
| 62 | ||
| 62 | ||
| 63 | 63 | *casram = BIT(data, 0); |
| 64 | 64 | *basic = BIT(data, 1); |
| 65 | 65 | *kernal = BIT(data, 2); |
| r14369 | r14370 | |
| 78 | 78 | UINT8 c64_state::read_memory(address_space &space, offs_t offset, int casram, int basic, int kernal, int charom, int io, int roml, int romh) |
| 79 | 79 | { |
| 80 | 80 | UINT8 data = 0; |
| 81 | ||
| 81 | ||
| 82 | 82 | if (!casram) |
| 83 | 83 | { |
| 84 | 84 | data = m_ram->pointer()[offset]; |
| r14369 | r14370 | |
| 119 | 119 | cia_set_port_mask_value(m_cia1, 1, input_port_read(machine(), "CTRLSEL") & 0x80 ? c64_keyline[9] : c64_keyline[8] ); |
| 120 | 120 | else |
| 121 | 121 | cia_set_port_mask_value(m_cia1, 0, input_port_read(machine(), "CTRLSEL") & 0x80 ? c64_keyline[8] : c64_keyline[9] ); |
| 122 | ||
| 122 | ||
| 123 | 123 | data = mos6526_r(m_cia1, offset & 0x0f); |
| 124 | 124 | break; |
| 125 | ||
| 125 | ||
| 126 | 126 | case 1: // CIA2 |
| 127 | 127 | data = mos6526_r(m_cia2, offset & 0x0f); |
| 128 | 128 | break; |
| 129 | ||
| 129 | ||
| 130 | 130 | case 2: // I/O1 |
| 131 | 131 | data = m_exp->io1_r(space, offset); |
| 132 | 132 | break; |
| 133 | ||
| 133 | ||
| 134 | 134 | case 3: // I/O2 |
| 135 | 135 | data = m_exp->io2_r(space, offset); |
| 136 | 136 | break; |
| r14369 | r14370 | |
| 146 | 146 | { |
| 147 | 147 | data = m_exp->romh_r(space, offset); |
| 148 | 148 | } |
| 149 | ||
| 149 | ||
| 150 | 150 | return data; |
| 151 | 151 | } |
| 152 | 152 | |
| r14369 | r14370 | |
| 158 | 158 | READ8_MEMBER( c64_state::read ) |
| 159 | 159 | { |
| 160 | 160 | int casram, basic, kernal, charom, grw, io, roml, romh; |
| 161 | ||
| 161 | ||
| 162 | 162 | bankswitch(offset, 0, 1, 0, 1, 0, &casram, &basic, &kernal, &charom, &grw, &io, &roml, &romh); |
| 163 | ||
| 163 | ||
| 164 | 164 | return read_memory(space, offset, casram, basic, kernal, charom, io, roml, romh); |
| 165 | 165 | } |
| 166 | 166 | |
| r14369 | r14370 | |
| 172 | 172 | WRITE8_MEMBER( c64_state::write ) |
| 173 | 173 | { |
| 174 | 174 | int casram, basic, kernal, charom, grw, io, roml, romh; |
| 175 | ||
| 175 | ||
| 176 | 176 | bankswitch(offset, 0, 0, 0, 1, 0, &casram, &basic, &kernal, &charom, &grw, &io, &roml, &romh); |
| 177 | 177 | |
| 178 | 178 | if (!casram) |
| r14369 | r14370 | |
| 201 | 201 | case 0: // CIA1 |
| 202 | 202 | mos6526_w(m_cia1, offset & 0x0f, data); |
| 203 | 203 | break; |
| 204 | ||
| 204 | ||
| 205 | 205 | case 1: // CIA2 |
| 206 | 206 | mos6526_w(m_cia2, offset & 0x0f, data); |
| 207 | 207 | break; |
| 208 | ||
| 208 | ||
| 209 | 209 | case 2: // I/O1 |
| 210 | 210 | m_exp->io1_w(space, offset, data); |
| 211 | 211 | break; |
| 212 | ||
| 212 | ||
| 213 | 213 | case 3: // I/O2 |
| 214 | 214 | m_exp->io2_w(space, offset, data); |
| 215 | 215 | break; |
| r14369 | r14370 | |
| 354 | 354 | static INTERRUPT_GEN( c64_frame_interrupt ) |
| 355 | 355 | { |
| 356 | 356 | c64_state *state = device->machine().driver_data<c64_state>(); |
| 357 | ||
| 357 | ||
| 358 | 358 | state->check_interrupts(); |
| 359 | 359 | cbm_common_interrupt(device); |
| 360 | 360 | } |
| r14369 | r14370 | |
| 377 | 377 | READ8_MEMBER( c64_state::vic_dma_read ) |
| 378 | 378 | { |
| 379 | 379 | int casram, basic, kernal, charom, grw, io, roml, romh; |
| 380 | ||
| 380 | ||
| 381 | 381 | offset = (!m_va15 << 15) | (!m_va14 << 14) | offset; |
| 382 | ||
| 382 | ||
| 383 | 383 | bankswitch(0, offset, 1, 1, 0, 0, &casram, &basic, &kernal, &charom, &grw, &io, &roml, &romh); |
| 384 | ||
| 384 | ||
| 385 | 385 | return read_memory(space, offset, casram, basic, kernal, charom, io, roml, romh); |
| 386 | 386 | } |
| 387 | 387 | |
| r14369 | r14370 | |
| 393 | 393 | WRITE_LINE_MEMBER( c64_state::vic_irq_w ) |
| 394 | 394 | { |
| 395 | 395 | m_vic_irq = state; |
| 396 | ||
| 396 | ||
| 397 | 397 | check_interrupts(); |
| 398 | 398 | } |
| 399 | 399 | |
| r14369 | r14370 | |
| 402 | 402 | return input_port_read(machine(), "CYCLES") & 0x07; |
| 403 | 403 | } |
| 404 | 404 | |
| 405 | static const vic2_interface vic_ntsc_intf = | |
| 405 | static const vic2_interface vic_ntsc_intf = | |
| 406 | 406 | { |
| 407 | 407 | SCREEN_TAG, |
| 408 | 408 | M6510_TAG, |
| r14369 | r14370 | |
| 416 | 416 | DEVCB_DRIVER_MEMBER(c64_state, vic_rdy_cb) |
| 417 | 417 | }; |
| 418 | 418 | |
| 419 | static const vic2_interface vic_pal_intf = | |
| 419 | static const vic2_interface vic_pal_intf = | |
| 420 | 420 | { |
| 421 | 421 | SCREEN_TAG, |
| 422 | 422 | M6510_TAG, |
| r14369 | r14370 | |
| 439 | 439 | { |
| 440 | 440 | running_machine &machine = device->machine(); |
| 441 | 441 | c64_state *state = device->machine().driver_data<c64_state>(); |
| 442 | ||
| 442 | ||
| 443 | 443 | int pot1 = 0xff, pot2 = 0xff, pot3 = 0xff, pot4 = 0xff, temp; |
| 444 | 444 | UINT8 cia0porta = mos6526_pa_r(state->m_cia1, 0); |
| 445 | 445 | int controller1 = input_port_read(machine, "CTRLSEL") & 0x07; |
| r14369 | r14370 | |
| 564 | 564 | WRITE_LINE_MEMBER( c64_state::cia1_irq_w ) |
| 565 | 565 | { |
| 566 | 566 | m_cia1_irq = state; |
| 567 | ||
| 567 | ||
| 568 | 568 | check_interrupts(); |
| 569 | 569 | } |
| 570 | 570 | |
| 571 | 571 | READ8_MEMBER( c64_state::cia1_pa_r ) |
| 572 | 572 | { |
| 573 | 573 | /* |
| 574 | ||
| 575 | bit description | |
| 576 | ||
| 577 | PA0 COL0, JOY B0 | |
| 578 | PA1 COL1, JOY B1 | |
| 579 | PA2 COL2, JOY B2 | |
| 580 | PA3 COL3, JOY B3 | |
| 581 | PA4 COL4, BTNB | |
| 582 | PA5 COL5 | |
| 583 | PA6 COL6 | |
| 584 | PA7 COL7 | |
| 585 | ||
| 586 | */ | |
| 587 | 574 | |
| 575 | bit description | |
| 576 | ||
| 577 | PA0 COL0, JOY B0 | |
| 578 | PA1 COL1, JOY B1 | |
| 579 | PA2 COL2, JOY B2 | |
| 580 | PA3 COL3, JOY B3 | |
| 581 | PA4 COL4, BTNB | |
| 582 | PA5 COL5 | |
| 583 | PA6 COL6 | |
| 584 | PA7 COL7 | |
| 585 | ||
| 586 | */ | |
| 587 | ||
| 588 | 588 | UINT8 cia0portb = mos6526_pb_r(m_cia1, 0); |
| 589 | 589 | |
| 590 | 590 | return cbm_common_cia0_port_a_r(m_cia1, cia0portb); |
| r14369 | r14370 | |
| 593 | 593 | READ8_MEMBER( c64_state::cia1_pb_r ) |
| 594 | 594 | { |
| 595 | 595 | /* |
| 596 | ||
| 597 | bit description | |
| 598 | ||
| 599 | PB0 JOY A0 | |
| 600 | PB1 JOY A1 | |
| 601 | PB2 JOY A2 | |
| 602 | PB3 JOY A3 | |
| 603 | PB4 BTNA/_LP | |
| 604 | PB5 | |
| 605 | PB6 | |
| 606 | PB7 | |
| 607 | ||
| 608 | */ | |
| 609 | 596 | |
| 597 | bit description | |
| 598 | ||
| 599 | PB0 JOY A0 | |
| 600 | PB1 JOY A1 | |
| 601 | PB2 JOY A2 | |
| 602 | PB3 JOY A3 | |
| 603 | PB4 BTNA/_LP | |
| 604 | PB5 | |
| 605 | PB6 | |
| 606 | PB7 | |
| 607 | ||
| 608 | */ | |
| 609 | ||
| 610 | 610 | UINT8 cia0porta = mos6526_pa_r(m_cia1, 0); |
| 611 | 611 | |
| 612 | 612 | return cbm_common_cia0_port_b_r(m_cia1, cia0porta); |
| r14369 | r14370 | |
| 615 | 615 | WRITE8_MEMBER( c64_state::cia1_pb_w ) |
| 616 | 616 | { |
| 617 | 617 | /* |
| 618 | ||
| 619 | bit description | |
| 620 | ||
| 621 | PB0 ROW0 | |
| 622 | PB1 ROW1 | |
| 623 | PB2 ROW2 | |
| 624 | PB3 ROW3 | |
| 625 | PB4 ROW4 | |
| 626 | PB5 ROW5 | |
| 627 | PB6 ROW6 | |
| 628 | PB7 ROW7 | |
| 629 | ||
| 630 | */ | |
| 631 | ||
| 618 | ||
| 619 | bit description | |
| 620 | ||
| 621 | PB0 ROW0 | |
| 622 | PB1 ROW1 | |
| 623 | PB2 ROW2 | |
| 624 | PB3 ROW3 | |
| 625 | PB4 ROW4 | |
| 626 | PB5 ROW5 | |
| 627 | PB6 ROW6 | |
| 628 | PB7 ROW7 | |
| 629 | ||
| 630 | */ | |
| 631 | ||
| 632 | 632 | vic2_lightpen_write(m_vic, BIT(data, 4)); |
| 633 | 633 | } |
| 634 | 634 | |
| r14369 | r14370 | |
| 653 | 653 | WRITE_LINE_MEMBER( c64_state::cia2_irq_w ) |
| 654 | 654 | { |
| 655 | 655 | m_cia2_irq = state; |
| 656 | ||
| 656 | ||
| 657 | 657 | check_interrupts(); |
| 658 | 658 | } |
| 659 | 659 | |
| 660 | 660 | READ8_MEMBER( c64_state::cia2_pa_r ) |
| 661 | 661 | { |
| 662 | 662 | /* |
| 663 | ||
| 664 | bit description | |
| 665 | ||
| 666 | PA0 | |
| 667 | PA1 | |
| 668 | PA2 USER PORT | |
| 669 | PA3 | |
| 670 | PA4 | |
| 671 | PA5 | |
| 672 | PA6 CLK | |
| 673 | PA7 DATA | |
| 674 | ||
| 675 | */ | |
| 676 | ||
| 663 | ||
| 664 | bit description | |
| 665 | ||
| 666 | PA0 | |
| 667 | PA1 | |
| 668 | PA2 USER PORT | |
| 669 | PA3 | |
| 670 | PA4 | |
| 671 | PA5 | |
| 672 | PA6 CLK | |
| 673 | PA7 DATA | |
| 674 | ||
| 675 | */ | |
| 676 | ||
| 677 | 677 | UINT8 data = 0; |
| 678 | ||
| 678 | ||
| 679 | 679 | // user port |
| 680 | 680 | data |= m_user->pa2_r() << 2; |
| 681 | ||
| 681 | ||
| 682 | 682 | // IEC bus |
| 683 | 683 | data |= m_iec->clk_r() << 6; |
| 684 | 684 | data |= m_iec->data_r() << 7; |
| 685 | ||
| 685 | ||
| 686 | 686 | return data; |
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | WRITE8_MEMBER( c64_state::cia2_pa_w ) |
| 690 | 690 | { |
| 691 | 691 | /* |
| 692 | ||
| 693 | bit description | |
| 694 | ||
| 695 | PA0 _VA14 | |
| 696 | PA1 _VA15 | |
| 697 | PA2 USER PORT | |
| 698 | PA3 ATN OUT | |
| 699 | PA4 CLK OUT | |
| 700 | PA5 DATA OUT | |
| 701 | PA6 | |
| 702 | PA7 | |
| 703 | ||
| 704 | */ | |
| 705 | ||
| 692 | ||
| 693 | bit description | |
| 694 | ||
| 695 | PA0 _VA14 | |
| 696 | PA1 _VA15 | |
| 697 | PA2 USER PORT | |
| 698 | PA3 ATN OUT | |
| 699 | PA4 CLK OUT | |
| 700 | PA5 DATA OUT | |
| 701 | PA6 | |
| 702 | PA7 | |
| 703 | ||
| 704 | */ | |
| 705 | ||
| 706 | 706 | // VIC banking |
| 707 | 707 | m_va14 = BIT(data, 0); |
| 708 | 708 | m_va15 = BIT(data, 1); |
| 709 | ||
| 709 | ||
| 710 | 710 | // user port |
| 711 | 711 | m_user->pa2_w(BIT(data, 2)); |
| 712 | ||
| 712 | ||
| 713 | 713 | // IEC bus |
| 714 | 714 | m_iec->atn_w(!BIT(data, 3)); |
| 715 | 715 | m_iec->clk_w(!BIT(data, 4)); |
| r14369 | r14370 | |
| 737 | 737 | READ8_MEMBER( c64_state::cpu_r ) |
| 738 | 738 | { |
| 739 | 739 | /* |
| 740 | ||
| 741 | bit description | |
| 742 | ||
| 743 | P0 1 | |
| 744 | P1 1 | |
| 745 | P2 1 | |
| 746 | P3 | |
| 747 | P4 CASS SENS | |
| 748 | P5 | |
| 749 | ||
| 750 | */ | |
| 751 | ||
| 740 | ||
| 741 | bit description | |
| 742 | ||
| 743 | P0 1 | |
| 744 | P1 1 | |
| 745 | P2 1 | |
| 746 | P3 | |
| 747 | P4 CASS SENS | |
| 748 | P5 | |
| 749 | ||
| 750 | */ | |
| 751 | ||
| 752 | 752 | UINT8 data = 0x07; |
| 753 | ||
| 753 | ||
| 754 | 754 | data |= ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED) << 4; |
| 755 | ||
| 755 | ||
| 756 | 756 | return data; |
| 757 | 757 | } |
| 758 | 758 | |
| 759 | 759 | WRITE8_MEMBER( c64_state::cpu_w ) |
| 760 | 760 | { |
| 761 | 761 | /* |
| 762 | ||
| 763 | bit description | |
| 764 | ||
| 765 | P0 LORAM | |
| 766 | P1 HIRAM | |
| 767 | P2 CHAREN | |
| 768 | P3 CASS WRT | |
| 769 | P4 | |
| 770 | P5 CASS MOTOR | |
| 771 | ||
| 772 | */ | |
| 773 | 762 | |
| 763 | bit description | |
| 764 | ||
| 765 | P0 LORAM | |
| 766 | P1 HIRAM | |
| 767 | P2 CHAREN | |
| 768 | P3 CASS WRT | |
| 769 | P4 | |
| 770 | P5 CASS MOTOR | |
| 771 | ||
| 772 | */ | |
| 773 | ||
| 774 | 774 | // HACK apply pull-up resistors |
| 775 | 775 | data |= (offset ^ 0x07) & 0x07; |
| 776 | ||
| 776 | ||
| 777 | 777 | m_loram = BIT(data, 0); |
| 778 | 778 | m_hiram = BIT(data, 1); |
| 779 | 779 | m_charen = BIT(data, 2); |
| 780 | ||
| 780 | ||
| 781 | 781 | // cassette write |
| 782 | 782 | m_cassette->output(BIT(data, 3) ? -(0x5a9e >> 1) : +(0x5a9e >> 1)); |
| 783 | ||
| 783 | ||
| 784 | 784 | // cassette motor |
| 785 | 785 | if (!BIT(data, 5)) |
| 786 | 786 | { |
| r14369 | r14370 | |
| 810 | 810 | READ8_MEMBER( sx64_state::cpu_r ) |
| 811 | 811 | { |
| 812 | 812 | /* |
| 813 | ||
| 814 | bit description | |
| 815 | ||
| 816 | P0 1 | |
| 817 | P1 1 | |
| 818 | P2 1 | |
| 819 | P3 1 | |
| 820 | P4 1 | |
| 821 | P5 1 | |
| 822 | ||
| 823 | */ | |
| 824 | 813 | |
| 814 | bit description | |
| 815 | ||
| 816 | P0 1 | |
| 817 | P1 1 | |
| 818 | P2 1 | |
| 819 | P3 1 | |
| 820 | P4 1 | |
| 821 | P5 1 | |
| 822 | ||
| 823 | */ | |
| 824 | ||
| 825 | 825 | return 0x3f; |
| 826 | 826 | } |
| 827 | 827 | |
| 828 | 828 | WRITE8_MEMBER( sx64_state::cpu_w ) |
| 829 | 829 | { |
| 830 | 830 | /* |
| 831 | ||
| 832 | bit description | |
| 833 | ||
| 834 | P0 LORAM | |
| 835 | P1 HIRAM | |
| 836 | P2 CHAREN | |
| 837 | P3 | |
| 838 | P4 | |
| 839 | P5 | |
| 840 | ||
| 841 | */ | |
| 842 | 831 | |
| 832 | bit description | |
| 833 | ||
| 834 | P0 LORAM | |
| 835 | P1 HIRAM | |
| 836 | P2 CHAREN | |
| 837 | P3 | |
| 838 | P4 | |
| 839 | P5 | |
| 840 | ||
| 841 | */ | |
| 842 | ||
| 843 | 843 | // HACK apply pull-up resistors |
| 844 | 844 | data |= (offset ^ 0x07) & 0x07; |
| 845 | ||
| 845 | ||
| 846 | 846 | m_loram = BIT(data, 0); |
| 847 | 847 | m_hiram = BIT(data, 1); |
| 848 | 848 | m_charen = BIT(data, 2); |
| r14369 | r14370 | |
| 864 | 864 | READ8_MEMBER( c64gs_state::cpu_r ) |
| 865 | 865 | { |
| 866 | 866 | /* |
| 867 | ||
| 868 | bit description | |
| 869 | ||
| 870 | P0 1 | |
| 871 | P1 1 | |
| 872 | P2 1 | |
| 873 | P3 1 | |
| 874 | P4 1 | |
| 875 | P5 1 | |
| 876 | ||
| 877 | */ | |
| 878 | 867 | |
| 868 | bit description | |
| 869 | ||
| 870 | P0 1 | |
| 871 | P1 1 | |
| 872 | P2 1 | |
| 873 | P3 1 | |
| 874 | P4 1 | |
| 875 | P5 1 | |
| 876 | ||
| 877 | */ | |
| 878 | ||
| 879 | 879 | return 0x3f; |
| 880 | 880 | } |
| 881 | 881 | |
| 882 | 882 | WRITE8_MEMBER( c64gs_state::cpu_w ) |
| 883 | 883 | { |
| 884 | 884 | /* |
| 885 | ||
| 886 | bit description | |
| 887 | ||
| 888 | P0 LORAM | |
| 889 | P1 HIRAM | |
| 890 | P2 CHAREN | |
| 891 | P3 | |
| 892 | P4 | |
| 893 | P5 | |
| 894 | ||
| 895 | */ | |
| 896 | 885 | |
| 886 | bit description | |
| 887 | ||
| 888 | P0 LORAM | |
| 889 | P1 HIRAM | |
| 890 | P2 CHAREN | |
| 891 | P3 | |
| 892 | P4 | |
| 893 | P5 | |
| 894 | ||
| 895 | */ | |
| 896 | ||
| 897 | 897 | // HACK apply pull-up resistors |
| 898 | 898 | data |= (offset ^ 0x07) & 0x07; |
| 899 | ||
| 899 | ||
| 900 | 900 | m_loram = BIT(data, 0); |
| 901 | 901 | m_hiram = BIT(data, 1); |
| 902 | 902 | m_charen = BIT(data, 2); |
| r14369 | r14370 | |
| 920 | 920 | c64_state *state = timer.machine().driver_data<c64_state>(); |
| 921 | 921 | |
| 922 | 922 | state->m_cass_rd = state->m_cassette->input() > +0.0; |
| 923 | ||
| 923 | ||
| 924 | 924 | state->check_interrupts(); |
| 925 | 925 | } |
| 926 | 926 | |
| r14369 | r14370 | |
| 932 | 932 | WRITE_LINE_MEMBER( c64_state::iec_srq_w ) |
| 933 | 933 | { |
| 934 | 934 | m_iec_srq = state; |
| 935 | ||
| 935 | ||
| 936 | 936 | check_interrupts(); |
| 937 | 937 | } |
| 938 | 938 | |
| r14369 | r14370 | |
| 953 | 953 | WRITE_LINE_MEMBER( c64_state::exp_irq_w ) |
| 954 | 954 | { |
| 955 | 955 | m_exp_irq = state; |
| 956 | ||
| 956 | ||
| 957 | 957 | check_interrupts(); |
| 958 | 958 | } |
| 959 | 959 | |
| 960 | 960 | WRITE_LINE_MEMBER( c64_state::exp_nmi_w ) |
| 961 | 961 | { |
| 962 | 962 | m_exp_nmi = state; |
| 963 | ||
| 963 | ||
| 964 | 964 | check_interrupts(); |
| 965 | 965 | } |
| 966 | 966 | |
| r14369 | r14370 | |
| 1003 | 1003 | m_basic = machine().region("basic")->base(); |
| 1004 | 1004 | m_kernal = machine().region("kernal")->base(); |
| 1005 | 1005 | m_charom = machine().region("charom")->base(); |
| 1006 | ||
| 1006 | ||
| 1007 | 1007 | // allocate memory |
| 1008 | 1008 | m_color_ram = auto_alloc_array(machine(), UINT8, 0x400); |
| 1009 | ||
| 1009 | ||
| 1010 | 1010 | // state saving |
| 1011 | 1011 | save_item(NAME(m_loram)); |
| 1012 | 1012 | save_item(NAME(m_hiram)); |
| r14369 | r14370 | |
| 1031 | 1031 | void c64c_state::machine_start() |
| 1032 | 1032 | { |
| 1033 | 1033 | c64_state::machine_start(); |
| 1034 | ||
| 1034 | ||
| 1035 | 1035 | // find memory regions |
| 1036 | 1036 | m_basic = machine().region(M6510_TAG)->base(); |
| 1037 | 1037 | m_kernal = machine().region(M6510_TAG)->base() + 0x2000; |
| r14369 | r14370 | |
| 1540 | 1540 | |
| 1541 | 1541 | ROM_REGION( 0x1000, "charom", 0 ) |
| 1542 | 1542 | ROM_LOAD( "901225-01.u5", 0x0000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa) ) |
| 1543 | ||
| 1543 | ||
| 1544 | 1544 | ROM_REGION( 0xf5, PLA_TAG, 0 ) |
| 1545 | 1545 | ROM_LOAD( "906114-01.u17", 0x00, 0xf5, CRC(54c89351) SHA1(efb315f560b6f72444b8f0b2ca4b0ccbcd144a1b) ) |
| 1546 | 1546 | ROM_END |
| r14369 | r14370 | |
| 1559 | 1559 | |
| 1560 | 1560 | ROM_REGION( 0x1000, "charom", 0 ) |
| 1561 | 1561 | ROM_LOAD( "906143-02.u5", 0x0000, 0x1000, CRC(1604f6c1) SHA1(0fad19dbcdb12461c99657b2979dbb5c2e47b527) ) |
| 1562 | ||
| 1562 | ||
| 1563 | 1563 | ROM_REGION( 0xf5, PLA_TAG, 0 ) |
| 1564 | 1564 | ROM_LOAD( "906114-01.u17", 0x00, 0xf5, CRC(54c89351) SHA1(efb315f560b6f72444b8f0b2ca4b0ccbcd144a1b) ) |
| 1565 | 1565 | ROM_END |
| r14369 | r14370 | |
| 1588 | 1588 | ROMX_LOAD( "charswe.u5", 0x0000, 0x1000, CRC(bee9b3fd) SHA1(446ae58f7110d74d434301491209299f66798d8a), ROM_BIOS(1) ) |
| 1589 | 1589 | ROM_SYSTEM_BIOS( 1, "alt", "Swedish Characters (Alt)" ) |
| 1590 | 1590 | ROMX_LOAD( "charswe2.u5", 0x0000, 0x1000, CRC(377a382b) SHA1(20df25e0ba1c88f31689c1521397c96968967fac), ROM_BIOS(2) ) |
| 1591 | ||
| 1591 | ||
| 1592 | 1592 | ROM_REGION( 0xf5, PLA_TAG, 0 ) |
| 1593 | 1593 | ROM_LOAD( "906114-01.u17", 0x00, 0xf5, CRC(54c89351) SHA1(efb315f560b6f72444b8f0b2ca4b0ccbcd144a1b) ) |
| 1594 | 1594 | ROM_END |
| r14369 | r14370 | |
| 1607 | 1607 | |
| 1608 | 1608 | ROM_REGION( 0x1000, "charom", 0 ) |
| 1609 | 1609 | ROM_LOAD( "901225-01.u5", 0x0000, 0x1000, CRC(ec4272ee) SHA1(adc7c31e18c7c7413d54802ef2f4193da14711aa) ) |
| 1610 | ||
| 1610 | ||
| 1611 | 1611 | ROM_REGION( 0xf5, PLA_TAG, 0 ) |
| 1612 | 1612 | ROM_LOAD( "906114-01.u17", 0x00, 0xf5, CRC(54c89351) SHA1(efb315f560b6f72444b8f0b2ca4b0ccbcd144a1b) ) |
| 1613 | 1613 | ROM_END |
| r14369 | r14370 | |
| 1661 | 1661 | |
| 1662 | 1662 | ROM_REGION( 0x2000, "kernal", 0 ) |
| 1663 | 1663 | ROM_LOAD( "kernelsx.ud3", 0x0000, 0x2000, CRC(7858d3d7) SHA1(097cda60469492a8916c2677b7cce4e12a944bc0) ) |
| 1664 | ||
| 1664 | ||
| 1665 | 1665 | ROM_REGION( 0x1000, "charom", 0 ) |
| 1666 | 1666 | ROM_LOAD( "charswe.ud1", 0x0000, 0x1000, CRC(bee9b3fd) SHA1(446ae58f7110d74d434301491209299f66798d8a) ) |
| 1667 | 1667 | |
| r14369 | r14370 | |
| 1675 | 1675 | //------------------------------------------------- |
| 1676 | 1676 | |
| 1677 | 1677 | // ROM_LOAD( "dx64kern.bin", 0x0000, 0x2000, CRC(58065128) ) TODO where is this illusive ROM? |
| 1678 | #define rom_dx64 | |
| 1678 | #define rom_dx64 | |
| 1679 | 1679 | |
| 1680 | 1680 | |
| 1681 | 1681 | //------------------------------------------------- |
| r14369 | r14370 | |
| 1745 | 1745 | // SYSTEM DRIVERS |
| 1746 | 1746 | //************************************************************************** |
| 1747 | 1747 | |
| 1748 | // YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS | |
| 1749 | COMP( 1982, c64n, 0, 0, ntsc, c64, 0, "Commodore Business Machines", "Commodore 64 (NTSC)", 0 ) | |
| 1750 | COMP( 1982, c64j, c64n, 0, ntsc, c64, 0, "Commodore Business Machines", "Commodore 64 (Japan)", 0 ) | |
| 1751 | COMP( 1982, c64p, c64n, 0, pal, c64, 0, "Commodore Business Machines", "Commodore 64 (PAL)", 0 ) | |
| 1752 | COMP( 1982, c64sw, c64n, 0, pal, c64sw, 0, "Commodore Business Machines", "Commodore 64 / VIC-64S (Sweden/Finland)", 0 ) | |
| 1753 | COMP( 1983, pet64, c64n, 0, pet64, c64, 0, "Commodore Business Machines", "PET 64 / CBM 4064 (NTSC)", 0 ) | |
| 1754 | COMP( 1983, edu64, c64n, 0, pet64, c64, 0, "Commodore Business Machines", "Educator 64 (NTSC)", 0 ) | |
| 1755 | COMP( 1984, sx64n, c64n, 0, ntsc_sx, c64, 0, "Commodore Business Machines", "SX-64 / Executive 64 (NTSC)", 0 ) | |
| 1756 | COMP( 1984, sx64p, c64n, 0, pal_sx, c64, 0, "Commodore Business Machines", "SX-64 / Executive 64 (PAL)", 0 ) | |
| 1748 | // YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS | |
| 1749 | COMP( 1982, c64n, 0, 0, ntsc, c64, 0, "Commodore Business Machines", "Commodore 64 (NTSC)", 0 ) | |
| 1750 | COMP( 1982, c64j, c64n, 0, ntsc, c64, 0, "Commodore Business Machines", "Commodore 64 (Japan)", 0 ) | |
| 1751 | COMP( 1982, c64p, c64n, 0, pal, c64, 0, "Commodore Business Machines", "Commodore 64 (PAL)", 0 ) | |
| 1752 | COMP( 1982, c64sw, c64n, 0, pal, c64sw, 0, "Commodore Business Machines", "Commodore 64 / VIC-64S (Sweden/Finland)", 0 ) | |
| 1753 | COMP( 1983, pet64, c64n, 0, pet64, c64, 0, "Commodore Business Machines", "PET 64 / CBM 4064 (NTSC)", 0 ) | |
| 1754 | COMP( 1983, edu64, c64n, 0, pet64, c64, 0, "Commodore Business Machines", "Educator 64 (NTSC)", 0 ) | |
| 1755 | COMP( 1984, sx64n, c64n, 0, ntsc_sx, c64, 0, "Commodore Business Machines", "SX-64 / Executive 64 (NTSC)", 0 ) | |
| 1756 | COMP( 1984, sx64p, c64n, 0, pal_sx, c64, 0, "Commodore Business Machines", "SX-64 / Executive 64 (PAL)", 0 ) | |
| 1757 | 1757 | COMP( 1984, vip64, c64n, 0, pal_sx, c64sw, 0, "Commodore Business Machines", "VIP-64 (Sweden/Finland)", 0 ) |
| 1758 | COMP( 1984, dx64, c64n, 0, ntsc_dx, c64, 0, "Commodore Business Machines", "DX-64 (NTSC)", | |
| 1758 | COMP( 1984, dx64, c64n, 0, ntsc_dx, c64, 0, "Commodore Business Machines", "DX-64 (NTSC)", | |
| 1759 | 1759 | //COMP(1983, clipper, c64, 0, c64pal, clipper, c64pal, "PDC", "Clipper", GAME_NOT_WORKING) // C64 in a briefcase with 3" floppy, electroluminescent flat screen, thermal printer |
| 1760 | 1760 | //COMP(1983, tesa6240, c64, 0, c64pal, c64, c64pal, "Tesa", "6240", GAME_NOT_WORKING) // modified SX64 with label printer |
| 1761 | COMP( 1986, c64cn, c64n, 0, ntsc_c, c64, 0, "Commodore Business Machines", "Commodore 64C (NTSC)", 0 ) | |
| 1762 | COMP( 1986, c64cp, c64n, 0, pal_c, c64, 0, "Commodore Business Machines", "Commodore 64C (PAL)", 0 ) | |
| 1763 | COMP( 1986, c64csw, c64n, 0, pal_c, c64sw, 0, "Commodore Business Machines", "Commodore 64C (Sweden/Finland)", 0 ) | |
| 1764 | COMP( 1986, c64g, c64n, 0, pal_c, c64, 0, "Commodore Business Machines", "Commodore 64G (PAL)", 0 ) | |
| 1765 | CONS( 1990, c64gs, c64n, 0, pal_gs, c64gs, 0, "Commodore Business Machines", "Commodore 64 Games System (PAL)", 0 ) | |
| 1761 | COMP( 1986, c64cn, c64n, 0, ntsc_c, c64, 0, "Commodore Business Machines", "Commodore 64C (NTSC)", 0 ) | |
| 1762 | COMP( 1986, c64cp, c64n, 0, pal_c, c64, 0, "Commodore Business Machines", "Commodore 64C (PAL)", 0 ) | |
| 1763 | COMP( 1986, c64csw, c64n, 0, pal_c, c64sw, 0, "Commodore Business Machines", "Commodore 64C (Sweden/Finland)", 0 ) | |
| 1764 | COMP( 1986, c64g, c64n, 0, pal_c, c64, 0, "Commodore Business Machines", "Commodore 64G (PAL)", 0 ) | |
| 1765 | CONS( 1990, c64gs, c64n, 0, pal_gs, c64gs, 0, "Commodore Business Machines", "Commodore 64 Games System (PAL)", 0 ) |
| r14369 | r14370 | |
|---|---|---|
| 1 | 1 | /* |
| 2 | 2 | |
| 3 | ||
| 3 | TODO: | |
| 4 | 4 | |
| 5 | - memory mapping with PLA | |
| 6 | - PLA dump | |
| 5 | - memory mapping with PLA | |
| 6 | - PLA dump | |
| 7 | 7 | |
| 8 | 8 | */ |
| 9 | 9 | |
| r14369 | r14370 | |
| 128 | 128 | READ8_MEMBER( vic10_state::vic_dma_read ) |
| 129 | 129 | { |
| 130 | 130 | address_space *program = m_maincpu->memory().space(AS_PROGRAM); |
| 131 | ||
| 131 | ||
| 132 | 132 | if (offset < 0x3000) |
| 133 | 133 | return program->read_byte(offset); |
| 134 | 134 | |
| r14369 | r14370 | |
| 143 | 143 | WRITE_LINE_MEMBER( vic10_state::vic_irq_w ) |
| 144 | 144 | { |
| 145 | 145 | m_vic_irq = state; |
| 146 | ||
| 146 | ||
| 147 | 147 | check_interrupts(); |
| 148 | 148 | } |
| 149 | 149 | |
| r14369 | r14370 | |
| 152 | 152 | return input_port_read(machine(), "CYCLES") & 0x07; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | static const vic2_interface vic_intf = | |
| 155 | static const vic2_interface vic_intf = | |
| 156 | 156 | { |
| 157 | 157 | SCREEN_TAG, |
| 158 | 158 | M6510_TAG, |
| r14369 | r14370 | |
| 175 | 175 | { |
| 176 | 176 | running_machine &machine = device->machine(); |
| 177 | 177 | vic10_state *state = device->machine().driver_data<vic10_state>(); |
| 178 | ||
| 178 | ||
| 179 | 179 | int pot1 = 0xff, pot2 = 0xff, pot3 = 0xff, pot4 = 0xff, temp; |
| 180 | 180 | UINT8 cia0porta = mos6526_pa_r(state->m_cia, 0); |
| 181 | 181 | int controller1 = input_port_read(machine, "CTRLSEL") & 0x07; |
| r14369 | r14370 | |
| 300 | 300 | WRITE_LINE_MEMBER( vic10_state::cia_irq_w ) |
| 301 | 301 | { |
| 302 | 302 | m_cia_irq = state; |
| 303 | ||
| 303 | ||
| 304 | 304 | check_interrupts(); |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | READ8_MEMBER( vic10_state::cia_pa_r ) |
| 308 | 308 | { |
| 309 | 309 | /* |
| 310 | ||
| 311 | bit description | |
| 312 | ||
| 313 | PA0 COL0, JOY B0 | |
| 314 | PA1 COL1, JOY B1 | |
| 315 | PA2 COL2, JOY B2 | |
| 316 | PA3 COL3, JOY B3 | |
| 317 | PA4 COL4, BTNB | |
| 318 | PA5 COL5 | |
| 319 | PA6 COL6 | |
| 320 | PA7 COL7 | |
| 321 | ||
| 322 | */ | |
| 323 | 310 | |
| 311 | bit description | |
| 312 | ||
| 313 | PA0 COL0, JOY B0 | |
| 314 | PA1 COL1, JOY B1 | |
| 315 | PA2 COL2, JOY B2 | |
| 316 | PA3 COL3, JOY B3 | |
| 317 | PA4 COL4, BTNB | |
| 318 | PA5 COL5 | |
| 319 | PA6 COL6 | |
| 320 | PA7 COL7 | |
| 321 | ||
| 322 | */ | |
| 323 | ||
| 324 | 324 | UINT8 cia0portb = mos6526_pb_r(m_cia, 0); |
| 325 | 325 | |
| 326 | 326 | return cbm_common_cia0_port_a_r(m_cia, cia0portb); |
| r14369 | r14370 | |
| 329 | 329 | READ8_MEMBER( vic10_state::cia_pb_r ) |
| 330 | 330 | { |
| 331 | 331 | /* |
| 332 | ||
| 333 | bit description | |
| 334 | ||
| 335 | PB0 JOY A0 | |
| 336 | PB1 JOY A1 | |
| 337 | PB2 JOY A2 | |
| 338 | PB3 JOY A3 | |
| 339 | PB4 BTNA/_LP | |
| 340 | PB5 | |
| 341 | PB6 | |
| 342 | PB7 | |
| 343 | ||
| 344 | */ | |
| 345 | 332 | |
| 333 | bit description | |
| 334 | ||
| 335 | PB0 JOY A0 | |
| 336 | PB1 JOY A1 | |
| 337 | PB2 JOY A2 | |
| 338 | PB3 JOY A3 | |
| 339 | PB4 BTNA/_LP | |
| 340 | PB5 | |
| 341 | PB6 | |
| 342 | PB7 | |
| 343 | ||
| 344 | */ | |
| 345 | ||
| 346 | 346 | UINT8 cia0porta = mos6526_pa_r(m_cia, 0); |
| 347 | 347 | |
| 348 | 348 | return cbm_common_cia0_port_b_r(m_cia, cia0porta); |
| r14369 | r14370 | |
| 351 | 351 | WRITE8_MEMBER( vic10_state::cia_pb_w ) |
| 352 | 352 | { |
| 353 | 353 | /* |
| 354 | ||
| 355 | bit description | |
| 356 | ||
| 357 | PB0 ROW0 | |
| 358 | PB1 ROW1 | |
| 359 | PB2 ROW2 | |
| 360 | PB3 ROW3 | |
| 361 | PB4 ROW4 | |
| 362 | PB5 ROW5 | |
| 363 | PB6 ROW6 | |
| 364 | PB7 ROW7 | |
| 365 | ||
| 366 | */ | |
| 367 | ||
| 354 | ||
| 355 | bit description | |
| 356 | ||
| 357 | PB0 ROW0 | |
| 358 | PB1 ROW1 | |
| 359 | PB2 ROW2 | |
| 360 | PB3 ROW3 | |
| 361 | PB4 ROW4 | |
| 362 | PB5 ROW5 | |
| 363 | PB6 ROW6 | |
| 364 | PB7 ROW7 | |
| 365 | ||
| 366 | */ | |
| 367 | ||
| 368 | 368 | vic2_lightpen_write(m_vic, BIT(data, 4)); |
| 369 | 369 | } |
| 370 | 370 | |
| r14369 | r14370 | |
| 389 | 389 | READ8_MEMBER( vic10_state::cpu_r ) |
| 390 | 390 | { |
| 391 | 391 | /* |
| 392 | ||
| 393 | bit description | |
| 394 | ||
| 395 | P0 EXPANSION PORT | |
| 396 | P1 1 | |
| 397 | P2 1 | |
| 398 | P3 | |
| 399 | P4 CASS SENS | |
| 400 | P5 | |
| 401 | ||
| 402 | */ | |
| 403 | ||
| 392 | ||
| 393 | bit description | |
| 394 | ||
| 395 | P0 EXPANSION PORT | |
| 396 | P1 1 | |
| 397 | P2 1 | |
| 398 | P3 | |
| 399 | P4 CASS SENS | |
| 400 | P5 | |
| 401 | ||
| 402 | */ | |
| 403 | ||
| 404 | 404 | UINT8 data = 0x06; |
| 405 | ||
| 405 | ||
| 406 | 406 | data |= m_exp->p0_r(); |
| 407 | ||
| 407 | ||
| 408 | 408 | data |= ((m_cassette->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED) << 4; |
| 409 | ||
| 409 | ||
| 410 | 410 | return data; |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | WRITE8_MEMBER( vic10_state::cpu_w ) |
| 414 | 414 | { |
| 415 | 415 | /* |
| 416 | ||
| 417 | bit description | |
| 418 | ||
| 419 | P0 EXPANSION PORT | |
| 420 | P1 | |
| 421 | P2 | |
| 422 | P3 CASS WRT | |
| 423 | P4 | |
| 424 | P5 CASS MOTOR | |
| 425 | ||
| 426 | */ | |
| 427 | ||
| 416 | ||
| 417 | bit description | |
| 418 | ||
| 419 | P0 EXPANSION PORT | |
| 420 | P1 | |
| 421 | P2 | |
| 422 | P3 CASS WRT | |
| 423 | P4 | |
| 424 | P5 CASS MOTOR | |
| 425 | ||
| 426 | */ | |
| 427 | ||
| 428 | 428 | if (BIT(offset, 0)) |
| 429 | 429 | { |
| 430 | 430 | m_exp->p0_w(BIT(data, 0)); |
| r14369 | r14370 | |
| 432 | 432 | |
| 433 | 433 | // cassette write |
| 434 | 434 | m_cassette->output(BIT(data, 3) ? -(0x5a9e >> 1) : +(0x5a9e >> 1)); |
| 435 | ||
| 435 | ||
| 436 | 436 | // cassette motor |
| 437 | 437 | if (!BIT(data, 5)) |
| 438 | 438 | { |
| r14369 | r14370 | |
| 474 | 474 | WRITE_LINE_MEMBER( vic10_state::exp_irq_w ) |
| 475 | 475 | { |
| 476 | 476 | m_exp_irq = state; |
| 477 | ||
| 477 | ||
| 478 | 478 | check_interrupts(); |
| 479 | 479 | } |
| 480 | 480 |
| Previous | 15994 Revisions | Next |