trunk/hash/apollo_ctape.xml
| r0 | r242111 | |
| 1 | <?xml version="1.0"?> |
| 2 | <!DOCTYPE softwarelist SYSTEM "softwarelist.dtd"> |
| 3 | |
| 4 | <!-- Domain/OS Known Undumped Versions (from http://www.hpmuseum.net/exhibit.php?swc=24) |
| 5 | |
| 6 | Domain/OS SR10.3 (1990) Product Number 018847 + 018848 |
| 7 | Domain/OS Quarterly PSK Q3-91 SR10.3 (1991) Product Number 19437 + 19439 |
| 8 | |
| 9 | --> |
| 10 | |
| 11 | <softwarelist name="apollo_ctape" description="Apollo cartridge tapes"> |
| 12 | |
| 13 | <software name="domainos"> |
| 14 | <description>Domain/OS SR10.4</description> |
| 15 | <year>1992</year> |
| 16 | <publisher>Apollo</publisher> |
| 17 | |
| 18 | <part name="cass1" interface="sc499_cass"> |
| 19 | <feature name="part_id" value="Tape 1 (CRTG_STD_SFW_BOOT_1)"/> |
| 20 | <dataarea name="ctape" size="53678592"> |
| 21 | <rom name="019593-001.crtg_std_sfw_boot_1.ct" size="53678592" crc="cf1b4813" sha1="4b7e64153b3046da25cef0e2115553611d57929e" offset="0" /> |
| 22 | </dataarea> |
| 23 | </part> |
| 24 | <part name="cass2" interface="sc499_cass"> |
| 25 | <feature name="part_id" value="Tape 2 (CRTG_STD_SFW_1)"/> |
| 26 | <dataarea name="ctape" size="58403328"> |
| 27 | <rom name="019594-001.crtg_std_sfw_1.ct" size="58403328" crc="3335f0c9" sha1="94ce5ea3f9d075df7952793254ef067b92df79a6" offset="0" /> |
| 28 | </dataarea> |
| 29 | </part> |
| 30 | <part name="cass3" interface="sc499_cass"> |
| 31 | <feature name="part_id" value="Tape 3 (CRTG_STD_SFW_2)"/> |
| 32 | <dataarea name="ctape" size="61564928"> |
| 33 | <rom name="019594-002.crtg_std_sfw_2.ct" size="61564928" crc="39d0647a" sha1="6cde13fae598574b4f5ad0fc4dbb33ea1902ff6e" offset="0" /> |
| 34 | </dataarea> |
| 35 | </part> |
| 36 | <part name="cass4" interface="sc499_cass"> |
| 37 | <feature name="part_id" value="Tape 4 (CRTG_STD_SFW_3)"/> |
| 38 | <dataarea name="ctape" size="56568320"> |
| 39 | <rom name="019594-003.crtg_std_sfw_3.ct" size="56568320" crc="e9e76b3f" sha1="24fe96a22c975e9c7fcbbf0daad89277a467fae3" offset="0" /> |
| 40 | </dataarea> |
| 41 | </part> |
| 42 | <part name="cass5" interface="sc499_cass"> |
| 43 | <feature name="part_id" value="Tape 5 (CRTG_STD_SFW_4)"/> |
| 44 | <dataarea name="ctape" size="57844224"> |
| 45 | <rom name="019594-004.crtg_std_sfw_4.ct" size="57844224" crc="88d4a0eb" sha1="a3b4eb922182302e350f475b8e5c39a79503c4e3" offset="0" /> |
| 46 | </dataarea> |
| 47 | </part> |
| 48 | </software> |
| 49 | |
| 50 | </softwarelist> |
trunk/src/emu/bus/isa/sc499.c
| r242110 | r242111 | |
| 318 | 318 | : device_t(mconfig, SC499, "Archive SC-499", tag, owner, clock, "sc499", __FILE__), |
| 319 | 319 | device_isa8_card_interface(mconfig, *this), |
| 320 | 320 | m_iobase(*this, "IO_BASE"), |
| 321 | | m_irqdrq(*this, "IRQ_DRQ") |
| 321 | m_irqdrq(*this, "IRQ_DRQ"), |
| 322 | m_image(*this, SC499_CTAPE_TAG) |
| 322 | 323 | { |
| 323 | 324 | } |
| 324 | 325 | |
| r242110 | r242111 | |
| 342 | 343 | |
| 343 | 344 | m_installed = false; |
| 344 | 345 | |
| 345 | | device_t *ctape_device = subdevice(SC499_CTAPE_TAG); |
| 346 | | m_image = dynamic_cast<device_image_interface *> (ctape_device); |
| 347 | | |
| 348 | 346 | if (m_image->image_core_file() == NULL) |
| 349 | 347 | { |
| 350 | 348 | LOG2(("start sc499: no cartridge tape")); |
| 351 | 349 | } |
| 352 | 350 | else |
| 353 | 351 | { |
| 354 | | LOG2(("start sc499: cartridge tape image is %s",m_image->filename())); |
| 352 | LOG2(("start sc499: cartridge tape image is %s", m_image->filename())); |
| 355 | 353 | } |
| 356 | 354 | |
| 357 | 355 | m_ctape_block_buffer.resize(SC499_CTAPE_BLOCK_SIZE); |
| r242110 | r242111 | |
| 465 | 463 | tape_status_set(SC499_ST0_WP); |
| 466 | 464 | } |
| 467 | 465 | |
| 468 | | if (m_image_length != m_image->length()) |
| 466 | if (m_image_length != m_image->tapelen()) |
| 469 | 467 | { |
| 470 | 468 | // tape has changed, get new size |
| 471 | | m_image_length = m_image->length(); |
| 472 | | m_ctape_block_count = (UINT32)((m_image_length+SC499_CTAPE_BLOCK_SIZE-1) / SC499_CTAPE_BLOCK_SIZE); |
| 469 | m_image_length = m_image->tapelen(); |
| 470 | m_ctape_block_count = (UINT32)((m_image_length + SC499_CTAPE_BLOCK_SIZE - 1) / SC499_CTAPE_BLOCK_SIZE); |
| 473 | 471 | } |
| 474 | 472 | |
| 475 | 473 | LOG1(("check_tape: tape image is %s with %d blocks", m_image->filename(), m_ctape_block_count)); |
| r242110 | r242111 | |
| 1167 | 1165 | |
| 1168 | 1166 | void sc499_device::read_block() |
| 1169 | 1167 | { |
| 1168 | UINT8 *tape; |
| 1169 | |
| 1170 | 1170 | if (m_tape_pos == 0) |
| 1171 | 1171 | { |
| 1172 | 1172 | // check if tape has been replaced or removed |
| 1173 | 1173 | check_tape(); |
| 1174 | 1174 | } |
| 1175 | 1175 | |
| 1176 | | m_image->fseek((UINT64) m_tape_pos * SC499_CTAPE_BLOCK_SIZE, SEEK_SET); |
| 1176 | tape = m_image->read_block(m_tape_pos); |
| 1177 | 1177 | |
| 1178 | | if (m_image->image_feof()) |
| 1178 | if (tape == NULL) |
| 1179 | 1179 | { |
| 1180 | // either there is no tape or m_tape_pos goes beyond end-of-tape |
| 1180 | 1181 | m_status &= ~SC499_STAT_EXC; |
| 1181 | 1182 | m_status &= ~SC499_STAT_DIR; |
| 1182 | 1183 | m_status &= ~SC499_STAT_DON; |
| r242110 | r242111 | |
| 1185 | 1186 | } |
| 1186 | 1187 | else |
| 1187 | 1188 | { |
| 1188 | | m_image->fread(m_ctape_block_buffer, SC499_CTAPE_BLOCK_SIZE); |
| 1189 | memcpy(m_ctape_block_buffer, tape, SC499_CTAPE_BLOCK_SIZE); |
| 1189 | 1190 | |
| 1190 | 1191 | // if (verbose > 1 || m_tape_pos % 100 == 0) |
| 1191 | 1192 | { |
| r242110 | r242111 | |
| 1236 | 1237 | check_tape(); |
| 1237 | 1238 | } |
| 1238 | 1239 | |
| 1239 | | m_image->fseek((UINT64) m_tape_pos * SC499_CTAPE_BLOCK_SIZE, SEEK_SET); |
| 1240 | | m_image->fwrite(m_ctape_block_buffer, SC499_CTAPE_BLOCK_SIZE); |
| 1240 | m_image->write_block(m_tape_pos, m_ctape_block_buffer); |
| 1241 | 1241 | m_ctape_block_count = m_tape_pos; |
| 1242 | 1242 | m_ctape_block_index = 0; |
| 1243 | 1243 | m_tape_pos++; |
| r242110 | r242111 | |
| 1268 | 1268 | void sc499_device::block_set_filemark() |
| 1269 | 1269 | { |
| 1270 | 1270 | static const UINT8 fm_pattern[] = {0xDE, 0xAF, 0xFA, 0xED}; |
| 1271 | | int i; |
| 1272 | | |
| 1273 | | for (i = 0; i < SC499_CTAPE_BLOCK_SIZE; i += 4) |
| 1271 | for (int i = 0; i < SC499_CTAPE_BLOCK_SIZE; i += 4) |
| 1274 | 1272 | { |
| 1275 | 1273 | memcpy(m_ctape_block_buffer + i, fm_pattern, 4); |
| 1276 | 1274 | } |
| 1277 | 1275 | } |
| 1278 | 1276 | |
| 1279 | 1277 | //########################################################################## |
| 1280 | | class sc499_ctape_image_device : public device_t, |
| 1281 | | public device_image_interface |
| 1282 | | { |
| 1283 | | public: |
| 1284 | | // construction/destruction |
| 1285 | | sc499_ctape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 1286 | 1278 | |
| 1287 | | // image-level overrides |
| 1288 | | virtual iodevice_t image_type() const { return IO_MAGTAPE; } |
| 1289 | | |
| 1290 | | virtual bool is_readable() const { return 1; } |
| 1291 | | virtual bool is_writeable() const { return 1; } |
| 1292 | | virtual bool is_creatable() const { return 1; } |
| 1293 | | virtual bool must_be_loaded() const { return 0; } |
| 1294 | | virtual bool is_reset_on_load() const { return 0; } |
| 1295 | | virtual const char *image_interface() const { return NULL; } |
| 1296 | | virtual const char *file_extensions() const { return "act"; } |
| 1297 | | virtual const option_guide *create_option_guide() const { return NULL; } |
| 1298 | | protected: |
| 1299 | | // device-level overrides |
| 1300 | | virtual void device_config_complete(); |
| 1301 | | virtual void device_start() { }; |
| 1302 | | }; |
| 1303 | | |
| 1304 | 1279 | const device_type SC499_CTAPE = &device_creator<sc499_ctape_image_device>; |
| 1305 | 1280 | |
| 1306 | 1281 | sc499_ctape_image_device::sc499_ctape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| r242110 | r242111 | |
| 1313 | 1288 | { |
| 1314 | 1289 | update_names(SC499_CTAPE, "ctape", "ct"); |
| 1315 | 1290 | }; |
| 1291 | |
| 1292 | |
| 1293 | UINT8 *sc499_ctape_image_device::read_block(int block_num) |
| 1294 | { |
| 1295 | // access beyond end of tape cart |
| 1296 | if (m_ctape_data.bytes() <= (block_num + 1) * SC499_CTAPE_BLOCK_SIZE) |
| 1297 | return NULL; |
| 1298 | else |
| 1299 | return m_ctape_data + (block_num * SC499_CTAPE_BLOCK_SIZE); |
| 1300 | } |
| 1301 | |
| 1302 | void sc499_ctape_image_device::write_block(int block_num, UINT8 *ptr) |
| 1303 | { |
| 1304 | if (!(m_ctape_data.bytes() <= (block_num + 1) * SC499_CTAPE_BLOCK_SIZE)) |
| 1305 | memcpy(m_ctape_data + (block_num * SC499_CTAPE_BLOCK_SIZE), ptr, SC499_CTAPE_BLOCK_SIZE); |
| 1306 | } |
| 1307 | |
| 1308 | bool sc499_ctape_image_device::call_load() |
| 1309 | { |
| 1310 | if (software_entry() == NULL) |
| 1311 | { |
| 1312 | m_ctape_data.resize(length()); |
| 1313 | fread(m_ctape_data, length()); |
| 1314 | } |
| 1315 | else |
| 1316 | { |
| 1317 | m_ctape_data.resize(get_software_region_length("ctape")); |
| 1318 | memcpy(m_ctape_data, get_software_region("ctape"), get_software_region_length("ctape")); |
| 1319 | } |
| 1320 | |
| 1321 | return IMAGE_INIT_PASS; |
| 1322 | } |
| 1323 | |
| 1324 | void sc499_ctape_image_device::call_unload() |
| 1325 | { |
| 1326 | m_ctape_data.resize(0); |
| 1327 | // TODO: add save tape on exit? |
| 1328 | //if (software_entry() == NULL) |
| 1329 | //{ |
| 1330 | // fseek(0, SEEK_SET); |
| 1331 | // fwrite(m_ctape_data, m_ctape_data.size); |
| 1332 | //} |
| 1333 | } |
trunk/src/emu/bus/isa/sc499.h
| r242110 | r242111 | |
| 21 | 21 | // TYPE DEFINITIONS |
| 22 | 22 | //************************************************************************** |
| 23 | 23 | |
| 24 | // ======================> sc499_ctape_image_device |
| 25 | |
| 26 | class sc499_ctape_image_device : public device_t, public device_image_interface |
| 27 | { |
| 28 | public: |
| 29 | // construction/destruction |
| 30 | sc499_ctape_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 31 | |
| 32 | // image-level overrides |
| 33 | virtual bool call_load(); |
| 34 | // virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) { return load_software(swlist, swname, start_entry); } |
| 35 | virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) { printf("%s\n", swname); return load_software(swlist, swname, start_entry); } |
| 36 | virtual void call_unload(); |
| 37 | virtual iodevice_t image_type() const { return IO_MAGTAPE; } |
| 38 | |
| 39 | virtual bool is_readable() const { return 1; } |
| 40 | virtual bool is_writeable() const { return 1; } |
| 41 | virtual bool is_creatable() const { return 1; } |
| 42 | virtual bool must_be_loaded() const { return 0; } |
| 43 | virtual bool is_reset_on_load() const { return 0; } |
| 44 | virtual const char *image_interface() const { return "sc499_cass"; } |
| 45 | virtual const char *file_extensions() const { return "act,ct"; } |
| 46 | virtual const option_guide *create_option_guide() const { return NULL; } |
| 47 | |
| 48 | UINT8 *read_block(int block_num); |
| 49 | void write_block(int block_num, UINT8 *ptr); |
| 50 | UINT64 tapelen() { return m_ctape_data.bytes(); } |
| 51 | |
| 52 | protected: |
| 53 | // device-level overrides |
| 54 | virtual void device_config_complete(); |
| 55 | virtual void device_start() { }; |
| 56 | |
| 57 | dynamic_buffer m_ctape_data; |
| 58 | }; |
| 59 | |
| 24 | 60 | // ======================> sc499_device |
| 25 | 61 | |
| 26 | 62 | class sc499_device: public device_t, public device_isa8_card_interface |
| r242110 | r242111 | |
| 105 | 141 | UINT64 m_image_length; |
| 106 | 142 | |
| 107 | 143 | dynamic_buffer m_ctape_block_buffer; |
| 144 | required_device<sc499_ctape_image_device> m_image; |
| 108 | 145 | |
| 109 | | device_image_interface *m_image; |
| 110 | | |
| 111 | 146 | enum line_state irq_state; |
| 112 | 147 | enum line_state dma_drq_state; |
| 113 | 148 | |
| r242110 | r242111 | |
| 119 | 154 | bool m_installed; |
| 120 | 155 | }; |
| 121 | 156 | |
| 157 | |
| 122 | 158 | // device type definition |
| 123 | 159 | extern const device_type ISA8_SC499; |
| 124 | 160 | |