src/mess/machine/ti99/gromport.c
| r13267 | r13268 | |
| 1661 | 1661 | */ |
| 1662 | 1662 | WRITE8_DEVICE_HANDLER(gromportg_w) |
| 1663 | 1663 | { |
| 1664 | | int slot; |
| 1664 | // int slot; |
| 1665 | 1665 | cartridge_t *cartridge; |
| 1666 | 1666 | ti99_multicart_state *cartslots = get_safe_token(device); |
| 1667 | 1667 | |
| r13267 | r13268 | |
| 1669 | 1669 | // 1001 1wbb bbbb bbr0 |
| 1670 | 1670 | |
| 1671 | 1671 | cartridge_slot_set(device, (UINT8)((offset>>2) & 0x00ff)); |
| 1672 | | slot = cartslots->active_slot; |
| 1672 | // slot = cartslots->active_slot; |
| 1673 | 1673 | |
| 1674 | | // The selection mechanism of the console checks the different GROM address |
| 1675 | | // bases, and when it finds different data, it concludes that there is |
| 1676 | | // indeed a multi-cartridge facility. Empty slots return 0 at all |
| 1677 | | // addresses. |
| 1678 | | // Unfortunately, TI's cartridge selection mechanism has an undesirable |
| 1679 | | // side-effect which we work around in this implementation. |
| 1680 | | // When we have only one cartridge we would like to get only the option to |
| 1681 | | // select this cartridge and not an option to switch to the next one (which |
| 1682 | | // would immediately cycle back to cartridge 1). However, the console |
| 1683 | | // routines always show the switch option when any two slots have different |
| 1684 | | // content, and this is the case with only one cartridge (slot 2 will then |
| 1685 | | // be filled with zeros). |
| 1686 | | // So if next_free_slot==1, we have one cartridge in slot 0. |
| 1687 | | // In that case we trick the OS to believe that the addressed |
| 1688 | | // cartridge appears at all locations which causes it to assume a |
| 1689 | | // standard single cartslot. |
| 1674 | // if (cartslots->fixed_slot==AUTO && cartslots->next_free_slot==1) |
| 1675 | // slot=0; |
| 1690 | 1676 | |
| 1691 | | if (cartslots->fixed_slot==AUTO && cartslots->next_free_slot==1) |
| 1692 | | slot=0; |
| 1693 | | |
| 1694 | 1677 | // Handle the GRAM Kracker |
| 1695 | 1678 | if ((cartslots->gk_slot != -1) && (input_port_read(device->machine(), "CARTSLOT")==CART_GK)) |
| 1696 | 1679 | { |
| r13267 | r13268 | |
| 1699 | 1682 | } |
| 1700 | 1683 | |
| 1701 | 1684 | // We need to send the write request to all attached cartridges |
| 1685 | // so the slot is irrelevant here. (We don't have GRAM cartridges, |
| 1686 | // anyway, so it's just used for setting the adddress) |
| 1702 | 1687 | for (int j=0; j < NUMBER_OF_CARTRIDGE_SLOTS; j++) |
| 1703 | 1688 | { |
| 1704 | 1689 | cartridge = &cartslots->cartridge[j]; |