src/mess/devices/ti99_peb.c
| r0 | r8307 | |
| 1 | /*
|
| 2 | Peripheral expansion bus support.
|
| 3 | |
| 4 | The ti-99/4, ti-99/4a, ti computer 99/8, myarc geneve, and snug sgcpu
|
| 5 | 99/4p systems all feature a bus connector that enables the connection of
|
| 6 | extension cards. (Although the hexbus is the preferred bus to add
|
| 7 | additional peripherals to a ti-99/8, ti-99/8 is believed to be compatible
|
| 8 | with the older PEB system.) In the case of the TI consoles, this bus
|
| 9 | connector is located on the right side of the console.
|
| 10 | |
| 11 | While a few extension cards connect to the side bus connector of the
|
| 12 | ti-99/4(a) console directly, most extension cards were designed to be
|
| 13 | inserted in a PEB instead. The PEB (Peripheral Expansion Box) is a big box
|
| 14 | with an alimentation, a few bus drivers, and several card slots, that
|
| 15 | connects to the ti-99/4(a) side port. The reason for using a PEB is that
|
| 16 | daisy-chaining many modules caused the system to be unreliable due to the
|
| 17 | noise produced by the successive contacts. (As a matter of fact, TI
|
| 18 | initially released most of its extension cards as side bus units, but when
|
| 19 | the design proved to be unreliable, the PEB was introduced. The TI speech
|
| 20 | synthesizer was the only TI extension that remained on the side bus after
|
| 21 | the introduction of the PEB, probably because TI wanted the speech
|
| 22 | synthesizer to be a cheap extension, and the PEB was not cheap.)
|
| 23 | |
| 24 | The third-party myarc geneve and snug sgcpu computers are actually cards
|
| 25 | to be inserted into a PEB: they have a PC keyboard connector, and replace
|
| 26 | the original ti-99 console completely.
|
| 27 | |
| 28 | Each expansion card is assigned to one of 16 CRU address ranges.
|
| 29 | I appended the names of known TI peripherals that use each port (I appended
|
| 30 | '???' when I don't know what the peripheral is :-) ).
|
| 31 | * 0x1000-0x10FE "For test equipment use on production line"
|
| 32 | * 0x1100-0x11FE disk controller
|
| 33 | * 0x1200-0x12FE modem???
|
| 34 | * 0x1300-0x13FE RS232 1&2, PIO 1
|
| 35 | * 0x1400-0x14FE unassigned
|
| 36 | * 0x1500-0x15FE RS232 3&4, PIO 2
|
| 37 | * 0x1600-0x16FE unassigned
|
| 38 | * 0x1700-0x17FE hex-bus (prototypes)
|
| 39 | * 0x1800-0x18FE thermal printer (early peripheral)
|
| 40 | * 0x1900-0x19FE EPROM programmer??? (Mezzanine board in July 1981's TI99/7
|
| 41 | prototype)
|
| 42 | * 0x1A00-0x1AFE unassigned
|
| 43 | * 0x1B00-0x1BFE TI GPL debugger card
|
| 44 | * 0x1C00-0x1CFE Video Controller Card (Possibly the weirdest device. This
|
| 45 | card is connected to the video output of the computer, to a VCR, and a
|
| 46 | video monitor. It can control the VCR, connect the display to either
|
| 47 | VCR output or computer video output, and it can read or save binary
|
| 48 | data to video tape. I think it can act as a genlock interface (i.e.
|
| 49 | TMS9918 transparent background shows the video signal), too, but I am
|
| 50 | not sure about this.)
|
| 51 | * 0x1D00-0x1DFE IEEE 488 Controller Card ('intelligent' parallel bus,
|
| 52 | schematics on ftp.whtech.com)
|
| 53 | * 0x1E00-0x1EFE unassigned
|
| 54 | * 0x1F00-0x1FFE P-code card (part of a complete development system)
|
| 55 | |
| 56 | The ti-99/8 implements 16 extra ports:
|
| 57 | * 0x2000-0x26ff and 0x2800-0x2fff: reserved for future expansion?
|
| 58 | * 0x2700-0x27ff: internal DSR
|
| 59 | |
| 60 | The snug sgcpu 99/4p implements 12 extra ports:
|
| 61 | * 0x0400-0x0eff: free
|
| 62 | * 0x0f00-0x0fff: internal DSR
|
| 63 | |
| 64 | Known mappings for 3rd party cards:
|
| 65 | * Horizon RAMdisk: any ports from 0 to 7 (port 0 is most common).
|
| 66 | * Myarc 128k/512k (RAM and DSR ROM): port 0 (0x1000-0x11FE)
|
| 67 | * Corcomp 512k (RAM and DSR ROM): port unknown
|
| 68 | * Super AMS 128k/512k: port 14 (0x1E00-0x1EFE)
|
| 69 | * Foundation 128k/512k: port 14 (0x1E00-0x1EFE)
|
| 70 | * Gram Karte: any port (0-15)
|
| 71 | * EVPC (video card): 0x1400-0x14FE
|
| 72 | * HSGPL (GROM replacement): 0x1B00-0x1BFE
|
| 73 | |
| 74 | Of course, these devices additionally need some support routines, and
|
| 75 | possibly memory-mapped I/O registers. To do so, memory range 0x4000-5FFF
|
| 76 | is shared by all cards. The system enables each card as needed by writing
|
| 77 | a 1 to the first CRU bit: when this happens the card can safely enable its
|
| 78 | ROM, RAM, memory-mapped registers, etc. Provided the ROM uses the proper
|
| 79 | ROM header, the system will recognize and call peripheral I/O functions,
|
| 80 | interrupt service routines, and startup routines. (All these routines are
|
| 81 | generally called DSR = Device Service Routine.)
|
| 82 | |
| 83 | Also, the cards can trigger level-1 ("INTA") interrupts. A LOAD interrupt
|
| 84 | is present on the side port of the ti-99/4(a), too, but it was never used
|
| 85 | by TI, AFAIK. Also, an interrupt line called "INTB" is found on several
|
| 86 | cards built by TI, but it is not connected: I am quite unsure whether it
|
| 87 | was intended to be connected to the LOAD line, to the INT2 line of TMS9985,
|
| 88 | or it was only to be used with the ti-99/4(a) development system running on
|
| 89 | a TI990/10. This is not the only unused feature: cards built by TI support
|
| 90 | sensing of an interrupt status register and 19-bit addressing, even though
|
| 91 | ti-99/4(A) does not take advantage of these features. TI documentation
|
| 92 | tells that some of these features are "defined by the Personal Computer PCC
|
| 93 | at Texas Instrument", which is not very explicit (What on earth does "PCC"
|
| 94 | stand for?). Maybe it refers to the ti-99/4(a) development system running
|
| 95 | on a TI990/10, or to the ti-99/7 and ti-99/8 prototypes.
|
| 96 | |
| 97 | Note that I use 8-bit RAM handlers. Obviously, using 16-bit handlers would
|
| 98 | be equivalent and faster on a ti-99/4(a), but we need to interface the
|
| 99 | extension cards not only to the ti-99/4(a), but to the geneve and ti-99/8
|
| 100 | emulators as well.
|
| 101 | |
| 102 | June 2010: Reimplemented using device structure (MZ) (obsoletes 99_peb.c)
|
| 103 | */
|
| 104 | |
| 105 | #include "emu.h"
|
| 106 | #include "ti99_peb.h"
|
| 107 | |
| 108 | enum width_t {
|
| 109 | width_8bit = 0,
|
| 110 | width_16bit
|
| 111 | };
|
| 112 | /* expansion card structure for the snug sgcpu 99/4p system, which supports
|
| 113 | dynamical 16-bit accesses (TI did not design this!) */
|
| 114 | typedef struct ti99_4p_peb_card_handlers_t
|
| 115 | {
|
| 116 | cru_read_handler cru_read; /* card CRU read handler */
|
| 117 | cru_write_handler cru_write; /* card CRU handler */
|
| 118 | |
| 119 | width_t width;
|
| 120 | union
|
| 121 | {
|
| 122 | struct
|
| 123 | {
|
| 124 | read8_space_func mem_read; /* card mem read handler (8 bits) */
|
| 125 | write8_space_func mem_write; /* card mem write handler (8 bits) */
|
| 126 | } width_8bit;
|
| 127 | struct
|
| 128 | {
|
| 129 | read16_space_func mem_read; /* card mem read handler (16 bits) */
|
| 130 | write16_space_func mem_write; /* card mem write handler (16 bits) */
|
| 131 | } width_16bit;
|
| 132 | } w;
|
| 133 | } ti99_4p_peb_card_handlers_t;
|
| 134 | |
| 135 | typedef struct _ti99_peb_state
|
| 136 | {
|
| 137 | /* TRUE if we are using the snug sgcpu 99/4p 16-bit extensions */
|
| 138 | int has_16bit_peb;
|
| 139 | |
| 140 | /* handlers for each of 28 slots */
|
| 141 | ti99_4p_peb_card_handlers_t ti99_4p_expansion_ports[28];
|
| 142 | |
| 143 | /* handlers for each of 16 slots + 16 extra slots for ti-99/8 */
|
| 144 | ti99_peb_card_handlers_t expansion_ports[16+16];
|
| 145 | |
| 146 | /* index of the currently active card (-1 if none) */
|
| 147 | int active_card;
|
| 148 | |
| 149 | /* index of the currently active card, overridden by the mapper */
|
| 150 | int active_card_tmp;
|
| 151 | |
| 152 | /* Mapper override. */
|
| 153 | int mapper_override;
|
| 154 | |
| 155 | // ila: inta status register (not actually used on ti-99/4(a), but nevertheless
|
| 156 | // present)
|
| 157 | int ila;
|
| 158 | |
| 159 | // ilb: intb status register (completely pointless on ti-99/4(a), as neither
|
| 160 | // INTB nor SENILB are connected; OTOH, INTB can trigger interrupts on a Geneve,
|
| 161 | // and snug sgcpu 99/4p can sense ILB)
|
| 162 | int ilb;
|
| 163 | |
| 164 | /* only used by the snug sgcpu 99/4p */
|
| 165 | int senila, senilb;
|
| 166 | |
| 167 | /* hack to simulate TMS9900 byte write */
|
| 168 | int tmp_buffer;
|
| 169 | |
| 170 | /* inta/intb handlers */
|
| 171 | void (*inta_callback)(running_machine *machine, int state);
|
| 172 | void (*intb_callback)(running_machine *machine, int state);
|
| 173 | |
| 174 | const address_space *space;
|
| 175 | |
| 176 | } ti99_peb_state;
|
| 177 | |
| 178 | INLINE ti99_peb_state *get_safe_token(running_device *device)
|
| 179 | {
|
| 180 | assert(device != NULL);
|
| 181 | assert(device->token != NULL);
|
| 182 | return (ti99_peb_state *)device->token;
|
| 183 | }
|
| 184 | |
| 185 | INLINE const ti99_peb_config *get_config(running_device *device)
|
| 186 | {
|
| 187 | assert(device != NULL);
|
| 188 | assert(device->type == PBOX);
|
| 189 | return (const ti99_peb_config *) device->baseconfig().inline_config;
|
| 190 | }
|
| 191 | |
| 192 | /*
|
| 193 | Sets the handlers for one expansion port (normal 8-bit card)
|
| 194 | |
| 195 | cru_base: CRU base address (any of 0x1000, 0x1100, 0x1200, ..., 0x1F00)
|
| 196 | (snug sgcpu 99/4p accepts 0x0400, ..., 0x1F00, ti-99/8 accepts 0x1000,
|
| 197 | ..., 0x2F00)
|
| 198 | handler: handler structure for the given card
|
| 199 | */
|
| 200 | void ti99_peb_set_card_handlers(running_device *box, int cru_base, const ti99_peb_card_handlers_t *handler)
|
| 201 | {
|
| 202 | int port;
|
| 203 | ti99_peb_state *peb = get_safe_token(box);
|
| 204 | |
| 205 | if (cru_base & 0xff)
|
| 206 | return;
|
| 207 | |
| 208 | if (peb->has_16bit_peb)
|
| 209 | {
|
| 210 | port = (cru_base - 0x0400) >> 8;
|
| 211 | |
| 212 | if ((port>=0) && (port<28))
|
| 213 | {
|
| 214 | peb->ti99_4p_expansion_ports[port].cru_read = handler->cru_read;
|
| 215 | peb->ti99_4p_expansion_ports[port].cru_write = handler->cru_write;
|
| 216 | peb->ti99_4p_expansion_ports[port].width = width_8bit;
|
| 217 | peb->ti99_4p_expansion_ports[port].w.width_8bit.mem_read = handler->mem_read;
|
| 218 | peb->ti99_4p_expansion_ports[port].w.width_8bit.mem_write = handler->mem_write;
|
| 219 | }
|
| 220 | }
|
| 221 | else
|
| 222 | {
|
| 223 | port = (cru_base - 0x1000) >> 8;
|
| 224 | |
| 225 | if ((port>=0) && (port</*16*/32))
|
| 226 | {
|
| 227 | peb->expansion_ports[port] = *handler;
|
| 228 | }
|
| 229 | }
|
| 230 | }
|
| 231 | |
| 232 | /*
|
| 233 | Sets the handlers for one expansion port (special 16-bit card for snug
|
| 234 | sgcpu 99/4p)
|
| 235 | |
| 236 | cru_base: CRU base address (any of 0x1000, 0x1100, 0x1200, ..., 0x1F00)
|
| 237 | (snug sgcpu 99/4p accepts 0x0400, ..., 0x1F00, ti-99/8 accepts 0x1000,
|
| 238 | ..., 0x2F00)
|
| 239 | handler: handler structure for the given card
|
| 240 | */
|
| 241 | void ti99_peb_set_16bit_card_handlers(running_device *box, int cru_base, const ti99_peb_16bit_card_handlers_t *handler)
|
| 242 | {
|
| 243 | int port;
|
| 244 | ti99_peb_state *peb = get_safe_token(box);
|
| 245 | |
| 246 | if (cru_base & 0xff)
|
| 247 | return;
|
| 248 | |
| 249 | if (peb->has_16bit_peb)
|
| 250 | {
|
| 251 | port = (cru_base - 0x0400) >> 8;
|
| 252 | |
| 253 | if ((port>=0) && (port<28))
|
| 254 | {
|
| 255 | peb->ti99_4p_expansion_ports[port].cru_read = handler->cru_read;
|
| 256 | peb->ti99_4p_expansion_ports[port].cru_write = handler->cru_write;
|
| 257 | peb->ti99_4p_expansion_ports[port].width = width_16bit;
|
| 258 | peb->ti99_4p_expansion_ports[port].w.width_16bit.mem_read = handler->mem_read;
|
| 259 | peb->ti99_4p_expansion_ports[port].w.width_16bit.mem_write = handler->mem_write;
|
| 260 | }
|
| 261 | }
|
| 262 | }
|
| 263 | |
| 264 | /*
|
| 265 | Update ila status register and assert or clear INTA interrupt line
|
| 266 | accordingly.
|
| 267 | |
| 268 | bit: bit number ([0,7] for original INTA register, [8,15] are extra
|
| 269 | "virtual" bits for devices that assert the INTA line without setting a
|
| 270 | bit of the ILA register)
|
| 271 | state: 1 to assert bit, 0 to clear
|
| 272 | */
|
| 273 | void ti99_peb_set_ila_bit(running_device *box, int bit, int state)
|
| 274 | {
|
| 275 | ti99_peb_state *peb = get_safe_token(box);
|
| 276 | if (state)
|
| 277 | {
|
| 278 | peb->ila |= 1 << bit;
|
| 279 | if (peb->inta_callback)
|
| 280 | (*peb->inta_callback)(box->machine, 1);
|
| 281 | }
|
| 282 | else
|
| 283 | {
|
| 284 | peb->ila &= ~(1 << bit);
|
| 285 | if ((!peb->ila) && peb->inta_callback)
|
| 286 | (*peb->inta_callback)(box->machine, 0);
|
| 287 | }
|
| 288 | }
|
| 289 | |
| 290 | /*
|
| 291 | Update ilb status register and assert or clear INTB interrupt line
|
| 292 | accordingly.
|
| 293 | |
| 294 | bit: bit number ([0,7] for original INTAB register, [8,15] are extra
|
| 295 | "virtual" bits for devices that assert the INTB line without setting a
|
| 296 | bit of the ILB register)
|
| 297 | state: 1 to assert bit, 0 to clear
|
| 298 | */
|
| 299 | void ti99_peb_set_ilb_bit(running_device *box, int bit, int state)
|
| 300 | {
|
| 301 | ti99_peb_state *peb = get_safe_token(box);
|
| 302 | |
| 303 | if (state)
|
| 304 | {
|
| 305 | peb->ilb |= 1 << bit;
|
| 306 | if (peb->intb_callback)
|
| 307 | (*peb->intb_callback)(box->machine, 1);
|
| 308 | }
|
| 309 | else
|
| 310 | {
|
| 311 | peb->ilb &= ~(1 << bit);
|
| 312 | if ((!peb->ilb) && peb->intb_callback)
|
| 313 | (*peb->intb_callback)(box->machine, 0);
|
| 314 | }
|
| 315 | }
|
| 316 | |
| 317 | |
| 318 | /*
|
| 319 | Read CRU in range >1000->1ffe (>800->fff) (ti-99/4(a))
|
| 320 | */
|
| 321 | READ8_DEVICE_HANDLER( ti99_4x_peb_cru_r )
|
| 322 | {
|
| 323 | int port;
|
| 324 | cru_read_handler handler;
|
| 325 | int reply;
|
| 326 | ti99_peb_state *peb = get_safe_token(device);
|
| 327 | |
| 328 | port = (offset & 0x00f0) >> 4;
|
| 329 | handler = peb->expansion_ports[port].cru_read;
|
| 330 | |
| 331 | reply = (handler) ? (*handler)(device->machine, offset & 0xf) : 0;
|
| 332 | |
| 333 | return reply;
|
| 334 | }
|
| 335 | |
| 336 | /*
|
| 337 | Write CRU in range >1000->1ffe (>800->fff) (ti-99/4(a))
|
| 338 | */
|
| 339 | WRITE8_DEVICE_HANDLER( ti99_4x_peb_cru_w )
|
| 340 | {
|
| 341 | int port;
|
| 342 | cru_write_handler handler;
|
| 343 | ti99_peb_state *peb = get_safe_token(device);
|
| 344 | |
| 345 | port = (offset & 0x0780) >> 7;
|
| 346 | handler = peb->expansion_ports[port].cru_write;
|
| 347 | |
| 348 | if (handler)
|
| 349 | (*handler)(device->machine, offset & 0x7f, data);
|
| 350 | |
| 351 | /* expansion card enable? */
|
| 352 | if ((offset & 0x7f) == 0)
|
| 353 | {
|
| 354 | if (data & 1)
|
| 355 | {
|
| 356 | /* enable */
|
| 357 | peb->active_card = port;
|
| 358 | }
|
| 359 | else
|
| 360 | {
|
| 361 | if (port == peb->active_card) /* geez... who cares? */
|
| 362 | {
|
| 363 | peb->active_card = -1; /* no port selected */
|
| 364 | }
|
| 365 | }
|
| 366 | }
|
| 367 | }
|
| 368 | |
| 369 | /*
|
| 370 | Read mem in range >4000->5ffe (ti-99/4(a))
|
| 371 | */
|
| 372 | READ16_DEVICE_HANDLER( ti99_4x_peb_r )
|
| 373 | {
|
| 374 | int reply = 0;
|
| 375 | read8_space_func handler;
|
| 376 | ti99_peb_state *peb = get_safe_token(device);
|
| 377 | |
| 378 | cpu_adjust_icount(device->machine->firstcpu,-4);
|
| 379 | |
| 380 | if (peb->active_card != -1)
|
| 381 | {
|
| 382 | handler = peb->expansion_ports[peb->active_card].mem_read;
|
| 383 | if (handler)
|
| 384 | {
|
| 385 | reply = (*handler)(peb->space, (offset << 1) + 1);
|
| 386 | reply |= ((unsigned) (*handler)(peb->space, offset << 1)) << 8;
|
| 387 | }
|
| 388 | }
|
| 389 | // printf("[%04x:%04x] = %04x\n", (active_card<<8)+0x1000, (offset<<1)+0x4000, reply);
|
| 390 | |
| 391 | return peb->tmp_buffer = reply;
|
| 392 | }
|
| 393 | |
| 394 | /*
|
| 395 | Write mem in range >4000->5ffe (ti-99/4(a))
|
| 396 | */
|
| 397 | WRITE16_DEVICE_HANDLER( ti99_4x_peb_w )
|
| 398 | {
|
| 399 | write8_space_func handler;
|
| 400 | ti99_peb_state *peb = get_safe_token(device);
|
| 401 | |
| 402 | cpu_adjust_icount(device->machine->firstcpu,-4);
|
| 403 | |
| 404 | /* simulate byte write */
|
| 405 | data = (peb->tmp_buffer & ~mem_mask) | (data & mem_mask);
|
| 406 | |
| 407 | if (peb->active_card != -1)
|
| 408 | {
|
| 409 | handler = peb->expansion_ports[peb->active_card].mem_write;
|
| 410 | if (handler)
|
| 411 | {
|
| 412 | (*handler)(peb->space, (offset << 1) + 1, data & 0xff);
|
| 413 | (*handler)(peb->space, offset << 1, (data >> 8) & 0xff);
|
| 414 | }
|
| 415 | }
|
| 416 | }
|
| 417 | |
| 418 | |
| 419 | /*
|
| 420 | Read CRU in range >1000->1ffe (>800->fff) (Geneve)
|
| 421 | */
|
| 422 | READ8_DEVICE_HANDLER( geneve_peb_cru_r )
|
| 423 | {
|
| 424 | int port;
|
| 425 | cru_read_handler handler;
|
| 426 | int reply;
|
| 427 | ti99_peb_state *peb = get_safe_token(device);
|
| 428 | |
| 429 | port = (offset & 0x00f0) >> 4;
|
| 430 | handler = peb->expansion_ports[port].cru_read;
|
| 431 | |
| 432 | reply = (handler) ? (*handler)(device->machine, offset & 0xf) : 0;
|
| 433 | |
| 434 | return reply;
|
| 435 | }
|
| 436 | |
| 437 | /*
|
| 438 | Write CRU in range >1000->1ffe (>800->fff) (Geneve)
|
| 439 | */
|
| 440 | WRITE8_DEVICE_HANDLER( geneve_peb_cru_w )
|
| 441 | {
|
| 442 | int port;
|
| 443 | cru_write_handler handler;
|
| 444 | ti99_peb_state *peb = get_safe_token(device);
|
| 445 | |
| 446 | port = (offset & 0x0780) >> 7;
|
| 447 | handler = peb->expansion_ports[port].cru_write;
|
| 448 | |
| 449 | if (handler)
|
| 450 | (*handler)(device->machine, offset & 0x7f, data);
|
| 451 | |
| 452 | /* expansion card enable? */
|
| 453 | if ((offset & 0x7f) == 0)
|
| 454 | {
|
| 455 | if (data & 1)
|
| 456 | {
|
| 457 | /* enable */
|
| 458 | peb->active_card = port;
|
| 459 | }
|
| 460 | else
|
| 461 | {
|
| 462 | if (port == peb->active_card) /* geez... who cares? */
|
| 463 | {
|
| 464 | peb->active_card = -1; /* no port selected */
|
| 465 | }
|
| 466 | }
|
| 467 | }
|
| 468 | }
|
| 469 | |
| 470 | /*
|
| 471 | Read mem in range >4000->5fff (Geneve)
|
| 472 | */
|
| 473 | READ8_DEVICE_HANDLER( geneve_peb_r )
|
| 474 | {
|
| 475 | int reply = 0;
|
| 476 | read8_space_func handler;
|
| 477 | ti99_peb_state *peb = get_safe_token(device);
|
| 478 | |
| 479 | cpu_adjust_icount(device->machine->firstcpu,-8);
|
| 480 | |
| 481 | if (peb->active_card != -1)
|
| 482 | {
|
| 483 | handler = peb->expansion_ports[peb->active_card].mem_read;
|
| 484 | if (handler)
|
| 485 | reply = (*handler)(peb->space, offset);
|
| 486 | }
|
| 487 | |
| 488 | return reply;
|
| 489 | }
|
| 490 | |
| 491 | /*
|
| 492 | Write mem in range >4000->5fff (Geneve)
|
| 493 | */
|
| 494 | WRITE8_DEVICE_HANDLER( geneve_peb_w )
|
| 495 | {
|
| 496 | write8_space_func handler;
|
| 497 | ti99_peb_state *peb = get_safe_token(device);
|
| 498 | |
| 499 | cpu_adjust_icount(device->machine->firstcpu,-8);
|
| 500 | |
| 501 | if (peb->active_card != -1)
|
| 502 | {
|
| 503 | handler = peb->expansion_ports[peb->active_card].mem_write;
|
| 504 | if (handler)
|
| 505 | (*handler)(peb->space, offset, data);
|
| 506 | }
|
| 507 | }
|
| 508 | |
| 509 | /*
|
| 510 | Read CRU in range >1000->2ffe (>0800->17ff) (ti-99/8)
|
| 511 | */
|
| 512 | READ8_DEVICE_HANDLER( ti99_8_peb_cru_r )
|
| 513 | {
|
| 514 | int port;
|
| 515 | cru_read_handler handler;
|
| 516 | int reply;
|
| 517 | ti99_peb_state *peb = get_safe_token(device);
|
| 518 | |
| 519 | port = (offset & 0x01f0) >> 4;
|
| 520 | handler = peb->expansion_ports[port].cru_read;
|
| 521 | |
| 522 | reply = (handler) ? (*handler)(device->machine, offset & 0xf) : 0;
|
| 523 | |
| 524 | return reply;
|
| 525 | }
|
| 526 | |
| 527 | /*
|
| 528 | Write CRU in range >1000->2ffe (>0800->17ff) (ti-99/8)
|
| 529 | */
|
| 530 | WRITE8_DEVICE_HANDLER( ti99_8_peb_cru_w )
|
| 531 | {
|
| 532 | int port;
|
| 533 | cru_write_handler handler;
|
| 534 | ti99_peb_state *peb = get_safe_token(device);
|
| 535 | |
| 536 | port = (offset & 0x0f80) >> 7;
|
| 537 | handler = peb->expansion_ports[port].cru_write;
|
| 538 | |
| 539 | if (handler)
|
| 540 | (*handler)(device->machine, offset & 0x7f, data);
|
| 541 | |
| 542 | /* expansion card enable? */
|
| 543 | if ((offset & 0x7f) == 0)
|
| 544 | {
|
| 545 | if (data & 1)
|
| 546 | {
|
| 547 | /* enable */
|
| 548 | peb->active_card = port;
|
| 549 | }
|
| 550 | else
|
| 551 | {
|
| 552 | if (port == peb->active_card) /* geez... who cares? */
|
| 553 | {
|
| 554 | peb->active_card = -1; /* no port selected */
|
| 555 | }
|
| 556 | }
|
| 557 | }
|
| 558 | }
|
| 559 | |
| 560 | /*
|
| 561 | Read mem in range >4000->5fff (ti-99/8)
|
| 562 | */
|
| 563 | READ8_DEVICE_HANDLER( ti99_8_peb_r )
|
| 564 | {
|
| 565 | int reply = 0;
|
| 566 | read8_space_func handler;
|
| 567 | ti99_peb_state *peb = get_safe_token(device);
|
| 568 | |
| 569 | cpu_adjust_icount(device->machine->firstcpu,-4);
|
| 570 | |
| 571 | if (peb->active_card != -1)
|
| 572 | {
|
| 573 | handler = peb->expansion_ports[peb->active_card].mem_read;
|
| 574 | if (handler)
|
| 575 | reply = (*handler)(peb->space, offset);
|
| 576 | }
|
| 577 | |
| 578 | return reply;
|
| 579 | }
|
| 580 | |
| 581 | /*
|
| 582 | Write mem in range >4000->5fff (ti-99/8)
|
| 583 | */
|
| 584 | WRITE8_DEVICE_HANDLER( ti99_8_peb_w )
|
| 585 | {
|
| 586 | write8_space_func handler;
|
| 587 | ti99_peb_state *peb = get_safe_token(device);
|
| 588 | |
| 589 | cpu_adjust_icount(device->machine->firstcpu,-4);
|
| 590 | |
| 591 | if (peb->active_card != -1)
|
| 592 | {
|
| 593 | handler = peb->expansion_ports[peb->active_card].mem_write;
|
| 594 | if (handler)
|
| 595 | (*handler)(peb->space, offset, data);
|
| 596 | }
|
| 597 | }
|
| 598 | |
| 599 | /*
|
| 600 | Read CRU in range >0400->1ffe (>200->fff) (snug sgcpu 99/4p)
|
| 601 | */
|
| 602 | READ8_DEVICE_HANDLER( ti99_4p_peb_cru_r )
|
| 603 | {
|
| 604 | int port;
|
| 605 | cru_read_handler handler;
|
| 606 | int reply;
|
| 607 | ti99_peb_state *peb = get_safe_token(device);
|
| 608 | |
| 609 | port = offset >> 4;
|
| 610 | handler = peb->ti99_4p_expansion_ports[port].cru_read;
|
| 611 | |
| 612 | reply = (handler) ? (*handler)(device->machine, offset & 0xf) : 0;
|
| 613 | |
| 614 | return reply;
|
| 615 | }
|
| 616 | |
| 617 | /*
|
| 618 | Write CRU in range >0400->1ffe (>200->fff) (snug sgcpu 99/4p)
|
| 619 | */
|
| 620 | WRITE8_DEVICE_HANDLER( ti99_4p_peb_cru_w )
|
| 621 | {
|
| 622 | int port;
|
| 623 | cru_write_handler handler;
|
| 624 | ti99_peb_state *peb = get_safe_token(device);
|
| 625 | |
| 626 | int cru_address = (offset + 0x200)<<1;
|
| 627 | |
| 628 | port = offset >> 7;
|
| 629 | handler = peb->ti99_4p_expansion_ports[port].cru_write;
|
| 630 | |
| 631 | if (handler)
|
| 632 | (*handler)(device->machine, offset & 0x7f, data);
|
| 633 | |
| 634 | /* expansion card enable? */
|
| 635 | if ((cru_address & 0xfe) == 0)
|
| 636 | {
|
| 637 | if (data & 1)
|
| 638 | {
|
| 639 | /* enable */
|
| 640 | if (cru_address == 0x1e00)
|
| 641 | {
|
| 642 | // The internal mapper has precedence over the external bus.
|
| 643 | // It may be turned on although there is another device currently turned on
|
| 644 | peb->active_card_tmp = peb->active_card;
|
| 645 | peb->mapper_override = TRUE;
|
| 646 | }
|
| 647 | peb->active_card = port;
|
| 648 | }
|
| 649 | else
|
| 650 | {
|
| 651 | if ((cru_address == 0x1e00) && peb->mapper_override)
|
| 652 | {
|
| 653 | peb->active_card = peb->active_card_tmp;
|
| 654 | peb->mapper_override = FALSE;
|
| 655 | }
|
| 656 | else
|
| 657 | {
|
| 658 | if (port == peb->active_card) /* geez... who cares? */
|
| 659 | {
|
| 660 | peb->active_card = -1; /* no port selected */
|
| 661 | }
|
| 662 | }
|
| 663 | }
|
| 664 | }
|
| 665 | }
|
| 666 | |
| 667 | /*
|
| 668 | Read mem in range >4000->5ffe (snug sgcpu 99/4p)
|
| 669 | */
|
| 670 | READ16_DEVICE_HANDLER( ti99_4p_peb_r )
|
| 671 | {
|
| 672 | int reply = 0;
|
| 673 | read8_space_func handler;
|
| 674 | read16_space_func handler16;
|
| 675 | ti99_peb_state *peb = get_safe_token(device);
|
| 676 | |
| 677 | if (peb->active_card == -1)
|
| 678 | cpu_adjust_icount(device->machine->firstcpu,-4); /* ??? */
|
| 679 | else
|
| 680 | {
|
| 681 | if (peb->ti99_4p_expansion_ports[peb->active_card].width == width_8bit)
|
| 682 | {
|
| 683 | cpu_adjust_icount(device->machine->firstcpu,-4);
|
| 684 | |
| 685 | handler = peb->ti99_4p_expansion_ports[peb->active_card].w.width_8bit.mem_read;
|
| 686 | if (handler)
|
| 687 | {
|
| 688 | reply = (*handler)(peb->space, (offset << 1) + 1);
|
| 689 | reply |= ((unsigned) (*handler)(peb->space, offset << 1)) << 8;
|
| 690 | }
|
| 691 | }
|
| 692 | else
|
| 693 | {
|
| 694 | cpu_adjust_icount(device->machine->firstcpu,-1); /* ??? */
|
| 695 | |
| 696 | handler16 = peb->ti99_4p_expansion_ports[peb->active_card].w.width_16bit.mem_read;
|
| 697 | if (handler16)
|
| 698 | reply = (*handler16)(peb->space, offset, /*mem_mask*/0xffff);
|
| 699 | }
|
| 700 | }
|
| 701 | |
| 702 | if (peb->senila || peb->senilb)
|
| 703 | {
|
| 704 | if ((peb->active_card != -1) || (peb->senila && peb->senilb))
|
| 705 | /* ah, the smell of burnt silicon... */
|
| 706 | logerror("<Scrrrrr>: your computer has just burnt (maybe).\n");
|
| 707 | |
| 708 | if (peb->senila)
|
| 709 | reply = (peb->ila & 0xff) | (peb->ila << 8);
|
| 710 | else if (peb->senilb)
|
| 711 | reply = (peb->ilb & 0xff) | (peb->ilb << 8);
|
| 712 | }
|
| 713 | |
| 714 | // printf("[%04x:%04x] = %04x\n", (active_card<<8)+0x400, (offset<<1)+0x4000, reply);
|
| 715 | return peb->tmp_buffer = reply;
|
| 716 | }
|
| 717 | |
| 718 | /*
|
| 719 | Write mem in range >4000->5ffe (snug sgcpu 99/4p)
|
| 720 | */
|
| 721 | WRITE16_DEVICE_HANDLER( ti99_4p_peb_w )
|
| 722 | {
|
| 723 | write8_space_func handler;
|
| 724 | write16_space_func handler16;
|
| 725 | ti99_peb_state *peb = get_safe_token(device);
|
| 726 | |
| 727 | if (peb->active_card == -1)
|
| 728 | cpu_adjust_icount(device->machine->firstcpu,-4); /* ??? */
|
| 729 | else
|
| 730 | {
|
| 731 | /* simulate byte write */
|
| 732 | data = (peb->tmp_buffer & ~mem_mask) | (data & mem_mask);
|
| 733 | |
| 734 | if (peb->ti99_4p_expansion_ports[peb->active_card].width == width_8bit)
|
| 735 | {
|
| 736 | cpu_adjust_icount(device->machine->firstcpu,-4);
|
| 737 | |
| 738 | handler = peb->ti99_4p_expansion_ports[peb->active_card].w.width_8bit.mem_write;
|
| 739 | if (handler)
|
| 740 | {
|
| 741 | (*handler)(peb->space, (offset << 1) + 1, data & 0xff);
|
| 742 | (*handler)(peb->space, offset << 1, (data >> 8) & 0xff);
|
| 743 | }
|
| 744 | }
|
| 745 | else
|
| 746 | {
|
| 747 | cpu_adjust_icount(device->machine->firstcpu,-1); /* ??? */
|
| 748 | |
| 749 | handler16 = peb->ti99_4p_expansion_ports[peb->active_card].w.width_16bit.mem_write;
|
| 750 | if (handler16)
|
| 751 | (*handler16)(peb->space, offset, data, /*mem_mask*/0xffff);
|
| 752 | }
|
| 753 | }
|
| 754 | }
|
| 755 | |
| 756 | /*
|
| 757 | Set the state of the SENILA line (snug sgcpu 99/4p)
|
| 758 | */
|
| 759 | void ti99_4p_peb_set_senila(running_device *box, int state)
|
| 760 | {
|
| 761 | ti99_peb_state *peb = get_safe_token(box);
|
| 762 | peb->senila = (state != 0);
|
| 763 | }
|
| 764 | |
| 765 | /*
|
| 766 | Set the state of the SENILB line (snug sgcpu 99/4p)
|
| 767 | */
|
| 768 | void ti99_4p_peb_set_senilb(running_device *box, int state)
|
| 769 | {
|
| 770 | ti99_peb_state *peb = get_safe_token(box);
|
| 771 | peb->senilb = (state != 0);
|
| 772 | }
|
| 773 | |
| 774 | |
| 775 | /***************************************************************************
|
| 776 | DEVICE FUNCTIONS
|
| 777 | ***************************************************************************/
|
| 778 | |
| 779 | static DEVICE_START( ti99_peb )
|
| 780 | {
|
| 781 | }
|
| 782 | |
| 783 | static DEVICE_STOP( ti99_peb )
|
| 784 | {
|
| 785 | }
|
| 786 | |
| 787 | static DEVICE_RESET( ti99_peb )
|
| 788 | {
|
| 789 | ti99_peb_state *peb = get_safe_token(device);
|
| 790 | |
| 791 | peb->has_16bit_peb = get_config(device)->mode16;
|
| 792 | peb->inta_callback = get_config(device)->inta_callback;
|
| 793 | peb->intb_callback = get_config(device)->intb_callback;
|
| 794 | |
| 795 | peb->active_card = -1;
|
| 796 | peb->active_card_tmp = -1;
|
| 797 | |
| 798 | peb->mapper_override = FALSE; // for ti99_4p
|
| 799 | |
| 800 | peb->ila = 0;
|
| 801 | peb->ilb = 0;
|
| 802 | |
| 803 | peb->space = cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
|
| 804 | |
| 805 | // Remove all card handlers; must be reinstalled
|
| 806 | memset(peb->expansion_ports, 0, sizeof(peb->expansion_ports));
|
| 807 | memset(peb->ti99_4p_expansion_ports, 0, sizeof(peb->ti99_4p_expansion_ports));
|
| 808 | }
|
| 809 | |
| 810 | static const char DEVTEMPLATE_SOURCE[] = __FILE__;
|
| 811 | |
| 812 | #define DEVTEMPLATE_ID(p,s) p##ti99_peb##s
|
| 813 | #define DEVTEMPLATE_FEATURES DT_HAS_START | DT_HAS_STOP | DT_HAS_RESET | DT_HAS_INLINE_CONFIG
|
| 814 | #define DEVTEMPLATE_NAME "TI99 Peripheral Expansion System"
|
| 815 | #define DEVTEMPLATE_FAMILY "External devices"
|
| 816 | #include "devtempl.h"
|
| 817 | |
src/mess/machine/ti99_4x.c
| r8306 | r8307 | |
| 57 | 57 | #include "audio/spchroms.h" |
| 58 | 58 | #include "devices/cassette.h" |
| 59 | 59 | #include "ti99_4x.h" |
| 60 | | #include "99_peb.h" |
| 60 | #include "devices/ti99_peb.h" |
| 61 | 61 | #include "994x_ser.h" |
| 62 | 62 | #include "99_dsk.h" |
| 63 | 63 | #include "99_ide.h" |
| r8306 | r8307 | |
| 75 | 75 | static READ16_HANDLER ( ti99_rspeech_r ); |
| 76 | 76 | static WRITE16_HANDLER ( ti99_wspeech_w ); |
| 77 | 77 | |
| 78 | | static void tms9901_set_int1(running_machine *machine, int state); |
| 79 | | |
| 80 | 78 | static void ti99_handset_task(running_machine *machine); |
| 81 | 79 | static void mecmouse_poll(running_machine *machine); |
| 82 | 80 | |
| r8306 | r8307 | |
| 270 | 268 | /* Link to the cartridge system. */ |
| 271 | 269 | static running_device *cartslots; |
| 272 | 270 | |
| 271 | /* Link to the Peripheral Expansion Box */ |
| 272 | static running_device *expansion_box; |
| 273 | |
| 273 | 274 | /*===========================================================================*/ |
| 274 | 275 | /* |
| 275 | 276 | General purpose code: |
| r8306 | r8307 | |
| 423 | 424 | console_GROMs.raddr_LSB = FALSE; |
| 424 | 425 | console_GROMs.waddr_LSB = FALSE; |
| 425 | 426 | |
| 427 | expansion_box = devtag_get_device(machine, "per_exp_box"); |
| 428 | |
| 426 | 429 | /* set up scratch pad pointer */ |
| 427 | 430 | memory_set_bankptr(machine, "bank1", memory_region(machine, "maincpu") + offset_sram); |
| 428 | 431 | |
| r8306 | r8307 | |
| 461 | 464 | gk_switch[4] = input_port_read(machine, "GKSWITCH4"); |
| 462 | 465 | gk_switch[5] = input_port_read(machine, "GKSWITCH5"); |
| 463 | 466 | |
| 464 | | // Removes all card handlers |
| 465 | | ti99_peb_init(); |
| 466 | | |
| 467 | 467 | // set up optional expansion hardware |
| 468 | | ti99_peb_reset(FALSE, tms9901_set_int1, NULL); |
| 469 | | |
| 470 | 468 | if (has_speech) |
| 471 | 469 | { |
| 472 | 470 | static const spchroms_interface speech_intf = { region_speech_rom }; |
| r8306 | r8307 | |
| 1499 | 1497 | /* |
| 1500 | 1498 | set the state of int1 (called by the peb core) |
| 1501 | 1499 | */ |
| 1502 | | static void tms9901_set_int1(running_machine *machine, int state) |
| 1500 | void tms9901_set_int1(running_machine *machine, int state) |
| 1503 | 1501 | { |
| 1504 | 1502 | tms9901_set_single_int(devtag_get_device(machine, "tms9901"), 1, state); |
| 1505 | 1503 | } |
| r8306 | r8307 | |
| 1891 | 1889 | memory_install_read16_handler(space, 0xa000, 0xffff, 0, 0, ti99_sAMSxramhigh_r); |
| 1892 | 1890 | memory_install_write16_handler(space, 0xa000, 0xffff, 0, 0, ti99_sAMSxramhigh_w); |
| 1893 | 1891 | |
| 1894 | | ti99_peb_set_card_handlers(0x1e00, & sAMS_expansion_handlers); |
| 1892 | ti99_peb_set_card_handlers(expansion_box, 0x1e00, & sAMS_expansion_handlers); |
| 1895 | 1893 | |
| 1896 | 1894 | sAMS_mapper_on = 0; |
| 1897 | 1895 | |
| r8306 | r8307 | |
| 2021 | 2019 | { |
| 2022 | 2020 | case RAM_FOUNDATION128: /* 128kb foundation */ |
| 2023 | 2021 | case RAM_FOUNDATION512: /* 512kb foundation */ |
| 2024 | | ti99_peb_set_card_handlers(0x1e00, & myarc_expansion_handlers); |
| 2022 | ti99_peb_set_card_handlers(expansion_box, 0x1e00, & myarc_expansion_handlers); |
| 2025 | 2023 | break; |
| 2026 | 2024 | case RAM_MYARC128: /* 128kb myarc clone */ |
| 2027 | 2025 | case RAM_MYARC512: /* 512kb myarc clone */ |
| 2028 | | ti99_peb_set_card_handlers(0x1000, & myarc_expansion_handlers); |
| 2029 | | ti99_peb_set_card_handlers(0x1900, & myarc_expansion_handlers); |
| 2026 | ti99_peb_set_card_handlers(expansion_box, 0x1000, & myarc_expansion_handlers); |
| 2027 | ti99_peb_set_card_handlers(expansion_box, 0x1900, & myarc_expansion_handlers); |
| 2030 | 2028 | break; |
| 2031 | 2029 | default: |
| 2032 | 2030 | break; /* let's just keep GCC's big mouth shut */ |
| r8306 | r8307 | |
| 2255 | 2253 | static void ti99_evpc_reset(running_machine *machine) |
| 2256 | 2254 | { |
| 2257 | 2255 | ti99_evpc_DSR = memory_region(machine, region_dsr) + offset_evpc_dsr; |
| 2256 | running_device *box = devtag_get_device(machine, "per_exp_box"); |
| 2258 | 2257 | |
| 2259 | 2258 | RAMEN = 0; |
| 2260 | 2259 | evpc_dsr_page = 0; |
| 2261 | 2260 | |
| 2262 | | ti99_peb_set_card_handlers(0x1400, & evpc_handlers); |
| 2261 | ti99_peb_set_card_handlers(box, 0x1400, & evpc_handlers); |
| 2263 | 2262 | } |
| 2264 | 2263 | |
| 2265 | 2264 | /* |
| r8306 | r8307 | |
| 2509 | 2508 | console_GROMs.raddr_LSB = FALSE; |
| 2510 | 2509 | console_GROMs.waddr_LSB = FALSE; |
| 2511 | 2510 | |
| 2511 | expansion_box = devtag_get_device(machine, "per_exp_box"); |
| 2512 | |
| 2512 | 2513 | ti99_8_enable_rom_and_ports = 1; /* ??? maybe there is a pull-up */ |
| 2513 | 2514 | /* MZ: already setting this in driver init, otherwise machine locks up */ |
| 2514 | 2515 | |
| r8306 | r8307 | |
| 2542 | 2543 | gk_switch[5] = input_port_read(machine, "GKSWITCH5"); |
| 2543 | 2544 | |
| 2544 | 2545 | // Removes all card handlers |
| 2545 | | ti99_peb_init(); |
| 2546 | // ti99_peb_init(); |
| 2546 | 2547 | |
| 2547 | 2548 | // set up optional expansion hardware |
| 2548 | | ti99_peb_reset(FALSE, tms9901_set_int1, NULL); |
| 2549 | 2549 | |
| 2550 | 2550 | ti99_8_internal_dsr_reset(machine); |
| 2551 | 2551 | |
| r8306 | r8307 | |
| 2767 | 2767 | |
| 2768 | 2768 | case 2: |
| 2769 | 2769 | /* ff4000 - ff5fff: DSR space */ |
| 2770 | | reply = ti99_8_peb_r(space, offset & 0x1fff); |
| 2770 | reply = ti99_8_peb_r(expansion_box, offset & 0x1fff); |
| 2771 | 2771 | break; |
| 2772 | 2772 | |
| 2773 | 2773 | case 3: |
| r8306 | r8307 | |
| 2942 | 2942 | |
| 2943 | 2943 | case 2: |
| 2944 | 2944 | /* DSR space */ |
| 2945 | | ti99_8_peb_w(space, offset & 0x1fff, data); |
| 2945 | ti99_8_peb_w(expansion_box, offset & 0x1fff, data); |
| 2946 | 2946 | break; |
| 2947 | 2947 | |
| 2948 | 2948 | case 3: |
| r8306 | r8307 | |
| 3016 | 3016 | static void ti99_8_internal_dsr_reset(running_machine *machine) |
| 3017 | 3017 | { |
| 3018 | 3018 | ti99_8_internal_DSR = memory_region(machine, "maincpu") + offset_rom0_8 + 0x4000; |
| 3019 | | |
| 3020 | | ti99_peb_set_card_handlers(0x2700, & ti99_8_internal_dsr_handlers); |
| 3019 | ti99_peb_set_card_handlers(expansion_box, 0x2700, & ti99_8_internal_dsr_handlers); |
| 3021 | 3020 | } |
| 3022 | 3021 | |
| 3023 | 3022 | /* write CRU bit: |
| r8306 | r8307 | |
| 3188 | 3187 | |
| 3189 | 3188 | UINT8* mem = memory_region(machine, "maincpu"); |
| 3190 | 3189 | |
| 3190 | expansion_box = devtag_get_device(machine, "per_exp_box"); |
| 3191 | |
| 3191 | 3192 | /* set up system ROM and scratch pad pointers */ |
| 3192 | 3193 | memory_set_bankptr(machine, "bank1", mem + offset_rom0_4p); /* system ROM */ |
| 3193 | 3194 | memory_set_bankptr(machine, "bank2", mem + offset_sram_4p); /* scratch pad */ |
| r8306 | r8307 | |
| 3212 | 3213 | has_usb_sm = input_port_read(machine, "HDCTRL") & HD_USB; |
| 3213 | 3214 | has_pcode = input_port_read(machine, "EXTCARD") & EXT_PCODE; |
| 3214 | 3215 | |
| 3215 | | // Removes all card handlers |
| 3216 | | ti99_peb_init(); |
| 3217 | | |
| 3218 | 3216 | // set up optional expansion hardware |
| 3219 | | ti99_peb_reset(TRUE, tms9901_set_int1, NULL); |
| 3220 | | |
| 3221 | 3217 | ti99_4p_internal_dsr_reset(machine); |
| 3222 | 3218 | ti99_4p_mapper_init(machine); |
| 3223 | 3219 | ti99_hsgpl_reset(machine); |
| r8306 | r8307 | |
| 3281 | 3277 | int i; |
| 3282 | 3278 | char bank_name[10]; |
| 3283 | 3279 | /* Not required at run-time */ |
| 3284 | | ti99_peb_set_16bit_card_handlers(0x1e00, & ti99_4p_mapper_handlers); |
| 3280 | ti99_peb_set_16bit_card_handlers(expansion_box, 0x1e00, & ti99_4p_mapper_handlers); |
| 3285 | 3281 | |
| 3286 | 3282 | ti99_4p_mapper_on = 0; |
| 3287 | 3283 | |
| r8306 | r8307 | |
| 3403 | 3399 | rom6_bank_offset = offset_rom6_4p; |
| 3404 | 3400 | ti99_4p_mem = (UINT16 *)mem; |
| 3405 | 3401 | |
| 3406 | | ti99_peb_set_16bit_card_handlers(0x0f00, & ti99_4p_internal_dsr_handlers); |
| 3402 | ti99_peb_set_16bit_card_handlers(expansion_box, 0x0f00, &ti99_4p_internal_dsr_handlers); |
| 3407 | 3403 | |
| 3408 | 3404 | ti99_4p_internal_rom6_enable = 0; |
| 3409 | | ti99_4p_peb_set_senila(0); |
| 3410 | | ti99_4p_peb_set_senilb(0); |
| 3405 | ti99_4p_peb_set_senila(expansion_box, 0); |
| 3406 | ti99_4p_peb_set_senilb(expansion_box, 0); |
| 3411 | 3407 | } |
| 3412 | 3408 | |
| 3413 | 3409 | /* |
| r8306 | r8307 | |
| 3425 | 3421 | ti99_4p_internal_rom6_enable = data; |
| 3426 | 3422 | break; |
| 3427 | 3423 | case 2: |
| 3428 | | ti99_4p_peb_set_senila(data); |
| 3424 | ti99_4p_peb_set_senila(expansion_box, data); |
| 3429 | 3425 | break; |
| 3430 | 3426 | case 3: |
| 3431 | | ti99_4p_peb_set_senilb(data); |
| 3427 | ti99_4p_peb_set_senilb(expansion_box, data); |
| 3432 | 3428 | break; |
| 3433 | 3429 | case 4: |
| 3434 | 3430 | /* 0: 16-bit (fast) memory timings */ |
src/mess/drivers/ti99_4x.c
| r8306 | r8307 | |
| 29 | 29 | #include "machine/tms9901.h" |
| 30 | 30 | #include "machine/tms9902.h" |
| 31 | 31 | #include "audio/spchroms.h" |
| 32 | | #include "machine/99_peb.h" |
| 32 | #include "devices/ti99_peb.h" |
| 33 | 33 | #include "machine/994x_ser.h" |
| 34 | 34 | #include "machine/99_dsk.h" |
| 35 | 35 | #include "machine/99_ide.h" |
| r8306 | r8307 | |
| 54 | 54 | ADDRESS_MAP_GLOBAL_MASK(0xffff) |
| 55 | 55 | AM_RANGE(0x0000, 0x1fff) AM_ROM /*system ROM*/ |
| 56 | 56 | AM_RANGE(0x2000, 0x3fff) AM_READWRITE(ti99_nop_8_r, ti99_nop_8_w) /*lower 8kb of RAM extension - installed dynamically*/ |
| 57 | | AM_RANGE(0x4000, 0x5fff) AM_READWRITE(ti99_4x_peb_r, ti99_4x_peb_w) /*DSR ROM space*/ |
| 57 | AM_RANGE(0x4000, 0x5fff) AM_DEVREADWRITE("per_exp_box", ti99_4x_peb_r, ti99_4x_peb_w) /*DSR ROM space*/ |
| 58 | 58 | AM_RANGE(0x6000, 0x7fff) AM_READWRITE(ti99_cart_r, ti99_cart_w) /*cartridge memory*/ |
| 59 | 59 | // AM_RANGE(0x6000, 0x7fff) AM_DEVREADWRITE("ti99_multicart", ti99_multicart_r, ti99_multicart_w) |
| 60 | 60 | AM_RANGE(0x8000, 0x80ff) AM_MIRROR(0x0300) AM_RAMBANK("bank1") /*RAM PAD, mirrored 4 times*/ |
| r8306 | r8307 | |
| 72 | 72 | ADDRESS_MAP_GLOBAL_MASK(0xffff) |
| 73 | 73 | AM_RANGE(0x0000, 0x1fff) AM_ROM /*system ROM*/ |
| 74 | 74 | AM_RANGE(0x2000, 0x3fff) AM_READWRITE(ti99_nop_8_r, ti99_nop_8_w) /*lower 8kb of RAM extension - installed dynamically*/ |
| 75 | | AM_RANGE(0x4000, 0x5fff) AM_READWRITE(ti99_4x_peb_r, ti99_4x_peb_w) /*DSR ROM space*/ |
| 75 | AM_RANGE(0x4000, 0x5fff) AM_DEVREADWRITE("per_exp_box", ti99_4x_peb_r, ti99_4x_peb_w) /*DSR ROM space*/ |
| 76 | 76 | AM_RANGE(0x6000, 0x7fff) AM_READWRITE(ti99_cart_r, ti99_cart_w) /*cartridge memory*/ |
| 77 | 77 | // AM_RANGE(0x6000, 0x7fff) AM_DEVREADWRITE("ti99_multicart", ti99_multicart_r, ti99_multicart_w) |
| 78 | 78 | AM_RANGE(0x8000, 0x80ff) AM_MIRROR(0x0300) AM_RAMBANK("bank1") /*RAM PAD, mirrored 4 times*/ |
| r8306 | r8307 | |
| 93 | 93 | static ADDRESS_MAP_START(cru_map, ADDRESS_SPACE_IO, 8) |
| 94 | 94 | AM_RANGE(0x0000, 0x007f) AM_DEVREAD("tms9901", tms9901_cru_r) |
| 95 | 95 | AM_RANGE(0x0080, 0x00ff) AM_DEVREAD("ti99_multicart", ti99_multicart_cru_r) /* SuperSpace */ |
| 96 | | AM_RANGE(0x0100, 0x01ff) AM_READ(ti99_4x_peb_cru_r) |
| 96 | AM_RANGE(0x0100, 0x01ff) AM_DEVREAD("per_exp_box", ti99_4x_peb_cru_r) |
| 97 | 97 | |
| 98 | 98 | AM_RANGE(0x0000, 0x03ff) AM_DEVWRITE("tms9901", tms9901_cru_w) |
| 99 | 99 | AM_RANGE(0x0400, 0x07ff) AM_DEVWRITE("ti99_multicart", ti99_multicart_cru_w) /* SuperSpace */ |
| 100 | | AM_RANGE(0x0800, 0x0fff) AM_WRITE(ti99_4x_peb_cru_w) |
| 100 | AM_RANGE(0x0800, 0x0fff) AM_DEVWRITE("per_exp_box", ti99_4x_peb_cru_w) |
| 101 | 101 | ADDRESS_MAP_END |
| 102 | 102 | |
| 103 | 103 | /* |
| r8306 | r8307 | |
| 790 | 790 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 791 | 791 | |
| 792 | 792 | /* devices */ |
| 793 | MDRV_PBOX_ADD( "per_exp_box", FALSE, tms9901_set_int1, NULL ) |
| 794 | |
| 793 | 795 | // MDRV_IDE_CONTROLLER_ADD( "ide", ti99_ide_interrupt ) |
| 794 | 796 | // MDRV_RTC65271_ADD("ide_rtc", ti99_clk_interrupt_callback) |
| 795 | 797 | |
| r8306 | r8307 | |
| 847 | 849 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 848 | 850 | |
| 849 | 851 | /* devices */ |
| 852 | MDRV_PBOX_ADD( "per_exp_box", FALSE, tms9901_set_int1, NULL ) |
| 853 | |
| 850 | 854 | // MDRV_IDE_CONTROLLER_ADD( "ide", ti99_ide_interrupt |
| 851 | 855 | // MDRV_RTC65271_ADD("ide_rtc", ti99_clk_interrupt_callback) |
| 852 | 856 | |
| r8306 | r8307 | |
| 904 | 908 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 905 | 909 | |
| 906 | 910 | /* devices */ |
| 911 | MDRV_PBOX_ADD( "per_exp_box", FALSE, tms9901_set_int1, NULL ) |
| 912 | |
| 907 | 913 | // MDRV_IDE_CONTROLLER_ADD( "ide", ti99_ide_interrupt ) |
| 908 | 914 | // MDRV_RTC65271_ADD("ide_rtc", ti99_clk_interrupt_callback) |
| 909 | 915 | |
| r8306 | r8307 | |
| 963 | 969 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 964 | 970 | |
| 965 | 971 | /* devices */ |
| 972 | MDRV_PBOX_ADD( "per_exp_box", FALSE, tms9901_set_int1, NULL ) |
| 973 | |
| 966 | 974 | // MDRV_IDE_CONTROLLER_ADD( "ide", ti99_ide_interrupt ) |
| 967 | 975 | // MDRV_RTC65271_ADD("ide_rtc", ti99_clk_interrupt_callback) */ |
| 968 | 976 | |
| r8306 | r8307 | |
| 1031 | 1039 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) |
| 1032 | 1040 | |
| 1033 | 1041 | /* devices */ |
| 1042 | MDRV_PBOX_ADD( "per_exp_box", FALSE, tms9901_set_int1, NULL ) |
| 1043 | |
| 1034 | 1044 | // MDRV_IDE_CONTROLLER_ADD( "ide", ti99_ide_interrupt ) |
| 1035 | 1045 | // MDRV_RTC65271_ADD("ide_rtc", ti99_clk_interrupt_callback) */ |
| 1036 | 1046 | |