hash/ti99_cart.xml
| r0 | r14621 | |
| 1 | <?xml version="1.0"?> |
| 2 | <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> |
| 3 | |
| 4 | <softwarelist name="ti99_cart" description="TI-99/4A cartridges"> |
| 5 | |
| 6 | <!-- |
| 7 | This is just the start of the software list for the TI. About 350 |
| 8 | cartridges wait to be inserted here. |
| 9 | |
| 10 | Currently we only support the cartridge types "standard" and "paged" |
| 11 | which is the type of the majority of cartridges. The RAM-based cartridges |
| 12 | (with NVRAM) may follow later (in particular MiniMemory). |
| 13 | |
| 14 | Alternatively, RPK support will continue to be available for all |
| 15 | cartridges. |
| 16 | |
| 17 | Note that the sizes of the grom data areas should not be bigger than |
| 18 | the included dump, as the region size determines how many GROMs are |
| 19 | included as subdevices. (OTOH, the additional GROMs would just be |
| 20 | empty, so no big trouble expected.) |
| 21 | --> |
| 22 | |
| 23 | <!-- Common type --> |
| 24 | <software name="ti_invaders"> |
| 25 | <description>TI Invaders</description> |
| 26 | <year>1981</year> |
| 27 | <publisher>Texas Instruments</publisher> |
| 28 | <info name="id" value="PHM 3053"/> |
| 29 | <part name="cart" interface="ti99_cart"> |
| 30 | <feature name="pcb" value="standard" /> |
| 31 | <dataarea name="rom_socket" size="0x2000"> |
| 32 | <rom name="phm3053c.bin" size="0x2000" crc="e7463430" sha1="b1cc3454aa5437447edb1fc1f48ec7da20e87377" offset="0x0000" /> |
| 33 | </dataarea> |
| 34 | <dataarea name="grom_socket" size="0x2000"> |
| 35 | <rom name="phm3053g.bin" size="0x2000" crc="9d1d9eaa" sha1="afb31bd69eed1e7e5e08a6fed98c8babed509fa9" offset="0x0000" /> |
| 36 | </dataarea> |
| 37 | </part> |
| 38 | </software> |
| 39 | |
| 40 | <!-- GROM-only --> |
| 41 | <software name="hunt_the_wumpus"> |
| 42 | <description>Hunt the wumpus</description> |
| 43 | <year>1980</year> |
| 44 | <publisher>Texas Instruments</publisher> |
| 45 | <info name="id" value="PHM 3023"/> |
| 46 | <part name="cart" interface="ti99_cart"> |
| 47 | <feature name="pcb" value="standard" /> |
| 48 | <dataarea name="grom_socket" size="0x2000"> |
| 49 | <rom name="phm3023g.bin" size="0x2000" crc="6a5a3f97" sha1="4569d2f1eaba7b1736b1146c3863bd8c3d231040" offset="0x0000" /> |
| 50 | </dataarea> |
| 51 | </part> |
| 52 | </software> |
| 53 | |
| 54 | <!-- ROM-only --> |
| 55 | <software name="as_defender"> |
| 56 | <description>Defender</description> |
| 57 | <year>1983</year> |
| 58 | <publisher>Atarisoft</publisher> |
| 59 | <part name="cart" interface="ti99_cart"> |
| 60 | <feature name="pcb" value="standard" /> |
| 61 | <dataarea name="rom_socket" size="0x2000"> |
| 62 | <rom name="defendc.bin" size="0x2000" crc="c51b0a8b" sha1="df4c3dd9ee5195a768a11721d86f6a164faa87a5" offset="0x0000" /> |
| 63 | </dataarea> |
| 64 | </part> |
| 65 | </software> |
| 66 | |
| 67 | <!-- With paging (PCB type "paged") --> |
| 68 | <software name="extended_basic"> |
| 69 | <description>TI Extended Basic</description> |
| 70 | <year>1981</year> |
| 71 | <publisher>Texas Instruments</publisher> |
| 72 | <info name="id" value="PHM 3026"/> |
| 73 | <info name="version" value="110"/> |
| 74 | <part name="cart" interface="ti99_cart"> |
| 75 | <feature name="pcb" value="paged" /> |
| 76 | <dataarea name="rom_socket" size="0x2000"> |
| 77 | <rom name="phm3026c.bin" size="0x2000" crc="bd8addb9" sha1="d0be337b61552f7ac49d52872f66eb6ef549a774" offset="0x0000" /> |
| 78 | </dataarea> |
| 79 | <dataarea name="rom2_socket" size="0x2000"> |
| 80 | <rom name="phm3026d.bin" size="0x2000" crc="44c4d8a8" sha1="db2850db78431d89de85dd573e6df76151b25aba" offset="0x0000" /> |
| 81 | </dataarea> |
| 82 | <dataarea name="grom_socket" size="0x8000"> |
| 83 | <rom name="phm3026g.bin" size="0x8000" crc="1a977b8c" sha1="ac30cc0ba075661b9c853b3fda47b4f4accbe25c" offset="0x0000" /> |
| 84 | </dataarea> |
| 85 | </part> |
| 86 | </software> |
| 87 | </softwarelist> |
src/mess/machine/ti99/gromport.c
| r14620 | r14621 | |
| 930 | 930 | { 0, NULL} |
| 931 | 931 | }; |
| 932 | 932 | |
| 933 | // Softlists do not support the cartridges with RAM yet |
| 934 | static const pcb_type sw_pcbdefs[] = |
| 935 | { |
| 936 | { PCB_STANDARD, "standard" }, |
| 937 | { PCB_PAGED, "paged" }, |
| 938 | { 0, NULL} |
| 939 | }; |
| 940 | |
| 933 | 941 | cartridge_device::cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 934 | 942 | : bus8z_device(mconfig, TICARTRIDGE, "TI-99 cartridge", tag, owner, clock), |
| 935 | 943 | device_image_interface(mconfig, *this), |
| r14620 | r14621 | |
| 965 | 973 | { |
| 966 | 974 | if (VERBOSE>8) LOG("cartridge_device: device_config_complete\n"); |
| 967 | 975 | update_names(); |
| 976 | m_softlist = false; |
| 968 | 977 | } |
| 969 | 978 | |
| 970 | 979 | void cartridge_device::prepare_cartridge() |
| r14620 | r14621 | |
| 977 | 986 | const memory_region *regr; |
| 978 | 987 | const memory_region *regr2; |
| 979 | 988 | |
| 980 | | m_pcb->m_grom_size = m_rpk->get_resource_length("grom_socket"); |
| 989 | m_pcb->m_grom_size = m_softlist? get_software_region_length("grom_socket") : m_rpk->get_resource_length("grom_socket"); |
| 990 | if (VERBOSE>6) LOG("gromport: grom_socket.size=0x%04x\n", m_pcb->m_grom_size); |
| 981 | 991 | |
| 982 | 992 | if (m_pcb->m_grom_size > 0) |
| 983 | 993 | { |
| 984 | 994 | regg = subregion("grom_contents"); |
| 985 | | grom_ptr = (UINT8*)m_rpk->get_contents_of_socket("grom_socket"); |
| 995 | grom_ptr = m_softlist? get_software_region("grom_socket") : (UINT8*)m_rpk->get_contents_of_socket("grom_socket"); |
| 986 | 996 | memcpy(regg->base(), grom_ptr, m_pcb->m_grom_size); |
| 987 | 997 | |
| 988 | 998 | if (m_type==PCB_GKRACKER) |
| r14620 | r14621 | |
| 999 | 1009 | if (m_pcb->m_grom_size > 0x8000) m_pcb->m_grom[4] = static_cast<ti99_grom_device*>(subdevice(GROM7_TAG)); |
| 1000 | 1010 | } |
| 1001 | 1011 | |
| 1002 | | m_pcb->m_rom_size = m_rpk->get_resource_length("rom_socket"); |
| 1012 | m_pcb->m_rom_size = m_softlist? get_software_region_length("rom_socket") : m_rpk->get_resource_length("rom_socket"); |
| 1003 | 1013 | if (m_pcb->m_rom_size > 0) |
| 1004 | 1014 | { |
| 1005 | 1015 | regr = subregion("rom_contents"); |
| 1006 | | m_pcb->m_rom_ptr = (UINT8*)m_rpk->get_contents_of_socket("rom_socket"); |
| 1016 | m_pcb->m_rom_ptr = m_softlist? get_software_region("rom_socket") : (UINT8*)m_rpk->get_contents_of_socket("rom_socket"); |
| 1007 | 1017 | memcpy(regr->base(), m_pcb->m_rom_ptr, m_pcb->m_rom_size); |
| 1008 | 1018 | } |
| 1009 | 1019 | |
| 1010 | | rom2_length = m_rpk->get_resource_length("rom2_socket"); |
| 1020 | rom2_length = m_softlist? get_software_region_length("rom2_socket") : m_rpk->get_resource_length("rom2_socket"); |
| 1011 | 1021 | if (rom2_length > 0) |
| 1012 | 1022 | { |
| 1013 | 1023 | // sizes do not differ between rom and rom2 |
| 1014 | 1024 | regr2 = subregion("rom2_contents"); |
| 1015 | | m_pcb->m_rom2_ptr = (UINT8*)m_rpk->get_contents_of_socket("rom2_socket"); |
| 1025 | m_pcb->m_rom2_ptr = m_softlist? get_software_region("rom2_socket") : (UINT8*)m_rpk->get_contents_of_socket("rom2_socket"); |
| 1016 | 1026 | memcpy(regr2->base(), m_pcb->m_rom2_ptr, rom2_length); |
| 1017 | 1027 | } |
| 1018 | 1028 | |
| 1019 | | m_pcb->m_ram_size = m_rpk->get_resource_length("ram_socket"); |
| 1020 | | if (m_pcb->m_ram_size > 0) |
| 1029 | // NVRAM cartridges are not supported by softlists (we need to find a way to load the nvram contents first) |
| 1030 | if (!m_softlist) |
| 1021 | 1031 | { |
| 1022 | | // TODO: Consider to use a region as well. If so, do not forget to memcpy. |
| 1023 | | m_pcb->m_ram_ptr = (UINT8*)m_rpk->get_contents_of_socket("ram_socket"); |
| 1032 | m_pcb->m_ram_size = m_rpk->get_resource_length("ram_socket"); |
| 1033 | if (m_pcb->m_ram_size > 0) |
| 1034 | { |
| 1035 | // TODO: Consider to use a region as well. If so, do not forget to memcpy. |
| 1036 | m_pcb->m_ram_ptr = (UINT8*)m_rpk->get_contents_of_socket("ram_socket"); |
| 1037 | } |
| 1024 | 1038 | } |
| 1025 | 1039 | } |
| 1026 | 1040 | |
| r14620 | r14621 | |
| 1047 | 1061 | pcb->m_gk_switch[swtch] = val; |
| 1048 | 1062 | } |
| 1049 | 1063 | |
| 1064 | bool cartridge_device::call_softlist_load(char *swlist, char *swname, rom_entry *start_entry) |
| 1065 | { |
| 1066 | if (VERBOSE>8) LOG("gromport.cartridge_device: swlist = %s, swname = %s\n", swlist, swname); |
| 1067 | load_software_part_region(this, swlist, swname, start_entry); |
| 1068 | m_softlist = true; |
| 1069 | m_rpk = NULL; |
| 1070 | return true; |
| 1071 | } |
| 1050 | 1072 | |
| 1051 | 1073 | bool cartridge_device::call_load() |
| 1052 | 1074 | { |
| 1053 | 1075 | // File name is in m_basename |
| 1054 | 1076 | // return true = error |
| 1055 | 1077 | if (VERBOSE>8) LOG("cartridge_device: loading\n"); |
| 1056 | | rpk_reader *reader = new rpk_reader(pcbdefs); |
| 1057 | 1078 | |
| 1058 | 1079 | astring ntag(tag(), ":PCB"); |
| 1059 | 1080 | const char* mytag = ntag.cstr(); |
| 1060 | | |
| 1061 | 1081 | gromport_device *gp = static_cast<gromport_device*>(owner()); |
| 1062 | 1082 | int slot = get_index_from_tagname(); |
| 1063 | 1083 | |
| 1064 | | try |
| 1084 | if (m_softlist) |
| 1065 | 1085 | { |
| 1066 | | m_rpk = reader->open(machine().options(), filename(), machine().system().name); |
| 1067 | | m_type = m_rpk->get_type(); |
| 1068 | | switch (m_type) |
| 1086 | LOG("using softlists\n"); |
| 1087 | int i; |
| 1088 | const char* pcb = get_feature("pcb"); |
| 1089 | do |
| 1069 | 1090 | { |
| 1070 | | case PCB_STANDARD: |
| 1071 | | if (VERBOSE>6) LOG("cartridge_device: standard PCB\n"); |
| 1072 | | m_pcb = static_cast<cartridge_pcb_standard_device*>(&machine().add_dynamic_device(*this, TICARTPCBSTD, mytag, 0)); |
| 1073 | | break; |
| 1074 | | case PCB_PAGED: |
| 1075 | | if (VERBOSE>6) LOG("cartridge_device: paged PCB\n"); |
| 1076 | | m_pcb = static_cast<cartridge_pcb_paged_device*>(&machine().add_dynamic_device(*this, TICARTPCBPAG, mytag, 0)); |
| 1077 | | break; |
| 1078 | | case PCB_MINIMEM: |
| 1079 | | if (VERBOSE>6) LOG("cartridge_device: minimem PCB\n"); |
| 1080 | | m_pcb = static_cast<cartridge_pcb_minimem_device*>(&machine().add_dynamic_device(*this, TICARTPCBMIN, mytag, 0)); |
| 1081 | | break; |
| 1082 | | case PCB_SUPER: |
| 1083 | | if (VERBOSE>6) LOG("cartridge_device: superspace PCB\n"); |
| 1084 | | m_pcb = static_cast<cartridge_pcb_superspace_device*>(&machine().add_dynamic_device(*this, TICARTPCBSUP, mytag, 0)); |
| 1085 | | break; |
| 1086 | | case PCB_MBX: |
| 1087 | | if (VERBOSE>6) LOG("cartridge_device: MBX PCB\n"); |
| 1088 | | m_pcb = static_cast<cartridge_pcb_mbx_device*>(&machine().add_dynamic_device(*this, TICARTPCBMBX, mytag, 0)); |
| 1089 | | break; |
| 1090 | | case PCB_PAGED379I: |
| 1091 | | if (VERBOSE>6) LOG("cartridge_device: Paged379i PCB\n"); |
| 1092 | | m_pcb = static_cast<cartridge_pcb_paged379i_device*>(&machine().add_dynamic_device(*this, TICARTPCBPGI, mytag, 0)); |
| 1093 | | break; |
| 1094 | | case PCB_PAGEDCRU: |
| 1095 | | if (VERBOSE>6) LOG("cartridge_device: PagedCRU PCB\n"); |
| 1096 | | m_pcb = static_cast<cartridge_pcb_pagedcru_device*>(&machine().add_dynamic_device(*this, TICARTPCBPGC, mytag, 0)); |
| 1097 | | break; |
| 1098 | | case PCB_GKRACKER: |
| 1099 | | if (VERBOSE>6) LOG("cartridge_device: GRAMKracker PCB\n"); |
| 1100 | | m_pcb = static_cast<cartridge_pcb_gramkracker_device*>(&machine().add_dynamic_device(*this, TICARTPCBGRK, mytag, 0)); |
| 1101 | | gp->set_gk_slot(slot); |
| 1102 | | break; |
| 1091 | if (strcmp(pcb, sw_pcbdefs[i].name)==0) |
| 1092 | { |
| 1093 | m_type = sw_pcbdefs[i].id; |
| 1094 | break; |
| 1095 | } |
| 1096 | i++; |
| 1097 | } while (sw_pcbdefs[i].id != 0); |
| 1098 | if (VERBOSE>5) LOG("gromport.cartridge_device: Cartridge type is %s (%d)\n", pcb, m_type); |
| 1099 | } |
| 1100 | else |
| 1101 | { |
| 1102 | rpk_reader *reader = new rpk_reader(pcbdefs); |
| 1103 | try |
| 1104 | { |
| 1105 | m_rpk = reader->open(machine().options(), filename(), machine().system().name); |
| 1106 | m_type = m_rpk->get_type(); |
| 1103 | 1107 | } |
| 1108 | catch (rpk_exception& err) |
| 1109 | { |
| 1110 | LOG("gromport.cartridge_device: Failed to load cartridge '%s': %s\n", basename(), err.to_string()); |
| 1111 | m_rpk = NULL; |
| 1112 | m_err = IMAGE_ERROR_INVALIDIMAGE; |
| 1113 | return true; |
| 1114 | } |
| 1115 | } |
| 1104 | 1116 | |
| 1105 | | prepare_cartridge(); |
| 1106 | | m_pcb->set_machine(machine()); // TODO: Feels like a hack. |
| 1107 | | gp->change_slot(true, slot); |
| 1108 | | |
| 1109 | | machine().schedule_hard_reset(); // could be configurable by DIP switch, simulating taping the RESET line |
| 1110 | | } |
| 1111 | | catch (rpk_exception& err) |
| 1117 | switch (m_type) |
| 1112 | 1118 | { |
| 1113 | | LOG("Failed to load cartridge '%s': %s\n", basename(), err.to_string()); |
| 1114 | | m_rpk = NULL; |
| 1115 | | m_err = IMAGE_ERROR_INVALIDIMAGE; |
| 1116 | | return true; |
| 1119 | case PCB_STANDARD: |
| 1120 | if (VERBOSE>6) LOG("gromport.cartridge_device: standard PCB\n"); |
| 1121 | m_pcb = static_cast<cartridge_pcb_standard_device*>(&machine().add_dynamic_device(*this, TICARTPCBSTD, mytag, 0)); |
| 1122 | break; |
| 1123 | case PCB_PAGED: |
| 1124 | if (VERBOSE>6) LOG("gromport.cartridge_device: paged PCB\n"); |
| 1125 | m_pcb = static_cast<cartridge_pcb_paged_device*>(&machine().add_dynamic_device(*this, TICARTPCBPAG, mytag, 0)); |
| 1126 | break; |
| 1127 | case PCB_MINIMEM: |
| 1128 | if (VERBOSE>6) LOG("gromport.cartridge_device: minimem PCB\n"); |
| 1129 | m_pcb = static_cast<cartridge_pcb_minimem_device*>(&machine().add_dynamic_device(*this, TICARTPCBMIN, mytag, 0)); |
| 1130 | break; |
| 1131 | case PCB_SUPER: |
| 1132 | if (VERBOSE>6) LOG("gromport.cartridge_device: superspace PCB\n"); |
| 1133 | m_pcb = static_cast<cartridge_pcb_superspace_device*>(&machine().add_dynamic_device(*this, TICARTPCBSUP, mytag, 0)); |
| 1134 | break; |
| 1135 | case PCB_MBX: |
| 1136 | if (VERBOSE>6) LOG("gromport.cartridge_device: MBX PCB\n"); |
| 1137 | m_pcb = static_cast<cartridge_pcb_mbx_device*>(&machine().add_dynamic_device(*this, TICARTPCBMBX, mytag, 0)); |
| 1138 | break; |
| 1139 | case PCB_PAGED379I: |
| 1140 | if (VERBOSE>6) LOG("gromport.cartridge_device: Paged379i PCB\n"); |
| 1141 | m_pcb = static_cast<cartridge_pcb_paged379i_device*>(&machine().add_dynamic_device(*this, TICARTPCBPGI, mytag, 0)); |
| 1142 | break; |
| 1143 | case PCB_PAGEDCRU: |
| 1144 | if (VERBOSE>6) LOG("gromport.cartridge_device: PagedCRU PCB\n"); |
| 1145 | m_pcb = static_cast<cartridge_pcb_pagedcru_device*>(&machine().add_dynamic_device(*this, TICARTPCBPGC, mytag, 0)); |
| 1146 | break; |
| 1147 | case PCB_GKRACKER: |
| 1148 | if (VERBOSE>6) LOG("gromport.cartridge_device: GRAMKracker PCB\n"); |
| 1149 | m_pcb = static_cast<cartridge_pcb_gramkracker_device*>(&machine().add_dynamic_device(*this, TICARTPCBGRK, mytag, 0)); |
| 1150 | gp->set_gk_slot(slot); |
| 1151 | break; |
| 1117 | 1152 | } |
| 1153 | |
| 1154 | prepare_cartridge(); |
| 1155 | m_pcb->set_machine(machine()); // TODO: Feels like a hack. |
| 1156 | gp->change_slot(true, slot); |
| 1157 | |
| 1158 | machine().schedule_hard_reset(); // could be configurable by DIP switch, simulating taping the RESET line |
| 1159 | |
| 1118 | 1160 | return false; |
| 1119 | 1161 | } |
| 1120 | 1162 | |
| 1121 | 1163 | void cartridge_device::call_unload() |
| 1122 | 1164 | { |
| 1123 | | if (VERBOSE>6) LOG("cartridge_device: unloading from %s\n", tag()); |
| 1165 | if (VERBOSE>6) LOG("gromport.cartridge_device: unloading from %s\n", tag()); |
| 1124 | 1166 | |
| 1125 | 1167 | gromport_device *gp = static_cast<gromport_device*>(owner()); |
| 1126 | 1168 | int slot = get_index_from_tagname(); |
src/mess/drivers/ti99_4x.c
| r14620 | r14621 | |
| 970 | 970 | MCFG_DMUX_ADD( DATAMUX_TAG, dmux_devices ) |
| 971 | 971 | MCFG_TI99_GROMPORT_ADD( GROMPORT_TAG, console_cartslot ) |
| 972 | 972 | |
| 973 | /* Software list */ |
| 974 | MCFG_SOFTWARE_LIST_ADD("cart_list_ti99", "ti99_cart") |
| 975 | |
| 973 | 976 | /* Peripheral expansion box */ |
| 974 | 977 | MCFG_PERIBOX_ADD( PERIBOX_TAG, peribox_conf ) |
| 975 | 978 | |
| r14620 | r14621 | |
| 1013 | 1016 | MCFG_DMUX_ADD( DATAMUX_TAG, dmux_devices ) |
| 1014 | 1017 | MCFG_TI99_GROMPORT_ADD( GROMPORT_TAG, console_cartslot ) |
| 1015 | 1018 | |
| 1019 | /* Software list */ |
| 1020 | MCFG_SOFTWARE_LIST_ADD("cart_list_ti99", "ti99_cart") |
| 1021 | |
| 1016 | 1022 | /* Peripheral expansion box */ |
| 1017 | 1023 | MCFG_PERIBOX_ADD( PERIBOX_TAG, peribox_conf ) |
| 1018 | 1024 | |
| r14620 | r14621 | |
| 1083 | 1089 | MCFG_DMUX_ADD( DATAMUX_TAG, dmux_devices ) |
| 1084 | 1090 | MCFG_TI99_GROMPORT_ADD( GROMPORT_TAG, console_cartslot ) |
| 1085 | 1091 | |
| 1092 | /* Software list */ |
| 1093 | MCFG_SOFTWARE_LIST_ADD("cart_list_ti99", "ti99_cart") |
| 1094 | |
| 1086 | 1095 | /* Peripheral expansion box */ |
| 1087 | 1096 | MCFG_PERIBOX_ADD( PERIBOX_TAG, peribox_conf ) |
| 1088 | 1097 | |
| r14620 | r14621 | |
| 1123 | 1132 | MCFG_DMUX_ADD( DATAMUX_TAG, dmux_devices ) |
| 1124 | 1133 | MCFG_TI99_GROMPORT_ADD( GROMPORT_TAG, console_cartslot ) |
| 1125 | 1134 | |
| 1135 | /* Software list */ |
| 1136 | MCFG_SOFTWARE_LIST_ADD("cart_list_ti99", "ti99_cart") |
| 1137 | |
| 1126 | 1138 | /* Peripheral expansion box */ |
| 1127 | 1139 | MCFG_PERIBOX_ADD( PERIBOX_TAG, peribox_conf ) |
| 1128 | 1140 | |
| r14620 | r14621 | |
| 1176 | 1188 | MCFG_DMUX_ADD( DATAMUX_TAG, dmux_devices ) |
| 1177 | 1189 | MCFG_TI99_GROMPORT_ADD( GROMPORT_TAG, console_cartslot ) |
| 1178 | 1190 | |
| 1191 | /* Software list */ |
| 1192 | MCFG_SOFTWARE_LIST_ADD("cart_list_ti99", "ti99_cart") |
| 1193 | |
| 1179 | 1194 | /* Peripheral expansion box */ |
| 1180 | 1195 | MCFG_PERIBOX_EV_ADD( PERIBOX_TAG, peribox_conf ) |
| 1181 | 1196 | |