src/mess/machine/nascom1.c
| r1621 | r1622 | |
| 13 | 13 | #include "image.h" |
| 14 | 14 | #include "includes/nascom1.h" |
| 15 | 15 | #include "cpu/z80/z80.h" |
| 16 | #include "devices/snapquik.h" |
| 16 | 17 | |
| 17 | 18 | |
| 19 | |
| 18 | 20 | static int nascom1_tape_size = 0; |
| 19 | 21 | static UINT8 *nascom1_tape_image = NULL; |
| 20 | 22 | static int nascom1_tape_index = 0; |
| r1621 | r1622 | |
| 138 | 140 | Note <addr> and <byte> are in hex. |
| 139 | 141 | */ |
| 140 | 142 | |
| 141 | | int nascom1_init_cartridge(int id, mame_file *file) |
| 143 | SNAPSHOT_LOAD( nascom1 ) |
| 142 | 144 | { |
| 143 | | int done; |
| 144 | | char fileaddr[5]; |
| 145 | | /* int filebyt1, filebyt2, filebyt3, filebyt4; |
| 146 | | int filebyt5, filebyt6, filebyt7, filebyt8; |
| 147 | | int addr; */ |
| 145 | UINT8 line[35]; |
| 148 | 146 | |
| 149 | | return (1); |
| 150 | | |
| 151 | | if (file) |
| 147 | while (image_fread(image, &line, sizeof(line)) == sizeof(line)) |
| 152 | 148 | { |
| 153 | | done = 0; |
| 154 | | fileaddr[4] = 0; |
| 155 | | while (!done) |
| 156 | | { |
| 157 | | mame_fread(file, (void *)fileaddr, 4); |
| 158 | | logerror ("%4.4s\n", fileaddr); |
| 159 | | if (fileaddr[0] == '.') |
| 160 | | { |
| 161 | | done = 1; |
| 162 | | } |
| 163 | | else |
| 164 | | { |
| 165 | | /* vsscanf (fileaddr, "%4X", &addr); */ |
| 166 | | /* logerror ("%04X: %02X %02X %02X %02X %02X %02X %02X %02X\n", |
| 167 | | addr, filebyt1, filebyt2, filebyt3, filebyt4, |
| 168 | | filebyt5, filebyt6, filebyt7, filebyt8); */ |
| 149 | int addr, b0, b1, b2, b3, b4, b5, b6, b7, dummy; |
| 169 | 150 | |
| 170 | | } |
| 151 | if (sscanf((char *)line, "%x %x %x %x %x %x %x %x %x %x\010\010\n", |
| 152 | &addr, &b0, &b1, &b2, &b3, &b4, &b5, &b6, &b7, &dummy) == 10) |
| 153 | { |
| 154 | program_write_byte_8(addr++, b0); |
| 155 | program_write_byte_8(addr++, b1); |
| 156 | program_write_byte_8(addr++, b2); |
| 157 | program_write_byte_8(addr++, b3); |
| 158 | program_write_byte_8(addr++, b4); |
| 159 | program_write_byte_8(addr++, b5); |
| 160 | program_write_byte_8(addr++, b6); |
| 161 | program_write_byte_8(addr++, b7); |
| 171 | 162 | } |
| 172 | 163 | } |
| 173 | | else |
| 174 | | { |
| 175 | | return (1); |
| 176 | | } |
| 177 | 164 | |
| 178 | | return (0); |
| 165 | return INIT_PASS; |
| 179 | 166 | } |
src/mess/drivers/nascom1.c
| r1621 | r1622 | |
| 182 | 182 | PORT_START /* 8: count = 8 */ |
| 183 | 183 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Backspace ClearScreen") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(8) |
| 184 | 184 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("New Line") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 185 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') |
| 185 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') |
| 186 | 186 | PORT_BIT(0x58, IP_ACTIVE_LOW, IPT_UNUSED) |
| 187 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') |
| 187 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR(UCHAR_SHIFT_2) PORT_CHAR('@') |
| 188 | 188 | INPUT_PORTS_END |
| 189 | 189 | |
| 190 | 190 | /* Sound output */ |
| r1621 | r1622 | |
| 282 | 282 | } |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | static void nascom1_snapshot_getinfo(const device_class *devclass, UINT32 state, union devinfo *info) |
| 286 | { |
| 287 | switch(state) |
| 288 | { |
| 289 | /* --- the following bits of info are returned as NULL-terminated strings --- */ |
| 290 | case DEVINFO_STR_FILE_EXTENSIONS: strcpy(info->s = device_temp_str(), "nas"); break; |
| 291 | |
| 292 | /* --- the following bits of info are returned as pointers to data or functions --- */ |
| 293 | case DEVINFO_PTR_SNAPSHOT_LOAD: info->f = (genf *) snapshot_load_nascom1; break; |
| 294 | |
| 295 | /* --- the following bits of info are returned as doubles --- */ |
| 296 | case DEVINFO_FLOAT_SNAPSHOT_DELAY: info->d = 0.5; break; |
| 297 | |
| 298 | default: snapshot_device_getinfo(devclass, state, info); break; |
| 299 | } |
| 300 | } |
| 301 | |
| 285 | 302 | SYSTEM_CONFIG_START(nascom1) |
| 286 | 303 | CONFIG_IMPORT_FROM(nascom) |
| 287 | 304 | CONFIG_DEVICE(nascom1_cassette_getinfo) |
| 305 | CONFIG_DEVICE(nascom1_snapshot_getinfo) |
| 288 | 306 | SYSTEM_CONFIG_END |
| 289 | 307 | |
| 290 | 308 | static void nascom2_cassette_getinfo(const device_class *devclass, UINT32 state, union devinfo *info) |
| r1621 | r1622 | |
| 311 | 329 | SYSTEM_CONFIG_START(nascom2) |
| 312 | 330 | CONFIG_IMPORT_FROM(nascom) |
| 313 | 331 | CONFIG_DEVICE(nascom2_cassette_getinfo) |
| 332 | CONFIG_DEVICE(nascom1_snapshot_getinfo) |
| 314 | 333 | SYSTEM_CONFIG_END |
| 315 | 334 | |
| 316 | 335 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */ |
docs/messnew.txt
| r1621 | r1622 | |
| 34 | 34 | instead of dip switches and updated it to use the default black and white |
| 35 | 35 | palette. [Dirk Best] |
| 36 | 36 | |
| 37 | - [NASCOM] Added snapshot loading support (.nas files) [Dirk Best] |
| 38 | |
| 37 | 39 | - [NES] Added support for mappers 42, 43, 44, 45 (partial), 46, 47, 49, |
| 38 | 40 | 51 (partial), 57, 58, 61, 62, 83 (partial), 112, 182, 188, 193 (not working), |
| 39 | 41 | 200, 201, 202, 203, 206, 240, 241 (partial), 242, 244, 246, 248. |