Previous 15994 Revisions Next

r9137 Wednesday 15th September, 2010 at 07:29:24 UTC by Curt Coder
[CONKORT] Renamed to abc830.c and separated into devices.
[src/mess]mess.mak
[src/mess/drivers]abc80.c abc80x.c
[src/mess/machine]abc830.c* abc830.h* conkort.c conkort.h

src/mess/machine/conkort.c
r9136r9137
1/*
2
3Luxor Conkort
4
5PCB Layout
6----------
7
855 10900-01
9
10|-----------------------------------|
11|   LD1 SW1 LS132       CON2        |
12|                               S   |
13|   4MHz        S240    N8T97N      |
14|   S                               |
15|   7404            MC1458  4024    |
16|       S                           |
17|   74276   S                       |
18|           S   S                   |
19|   LS32    S   ULA         LS273   |
20|                                   |
21|                                   |
22|       MB8876          ROM         |
23|                                   |
24|                                   |
25|   S   LS32    LS156       TC5514  |
26|                                   |
27|                           TC5514  |
28|       Z80                         |
29|                           LS273   |
30|                                   |
31|                           LS373   |
32|       Z80PIO                      |
33|                           LS245   |
34|   S1                              |
35|   LS125   LS124     S20   DM8131  |
36|                                   |
37|--|-----------------------------|--|
38   |------------CON1-------------|
39
40Notes:
41    All IC's shown.
42
43    ROM     - Hitachi HN462716 2Kx8 EPROM "MPT02"
44    Z80     - Sharp LH0080A Z80A CPU
45    Z80PIO  - SGS Z8420AB1 Z80A PIO
46    MB8876  - Mitsubishi MB8876 Floppy Disc Controller (FD1791 compatible)
47    TC5514  - Toshiba TC5514AP-2 1Kx4 bit Static RAM
48    DM8131  - National Semiconductor DM8131N 6-Bit Unified Bus Comparator
49    ULA     - Ferranti ULA 2C140E "copy protection device"
50    N8T97N  - SA N8T97N ?
51    CON1    - ABC bus connector
52    CON2    - 25-pin D sub floppy connector (AMP4284)
53    SW1     - Disk drive type (SS/DS, SD/DD)
54    S1      - ABC bus card address bit 0
55    S2      -
56    S3      -
57    S4      -
58    S5      -
59    S6      -
60    S7      -
61    S8      -
62    S9      -
63    LD1     - LED
64
65PCB Layout
66----------
67
6855 11046-03
69
70|-----------------------------------|
71|   LD1 SW1             CON2        |
72|                                   |
73|                       CON3    S8  |
74|                               S9  |
75|   LS240   LS174   7406    7406    |
76|                                   |
77|   LS174   FDC9229 LS107   LS266   |
78|                                   |
79|                                   |
80|       SAB1793                     |
81|                   LS368   16MHz   |
82|                   S6              |
83|       Z80DMA          ROM         |
84|                                   |
85|                                   |
86|       Z80             TC5565      |
87|                                   |
88|                                   |
89|   LS138   LS174   SW2     74374   |
90|                                   |
91|   LS10    LS266   S5      LS374   |
92|                   S3              |
93|                   S1      LS240   |
94|                                   |
95|           LS244   SW3     DM8131  |
96|                                   |
97|                                   |
98|--|-----------------------------|--|
99   |------------CON1-------------|
100
101Notes:
102    All IC's shown.
103
104    ROM     - Toshiba TMM27128D-20 16Kx8 EPROM "CNTR 1.07 6490318-07"
105    TC5565  - Toshiba TC5565PL-15 8Kx8 bit Static RAM
106    Z80     - Zilog Z8400APS Z80A CPU
107    Z80DMA  - Zilog Z8410APS Z80A DMA
108    SAB1793 - Siemens SAB1793-02P Floppy Disc Controller
109    FDC9229 - SMC FDC9229BT Floppy Disc Interface Circuit
110    DM8131  - National Semiconductor DM8131N 6-Bit Unified Bus Comparator
111    CON1    - ABC bus connector
112    CON2    - 25-pin D sub floppy connector (AMP4284)
113    CON3    - 34-pin header floppy connector (Shugart pinout)
114    SW1     - Disk drive type (SS/DS, SD/DD)
115    SW2     - Disk drive model
116    SW3     - ABC bus address
117    S1      - Interface type (A:? B:ABCBUS)
118    S3      - Interface type (A:? B:ABCBUS)
119    S5      - Interface type (A:? B:ABCBUS)
120    S6      - Amount of RAM installed (A:2KB, B:8KB)
121    S7      - Number of drives connected (0:3, 1:2) *located on solder side
122    S8      - Disk drive type (0:8", 1:5.25")
123    S9      - Location of RDY signal (A:8" P2-6, B:5.25" P2-34)
124    LD1     - LED
125
126CON2 Pinout
127-----------
128
129   1      SIDE SEL
130   2      WRITE PROTECT
131   3      GND
132   4      GND
133   5      GND
134   6      GND
135   7      GND
136   8      GND
137   9      GND
138   10      SEL 0
139   11      GND
140   12      TG43
141   13      TWOSID
142   14      READ DATA
143   15      TRACK 00
144   16      WRITE GATE
145   17      WRITE DATA
146   18      STEP
147   19      DIRECTION
148   20      MOTOR ON
149   21     
150   22      SEL 1
151   23      INDEX PULSE
152   24      READY
153   25      HEAD LOAD
154
155*/
156
157/*
158
159    TODO:
160
161    Slow Controller
162    ---------------
163
164    - Z80 IN instruction needs to halt in mid air for this controller to ever work (the first data byte of disk sector is read too early)
165
166        wd17xx_command_w $88 READ_SEC
167        wd17xx_data_r: (no new data) $00 (data_count 0)
168        WAIT
169        wd179x: Read Sector callback.
170        sector found! C:$00 H:$00 R:$0b N:$01
171        wd17xx_data_r: $FF (data_count 256)
172        WAIT
173
174    - copy protection device (sends sector header bytes to CPU? DDEN is serial clock? code checks for either $b6 or $f7)
175
176        06F8: ld   a,$2F                    ; SEEK
177        06FA: out  ($BC),a
178        06FC: push af
179        06FD: push bc
180        06FE: ld   bc,$0724
181        0701: push bc
182        0702: ld   b,$07
183        0704: rr   a
184        0706: call $073F
185        073F: DB 7E         in   a,($7E)    ; PIO PORT B
186        0741: EE 08         xor  $08        ; DDEN
187        0743: D3 7E         out  ($7E),a
188        0745: EE 08         xor  $08
189        0747: D3 7E         out  ($7E),a
190        0749: DB 7E         in   a,($7E)
191        074B: 1F            rra
192        074C: 1F            rra
193        074D: 1F            rra
194        074E: CB 11         rl   c
195        0750: 79            ld   a,c
196        0751: C9            ret
197        0709: djnz $0703            <-- jumps to middle of instruction!
198        0703: rlca
199        0704: rr   a
200        0706: call $073F
201
202    - S2-S5 jumpers
203   - ABC80 ERR 48 on boot
204   - side select makes controller go crazy and try to WRITE_TRK
205
206    Fast Controller
207    ---------------
208   - controller reads a couple of sectors on boot, bails out, and starts to STEP_OUT ad infinitum
209   - Z80 DMA reset command is broken (it keeps resetting A/B port addresses)
210   - 2KB RAM option
211   - some SW2 options make controller try to WRITE_TRK
212   - 640KB disks have 7:1 sector interleave (physical sector numbering 1,8,F,6,D,4,B,2,9,10,7,E,5,C,3,A)
213   - ABC830 mode double steps the head
214
215      wd17xx_command_w $59 STEP_IN
216      wd17xx_command_w $49 STEP_IN
217      wd17xx_set_drive: $00
218      wd17xx_sector_w $01
219      wd17xx_command_w $88 READ_SEC
220      cmd=03, trk=01, sec=01, dat=0A
221      wd179x: Read Sector callback.
222      track 1 sector 1 not found!
223
224*/
225
226#include "emu.h"
227#include "conkort.h"
228#include "machine/z80dma.h"
229#include "machine/z80pio.h"
230#include "cpu/z80/z80.h"
231#include "cpu/z80/z80daisy.h"
232#include "machine/wd17xx.h"
233#include "machine/abcbus.h"
234#include "devices/flopdrv.h"
235#include "formats/flopimg.h"
236#include "formats/basicdsk.h"
237
238/***************************************************************************
239    PARAMETERS
240***************************************************************************/
241
242#define Z80_TAG      "5a"
243#define Z80PIO_TAG   "3a"
244#define FD1791_TAG   "7a"
245
246//#define Z80_TAG   "5ab"
247#define Z80DMA_TAG   "6ab"
248#define SAB1793_TAG   "7ab"
249#define FDC9229_TAG   "8b"
250
251/***************************************************************************
252    TYPE DEFINITIONS
253***************************************************************************/
254
255typedef struct _slow_t slow_t;
256struct _slow_t
257{
258   int cs;               /* card selected */
259   UINT8 status;         /* ABC BUS status */
260   UINT8 data;            /* ABC BUS data */
261   int fdc_irq;         /* floppy interrupt */
262   int fdc_drq;         /* floppy data request */
263   int wait_enable;      /* wait enable */
264   int sel0;            /* drive select 0 */
265   int sel1;            /* drive select 1 */
266
267   /* devices */
268   running_device *bus;
269   running_device *cpu;
270   running_device *z80pio;
271   running_device *fd1791;
272   running_device *image0;
273   running_device *image1;
274};
275
276typedef struct _fast_t fast_t;
277struct _fast_t
278{
279   int cs;               /* card selected */
280   UINT8 status;         /* ABC BUS status */
281   UINT8 data_in;         /* ABC BUS data in */
282   UINT8 data_out;         /* ABC BUS data out */
283   int fdc_irq;         /* FDC interrupt */
284   int dma_irq;         /* DMA interrupt */
285   int busy;            /* busy bit */
286
287   /* devices */
288   running_device *bus;
289   running_device *cpu;
290   running_device *z80dma;
291   running_device *wd1793;
292   running_device *image0;
293   running_device *image1;
294};
295
296/***************************************************************************
297    INLINE FUNCTIONS
298***************************************************************************/
299
300INLINE slow_t *get_safe_token_slow(running_device *device)
301{
302   assert(device != NULL);
303   assert(device->type() == LUXOR_55_10828);
304   return (slow_t *)downcast<legacy_device_base *>(device)->token();
305}
306
307INLINE fast_t *get_safe_token_fast(running_device *device)
308{
309   assert(device != NULL);
310   assert(device->type() == LUXOR_55_21046);
311   return (fast_t *)downcast<legacy_device_base *>(device)->token();
312}
313
314INLINE conkort_config *get_safe_config(running_device *device)
315{
316   assert(device != NULL);
317   assert((device->type() == LUXOR_55_10828) || (device->type() == LUXOR_55_21046));
318   return (conkort_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
319}
320
321/***************************************************************************
322    IMPLEMENTATION
323***************************************************************************/
324
325/* Slow Controller */
326
327WRITE8_DEVICE_HANDLER( luxor_55_10828_cs_w )
328{
329   slow_t *conkort = get_safe_token_slow(device);
330   UINT8 address = 0x2c | BIT(input_port_read(device->machine, "luxor_55_10828:S1"), 0);
331
332   conkort->cs = (data == address);
333}
334
335READ8_DEVICE_HANDLER( luxor_55_10828_inp_r )
336{
337   slow_t *conkort = get_safe_token_slow(device);
338   UINT8 data = 0xff;
339
340   if (conkort->cs)
341   {
342      if (!BIT(conkort->status, 6))
343      {
344         data = conkort->data;
345      }
346
347      z80pio_astb_w(conkort->z80pio, 0);
348      z80pio_astb_w(conkort->z80pio, 1);
349   }
350
351   return data;
352}
353
354WRITE8_DEVICE_HANDLER( luxor_55_10828_utp_w )
355{
356   slow_t *conkort = get_safe_token_slow(device);
357
358   if (!conkort->cs) return;
359
360   if (BIT(conkort->status, 6))
361   {
362      conkort->data = data;
363   }
364
365   z80pio_astb_w(conkort->z80pio, 0);
366   z80pio_astb_w(conkort->z80pio, 1);
367}
368
369READ8_DEVICE_HANDLER( luxor_55_10828_stat_r )
370{
371   slow_t *conkort = get_safe_token_slow(device);
372   UINT8 data = 0xff;
373
374   if (conkort->cs)
375   {
376      data = (conkort->status & 0xfe) | z80pio_ardy_r(conkort->z80pio);
377   }
378
379   return data;
380}
381
382WRITE8_DEVICE_HANDLER( luxor_55_10828_c1_w )
383{
384   slow_t *conkort = get_safe_token_slow(device);
385
386   if (conkort->cs)
387   {
388      cpu_set_input_line(conkort->cpu, INPUT_LINE_NMI, ASSERT_LINE);
389      cpu_set_input_line(conkort->cpu, INPUT_LINE_NMI, CLEAR_LINE);
390   }
391}
392
393WRITE8_DEVICE_HANDLER( luxor_55_10828_c3_w )
394{
395   slow_t *conkort = get_safe_token_slow(device);
396
397   if (conkort->cs)
398   {
399      cpu_set_input_line(conkort->cpu, INPUT_LINE_RESET, PULSE_LINE);
400   }
401}
402
403WRITE_LINE_DEVICE_HANDLER( luxor_55_10828_rst_w )
404{
405   if (!state)
406   {
407      device->reset();
408   }
409}
410
411static WRITE8_DEVICE_HANDLER( slow_ctrl_w )
412{
413   /*
414
415        bit     signal          description
416
417        0       SEL 0
418        1       SEL 1
419        2       SEL 2
420        3       _MOT ON
421        4       SIDE
422        5       _PRECOMP ON
423        6       _WAIT ENABLE
424        7       FDC _MR
425
426    */
427
428   slow_t *conkort = get_safe_token_slow(device->owner());
429
430   /* drive selection */
431   if (BIT(data, 0)) wd17xx_set_drive(device, 0);
432   if (BIT(data, 1)) wd17xx_set_drive(device, 1);
433//  if (BIT(data, 2)) wd17xx_set_drive(device, 2);
434   conkort->sel0 = BIT(data, 0);
435   conkort->sel1 = BIT(data, 1);
436
437   /* motor enable */
438   int mtron = BIT(data, 3);
439   floppy_mon_w(conkort->image0, mtron);
440   floppy_mon_w(conkort->image1, mtron);
441   floppy_drive_set_ready_state(conkort->image0, !mtron, 1);
442   floppy_drive_set_ready_state(conkort->image1, !mtron, 1);
443
444   /* disk side selection */
445   //wd17xx_set_side(device, BIT(data, 4));
446
447   /* wait enable */
448   conkort->wait_enable = BIT(data, 6);
449
450   /* FDC master reset */
451   wd17xx_mr_w(device, BIT(data, 7));
452}
453
454static WRITE8_DEVICE_HANDLER( slow_status_w )
455{
456   /*
457
458        bit     description
459
460        0       _INT to main Z80
461        1
462        2
463        3
464        4
465        5
466        6       LS245 DIR
467        7
468
469    */
470
471   slow_t *conkort = get_safe_token_slow(device->owner());
472
473   /* interrupt */
474//   abcbus_int_w(conkort->bus, BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE);
475
476   conkort->status = data & 0xfe;
477}
478
479static READ8_DEVICE_HANDLER( slow_fdc_r )
480{
481   slow_t *conkort = get_safe_token_slow(device->owner());
482   UINT8 data = 0;
483
484   if (!conkort->wait_enable && !conkort->fdc_irq && !conkort->fdc_drq)
485   {
486      /* TODO: this is really connected to the Z80 WAIT line */
487      cpu_set_input_line(conkort->cpu, INPUT_LINE_HALT, ASSERT_LINE);
488   }
489
490   switch (offset & 0x03)
491   {
492   case 0: data = wd17xx_status_r(device, 0); break;
493   case 1: data = wd17xx_track_r(device, 0); break;
494   case 2: data = wd17xx_sector_r(device, 0); break;
495   case 3: data = wd17xx_data_r(device, 0); break;
496   }
497
498   /* FD1791 has inverted data lines */
499   return data ^ 0xff;
500}
501
502static WRITE8_DEVICE_HANDLER( slow_fdc_w )
503{
504   slow_t *conkort = get_safe_token_slow(device->owner());
505
506   if (!conkort->wait_enable && !conkort->fdc_irq && !conkort->fdc_drq)
507   {
508      logerror("WAIT\n");
509      /* TODO: this is really connected to the Z80 WAIT line */
510      cpu_set_input_line(conkort->cpu, INPUT_LINE_HALT, ASSERT_LINE);
511   }
512
513   /* FD1791 has inverted data lines */
514   data ^= 0xff;
515
516   switch (offset & 0x03)
517   {
518   case 0: wd17xx_command_w(device, 0, data); break;
519   case 1: wd17xx_track_w(device, 0, data); break;
520   case 2: wd17xx_sector_w(device, 0, data); break;
521   case 3: wd17xx_data_w(device, 0, data); break;
522   }
523}
524
525/* Fast Controller */
526
527WRITE8_DEVICE_HANDLER( luxor_55_21046_cs_w )
528{
529   fast_t *conkort = get_safe_token_fast(device);
530
531   conkort->cs = (data == input_port_read(device->machine, "luxor_55_21046:SW3"));
532}
533
534READ8_DEVICE_HANDLER( luxor_55_21046_stat_r )
535{
536   fast_t *conkort = get_safe_token_fast(device);
537
538   UINT8 data = 0;
539
540   if (conkort->cs)
541   {
542      data = (conkort->status & 0xce) | conkort->busy;
543   }
544
545   // LS240 inverts the data
546   return data ^ 0xff;
547}
548
549READ8_DEVICE_HANDLER( luxor_55_21046_inp_r )
550{
551   fast_t *conkort = get_safe_token_fast(device);
552
553   UINT8 data = 0xff;
554
555   if (conkort->cs)
556   {
557      data = conkort->data_out;
558      conkort->busy = 1;
559   }
560
561   return data;
562}
563
564WRITE8_DEVICE_HANDLER( luxor_55_21046_utp_w )
565{
566   fast_t *conkort = get_safe_token_fast(device);
567
568   if (conkort->cs)
569   {
570      conkort->data_in = data;
571      conkort->busy = 1;
572   }
573}
574
575WRITE8_DEVICE_HANDLER( luxor_55_21046_c1_w )
576{
577   fast_t *conkort = get_safe_token_fast(device);
578
579   if (conkort->cs)
580   {
581      cpu_set_input_line(conkort->cpu, INPUT_LINE_NMI, ASSERT_LINE);
582      cpu_set_input_line(conkort->cpu, INPUT_LINE_NMI, CLEAR_LINE);
583   }
584}
585
586WRITE8_DEVICE_HANDLER( luxor_55_21046_c3_w )
587{
588   fast_t *conkort = get_safe_token_fast(device);
589
590   if (conkort->cs)
591   {
592      cpu_set_input_line(conkort->cpu, INPUT_LINE_RESET, ASSERT_LINE);
593      cpu_set_input_line(conkort->cpu, INPUT_LINE_RESET, CLEAR_LINE);
594   }
595}
596
597WRITE_LINE_DEVICE_HANDLER( luxor_55_21046_rst_w )
598{
599   if (!state)
600   {
601      device->reset();
602   }
603}
604
605static READ8_DEVICE_HANDLER( fast_3d_r )
606{
607   fast_t *conkort = get_safe_token_fast(device->owner());
608
609   if (BIT(conkort->status, 0))
610   {
611      conkort->busy = 0;
612   }
613
614   return conkort->data_in;
615}
616
617static WRITE8_DEVICE_HANDLER( fast_4d_w )
618{
619   fast_t *conkort = get_safe_token_fast(device->owner());
620   
621   if (BIT(conkort->status, 0))
622   {
623      conkort->busy = 0;
624   }
625
626   conkort->data_out = data;
627}
628
629static WRITE8_DEVICE_HANDLER( fast_4b_w )
630{
631   /*
632
633      bit      description
634
635      0      force busy
636      1     
637      2     
638      3     
639      4      N/C
640      5      N/C
641      6     
642      7     
643
644   */
645
646   fast_t *conkort = get_safe_token_fast(device->owner());
647
648   conkort->status = data;
649
650   /* busy */
651   if (!BIT(conkort->status, 0))
652   {
653      conkort->busy = 1;
654   }
655}
656
657static WRITE8_DEVICE_HANDLER( fast_9b_w )
658{
659   /*
660
661      bit      description
662
663      0      DS0
664      1      DS1
665      2      DS2
666      3      MTRON
667      4      TG43 (8" only)
668      5      SIDE1
669      6
670      7
671
672   */
673
674   fast_t *conkort = get_safe_token_fast(device->owner());
675
676   /* drive select */
677   if (BIT(data, 0)) wd17xx_set_drive(device, 0);
678   if (BIT(data, 1)) wd17xx_set_drive(device, 1);
679   //if (BIT(data, 2)) wd17xx_set_drive(device, 2);
680
681   /* motor enable */
682   int mtron = BIT(data, 3);
683   floppy_mon_w(conkort->image0, !mtron);
684   floppy_mon_w(conkort->image1, !mtron);
685   floppy_drive_set_ready_state(conkort->image0, mtron, 1);
686   floppy_drive_set_ready_state(conkort->image1, mtron, 1);
687
688   /* side select */
689   wd17xx_set_side(device, BIT(data, 5));
690}
691
692static WRITE8_DEVICE_HANDLER( fast_8a_w )
693{
694   /*
695
696      bit      description
697
698      0      FD1793 _MR
699      1      FD1793 _DDEN, FDC9229 DENS
700      2      FDC9229 MINI
701      3      READY signal polarity (0=inverted)
702      4      FDC9229 P2
703      5      FDC9229 P1
704      6
705      7
706
707      FDC9229 P0 is grounded
708
709   */
710
711   /* master reset */
712   wd17xx_mr_w(device, BIT(data, 0));
713
714   /* density select */
715   wd17xx_dden_w(device, BIT(data, 1));
716}
717
718static READ8_DEVICE_HANDLER( fast_9a_r )
719{
720   /*
721
722      bit      description
723
724      0      busy
725      1      TWOSID
726      2      SW2
727      3      DSKCHG ?
728      4      SW1-1
729      5      SW1-2
730      6      SW1-3
731      7      SW1-4
732
733   */
734
735   fast_t *conkort = get_safe_token_fast(device->owner());
736
737   UINT8 data = 0;
738
739   /* busy */
740   data |= conkort->busy;
741
742   /* SW1 */
743   UINT8 sw1 = input_port_read(device->machine, "luxor_55_21046:SW1") & 0x0f;
744
745   data |= sw1 << 4;
746
747   /* SW2 */
748   UINT8 sw2 = input_port_read(device->machine, "luxor_55_21046:SW2") & 0x0f;
749
750   int sw2_1 = BIT(offset, 8) & BIT(sw2, 0);
751   int sw2_2 = BIT(offset, 9) & BIT(sw2, 1);
752   int sw2_3 = BIT(offset, 10) & BIT(sw2, 2);
753   int sw2_4 = BIT(offset, 11) & BIT(sw2, 3);
754   int sw2_data = !(sw2_1 & sw2_2 & !(sw2_3 ^ sw2_4));
755   
756   data |= sw2_data << 2;
757
758   return data ^ 0xff;
759}
760
761/* Memory Maps */
762
763// Slow Controller
764
765static ADDRESS_MAP_START( slow_map, ADDRESS_SPACE_PROGRAM, 8 )
766   ADDRESS_MAP_GLOBAL_MASK(0x1fff)
767   AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x0800) AM_ROM AM_REGION("luxor_55_10828:abc830", 0)
768   AM_RANGE(0x1000, 0x13ff) AM_MIRROR(0x0c00) AM_RAM
769ADDRESS_MAP_END
770
771static ADDRESS_MAP_START( slow_io_map, ADDRESS_SPACE_IO, 8 )
772   ADDRESS_MAP_GLOBAL_MASK(0xff)
773   AM_RANGE(0x70, 0x73) AM_MIRROR(0x0c) AM_DEVREADWRITE(Z80PIO_TAG, z80pio_ba_cd_r, z80pio_ba_cd_w)
774   AM_RANGE(0xb0, 0xb3) AM_MIRROR(0x0c) AM_DEVREADWRITE(FD1791_TAG, slow_fdc_r, slow_fdc_w)
775   AM_RANGE(0xd0, 0xd0) AM_MIRROR(0x0f) AM_DEVWRITE(FD1791_TAG, slow_status_w)
776   AM_RANGE(0xe0, 0xe0) AM_MIRROR(0x0f) AM_DEVWRITE(FD1791_TAG, slow_ctrl_w)
777ADDRESS_MAP_END
778
779// Fast Controller
780
781static ADDRESS_MAP_START( fast_map, ADDRESS_SPACE_PROGRAM, 8 )
782   ADDRESS_MAP_UNMAP_HIGH
783   ADDRESS_MAP_GLOBAL_MASK(0x3fff)
784   AM_RANGE(0x0000, 0x1fff) AM_ROM AM_REGION("luxor_55_21046:conkort", 0x2000)
785   AM_RANGE(0x2000, 0x3fff) AM_RAM
786ADDRESS_MAP_END
787
788static ADDRESS_MAP_START( fast_io_map, ADDRESS_SPACE_IO, 8 )
789   ADDRESS_MAP_UNMAP_HIGH
790   AM_RANGE(0x00, 0x00) AM_MIRROR(0xff0f) AM_DEVREAD(SAB1793_TAG, fast_3d_r)
791   AM_RANGE(0x10, 0x10) AM_MIRROR(0xff0f) AM_DEVWRITE(SAB1793_TAG, fast_4d_w)
792   AM_RANGE(0x20, 0x20) AM_MIRROR(0xff0f) AM_DEVWRITE(SAB1793_TAG, fast_4b_w)
793   AM_RANGE(0x30, 0x30) AM_MIRROR(0xff0f) AM_DEVWRITE(SAB1793_TAG, fast_9b_w)
794   AM_RANGE(0x40, 0x40) AM_MIRROR(0xff0f) AM_DEVWRITE(SAB1793_TAG, fast_8a_w)
795   AM_RANGE(0x50, 0x50) AM_MIRROR(0xff0f) AM_MASK(0xff00) AM_DEVREAD(SAB1793_TAG, fast_9a_r)
796   AM_RANGE(0x60, 0x63) AM_MIRROR(0xff0c) AM_DEVREAD(SAB1793_TAG, wd17xx_r)
797   AM_RANGE(0x70, 0x73) AM_MIRROR(0xff0c) AM_DEVWRITE(SAB1793_TAG, wd17xx_w)
798   AM_RANGE(0x80, 0x80) AM_MIRROR(0xff0f) AM_DEVREADWRITE(Z80DMA_TAG, z80dma_r, z80dma_w)
799ADDRESS_MAP_END
800
801/* Input Ports */
802
803INPUT_PORTS_START( luxor_55_10828 )
804   PORT_START("luxor_55_10828:SW1")
805   PORT_DIPNAME( 0x01, 0x01, "Drive 0 Sided" ) PORT_DIPLOCATION("SW1:1")
806   PORT_DIPSETTING(    0x01, DEF_STR( Single ) )
807   PORT_DIPSETTING(    0x00, "Double" )
808   PORT_DIPNAME( 0x02, 0x02, "Drive 1 Sided" ) PORT_DIPLOCATION("SW1:2")
809   PORT_DIPSETTING(    0x02, DEF_STR( Single ) )
810   PORT_DIPSETTING(    0x00, "Double" )
811   PORT_DIPNAME( 0x04, 0x00, "Drive 0 Density" ) PORT_DIPLOCATION("SW1:3")
812   PORT_DIPSETTING(    0x04, DEF_STR( Single ) )
813   PORT_DIPSETTING(    0x00, "Double" )
814   PORT_DIPNAME( 0x08, 0x00, "Drive 1 Density" ) PORT_DIPLOCATION("SW1:4")
815   PORT_DIPSETTING(    0x08, DEF_STR( Single ) )
816   PORT_DIPSETTING(    0x00, "Double" )
817
818   PORT_START("luxor_55_10828:S1")
819   PORT_DIPNAME( 0x01, 0x01, "Card Address" ) PORT_DIPLOCATION("S1:1")
820   PORT_DIPSETTING(    0x00, "44" )
821   PORT_DIPSETTING(    0x01, "45" )
822INPUT_PORTS_END
823
824INPUT_PORTS_START( luxor_55_21046 )
825   PORT_START("luxor_55_21046:SW1")
826   // ABC 838
827   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:1,2,3,4") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
828   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
829   // ABC 830
830   PORT_DIPNAME( 0x01, 0x00, "Drive 0 Sided" ) PORT_DIPLOCATION("SW1:1") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
831   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
832   PORT_DIPSETTING(    0x01, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
833   PORT_DIPNAME( 0x02, 0x00, "Drive 1 Sided" ) PORT_DIPLOCATION("SW1:2") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
834   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
835   PORT_DIPSETTING(    0x02, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
836   PORT_DIPNAME( 0x04, 0x00, "Drive 0 Density" ) PORT_DIPLOCATION("SW1:3") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
837   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
838   PORT_DIPSETTING(    0x04, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
839   PORT_DIPNAME( 0x08, 0x00, "Drive 1 Density" ) PORT_DIPLOCATION("SW1:4") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
840   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
841   PORT_DIPSETTING(    0x08, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
842   // ABC 832/834/850
843   PORT_DIPNAME( 0x01, 0x01, "Drive 0 Sided" ) PORT_DIPLOCATION("SW1:1") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
844   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
845   PORT_DIPSETTING(    0x01, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
846   PORT_DIPNAME( 0x02, 0x02, "Drive 1 Sided" ) PORT_DIPLOCATION("SW1:2") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
847   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
848   PORT_DIPSETTING(    0x02, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
849   PORT_DIPNAME( 0x04, 0x00, "Drive 0 Tracks" ) PORT_DIPLOCATION("SW1:3") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
850   PORT_DIPSETTING(    0x00, "80" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
851   PORT_DIPSETTING(    0x04, "40" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
852   PORT_DIPNAME( 0x08, 0x00, "Drive 1 Tracks" ) PORT_DIPLOCATION("SW1:4") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
853   PORT_DIPSETTING(    0x00, "80" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
854   PORT_DIPSETTING(    0x08, "40" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
855
856   PORT_START("luxor_55_21046:SW2")
857   PORT_DIPNAME( 0x0f, 0x0b, "Drive Type" ) PORT_DIPLOCATION("SW2:1,2,3,4")
858   PORT_DIPSETTING(    0x0e, "TEAC FD55F (ABC 834)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 230 7802-01
859   PORT_DIPSETTING(    0x0d, "BASF 6138 (ABC 850)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 230 8440-15
860   PORT_DIPSETTING(    0x0c, "Micropolis 1015F (ABC 832)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 190 9711-15
861   PORT_DIPSETTING(    0x0b, "BASF 6118 (ABC 832)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 190 9711-16
862   PORT_DIPSETTING(    0x0a, "Micropolis 1115F (ABC 832)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 190 9711-17
863   PORT_DIPSETTING(    0x07, "BASF 6106/08 (ABC 830)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d) // 190 9206-16
864   PORT_DIPSETTING(    0x06, "MPI 51 (ABC 830)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d) // 190 9206-16
865   PORT_DIPSETTING(    0x01, "BASF 6105 (ABC 838)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
866   PORT_DIPSETTING(    0x00, "BASF 6106 (ABC 838)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2e) // 230 8838-15
867   
868   PORT_START("luxor_55_21046:SW3")
869   PORT_DIPNAME( 0x7f, 0x2c, "Card Address" ) PORT_DIPLOCATION("SW3:1,2,3,4,5,6,7")
870   PORT_DIPSETTING(    0x2c, "44 (ABC 832/834/850)" )
871   PORT_DIPSETTING(    0x2d, "45 (ABC 830)" )
872   PORT_DIPSETTING(    0x2e, "46 (ABC 838)" )
873
874   PORT_START("luxor_55_21046:S6")
875   PORT_DIPNAME( 0x01, 0x01, "RAM Size" ) PORT_DIPLOCATION("S6:1")
876   PORT_DIPSETTING(    0x00, "2 KB" )
877   PORT_DIPSETTING(    0x01, "8 KB" )
878
879   PORT_START("luxor_55_21046:S8")
880   PORT_DIPNAME( 0x01, 0x01, "Drive Type" ) PORT_DIPLOCATION("S8:1")
881   PORT_DIPSETTING(    0x00, "8\"" )
882   PORT_DIPSETTING(    0x01, "5.25\"" )
883
884   PORT_START("luxor_55_21046:S9")
885   PORT_DIPNAME( 0x01, 0x01, "RDY Pin" ) PORT_DIPLOCATION("S9:1")
886   PORT_DIPSETTING(    0x00, "P2-6 (8\")" )
887   PORT_DIPSETTING(    0x01, "P2-34 (5.25\")" )
888INPUT_PORTS_END
889
890/* Z80 PIO */
891
892static READ8_DEVICE_HANDLER( pio_pa_r )
893{
894   slow_t *conkort = get_safe_token_slow(device->owner());
895
896   return conkort->data;
897}
898
899static WRITE8_DEVICE_HANDLER( pio_pa_w )
900{
901   slow_t *conkort = get_safe_token_slow(device->owner());
902
903   conkort->data = data;
904}
905
906static READ8_DEVICE_HANDLER( pio_pb_r )
907{
908   /*
909
910        bit     description
911
912        0       !(_DS0 & _DS1)  single/double sided (0=SS, 1=DS)
913        1       !(_DD0 & _DD1)  single/double density (0=DS, 1=DD)
914        2       8B pin 10
915        3       FDC _DDEN       double density enable
916        4       _R/BS           radial/binary drive select
917        5       FDC HLT         head load timing
918        6       FDC _HDLD       head load
919        7       FDC IRQ         interrupt request
920
921    */
922
923   slow_t *conkort = get_safe_token_slow(device->owner());
924
925   UINT8 data = 0x04;
926
927   /* single/double sided drive */
928   UINT8 sw1 = input_port_read(device->machine, "luxor_55_10828:SW1") & 0x0f;
929   int ds0 = conkort->sel0 ? BIT(sw1, 0) : 1;
930   int ds1 = conkort->sel1 ? BIT(sw1, 1) : 1;
931   data |= !(ds0 & ds1);
932
933   /* single/double density drive */
934   int dd0 = conkort->sel0 ? BIT(sw1, 2) : 1;
935   int dd1 = conkort->sel1 ? BIT(sw1, 3) : 1;
936   data |= !(dd0 & dd1) << 1;
937
938   /* radial/binary drive select */
939   data |= 0x10;
940
941   /* head load */
942//  data |= wd17xx_hdld_r(device) << 6;
943   data |= 0x40;
944
945   /* FDC interrupt request */
946   data |= conkort->fdc_irq << 7;
947
948   return data;
949}
950
951static WRITE8_DEVICE_HANDLER( pio_pb_w )
952{
953   /*
954
955        bit     signal          description
956
957        0       !(_DS0 & _DS1)  single/double sided (0=SS, 1=DS)
958        1       !(_DD0 & _DD1)  single/double density (0=DS, 1=DD)
959        2       8B pin 10
960        3       FDC _DDEN       double density enable
961        4       _R/BS           radial/binary drive select
962        5       FDC HLT         head load timing
963        6       FDC _HDLD       head load
964        7       FDC IRQ         interrupt request
965
966    */
967
968   slow_t *conkort = get_safe_token_slow(device->owner());
969
970   /* double density enable */
971   wd17xx_dden_w(conkort->fd1791, BIT(data, 3));
972
973   /* head load timing */
974//  wd17xx_hlt_w(conkort->fd1791, BIT(data, 5));
975}
976
977static Z80PIO_INTERFACE( pio_intf )
978{
979   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),   /* interrupt callback */
980   DEVCB_HANDLER(pio_pa_r),                  /* port A read callback */
981   DEVCB_HANDLER(pio_pa_w),                  /* port A write callback */
982   DEVCB_NULL,                              /* port A ready callback */
983   DEVCB_HANDLER(pio_pb_r),                  /* port B read callback */
984   DEVCB_HANDLER(pio_pb_w),                  /* port B write callback */
985   DEVCB_NULL                              /* port B ready callback */
986};
987
988static const z80_daisy_config slow_daisy_chain[] =
989{
990   { Z80PIO_TAG },
991   { NULL }
992};
993
994/* Z80 DMA */
995
996/*
997
998    DMA Transfer Programs
999
1000    READ DAM
1001    --------
1002    7D 45 21 05 00 C3 14 28 95 6B 02 8A CF 01 AF CF 87
1003
1004    7D  transfer mode, port A -> port B, port A starting address follows, block length follows
1005    45  port A starting address low byte = 45
1006    21  port A starting address high byte = 21
1007    05  block length low byte = 05
1008    00  block length high byte = 00
1009    C3  reset
1010    14  port A is memory, port A address increments
1011    28  port B is I/O, port B address fixed
1012    95  byte mode, port B starting address low byte follows, interrupt control byte follows
1013    6B  port B starting address low byte = 6B (FDC DATA read)
1014    02  interrupt at end of block
1015    8A  ready active high
1016    CF  load
1017    01  transfer B->A
1018    AF  disable interrupts
1019    CF  load
1020    87  enable DMA
1021
1022    ??
1023    --
1024    C3 14 28 95 7B 02 8A CF 05 AF CF 87
1025
1026    C3  reset
1027    14  port A is memory, port A address increments
1028    28  port B is I/O, port B address fixed
1029    95  byte mode, port B starting address low follows, interrupt control byte follows
1030    7B  port B starting address 0x007B (FDC DATA write)
1031    02  interrupt at end of block
1032    8A  ready active high
1033    CF  load
1034    05  transfer A->B
1035    AF  disable interrupts
1036    CF  load
1037    87  enable DMA
1038
1039    ??
1040    --
1041    C3 91 40 8A AB
1042
1043    C3  reset
1044    91  byte mode, interrupt control byte follows
1045    40  interrupt on RDY
1046    8A  _CE only, ready active high, stop on end of block
1047    AB  enable interrupts
1048
1049*/
1050
1051static WRITE_LINE_DEVICE_HANDLER( z80dma_int_w )
1052{
1053   fast_t *conkort = get_safe_token_fast(device->owner());
1054
1055   conkort->dma_irq = state;
1056
1057   cpu_set_input_line(conkort->cpu, INPUT_LINE_IRQ0, conkort->fdc_irq | conkort->dma_irq);
1058}
1059
1060static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
1061static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
1062
1063static Z80DMA_INTERFACE( dma_intf )
1064{
1065   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_HALT),
1066   DEVCB_LINE(z80dma_int_w),
1067   DEVCB_NULL,
1068   DEVCB_MEMORY_HANDLER(Z80_TAG, PROGRAM, memory_read_byte),
1069   DEVCB_MEMORY_HANDLER(Z80_TAG, PROGRAM, memory_write_byte),
1070   DEVCB_MEMORY_HANDLER(Z80_TAG, IO, memory_read_byte),
1071   DEVCB_MEMORY_HANDLER(Z80_TAG, IO, memory_write_byte)
1072};
1073
1074/* FD1791 */
1075
1076static WRITE_LINE_DEVICE_HANDLER( slow_fd1791_intrq_w )
1077{
1078   slow_t *conkort = get_safe_token_slow(device->owner());
1079
1080   conkort->fdc_irq = state;
1081   z80pio_pb_w(conkort->z80pio, 0, state << 7);
1082
1083   if (state)
1084   {
1085      /* TODO: this is really connected to the Z80 WAIT line */
1086      cpu_set_input_line(conkort->cpu, INPUT_LINE_HALT, CLEAR_LINE);
1087   }
1088}
1089
1090static WRITE_LINE_DEVICE_HANDLER( slow_fd1791_drq_w )
1091{
1092   slow_t *conkort = get_safe_token_slow(device->owner());
1093
1094   conkort->fdc_drq = state;
1095
1096   if (state)
1097   {
1098      /* TODO: this is really connected to the Z80 WAIT line */
1099      cpu_set_input_line(conkort->cpu, INPUT_LINE_HALT, CLEAR_LINE);
1100   }
1101}
1102
1103static const wd17xx_interface slow_fdc_intf =
1104{
1105   DEVCB_NULL,
1106   DEVCB_LINE(slow_fd1791_intrq_w),
1107   DEVCB_LINE(slow_fd1791_drq_w),
1108   { FLOPPY_0, FLOPPY_1, NULL, NULL }
1109};
1110
1111/* FD1793 */
1112
1113static WRITE_LINE_DEVICE_HANDLER( fast_fd1793_intrq_w )
1114{
1115   fast_t *conkort = get_safe_token_fast(device->owner());
1116
1117   conkort->fdc_irq = state;
1118
1119   cpu_set_input_line(conkort->cpu, INPUT_LINE_IRQ0, conkort->fdc_irq | conkort->dma_irq);
1120}
1121
1122static const wd17xx_interface fast_fdc_intf =
1123{
1124   DEVCB_NULL,
1125   DEVCB_LINE(fast_fd1793_intrq_w),
1126   DEVCB_DEVICE_LINE(Z80DMA_TAG, z80dma_rdy_w),
1127   { FLOPPY_0, FLOPPY_1, NULL, NULL }
1128};
1129
1130static const floppy_config abc800_floppy_config =
1131{
1132   DEVCB_NULL,
1133   DEVCB_NULL,
1134   DEVCB_NULL,
1135   DEVCB_NULL,
1136   DEVCB_NULL,
1137   FLOPPY_STANDARD_5_25_DSHD, // FIXME
1138   FLOPPY_OPTIONS_NAME(abc80),
1139   NULL
1140};
1141/*
1142static const floppy_config fd2_floppy_config =
1143{
1144   DEVCB_NULL,
1145   DEVCB_NULL,
1146   DEVCB_NULL,
1147   DEVCB_NULL,
1148   DEVCB_NULL,
1149   FLOPPY_STANDARD_5_25_SSDD_40,
1150   FLOPPY_OPTIONS_NAME(abc830),
1151   NULL
1152};
1153
1154static const floppy_config abc830_floppy_config =
1155{
1156   DEVCB_NULL,
1157   DEVCB_NULL,
1158   DEVCB_NULL,
1159   DEVCB_NULL,
1160   DEVCB_NULL,
1161   FLOPPY_STANDARD_5_25_SSDD_40,
1162   FLOPPY_OPTIONS_NAME(abc830),
1163   NULL
1164};
1165
1166static const floppy_config abc832_floppy_config =
1167{
1168   DEVCB_NULL,
1169   DEVCB_NULL,
1170   DEVCB_NULL,
1171   DEVCB_NULL,
1172   DEVCB_NULL,
1173   FLOPPY_STANDARD_5_25_DSHD,
1174   FLOPPY_OPTIONS_NAME(abc832),
1175   NULL
1176};
1177
1178static const floppy_config abc838_floppy_config =
1179{
1180   DEVCB_NULL,
1181   DEVCB_NULL,
1182   DEVCB_NULL,
1183   DEVCB_NULL,
1184   DEVCB_NULL,
1185   FLOPPY_STANDARD_8_DS,
1186   FLOPPY_OPTIONS_NAME(abc838),
1187   NULL
1188};
1189*/
1190/* Machine Driver */
1191
1192static MACHINE_CONFIG_FRAGMENT( luxor_55_10828 )
1193   MDRV_CPU_ADD(Z80_TAG, Z80, XTAL_4MHz/2)
1194   MDRV_CPU_PROGRAM_MAP(slow_map)
1195   MDRV_CPU_IO_MAP(slow_io_map)
1196   MDRV_CPU_CONFIG(slow_daisy_chain)
1197
1198   MDRV_Z80PIO_ADD(Z80PIO_TAG, XTAL_4MHz/2, pio_intf)
1199   MDRV_WD179X_ADD(FD1791_TAG, slow_fdc_intf)
1200
1201   MDRV_FLOPPY_2_DRIVES_ADD(abc800_floppy_config)
1202MACHINE_CONFIG_END
1203
1204static MACHINE_CONFIG_FRAGMENT( luxor_55_21046 )
1205   MDRV_CPU_ADD(Z80_TAG, Z80, XTAL_16MHz/4)
1206   MDRV_CPU_PROGRAM_MAP(fast_map)
1207   MDRV_CPU_IO_MAP(fast_io_map)
1208
1209   MDRV_Z80DMA_ADD(Z80DMA_TAG, XTAL_16MHz/4, dma_intf)
1210   MDRV_WD1793_ADD(SAB1793_TAG, fast_fdc_intf)
1211
1212   MDRV_FLOPPY_2_DRIVES_ADD(abc800_floppy_config)
1213MACHINE_CONFIG_END
1214
1215/* ROMs */
1216
1217ROM_START( luxor_55_10828 )
1218   ROM_REGION( 0x1000, "abc830", ROMREGION_LOADBYNAME )
1219   ROM_LOAD( "mpi02.7c",    0x0000, 0x0800, CRC(2aac9296) SHA1(c01a62e7933186bdf7068d2e9a5bc36590544349) ) // MPI 51 (5510760-01)
1220   ROM_LOAD( "basf6106.7c", 0x0800, 0x0800, NO_DUMP ) // BASF 6106
1221
1222   ROM_REGION( 0x1800, "abc832", ROMREGION_LOADBYNAME )
1223   ROM_LOAD( "micr1015.7c", 0x0000, 0x0800, CRC(a7bc05fa) SHA1(6ac3e202b7ce802c70d89728695f1cb52ac80307) ) // Micropolis 1015
1224   ROM_LOAD( "micr1115.7c", 0x0800, 0x0800, CRC(f2fc5ccc) SHA1(86d6baadf6bf1d07d0577dc1e092850b5ff6dd1b) ) // Micropolis 1115 (v2.3)
1225   ROM_LOAD( "basf6118.7c", 0x1000, 0x0800, CRC(9ca1a1eb) SHA1(04973ad69de8da403739caaebe0b0f6757e4a6b1) ) // BASF 6118 (v1.2)
1226
1227   ROM_REGION( 0x1000, "abc838", ROMREGION_LOADBYNAME )
1228   ROM_LOAD( "basf6104.7c", 0x0800, 0x0800, NO_DUMP ) // BASF 6104
1229   ROM_LOAD( "basf6115.7c", 0x0800, 0x0800, NO_DUMP ) // BASF 6115
1230ROM_END
1231
1232ROM_START( luxor_55_21046 )
1233   ROM_REGION( 0x4000, "conkort", ROMREGION_LOADBYNAME ) // A13 is always high
1234   ROM_LOAD( "fast108.6cd", 0x2000, 0x2000, BAD_DUMP CRC(229764cb) SHA1(a2e2f6f49c31b827efc62f894de9a770b65d109d) ) // Luxor v1.08
1235   ROM_LOAD( "fast207.6cd", 0x2000, 0x2000, BAD_DUMP CRC(86622f52) SHA1(61ad271de53152c1640c0b364fce46d1b0b4c7e2) ) // DIAB v2.07
1236   ROM_LOAD( "cntr 1.07 6490318-07.6cd", 0x0000, 0x4000, CRC(db8c1c0e) SHA1(8bccd5bc72124984de529ee058df779f06d2c1d5) ) // PROM v1.07, Art N/O 6490318-07. Luxor Styrkort Art. N/O 55 21046-41. Date 1985-07-03
1237ROM_END
1238
1239ROM_START( myab_turbo_kontroller )
1240   ROM_REGION( 0x3000, "myab", ROMREGION_LOADBYNAME )
1241   ROM_LOAD( "unidis5d.bin", 0x0000, 0x1000, CRC(569dd60c) SHA1(47b810bcb5a063ffb3034fd7138dc5e15d243676) ) // 5" 25-pin
1242   ROM_LOAD( "unidiskh.bin", 0x1000, 0x1000, CRC(5079ad85) SHA1(42bb91318f13929c3a440de3fa1f0491a0b90863) ) // 5" 34-pin
1243   ROM_LOAD( "unidisk8.bin", 0x2000, 0x1000, CRC(d04e6a43) SHA1(8db504d46ff0355c72bd58fd536abeb17425c532) ) // 8"
1244ROM_END
1245
1246ROM_START( hdd_controller )
1247   ROM_REGION( 0x1000, "abc850", ROMREGION_LOADBYNAME )
1248   ROM_LOAD( "rodi202.bin",  0x0000, 0x0800, CRC(337b4dcf) SHA1(791ebeb4521ddc11fb9742114018e161e1849bdf) ) // Rodime RO202 (http://artofhacking.com/th99/h/txt/3699.txt)
1249   ROM_LOAD( "basf6185.bin", 0x0800, 0x0800, CRC(06f8fe2e) SHA1(e81f2a47c854e0dbb096bee3428d79e63591059d) ) // BASF 6185 (http://bk0010.narod.ru/hardware_specs/h/txt/178.txt)
1250
1251   ROM_REGION( 0x1000, "abc852", ROMREGION_LOADBYNAME )
1252   ROM_LOAD( "nec5126.bin",  0x0000, 0x1000, CRC(17c247e7) SHA1(7339738b87751655cb4d6414422593272fe72f5d) ) // NEC 5126
1253
1254   ROM_REGION( 0x800, "abc856", ROMREGION_LOADBYNAME )
1255   ROM_LOAD( "micr1325.bin", 0x0000, 0x0800, CRC(084af409) SHA1(342b8e214a8c4c2b014604e53c45ef1bd1c69ea3) ) // Micropolis 1325
1256
1257   ROM_REGION( 0x1000, "xebec", ROMREGION_LOADBYNAME )
1258   ROM_LOAD( "st4038.bin",   0x0000, 0x0800, CRC(4c803b87) SHA1(1141bb51ad9200fc32d92a749460843dc6af8953) ) // Seagate ST4038
1259   ROM_LOAD( "st225.bin",    0x0800, 0x0800, CRC(c9f68f81) SHA1(7ff8b2a19f71fe0279ab3e5a0a5fffcb6030360c) ) // Seagate ST225
1260ROM_END
1261
1262/*-------------------------------------------------
1263    DEVICE_START( luxor_55_10828 )
1264-------------------------------------------------*/
1265
1266static DEVICE_START( luxor_55_10828 )
1267{
1268   slow_t *conkort = get_safe_token_slow(device);
1269   const conkort_config *config = get_safe_config(device);
1270
1271   /* find our CPU */
1272   conkort->cpu = device->subdevice(Z80_TAG);
1273
1274   /* find devices */
1275   conkort->bus = device->machine->device(config->bus_tag);
1276   conkort->z80pio = device->subdevice(Z80PIO_TAG);
1277   conkort->fd1791 = device->subdevice(FD1791_TAG);
1278   conkort->image0 = device->subdevice(FLOPPY_0);
1279   conkort->image1 = device->subdevice(FLOPPY_1);
1280
1281   /* register for state saving */
1282   state_save_register_device_item(device, 0, conkort->cs);
1283   state_save_register_device_item(device, 0, conkort->status);
1284   state_save_register_device_item(device, 0, conkort->data);
1285   state_save_register_device_item(device, 0, conkort->fdc_irq);
1286   state_save_register_device_item(device, 0, conkort->fdc_drq);
1287   state_save_register_device_item(device, 0, conkort->wait_enable);
1288   state_save_register_device_item(device, 0, conkort->sel0);
1289   state_save_register_device_item(device, 0, conkort->sel1);
1290
1291   /* patch out protection checks */
1292   UINT8 *rom = device->subregion("abc830")->base();
1293   rom[0x0718] = 0xff;
1294   rom[0x072c] = 0xff;
1295   rom[0x0336] = 0xff;
1296   rom[0x00fa] = 0xff;
1297   rom[0x0771] = 0xff;
1298   rom[0x0788] = 0xff;
1299}
1300
1301/*-------------------------------------------------
1302    DEVICE_RESET( luxor_55_10828 )
1303-------------------------------------------------*/
1304
1305static DEVICE_RESET( luxor_55_10828 )
1306{
1307   slow_t *conkort = get_safe_token_slow(device);
1308
1309   conkort->cpu->reset();
1310
1311   conkort->cs = 0;
1312}
1313
1314/*-------------------------------------------------
1315    DEVICE_GET_INFO( luxor_55_10828 )
1316-------------------------------------------------*/
1317
1318DEVICE_GET_INFO( luxor_55_10828 )
1319{
1320   switch (state)
1321   {
1322      /* --- the following bits of info are returned as 64-bit signed integers --- */
1323      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = sizeof(conkort_config);                     break;
1324      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(slow_t);                           break;
1325
1326      /* --- the following bits of info are returned as pointers --- */
1327      case DEVINFO_PTR_ROM_REGION:               info->romregion = ROM_NAME(luxor_55_10828);               break;
1328      case DEVINFO_PTR_MACHINE_CONFIG:            info->machine_config = MACHINE_CONFIG_NAME(luxor_55_10828);   break;
1329
1330      /* --- the following bits of info are returned as pointers to data or functions --- */
1331      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(luxor_55_10828);         break;
1332      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
1333      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(luxor_55_10828);         break;
1334
1335      /* --- the following bits of info are returned as NULL-terminated strings --- */
1336      case DEVINFO_STR_NAME:                     strcpy(info->s, "Luxor 55 10828-01");                  break;
1337      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "Luxor ABC");                        break;
1338      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                              break;
1339      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);                           break;
1340      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright the MESS Team");             break;
1341   }
1342}
1343
1344/*-------------------------------------------------
1345    DEVICE_START( luxor_55_21046 )
1346-------------------------------------------------*/
1347
1348static DEVICE_START( luxor_55_21046 )
1349{
1350   fast_t *conkort = get_safe_token_fast(device);
1351   const conkort_config *config = get_safe_config(device);
1352
1353   /* find our CPU */
1354   conkort->cpu = device->subdevice(Z80_TAG);
1355
1356   /* find devices */
1357   conkort->bus = device->machine->device(config->bus_tag);
1358   conkort->z80dma = device->subdevice(Z80DMA_TAG);
1359   conkort->wd1793 = device->subdevice(SAB1793_TAG);
1360   conkort->image0 = device->subdevice(FLOPPY_0);
1361   conkort->image1 = device->subdevice(FLOPPY_1);
1362
1363   conkort->dma_irq = 0;
1364   conkort->fdc_irq = 0;
1365   conkort->busy = 0;
1366
1367   /* register for state saving */
1368   state_save_register_device_item(device, 0, conkort->cs);
1369   state_save_register_device_item(device, 0, conkort->status);
1370   state_save_register_device_item(device, 0, conkort->data_in);
1371   state_save_register_device_item(device, 0, conkort->data_out);
1372   state_save_register_device_item(device, 0, conkort->fdc_irq);
1373   state_save_register_device_item(device, 0, conkort->dma_irq);
1374   state_save_register_device_item(device, 0, conkort->busy);
1375
1376   /* patch out sector skew table */
1377/*   UINT8 *rom = device->subregion("conkort")->base();
1378   rom[0x2dd3] = 0;
1379   rom[0x2dd4] = 1;
1380   rom[0x2dd5] = 2;
1381   rom[0x2dd6] = 3;
1382   rom[0x2dd7] = 4;
1383   rom[0x2dd8] = 5;
1384   rom[0x2dd9] = 6;
1385   rom[0x2dda] = 7;
1386   rom[0x2ddb] = 8;
1387   rom[0x2ddc] = 9;
1388   rom[0x2ddd] = 10;
1389   rom[0x2dde] = 11;
1390   rom[0x2ddf] = 12;
1391   rom[0x2de0] = 13;
1392   rom[0x2de1] = 14;
1393   rom[0x2de1] = 15;*/
1394}
1395
1396/*-------------------------------------------------
1397    DEVICE_RESET( luxor_55_21046 )
1398-------------------------------------------------*/
1399
1400static DEVICE_RESET( luxor_55_21046 )
1401{
1402   fast_t *conkort = get_safe_token_fast(device);
1403
1404   conkort->cpu->reset();
1405
1406   conkort->cs = 0;
1407
1408   floppy_mon_w(conkort->image0, ASSERT_LINE);
1409   floppy_mon_w(conkort->image1, ASSERT_LINE);
1410   floppy_drive_set_ready_state(conkort->image0, 1, 1);
1411   floppy_drive_set_ready_state(conkort->image1, 1, 1);
1412}
1413
1414/*-------------------------------------------------
1415    DEVICE_GET_INFO( luxor_55_21046 )
1416-------------------------------------------------*/
1417
1418DEVICE_GET_INFO( luxor_55_21046 )
1419{
1420   switch (state)
1421   {
1422      /* --- the following bits of info are returned as 64-bit signed integers --- */
1423      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = sizeof(conkort_config);                     break;
1424      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(fast_t);                           break;
1425
1426      /* --- the following bits of info are returned as pointers --- */
1427      case DEVINFO_PTR_ROM_REGION:               info->romregion = ROM_NAME(luxor_55_21046);               break;
1428      case DEVINFO_PTR_MACHINE_CONFIG:            info->machine_config = MACHINE_CONFIG_NAME(luxor_55_21046);   break;
1429
1430      /* --- the following bits of info are returned as pointers to data or functions --- */
1431      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(luxor_55_21046);         break;
1432      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
1433      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(luxor_55_21046);         break;
1434
1435      /* --- the following bits of info are returned as NULL-terminated strings --- */
1436      case DEVINFO_STR_NAME:                     strcpy(info->s, "Luxor Conkort 55 21046-xx");            break;
1437      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "Luxor ABC");                        break;
1438      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                              break;
1439      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);                           break;
1440      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright the MESS Team");             break;
1441   }
1442}
1443
1444FLOPPY_OPTIONS_START(abc80)
1445   FLOPPY_OPTION(abc80, "dsk", "Scandia Metric FD2", basicdsk_identify_default, basicdsk_construct_default,
1446      HEADS([1])
1447      TRACKS([40])
1448      SECTORS([8])
1449      SECTOR_LENGTH([256])
1450      INTERLEAVE([4])
1451      FIRST_SECTOR_ID([1]))
1452   FLOPPY_OPTION(abc80, "dsk", "ABC 830", basicdsk_identify_default, basicdsk_construct_default,
1453      HEADS([1])
1454      TRACKS([40])
1455      SECTORS([16])
1456      SECTOR_LENGTH([256])
1457      INTERLEAVE([7])
1458      FIRST_SECTOR_ID([1]))
1459   FLOPPY_OPTION(abc80, "dsk", "ABC 832/834", basicdsk_identify_default, basicdsk_construct_default,
1460      HEADS([2])
1461      TRACKS([80])
1462      SECTORS([16])
1463      SECTOR_LENGTH([256])
1464      INTERLEAVE([7])
1465      FIRST_SECTOR_ID([1]))
1466   FLOPPY_OPTION(abc80, "dsk", "ABC 838", basicdsk_identify_default, basicdsk_construct_default,
1467      HEADS([2])
1468      TRACKS([77])
1469      SECTORS([26])
1470      INTERLEAVE([7])
1471      SECTOR_LENGTH([256])
1472      FIRST_SECTOR_ID([1]))
1473FLOPPY_OPTIONS_END
1474
1475DEFINE_LEGACY_DEVICE(LUXOR_55_10828, luxor_55_10828);
1476DEFINE_LEGACY_DEVICE(LUXOR_55_21046, luxor_55_21046);
src/mess/machine/conkort.h
r9136r9137
1#ifndef __CONKORT__
2#define __CONKORT__
3
4#include "emu.h"
5#include "formats/flopimg.h"
6
7/***************************************************************************
8    MACROS / CONSTANTS
9***************************************************************************/
10
11DECLARE_LEGACY_DEVICE(LUXOR_55_10828, luxor_55_10828);
12DECLARE_LEGACY_DEVICE(LUXOR_55_21046, luxor_55_21046);
13
14#define MDRV_LUXOR_55_10828_ADD(_tag, _bus_tag) \
15   MDRV_DEVICE_ADD(_tag, LUXOR_55_10828, 0) \
16   MDRV_DEVICE_CONFIG_DATAPTR(conkort_config, bus_tag, _bus_tag)
17
18#define MDRV_LUXOR_55_21046_ADD(_tag, _bus_tag) \
19   MDRV_DEVICE_ADD(_tag, LUXOR_55_21046, 0) \
20   MDRV_DEVICE_CONFIG_DATAPTR(conkort_config, bus_tag, _bus_tag)
21
22#define LUXOR_55_10828_ABCBUS(_tag) \
23   _tag, DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_cs_w), DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_stat_r), \
24   DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_inp_r), DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_utp_w), DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_c1_w), \
25   DEVCB_NULL, DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_c3_w), DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, luxor_55_10828_rst_w)
26
27#define LUXOR_55_21046_ABCBUS(_tag) \
28   _tag, DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_cs_w), DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_stat_r), \
29   DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_inp_r), DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_utp_w), DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_c1_w), \
30   DEVCB_NULL, DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_c3_w), DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, luxor_55_21046_rst_w)
31
32/***************************************************************************
33    TYPE DEFINITIONS
34***************************************************************************/
35
36typedef struct _conkort_config conkort_config;
37struct _conkort_config
38{
39   const char *bus_tag;      /* bus device */
40};
41
42/***************************************************************************
43    PROTOTYPES
44***************************************************************************/
45/* configuration dips */
46INPUT_PORTS_EXTERN( luxor_55_10828 );
47INPUT_PORTS_EXTERN( luxor_55_21046 );
48
49/* floppy options */
50FLOPPY_OPTIONS_EXTERN( abc80 );
51
52/* ABC bus interface */
53WRITE8_DEVICE_HANDLER( luxor_55_10828_cs_w );
54WRITE_LINE_DEVICE_HANDLER( luxor_55_10828_rst_w );
55READ8_DEVICE_HANDLER( luxor_55_10828_stat_r );
56READ8_DEVICE_HANDLER( luxor_55_10828_inp_r );
57WRITE8_DEVICE_HANDLER( luxor_55_10828_utp_w );
58WRITE8_DEVICE_HANDLER( luxor_55_10828_c1_w );
59WRITE8_DEVICE_HANDLER( luxor_55_10828_c3_w );
60
61WRITE8_DEVICE_HANDLER( luxor_55_21046_cs_w );
62WRITE_LINE_DEVICE_HANDLER( luxor_55_21046_rst_w );
63READ8_DEVICE_HANDLER( luxor_55_21046_stat_r );
64READ8_DEVICE_HANDLER( luxor_55_21046_inp_r );
65WRITE8_DEVICE_HANDLER( luxor_55_21046_utp_w );
66WRITE8_DEVICE_HANDLER( luxor_55_21046_c1_w );
67WRITE8_DEVICE_HANDLER( luxor_55_21046_c3_w );
68
69#endif
src/mess/machine/abc830.c
r0r9137
1/*
2
3Luxor Conkort
4
5PCB Layout
6----------
7
855 10900-01
9
10|-----------------------------------|
11|   LD1 SW1 LS132       CON2        |
12|                               S   |
13|   4MHz        S240    N8T97N      |
14|   S                               |
15|   7404            MC1458  4024    |
16|       S                           |
17|   74276   S                       |
18|           S   S                   |
19|   LS32    S   C140E       LS273   |
20|                                   |
21|                                   |
22|       MB8876          ROM         |
23|                                   |
24|                                   |
25|   S   LS32    LS156       TC5514  |
26|                                   |
27|                           TC5514  |
28|       Z80                         |
29|                           LS273   |
30|                                   |
31|                           LS373   |
32|       Z80PIO                      |
33|                           LS245   |
34|   S1                              |
35|   LS125   LS124     S20   DM8131  |
36|                                   |
37|--|-----------------------------|--|
38   |------------CON1-------------|
39
40Notes:
41    All IC's shown.
42
43    ROM     - Hitachi HN462716 2Kx8 EPROM "MPT02"
44    Z80     - Sharp LH0080A Z80A CPU
45    Z80PIO  - SGS Z8420AB1 Z80A PIO
46    MB8876  - Mitsubishi MB8876 Floppy Disc Controller (FD1791 compatible)
47    TC5514  - Toshiba TC5514AP-2 1Kx4 bit Static RAM
48    DM8131  - National Semiconductor DM8131N 6-Bit Unified Bus Comparator
49    C140E   - Ferranti 2C140E "copy protection device"
50    N8T97N  - SA N8T97N ?
51    CON1    - ABC bus connector
52    CON2    - 25-pin D sub floppy connector (AMP4284)
53    SW1     - Disk drive type (SS/DS, SD/DD)
54    S1      - ABC bus card address bit 0
55    S2      -
56    S3      -
57    S4      -
58    S5      -
59    S6      -
60    S7      -
61    S8      -
62    S9      -
63    LD1     - LED
64
65PCB Layout
66----------
67
6855 11046-03
69
70|-----------------------------------|
71|   LD1 SW1             CON2        |
72|                                   |
73|                       CON3    S8  |
74|                               S9  |
75|   LS240   LS174   7406    7406    |
76|                                   |
77|   LS174   FDC9229 LS107   LS266   |
78|                                   |
79|                                   |
80|       SAB1793                     |
81|                   LS368   16MHz   |
82|                   S6              |
83|       Z80DMA          ROM         |
84|                                   |
85|                                   |
86|       Z80             TC5565      |
87|                                   |
88|                                   |
89|   LS138   LS174   SW2     74374   |
90|                                   |
91|   LS10    LS266   S5      LS374   |
92|                   S3              |
93|                   S1      LS240   |
94|                                   |
95|           LS244   SW3     DM8131  |
96|                                   |
97|                                   |
98|--|-----------------------------|--|
99   |------------CON1-------------|
100
101Notes:
102    All IC's shown.
103
104    ROM     - Toshiba TMM27128D-20 16Kx8 EPROM "CNTR 1.07 6490318-07"
105    TC5565  - Toshiba TC5565PL-15 8Kx8 bit Static RAM
106    Z80     - Zilog Z8400APS Z80A CPU
107    Z80DMA  - Zilog Z8410APS Z80A DMA
108    SAB1793 - Siemens SAB1793-02P Floppy Disc Controller
109    FDC9229 - SMC FDC9229BT Floppy Disc Interface Circuit
110    DM8131  - National Semiconductor DM8131N 6-Bit Unified Bus Comparator
111    CON1    - ABC bus connector
112    CON2    - 25-pin D sub floppy connector (AMP4284)
113    CON3    - 34-pin header floppy connector
114    SW1     - Disk drive type (SS/DS, SD/DD)
115    SW2     - Disk drive model
116    SW3     - ABC bus address
117    S1      - Interface type (A:? B:ABCBUS)
118    S3      - Interface type (A:? B:ABCBUS)
119    S5      - Interface type (A:? B:ABCBUS)
120    S6      - Amount of RAM installed (A:2KB, B:8KB)
121    S7      - Number of drives connected (0:3, 1:2) *located on solder side
122    S8      - Disk drive type (0:8", 1:5.25")
123    S9      - Location of RDY signal (A:8" P2-6, B:5.25" P2-34)
124    LD1     - LED
125
126*/
127
128/*
129
130    TODO:
131
132    Slow Controller
133    ---------------
134
135    - Z80 IN instruction needs to halt in mid air for this controller to ever work (the first data byte of disk sector is read too early)
136
137        wd17xx_command_w $88 READ_SEC
138        wd17xx_data_r: (no new data) $00 (data_count 0)
139        WAIT
140        wd179x: Read Sector callback.
141        sector found! C:$00 H:$00 R:$0b N:$01
142        wd17xx_data_r: $FF (data_count 256)
143        WAIT
144
145    - copy protection device (sends sector header bytes to CPU? DDEN is serial clock? code checks for either $b6 or $f7)
146
147        06F8: ld   a,$2F                    ; SEEK
148        06FA: out  ($BC),a
149        06FC: push af
150        06FD: push bc
151        06FE: ld   bc,$0724
152        0701: push bc
153        0702: ld   b,$07
154        0704: rr   a
155        0706: call $073F
156        073F: DB 7E         in   a,($7E)    ; PIO PORT B
157        0741: EE 08         xor  $08        ; DDEN
158        0743: D3 7E         out  ($7E),a
159        0745: EE 08         xor  $08
160        0747: D3 7E         out  ($7E),a
161        0749: DB 7E         in   a,($7E)
162        074B: 1F            rra
163        074C: 1F            rra
164        074D: 1F            rra
165        074E: CB 11         rl   c
166        0750: 79            ld   a,c
167        0751: C9            ret
168        0709: djnz $0703            <-- jumps to middle of instruction!
169        0703: rlca
170        0704: rr   a
171        0706: call $073F
172
173    - S2-S5 jumpers
174   - ABC80 ERR 48 on boot
175   - side select makes controller go crazy and try to WRITE_TRK
176
177    Fast Controller
178    ---------------
179   - controller reads a couple of sectors on boot, bails out, and starts to STEP_OUT ad infinitum
180   - Z80 DMA reset command is broken (it keeps resetting A/B port addresses)
181   - 2KB RAM option
182   - some SW2 options make controller try to WRITE_TRK
183   - 640KB disks have 7:1 sector interleave (logical sector numbering 1,8,F,6,D,4,B,2,9,10,7,E,5,C,3,A)
184
185*/
186
187#include "emu.h"
188#include "abc830.h"
189#include "machine/z80dma.h"
190#include "machine/z80pio.h"
191#include "cpu/z80/z80.h"
192#include "cpu/z80/z80daisy.h"
193#include "machine/wd17xx.h"
194#include "machine/abcbus.h"
195#include "devices/flopdrv.h"
196#include "formats/flopimg.h"
197#include "formats/basicdsk.h"
198
199/***************************************************************************
200    PARAMETERS
201***************************************************************************/
202
203#define Z80_TAG      "5a"
204#define Z80PIO_TAG   "3a"
205#define FD1791_TAG   "7a"
206
207//#define Z80_TAG   "5ab"
208#define Z80DMA_TAG   "6ab"
209#define SAB1793_TAG   "7ab"
210#define FDC9229_TAG   "8b"
211
212/***************************************************************************
213    TYPE DEFINITIONS
214***************************************************************************/
215
216typedef struct _slow_t slow_t;
217struct _slow_t
218{
219   int cs;               /* card selected */
220   UINT8 status;         /* ABC BUS status */
221   UINT8 data;            /* ABC BUS data */
222   int fdc_irq;         /* floppy interrupt */
223   int fdc_drq;         /* floppy data request */
224   int wait_enable;      /* wait enable */
225   int sel0;            /* drive select 0 */
226   int sel1;            /* drive select 1 */
227
228   /* devices */
229   running_device *bus;
230   running_device *cpu;
231   running_device *z80pio;
232   running_device *fd1791;
233   running_device *image0;
234   running_device *image1;
235};
236
237typedef struct _fast_t fast_t;
238struct _fast_t
239{
240   int cs;               /* card selected */
241   UINT8 status;         /* ABC BUS status */
242   UINT8 data_in;         /* ABC BUS data in */
243   UINT8 data_out;         /* ABC BUS data out */
244   int fdc_irq;         /* FDC interrupt */
245   int dma_irq;         /* DMA interrupt */
246   int busy;            /* busy bit */
247   int force_busy;         /* force busy bit */
248
249   /* devices */
250   running_device *bus;
251   running_device *cpu;
252   running_device *z80dma;
253   running_device *wd1793;
254   running_device *image0;
255   running_device *image1;
256};
257
258/***************************************************************************
259    INLINE FUNCTIONS
260***************************************************************************/
261
262INLINE slow_t *get_safe_token_slow(running_device *device)
263{
264   assert(device != NULL);
265   assert(device->type() == ABC830_PIO);
266   return (slow_t *)downcast<legacy_device_base *>(device)->token();
267}
268
269INLINE fast_t *get_safe_token_fast(running_device *device)
270{
271   assert(device != NULL);
272   assert((device->type() == ABC830) || (device->type() == ABC832) || (device->type() == ABC838));
273   return (fast_t *)downcast<legacy_device_base *>(device)->token();
274}
275
276INLINE conkort_config *get_safe_config(running_device *device)
277{
278   assert(device != NULL);
279   assert((device->type() == ABC830_PIO) || (device->type() == ABC830) || (device->type() == ABC832) || (device->type() == ABC838));
280   return (conkort_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
281}
282
283/***************************************************************************
284    IMPLEMENTATION
285***************************************************************************/
286
287/* Slow Controller */
288
289WRITE8_DEVICE_HANDLER( luxor_55_10828_cs_w )
290{
291   slow_t *conkort = get_safe_token_slow(device);
292   UINT8 address = 0x2c | BIT(input_port_read(device->machine, "luxor_55_10828:S1"), 0);
293
294   conkort->cs = (data == address);
295}
296
297READ8_DEVICE_HANDLER( luxor_55_10828_inp_r )
298{
299   slow_t *conkort = get_safe_token_slow(device);
300   UINT8 data = 0xff;
301
302   if (conkort->cs)
303   {
304      if (!BIT(conkort->status, 6))
305      {
306         data = conkort->data;
307      }
308
309      z80pio_astb_w(conkort->z80pio, 0);
310      z80pio_astb_w(conkort->z80pio, 1);
311   }
312
313   return data;
314}
315
316WRITE8_DEVICE_HANDLER( luxor_55_10828_utp_w )
317{
318   slow_t *conkort = get_safe_token_slow(device);
319
320   if (!conkort->cs) return;
321
322   if (BIT(conkort->status, 6))
323   {
324      conkort->data = data;
325   }
326
327   z80pio_astb_w(conkort->z80pio, 0);
328   z80pio_astb_w(conkort->z80pio, 1);
329}
330
331READ8_DEVICE_HANDLER( luxor_55_10828_stat_r )
332{
333   slow_t *conkort = get_safe_token_slow(device);
334   UINT8 data = 0xff;
335
336   if (conkort->cs)
337   {
338      data = (conkort->status & 0xfe) | z80pio_ardy_r(conkort->z80pio);
339   }
340
341   return data;
342}
343
344WRITE8_DEVICE_HANDLER( luxor_55_10828_c1_w )
345{
346   slow_t *conkort = get_safe_token_slow(device);
347
348   if (conkort->cs)
349   {
350      cpu_set_input_line(conkort->cpu, INPUT_LINE_NMI, ASSERT_LINE);
351      cpu_set_input_line(conkort->cpu, INPUT_LINE_NMI, CLEAR_LINE);
352   }
353}
354
355WRITE8_DEVICE_HANDLER( luxor_55_10828_c3_w )
356{
357   slow_t *conkort = get_safe_token_slow(device);
358
359   if (conkort->cs)
360   {
361      cpu_set_input_line(conkort->cpu, INPUT_LINE_RESET, PULSE_LINE);
362   }
363}
364
365WRITE_LINE_DEVICE_HANDLER( luxor_55_10828_rst_w )
366{
367   if (!state)
368   {
369      device->reset();
370   }
371}
372
373static WRITE8_DEVICE_HANDLER( slow_ctrl_w )
374{
375   /*
376
377        bit     signal          description
378
379        0       SEL 0
380        1       SEL 1
381        2       SEL 2
382        3       _MOT ON
383        4       SIDE
384        5       _PRECOMP ON
385        6       _WAIT ENABLE
386        7       FDC _MR
387
388    */
389
390   slow_t *conkort = get_safe_token_slow(device->owner());
391
392   /* drive selection */
393   if (BIT(data, 0)) wd17xx_set_drive(device, 0);
394   if (BIT(data, 1)) wd17xx_set_drive(device, 1);
395//  if (BIT(data, 2)) wd17xx_set_drive(device, 2);
396   conkort->sel0 = BIT(data, 0);
397   conkort->sel1 = BIT(data, 1);
398
399   /* motor enable */
400   int mtron = BIT(data, 3);
401   floppy_mon_w(conkort->image0, mtron);
402   floppy_mon_w(conkort->image1, mtron);
403   floppy_drive_set_ready_state(conkort->image0, !mtron, 1);
404   floppy_drive_set_ready_state(conkort->image1, !mtron, 1);
405
406   /* disk side selection */
407   //wd17xx_set_side(device, BIT(data, 4));
408
409   /* wait enable */
410   conkort->wait_enable = BIT(data, 6);
411
412   /* FDC master reset */
413   wd17xx_mr_w(device, BIT(data, 7));
414}
415
416static WRITE8_DEVICE_HANDLER( slow_status_w )
417{
418   /*
419
420        bit     description
421
422        0       _INT to main Z80
423        1
424        2
425        3
426        4
427        5
428        6       LS245 DIR
429        7
430
431    */
432
433   slow_t *conkort = get_safe_token_slow(device->owner());
434
435   /* interrupt */
436   abcbus_int_w(conkort->bus, BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE);
437
438   conkort->status = data & 0xfe;
439}
440
441static READ8_DEVICE_HANDLER( slow_fdc_r )
442{
443   slow_t *conkort = get_safe_token_slow(device->owner());
444   UINT8 data = 0xff;
445
446   if (!conkort->wait_enable && !conkort->fdc_irq && !conkort->fdc_drq)
447   {
448      /* TODO: this is really connected to the Z80 WAIT line */
449      cpu_set_input_line(conkort->cpu, INPUT_LINE_HALT, ASSERT_LINE);
450   }
451
452   switch (offset & 0x03)
453   {
454   case 0: data = wd17xx_status_r(device, 0); break;
455   case 1: data = wd17xx_track_r(device, 0); break;
456   case 2: data = wd17xx_sector_r(device, 0); break;
457   case 3: data = wd17xx_data_r(device, 0); break;
458   }
459
460   /* FD1791 has inverted data lines */
461   return data ^ 0xff;
462}
463
464static WRITE8_DEVICE_HANDLER( slow_fdc_w )
465{
466   slow_t *conkort = get_safe_token_slow(device->owner());
467
468   if (!conkort->wait_enable && !conkort->fdc_irq && !conkort->fdc_drq)
469   {
470      logerror("WAIT\n");
471      /* TODO: this is really connected to the Z80 WAIT line */
472      cpu_set_input_line(conkort->cpu, INPUT_LINE_HALT, ASSERT_LINE);
473   }
474
475   /* FD1791 has inverted data lines */
476   data ^= 0xff;
477
478   switch (offset & 0x03)
479   {
480   case 0: wd17xx_command_w(device, 0, data); break;
481   case 1: wd17xx_track_w(device, 0, data); break;
482   case 2: wd17xx_sector_w(device, 0, data); break;
483   case 3: wd17xx_data_w(device, 0, data); break;
484   }
485}
486
487/* Fast Controller */
488
489WRITE8_DEVICE_HANDLER( luxor_55_21046_cs_w )
490{
491   fast_t *conkort = get_safe_token_fast(device);
492
493   conkort->cs = (data == input_port_read(device->machine, "luxor_55_21046:SW3"));
494}
495
496READ8_DEVICE_HANDLER( luxor_55_21046_stat_r )
497{
498   fast_t *conkort = get_safe_token_fast(device);
499
500   UINT8 data = 0;
501
502   if (conkort->cs)
503   {
504      data = (conkort->status & 0xce) | conkort->busy;
505   }
506
507   // LS240 inverts the data
508   return data ^ 0xff;
509}
510
511READ8_DEVICE_HANDLER( luxor_55_21046_inp_r )
512{
513   fast_t *conkort = get_safe_token_fast(device);
514
515   UINT8 data = 0xff;
516
517   if (conkort->cs)
518   {
519      data = conkort->data_out;
520      conkort->busy = 1;
521   }
522
523   return data;
524}
525
526WRITE8_DEVICE_HANDLER( luxor_55_21046_utp_w )
527{
528   fast_t *conkort = get_safe_token_fast(device);
529
530   if (conkort->cs)
531   {
532      conkort->data_in = data;
533      conkort->busy = 1;
534   }
535}
536
537WRITE8_DEVICE_HANDLER( luxor_55_21046_c1_w )
538{
539   fast_t *conkort = get_safe_token_fast(device);
540
541   if (conkort->cs)
542   {
543      cpu_set_input_line(conkort->cpu, INPUT_LINE_NMI, ASSERT_LINE);
544      cpu_set_input_line(conkort->cpu, INPUT_LINE_NMI, CLEAR_LINE);
545   }
546}
547
548WRITE8_DEVICE_HANDLER( luxor_55_21046_c3_w )
549{
550   fast_t *conkort = get_safe_token_fast(device);
551
552   if (conkort->cs)
553   {
554      cpu_set_input_line(conkort->cpu, INPUT_LINE_RESET, ASSERT_LINE);
555      cpu_set_input_line(conkort->cpu, INPUT_LINE_RESET, CLEAR_LINE);
556   }
557}
558
559WRITE_LINE_DEVICE_HANDLER( luxor_55_21046_rst_w )
560{
561   if (!state)
562   {
563      device->reset();
564   }
565}
566
567static READ8_DEVICE_HANDLER( fast_3d_r )
568{
569   fast_t *conkort = get_safe_token_fast(device->owner());
570
571   if (BIT(conkort->status, 0))
572   {
573      conkort->busy = 0;
574   }
575
576   return conkort->data_in;
577}
578
579static WRITE8_DEVICE_HANDLER( fast_4d_w )
580{
581   fast_t *conkort = get_safe_token_fast(device->owner());
582   
583   if (BIT(conkort->status, 0))
584   {
585      conkort->busy = 0;
586   }
587
588   conkort->data_out = data;
589}
590
591static WRITE8_DEVICE_HANDLER( fast_4b_w )
592{
593   /*
594
595      bit      description
596
597      0      force busy
598      1     
599      2     
600      3     
601      4      N/C
602      5      N/C
603      6     
604      7     
605
606   */
607
608   fast_t *conkort = get_safe_token_fast(device->owner());
609
610   conkort->status = data;
611
612   /* busy */
613   if (!BIT(conkort->status, 0))
614   {
615      conkort->busy = 1;
616   }
617}
618
619static WRITE8_DEVICE_HANDLER( fast_9b_w )
620{
621   /*
622
623      bit      description
624
625      0      DS0
626      1      DS1
627      2      DS2
628      3      MTRON
629      4      pin 2 of 50-pin floppy connector, not used
630      5      SIDE1
631      6
632      7
633
634   */
635
636   fast_t *conkort = get_safe_token_fast(device->owner());
637
638   /* drive select */
639   if (BIT(data, 0)) wd17xx_set_drive(device, 0);
640   if (BIT(data, 1)) wd17xx_set_drive(device, 1);
641   //if (BIT(data, 2)) wd17xx_set_drive(device, 2);
642
643   /* motor enable */
644   int mtron = BIT(data, 3);
645   floppy_mon_w(conkort->image0, !mtron);
646   floppy_mon_w(conkort->image1, !mtron);
647   floppy_drive_set_ready_state(conkort->image0, mtron, 1);
648   floppy_drive_set_ready_state(conkort->image1, mtron, 1);
649
650   /* side select */
651   wd17xx_set_side(device, BIT(data, 5));
652}
653
654static WRITE8_DEVICE_HANDLER( fast_8a_w )
655{
656   /*
657
658      bit      description
659
660      0      FD1793 _MR
661      1      FD1793 _DDEN, FDC9229 DENS
662      2      FDC9229 MINI
663      3      READY signal polarity (0=inverted)
664      4      FDC9229 P2
665      5      FDC9229 P1
666      6
667      7
668
669      FDC9229 P0 is grounded
670
671   */
672
673   /* master reset */
674   wd17xx_mr_w(device, BIT(data, 0));
675
676   /* density select */
677   wd17xx_dden_w(device, BIT(data, 1));
678}
679
680static READ8_DEVICE_HANDLER( fast_9a_r )
681{
682   /*
683
684      bit      description
685
686      0      3A.8 (busy)
687      1      50-pin floppy connector pin 10, not used
688      2      3A.12 (SW2)
689      3      ? GND
690      4      SW1-1
691      5      SW1-2
692      6      SW1-3
693      7      SW1-4
694
695   */
696
697   fast_t *conkort = get_safe_token_fast(device->owner());
698
699   UINT8 data = 0;
700
701   /* busy */
702   data |= conkort->busy;
703
704   /* SW1 */
705   UINT8 sw1 = input_port_read(device->machine, "luxor_55_21046:SW1") & 0x0f;
706
707   data |= sw1 << 4;
708
709   /* SW2 */
710   UINT8 sw2 = input_port_read(device->machine, "luxor_55_21046:SW2") & 0x0f;
711
712   int sw2_1 = BIT(offset, 8) & BIT(sw2, 0);
713   int sw2_2 = BIT(offset, 9) & BIT(sw2, 1);
714   int sw2_3 = BIT(offset, 10) & BIT(sw2, 2);
715   int sw2_4 = BIT(offset, 11) & BIT(sw2, 3);
716   int sw2_data = !(sw2_1 & sw2_2 & !(sw2_3 ^ sw2_4));
717   
718   data |= sw2_data << 2;
719
720   return data ^ 0xff;
721}
722
723/* Memory Maps */
724
725// Slow Controller
726
727static ADDRESS_MAP_START( slow_map, ADDRESS_SPACE_PROGRAM, 8 )
728   ADDRESS_MAP_GLOBAL_MASK(0x1fff)
729   AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x0800) AM_ROM AM_REGION("luxor_55_10828:abc830", 0)
730   AM_RANGE(0x1000, 0x13ff) AM_MIRROR(0x0c00) AM_RAM
731ADDRESS_MAP_END
732
733static ADDRESS_MAP_START( slow_io_map, ADDRESS_SPACE_IO, 8 )
734   ADDRESS_MAP_GLOBAL_MASK(0xff)
735   AM_RANGE(0x70, 0x73) AM_MIRROR(0x0c) AM_DEVREADWRITE(Z80PIO_TAG, z80pio_ba_cd_r, z80pio_ba_cd_w)
736   AM_RANGE(0xb0, 0xb3) AM_MIRROR(0x0c) AM_DEVREADWRITE(FD1791_TAG, slow_fdc_r, slow_fdc_w)
737   AM_RANGE(0xd0, 0xd0) AM_MIRROR(0x0f) AM_DEVWRITE(FD1791_TAG, slow_status_w)
738   AM_RANGE(0xe0, 0xe0) AM_MIRROR(0x0f) AM_DEVWRITE(FD1791_TAG, slow_ctrl_w)
739ADDRESS_MAP_END
740
741// Fast Controller
742
743static ADDRESS_MAP_START( fast_map, ADDRESS_SPACE_PROGRAM, 8 )
744   ADDRESS_MAP_UNMAP_HIGH
745   ADDRESS_MAP_GLOBAL_MASK(0x3fff)
746   AM_RANGE(0x0000, 0x1fff) AM_ROM AM_REGION("luxor_55_21046:conkort", 0x2000)
747   AM_RANGE(0x2000, 0x3fff) AM_RAM
748ADDRESS_MAP_END
749
750static ADDRESS_MAP_START( fast_io_map, ADDRESS_SPACE_IO, 8 )
751   ADDRESS_MAP_UNMAP_HIGH
752   AM_RANGE(0x00, 0x00) AM_MIRROR(0xff0f) AM_DEVREAD(SAB1793_TAG, fast_3d_r)
753   AM_RANGE(0x10, 0x10) AM_MIRROR(0xff0f) AM_DEVWRITE(SAB1793_TAG, fast_4d_w)
754   AM_RANGE(0x20, 0x20) AM_MIRROR(0xff0f) AM_DEVWRITE(SAB1793_TAG, fast_4b_w)
755   AM_RANGE(0x30, 0x30) AM_MIRROR(0xff0f) AM_DEVWRITE(SAB1793_TAG, fast_9b_w)
756   AM_RANGE(0x40, 0x40) AM_MIRROR(0xff0f) AM_DEVWRITE(SAB1793_TAG, fast_8a_w)
757   AM_RANGE(0x50, 0x50) AM_MIRROR(0xff0f) AM_MASK(0xff00) AM_DEVREAD(SAB1793_TAG, fast_9a_r)
758   AM_RANGE(0x60, 0x63) AM_MIRROR(0xff0c) AM_DEVREAD(SAB1793_TAG, wd17xx_r)
759   AM_RANGE(0x70, 0x73) AM_MIRROR(0xff0c) AM_DEVWRITE(SAB1793_TAG, wd17xx_w)
760   AM_RANGE(0x80, 0x80) AM_MIRROR(0xff0f) AM_DEVREADWRITE(Z80DMA_TAG, z80dma_r, z80dma_w)
761ADDRESS_MAP_END
762
763/* Input Ports */
764
765INPUT_PORTS_START( luxor_55_10828 )
766   PORT_START("luxor_55_10828:SW1")
767   PORT_DIPNAME( 0x01, 0x01, "Drive 0 Sided" ) PORT_DIPLOCATION("SW1:1")
768   PORT_DIPSETTING(    0x01, DEF_STR( Single ) )
769   PORT_DIPSETTING(    0x00, "Double" )
770   PORT_DIPNAME( 0x02, 0x02, "Drive 1 Sided" ) PORT_DIPLOCATION("SW1:2")
771   PORT_DIPSETTING(    0x02, DEF_STR( Single ) )
772   PORT_DIPSETTING(    0x00, "Double" )
773   PORT_DIPNAME( 0x04, 0x00, "Drive 0 Density" ) PORT_DIPLOCATION("SW1:3")
774   PORT_DIPSETTING(    0x04, DEF_STR( Single ) )
775   PORT_DIPSETTING(    0x00, "Double" )
776   PORT_DIPNAME( 0x08, 0x00, "Drive 1 Density" ) PORT_DIPLOCATION("SW1:4")
777   PORT_DIPSETTING(    0x08, DEF_STR( Single ) )
778   PORT_DIPSETTING(    0x00, "Double" )
779
780   PORT_START("luxor_55_10828:S1")
781   PORT_DIPNAME( 0x01, 0x01, "Card Address" ) PORT_DIPLOCATION("S1:1")
782   PORT_DIPSETTING(    0x00, "44" )
783   PORT_DIPSETTING(    0x01, "45" )
784INPUT_PORTS_END
785
786INPUT_PORTS_START( luxor_55_21046 )
787   PORT_START("luxor_55_21046:SW1")
788   // ABC 838
789   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:1,2,3,4") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
790   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
791   // ABC 830
792   PORT_DIPNAME( 0x01, 0x00, "Drive 0 Sided" ) PORT_DIPLOCATION("SW1:1") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
793   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
794   PORT_DIPSETTING(    0x01, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
795   PORT_DIPNAME( 0x02, 0x00, "Drive 1 Sided" ) PORT_DIPLOCATION("SW1:2") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
796   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
797   PORT_DIPSETTING(    0x02, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
798   PORT_DIPNAME( 0x04, 0x00, "Drive 0 Density" ) PORT_DIPLOCATION("SW1:3") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
799   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
800   PORT_DIPSETTING(    0x04, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
801   PORT_DIPNAME( 0x08, 0x00, "Drive 1 Density" ) PORT_DIPLOCATION("SW1:4") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
802   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
803   PORT_DIPSETTING(    0x08, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d)
804   // ABC 832/834/850
805   PORT_DIPNAME( 0x01, 0x01, "Drive 0 Sided" ) PORT_DIPLOCATION("SW1:1") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
806   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
807   PORT_DIPSETTING(    0x01, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
808   PORT_DIPNAME( 0x02, 0x02, "Drive 1 Sided" ) PORT_DIPLOCATION("SW1:2") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
809   PORT_DIPSETTING(    0x00, DEF_STR( Single ) ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
810   PORT_DIPSETTING(    0x02, "Double" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
811   PORT_DIPNAME( 0x04, 0x00, "Drive 0 Tracks" ) PORT_DIPLOCATION("SW1:3") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
812   PORT_DIPSETTING(    0x00, "80" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
813   PORT_DIPSETTING(    0x04, "40" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
814   PORT_DIPNAME( 0x08, 0x00, "Drive 1 Tracks" ) PORT_DIPLOCATION("SW1:4") PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
815   PORT_DIPSETTING(    0x00, "80" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
816   PORT_DIPSETTING(    0x08, "40" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c)
817
818   PORT_START("luxor_55_21046:SW2")
819   PORT_DIPNAME( 0x0f, 0x0b, "Drive Type" ) PORT_DIPLOCATION("SW2:1,2,3,4")
820   PORT_DIPSETTING(    0x0e, "TEAC FD55F (ABC 834)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 230 7802-01
821   PORT_DIPSETTING(    0x0d, "BASF 6138 (ABC 850)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 230 8440-15
822   PORT_DIPSETTING(    0x0c, "Micropolis 1015F (ABC 832)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 190 9711-15
823   PORT_DIPSETTING(    0x0b, "BASF 6118 (ABC 832)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 190 9711-16
824   PORT_DIPSETTING(    0x0a, "Micropolis 1115F (ABC 832)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2c) // 190 9711-17
825   PORT_DIPSETTING(    0x07, "BASF 6106/08 (ABC 830)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d) // 190 9206-16
826   PORT_DIPSETTING(    0x06, "MPI 51 (ABC 830)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2d) // 190 9206-16
827   PORT_DIPSETTING(    0x01, "BASF 6105 (ABC 838)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2e)
828   PORT_DIPSETTING(    0x00, "BASF 6106 (ABC 838)" ) PORT_CONDITION("luxor_55_21046:SW3", 0x7f, PORTCOND_EQUALS, 0x2e) // 230 8838-15
829   
830   PORT_START("luxor_55_21046:SW3")
831   PORT_DIPNAME( 0x7f, 0x2c, "Card Address" ) PORT_DIPLOCATION("SW3:1,2,3,4,5,6,7")
832   PORT_DIPSETTING(    0x2c, "44 (ABC 832/834/850)" )
833   PORT_DIPSETTING(    0x2d, "45 (ABC 830)" )
834   PORT_DIPSETTING(    0x2e, "46 (ABC 838)" )
835
836   PORT_START("luxor_55_21046:S6")
837   PORT_DIPNAME( 0x01, 0x01, "RAM Size" ) PORT_DIPLOCATION("S6:1")
838   PORT_DIPSETTING(    0x00, "2 KB" )
839   PORT_DIPSETTING(    0x01, "8 KB" )
840
841   PORT_START("luxor_55_21046:S8")
842   PORT_DIPNAME( 0x01, 0x01, "Drive Type" ) PORT_DIPLOCATION("S8:1")
843   PORT_DIPSETTING(    0x00, "8\"" )
844   PORT_DIPSETTING(    0x01, "5.25\"" )
845
846   PORT_START("luxor_55_21046:S9")
847   PORT_DIPNAME( 0x01, 0x01, "RDY Pin" ) PORT_DIPLOCATION("S9:1")
848   PORT_DIPSETTING(    0x00, "P2-6 (8\")" )
849   PORT_DIPSETTING(    0x01, "P2-34 (5.25\")" )
850INPUT_PORTS_END
851
852/* Z80 PIO */
853
854static READ8_DEVICE_HANDLER( conkort_pio_port_a_r )
855{
856   slow_t *conkort = get_safe_token_slow(device->owner());
857
858   return conkort->data;
859}
860
861static WRITE8_DEVICE_HANDLER( conkort_pio_port_a_w )
862{
863   slow_t *conkort = get_safe_token_slow(device->owner());
864
865   conkort->data = data;
866}
867
868static READ8_DEVICE_HANDLER( conkort_pio_port_b_r )
869{
870   /*
871
872        bit     description
873
874        0       !(_DS0 & _DS1)  single/double sided (0=SS, 1=DS)
875        1       !(_DD0 & _DD1)  single/double density (0=DS, 1=DD)
876        2       8B pin 10
877        3       FDC _DDEN       double density enable
878        4       _R/BS           radial/binary drive select
879        5       FDC HLT         head load timing
880        6       FDC _HDLD       head loaded
881        7       FDC IRQ         interrupt request
882
883    */
884
885   slow_t *conkort = get_safe_token_slow(device->owner());
886
887   UINT8 data = 0x04;
888
889   /* single/double sided drive */
890   UINT8 sw1 = input_port_read(device->machine, "luxor_55_10828:SW1") & 0x0f;
891   int ds0 = conkort->sel0 ? BIT(sw1, 0) : 1;
892   int ds1 = conkort->sel1 ? BIT(sw1, 1) : 1;
893   data |= !(ds0 & ds1);
894
895   /* single/double density drive */
896   int dd0 = conkort->sel0 ? BIT(sw1, 2) : 1;
897   int dd1 = conkort->sel1 ? BIT(sw1, 3) : 1;
898   data |= !(dd0 & dd1) << 1;
899
900   /* radial/binary drive select */
901   data |= 0x10;
902
903   /* head load */
904//  data |= wd17xx_hdld_r(device) << 6;
905   data |= 0x40;
906
907   /* FDC interrupt request */
908   data |= conkort->fdc_irq << 7;
909
910   return data;
911}
912
913static WRITE8_DEVICE_HANDLER( conkort_pio_port_b_w )
914{
915   /*
916
917        bit     signal          description
918
919        0       !(_DS0 & _DS1)  single/double sided (0=SS, 1=DS)
920        1       !(_DD0 & _DD1)  single/double density (0=DS, 1=DD)
921        2       8B pin 10
922        3       FDC _DDEN       double density enable
923        4       _R/BS           radial/binary drive select
924        5       FDC HLT         head load timing
925        6       FDC _HDLD       head loaded
926        7       FDC IRQ         interrupt request
927
928    */
929
930   slow_t *conkort = get_safe_token_slow(device->owner());
931
932   /* double density enable */
933   wd17xx_dden_w(conkort->fd1791, BIT(data, 3));
934
935   /* head load timing */
936//  wd17xx_hlt_w(conkort->fd1791, BIT(data, 5));
937}
938
939static Z80PIO_INTERFACE( conkort_pio_intf )
940{
941   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),      /* interrupt callback */
942   DEVCB_HANDLER(conkort_pio_port_a_r),   /* port A read callback */
943   DEVCB_HANDLER(conkort_pio_port_a_w),   /* port A write callback */
944   DEVCB_NULL,                        /* port A ready callback */
945   DEVCB_HANDLER(conkort_pio_port_b_r),   /* port B read callback */
946   DEVCB_HANDLER(conkort_pio_port_b_w),   /* port B write callback */
947   DEVCB_NULL                        /* port B ready callback */
948};
949
950static const z80_daisy_config slow_daisy_chain[] =
951{
952   { Z80PIO_TAG },
953   { NULL }
954};
955
956/* Z80 DMA */
957
958/*
959
960    DMA Transfer Programs
961
962    READ DAM
963    --------
964    7D 45 21 05 00 C3 14 28 95 6B 02 8A CF 01 AF CF 87
965
966    7D  transfer mode, port A -> port B, port A starting address follows, block length follows
967    45  port A starting address low byte = 45
968    21  port A starting address high byte = 21
969    05  block length low byte = 05
970    00  block length high byte = 00
971    C3  reset
972    14  port A is memory, port A address increments
973    28  port B is I/O, port B address fixed
974    95  byte mode, port B starting address low byte follows, interrupt control byte follows
975    6B  port B starting address low byte = 6B (FDC DATA read)
976    02  interrupt at end of block
977    8A  ready active high
978    CF  load
979    01  transfer B->A
980    AF  disable interrupts
981    CF  load
982    87  enable DMA
983
984    ??
985    --
986    C3 14 28 95 7B 02 8A CF 05 AF CF 87
987
988    C3  reset
989    14  port A is memory, port A address increments
990    28  port B is I/O, port B address fixed
991    95  byte mode, port B starting address low follows, interrupt control byte follows
992    7B  port B starting address 0x007B (FDC DATA write)
993    02  interrupt at end of block
994    8A  ready active high
995    CF  load
996    05  transfer A->B
997    AF  disable interrupts
998    CF  load
999    87  enable DMA
1000
1001    ??
1002    --
1003    C3 91 40 8A AB
1004
1005    C3  reset
1006    91  byte mode, interrupt control byte follows
1007    40  interrupt on RDY
1008    8A  _CE only, ready active high, stop on end of block
1009    AB  enable interrupts
1010
1011*/
1012
1013static WRITE_LINE_DEVICE_HANDLER( z80dma_int_w )
1014{
1015   fast_t *conkort = get_safe_token_fast(device->owner());
1016
1017   conkort->dma_irq = state;
1018
1019   cpu_set_input_line(conkort->cpu, INPUT_LINE_IRQ0, conkort->fdc_irq | conkort->dma_irq);
1020}
1021
1022static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
1023static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
1024
1025static Z80DMA_INTERFACE( dma_intf )
1026{
1027   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_HALT),
1028   DEVCB_LINE(z80dma_int_w),
1029   DEVCB_NULL,
1030   DEVCB_MEMORY_HANDLER(Z80_TAG, PROGRAM, memory_read_byte),
1031   DEVCB_MEMORY_HANDLER(Z80_TAG, PROGRAM, memory_write_byte),
1032   DEVCB_MEMORY_HANDLER(Z80_TAG, IO, memory_read_byte),
1033   DEVCB_MEMORY_HANDLER(Z80_TAG, IO, memory_write_byte)
1034};
1035
1036/* FD1791 */
1037
1038static WRITE_LINE_DEVICE_HANDLER( slow_fd1791_intrq_w )
1039{
1040   slow_t *conkort = get_safe_token_slow(device->owner());
1041
1042   conkort->fdc_irq = state;
1043   z80pio_pb_w(conkort->z80pio, 0, state << 7);
1044
1045   if (state)
1046   {
1047      /* TODO: this is really connected to the Z80 WAIT line */
1048      cpu_set_input_line(conkort->cpu, INPUT_LINE_HALT, CLEAR_LINE);
1049   }
1050}
1051
1052static WRITE_LINE_DEVICE_HANDLER( slow_fd1791_drq_w )
1053{
1054   slow_t *conkort = get_safe_token_slow(device->owner());
1055
1056   conkort->fdc_drq = state;
1057
1058   if (state)
1059   {
1060      /* TODO: this is really connected to the Z80 WAIT line */
1061      cpu_set_input_line(conkort->cpu, INPUT_LINE_HALT, CLEAR_LINE);
1062   }
1063}
1064
1065static const wd17xx_interface slow_fdc_intf =
1066{
1067   DEVCB_NULL,
1068   DEVCB_LINE(slow_fd1791_intrq_w),
1069   DEVCB_LINE(slow_fd1791_drq_w),
1070   { FLOPPY_0, FLOPPY_1, NULL, NULL }
1071};
1072
1073static FLOPPY_OPTIONS_START( fd2 )
1074   FLOPPY_OPTION(fd2, "dsk", "Scandia Metric FD2", basicdsk_identify_default, basicdsk_construct_default,
1075      HEADS([1])
1076      TRACKS([40])
1077      SECTORS([8])
1078      SECTOR_LENGTH([256])
1079      FIRST_SECTOR_ID([1]))
1080FLOPPY_OPTIONS_END
1081
1082static FLOPPY_OPTIONS_START( abc830 )
1083   FLOPPY_OPTION(abc830, "dsk", "ABC 830", basicdsk_identify_default, basicdsk_construct_default,
1084      HEADS([1])
1085      TRACKS([40])
1086      SECTORS([16])
1087      SECTOR_LENGTH([256])
1088      INTERLEAVE([7])
1089      FIRST_SECTOR_ID([1]))
1090FLOPPY_OPTIONS_END
1091
1092static FLOPPY_OPTIONS_START( abc832 )
1093   FLOPPY_OPTION(abc832, "dsk", "ABC 832/834", basicdsk_identify_default, basicdsk_construct_default,
1094      HEADS([2])
1095      TRACKS([80])
1096      SECTORS([16])
1097      SECTOR_LENGTH([256])
1098      FIRST_SECTOR_ID([1]))
1099FLOPPY_OPTIONS_END
1100
1101static FLOPPY_OPTIONS_START( abc838 )
1102   FLOPPY_OPTION(abc838, "dsk", "ABC 838", basicdsk_identify_default, basicdsk_construct_default,
1103      HEADS([2])
1104      TRACKS([77])
1105      SECTORS([26])
1106      SECTOR_LENGTH([256])
1107      FIRST_SECTOR_ID([1]))
1108FLOPPY_OPTIONS_END
1109
1110static const floppy_config fd2_floppy_config =
1111{
1112    DEVCB_NULL,
1113    DEVCB_NULL,
1114    DEVCB_NULL,
1115    DEVCB_NULL,
1116    DEVCB_NULL,
1117    FLOPPY_STANDARD_5_25_SSSD,
1118    FLOPPY_OPTIONS_NAME(fd2),
1119    NULL
1120};
1121
1122static const floppy_config abc830_floppy_config =
1123{
1124    DEVCB_NULL,
1125    DEVCB_NULL,
1126    DEVCB_NULL,
1127    DEVCB_NULL,
1128    DEVCB_NULL,
1129    FLOPPY_STANDARD_5_25_SSDD_40,
1130    FLOPPY_OPTIONS_NAME(abc830),
1131    NULL
1132};
1133
1134static const floppy_config abc832_floppy_config =
1135{
1136    DEVCB_NULL,
1137    DEVCB_NULL,
1138    DEVCB_NULL,
1139    DEVCB_NULL,
1140    DEVCB_NULL,
1141    FLOPPY_STANDARD_5_25_DSQD,
1142    FLOPPY_OPTIONS_NAME(abc832),
1143    NULL
1144};
1145
1146static const floppy_config abc838_floppy_config =
1147{
1148    DEVCB_NULL,
1149    DEVCB_NULL,
1150    DEVCB_NULL,
1151    DEVCB_NULL,
1152    DEVCB_NULL,
1153    FLOPPY_STANDARD_8_DSDD,
1154    FLOPPY_OPTIONS_NAME(abc838),
1155    NULL
1156};
1157
1158/* FD1793 */
1159
1160static WRITE_LINE_DEVICE_HANDLER( fast_fd1793_intrq_w )
1161{
1162   fast_t *conkort = get_safe_token_fast(device->owner());
1163
1164   conkort->fdc_irq = state;
1165
1166   cpu_set_input_line(conkort->cpu, INPUT_LINE_IRQ0, conkort->fdc_irq | conkort->dma_irq);
1167}
1168
1169static const wd17xx_interface fast_fdc_intf =
1170{
1171   DEVCB_NULL,
1172   DEVCB_LINE(fast_fd1793_intrq_w),
1173   DEVCB_DEVICE_LINE(Z80DMA_TAG, z80dma_rdy_w),
1174   { FLOPPY_0, FLOPPY_1, NULL, NULL }
1175};
1176
1177/* Machine Driver */
1178
1179static MACHINE_CONFIG_FRAGMENT( luxor_55_10828 )
1180   MDRV_CPU_ADD(Z80_TAG, Z80, XTAL_4MHz/2)
1181   MDRV_CPU_PROGRAM_MAP(slow_map)
1182   MDRV_CPU_IO_MAP(slow_io_map)
1183   MDRV_CPU_CONFIG(slow_daisy_chain)
1184
1185   MDRV_Z80PIO_ADD(Z80PIO_TAG, XTAL_4MHz/2, conkort_pio_intf)
1186   MDRV_WD179X_ADD(FD1791_TAG, slow_fdc_intf)
1187MACHINE_CONFIG_END
1188
1189static MACHINE_CONFIG_DERIVED( abc830_pio, luxor_55_10828 )
1190   MDRV_FLOPPY_2_DRIVES_ADD(abc830_floppy_config)
1191MACHINE_CONFIG_END
1192
1193static MACHINE_CONFIG_FRAGMENT( luxor_55_21046 )
1194   MDRV_CPU_ADD(Z80_TAG, Z80, XTAL_16MHz/4)
1195   MDRV_CPU_PROGRAM_MAP(fast_map)
1196   MDRV_CPU_IO_MAP(fast_io_map)
1197
1198   MDRV_Z80DMA_ADD(Z80DMA_TAG, XTAL_16MHz/4, dma_intf)
1199   MDRV_WD1793_ADD(SAB1793_TAG, fast_fdc_intf)
1200MACHINE_CONFIG_END
1201
1202static MACHINE_CONFIG_DERIVED( abc830, luxor_55_21046 )
1203   MDRV_FLOPPY_2_DRIVES_ADD(abc830_floppy_config)
1204MACHINE_CONFIG_END
1205
1206static MACHINE_CONFIG_DERIVED( abc832, luxor_55_21046 )
1207   MDRV_FLOPPY_2_DRIVES_ADD(abc832_floppy_config)
1208MACHINE_CONFIG_END
1209
1210static MACHINE_CONFIG_DERIVED( abc838, luxor_55_21046 )
1211   MDRV_FLOPPY_2_DRIVES_ADD(abc838_floppy_config)
1212MACHINE_CONFIG_END
1213
1214/* ROMs */
1215
1216ROM_START( luxor_55_10828 )
1217   ROM_REGION( 0x1000, "abc830", ROMREGION_LOADBYNAME )
1218   ROM_LOAD( "mpi02.bin",    0x0000, 0x0800, CRC(2aac9296) SHA1(c01a62e7933186bdf7068d2e9a5bc36590544349) ) // MPI 51 (5510760-01)
1219   ROM_LOAD( "basf6106.bin", 0x0800, 0x0800, NO_DUMP ) // BASF 6106
1220
1221   ROM_REGION( 0x1800, "abc832", ROMREGION_LOADBYNAME )
1222   ROM_LOAD( "micr1015.bin", 0x0000, 0x0800, CRC(a7bc05fa) SHA1(6ac3e202b7ce802c70d89728695f1cb52ac80307) ) // Micropolis 1015
1223   ROM_LOAD( "micr1115.bin", 0x0800, 0x0800, CRC(f2fc5ccc) SHA1(86d6baadf6bf1d07d0577dc1e092850b5ff6dd1b) ) // Micropolis 1115 (v2.3)
1224   ROM_LOAD( "basf6118.bin", 0x1000, 0x0800, CRC(9ca1a1eb) SHA1(04973ad69de8da403739caaebe0b0f6757e4a6b1) ) // BASF 6118 (v1.2)
1225
1226   ROM_REGION( 0x1000, "abc838", ROMREGION_LOADBYNAME )
1227   ROM_LOAD( "basf6104.bin", 0x0800, 0x0800, NO_DUMP ) // BASF 6104
1228   ROM_LOAD( "basf6115.bin", 0x0800, 0x0800, NO_DUMP ) // BASF 6115
1229ROM_END
1230
1231ROM_START( luxor_55_21046 )
1232   ROM_REGION( 0x4000, "conkort", ROMREGION_LOADBYNAME ) // A13 is always high
1233   ROM_LOAD( "fast108.6cd", 0x2000, 0x2000, CRC(229764cb) SHA1(a2e2f6f49c31b827efc62f894de9a770b65d109d) ) // Luxor v1.08
1234   ROM_LOAD( "fast207.6cd", 0x2000, 0x2000, CRC(86622f52) SHA1(61ad271de53152c1640c0b364fce46d1b0b4c7e2) ) // DIAB v2.07
1235   ROM_LOAD( "cntr 1.07 6490318-07.6cd", 0x0000, 0x4000, CRC(db8c1c0e) SHA1(8bccd5bc72124984de529ee058df779f06d2c1d5) ) // PROM v1.07, Art N/O 6490318-07. Luxor Styrkort Art. N/O 55 21046-41. Date 1985-07-03
1236ROM_END
1237
1238ROM_START( myab_turbo_kontroller )
1239   ROM_REGION( 0x3000, "myab", ROMREGION_LOADBYNAME )
1240   ROM_LOAD( "unidis5d.bin", 0x0000, 0x1000, CRC(569dd60c) SHA1(47b810bcb5a063ffb3034fd7138dc5e15d243676) ) // 5" 25-pin
1241   ROM_LOAD( "unidiskh.bin", 0x1000, 0x1000, CRC(5079ad85) SHA1(42bb91318f13929c3a440de3fa1f0491a0b90863) ) // 5" 34-pin
1242   ROM_LOAD( "unidisk8.bin", 0x2000, 0x1000, CRC(d04e6a43) SHA1(8db504d46ff0355c72bd58fd536abeb17425c532) ) // 8"
1243ROM_END
1244
1245ROM_START( hdd_controller )
1246   ROM_REGION( 0x1000, "abc850", ROMREGION_LOADBYNAME )
1247   ROM_LOAD( "rodi202.bin",  0x0000, 0x0800, CRC(337b4dcf) SHA1(791ebeb4521ddc11fb9742114018e161e1849bdf) ) // Rodime RO202 (http://artofhacking.com/th99/h/txt/3699.txt)
1248   ROM_LOAD( "basf6185.bin", 0x0800, 0x0800, CRC(06f8fe2e) SHA1(e81f2a47c854e0dbb096bee3428d79e63591059d) ) // BASF 6185 (http://bk0010.narod.ru/hardware_specs/h/txt/178.txt)
1249
1250   ROM_REGION( 0x1000, "abc852", ROMREGION_LOADBYNAME )
1251   ROM_LOAD( "nec5126.bin",  0x0000, 0x1000, CRC(17c247e7) SHA1(7339738b87751655cb4d6414422593272fe72f5d) ) // NEC 5126
1252
1253   ROM_REGION( 0x800, "abc856", ROMREGION_LOADBYNAME )
1254   ROM_LOAD( "micr1325.bin", 0x0000, 0x0800, CRC(084af409) SHA1(342b8e214a8c4c2b014604e53c45ef1bd1c69ea3) ) // Micropolis 1325
1255
1256   ROM_REGION( 0x1000, "xebec", ROMREGION_LOADBYNAME )
1257   ROM_LOAD( "st4038.bin",   0x0000, 0x0800, CRC(4c803b87) SHA1(1141bb51ad9200fc32d92a749460843dc6af8953) ) // Seagate ST4038
1258   ROM_LOAD( "st225.bin",    0x0800, 0x0800, CRC(c9f68f81) SHA1(7ff8b2a19f71fe0279ab3e5a0a5fffcb6030360c) ) // Seagate ST225
1259ROM_END
1260
1261/*-------------------------------------------------
1262    DEVICE_START( luxor_55_10828 )
1263-------------------------------------------------*/
1264
1265static DEVICE_START( luxor_55_10828 )
1266{
1267   slow_t *conkort = get_safe_token_slow(device);
1268   const conkort_config *config = get_safe_config(device);
1269
1270   /* find our CPU */
1271   conkort->cpu = device->subdevice(Z80_TAG);
1272
1273   /* find devices */
1274   conkort->bus = device->machine->device(config->bus_tag);
1275   conkort->z80pio = device->subdevice(Z80PIO_TAG);
1276   conkort->fd1791 = device->subdevice(FD1791_TAG);
1277   conkort->image0 = device->subdevice(FLOPPY_0);
1278   conkort->image1 = device->subdevice(FLOPPY_1);
1279
1280   /* register for state saving */
1281   state_save_register_device_item(device, 0, conkort->cs);
1282   state_save_register_device_item(device, 0, conkort->status);
1283   state_save_register_device_item(device, 0, conkort->data);
1284   state_save_register_device_item(device, 0, conkort->fdc_irq);
1285   state_save_register_device_item(device, 0, conkort->fdc_drq);
1286   state_save_register_device_item(device, 0, conkort->wait_enable);
1287   state_save_register_device_item(device, 0, conkort->sel0);
1288   state_save_register_device_item(device, 0, conkort->sel1);
1289
1290   /* patch out protection checks */
1291   UINT8 *rom = device->subregion("abc830")->base();
1292   rom[0x0718] = 0xff;
1293   rom[0x072c] = 0xff;
1294   rom[0x0336] = 0xff;
1295   rom[0x00fa] = 0xff;
1296   rom[0x0771] = 0xff;
1297   rom[0x0788] = 0xff;
1298}
1299
1300/*-------------------------------------------------
1301    DEVICE_RESET( luxor_55_10828 )
1302-------------------------------------------------*/
1303
1304static DEVICE_RESET( luxor_55_10828 )
1305{
1306   slow_t *conkort = get_safe_token_slow(device);
1307
1308   conkort->cpu->reset();
1309
1310   conkort->cs = 0;
1311}
1312
1313/*-------------------------------------------------
1314    DEVICE_GET_INFO( luxor_55_10828 )
1315-------------------------------------------------*/
1316
1317static DEVICE_GET_INFO( luxor_55_10828 )
1318{
1319   switch (state)
1320   {
1321      /* --- the following bits of info are returned as 64-bit signed integers --- */
1322      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = sizeof(conkort_config);                     break;
1323      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(slow_t);                           break;
1324
1325      /* --- the following bits of info are returned as pointers --- */
1326      case DEVINFO_PTR_ROM_REGION:               info->romregion = ROM_NAME(luxor_55_10828);               break;
1327      case DEVINFO_PTR_MACHINE_CONFIG:            info->machine_config = MACHINE_CONFIG_NAME(luxor_55_10828);   break;
1328
1329      /* --- the following bits of info are returned as pointers to data or functions --- */
1330      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(luxor_55_10828);         break;
1331      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
1332      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(luxor_55_10828);         break;
1333
1334      /* --- the following bits of info are returned as NULL-terminated strings --- */
1335      case DEVINFO_STR_NAME:                     strcpy(info->s, "Luxor 55 10828-01");                  break;
1336      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "Luxor ABC");                        break;
1337      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                              break;
1338      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);                           break;
1339      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright the MESS Team");             break;
1340   }
1341}
1342
1343/*-------------------------------------------------
1344    DEVICE_GET_INFO( abc830_pio )
1345-------------------------------------------------*/
1346
1347DEVICE_GET_INFO( abc830_pio )
1348{
1349   switch (state)
1350   {
1351      /* --- the following bits of info are returned as pointers --- */
1352      case DEVINFO_PTR_MACHINE_CONFIG:            info->machine_config = MACHINE_CONFIG_NAME(abc830_pio);      break;
1353
1354      /* --- the following bits of info are returned as NULL-terminated strings --- */
1355      case DEVINFO_STR_NAME:                     strcpy(info->s, "Luxor ABC 830");                     break;
1356
1357      default:                                        DEVICE_GET_INFO_CALL(luxor_55_10828);                  break;
1358   }
1359}
1360
1361/*-------------------------------------------------
1362    DEVICE_START( luxor_55_21046 )
1363-------------------------------------------------*/
1364
1365static DEVICE_START( luxor_55_21046 )
1366{
1367   fast_t *conkort = get_safe_token_fast(device);
1368   const conkort_config *config = get_safe_config(device);
1369
1370   /* find our CPU */
1371   conkort->cpu = device->subdevice(Z80_TAG);
1372
1373   /* find devices */
1374   conkort->bus = device->machine->device(config->bus_tag);
1375   conkort->z80dma = device->subdevice(Z80DMA_TAG);
1376   conkort->wd1793 = device->subdevice(SAB1793_TAG);
1377   conkort->image0 = device->subdevice(FLOPPY_0);
1378   conkort->image1 = device->subdevice(FLOPPY_1);
1379
1380   conkort->dma_irq = 0;
1381   conkort->fdc_irq = 0;
1382   conkort->busy = 0;
1383
1384   /* register for state saving */
1385   state_save_register_device_item(device, 0, conkort->cs);
1386   state_save_register_device_item(device, 0, conkort->status);
1387   state_save_register_device_item(device, 0, conkort->data_in);
1388   state_save_register_device_item(device, 0, conkort->data_out);
1389   state_save_register_device_item(device, 0, conkort->fdc_irq);
1390   state_save_register_device_item(device, 0, conkort->dma_irq);
1391   state_save_register_device_item(device, 0, conkort->busy);
1392
1393   /* patch out sector skew table */
1394/*   UINT8 *rom = device->subregion("conkort")->base();
1395   rom[0x2dd3] = 0;
1396   rom[0x2dd4] = 1;
1397   rom[0x2dd5] = 2;
1398   rom[0x2dd6] = 3;
1399   rom[0x2dd7] = 4;
1400   rom[0x2dd8] = 5;
1401   rom[0x2dd9] = 6;
1402   rom[0x2dda] = 7;
1403   rom[0x2ddb] = 8;
1404   rom[0x2ddc] = 9;
1405   rom[0x2ddd] = 10;
1406   rom[0x2dde] = 11;
1407   rom[0x2ddf] = 12;
1408   rom[0x2de0] = 13;
1409   rom[0x2de1] = 14;
1410   rom[0x2de1] = 15;*/
1411}
1412
1413/*-------------------------------------------------
1414    DEVICE_RESET( luxor_55_21046 )
1415-------------------------------------------------*/
1416
1417static DEVICE_RESET( luxor_55_21046 )
1418{
1419   fast_t *conkort = get_safe_token_fast(device);
1420
1421   conkort->cpu->reset();
1422
1423   conkort->cs = 0;
1424
1425   floppy_mon_w(conkort->image0, ASSERT_LINE);
1426   floppy_mon_w(conkort->image1, ASSERT_LINE);
1427   floppy_drive_set_ready_state(conkort->image0, 1, 1);
1428   floppy_drive_set_ready_state(conkort->image1, 1, 1);
1429}
1430
1431/*-------------------------------------------------
1432    DEVICE_GET_INFO( luxor_55_21046 )
1433-------------------------------------------------*/
1434
1435static DEVICE_GET_INFO( luxor_55_21046 )
1436{
1437   switch (state)
1438   {
1439      /* --- the following bits of info are returned as 64-bit signed integers --- */
1440      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = sizeof(conkort_config);                     break;
1441      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(fast_t);                           break;
1442
1443      /* --- the following bits of info are returned as pointers --- */
1444      case DEVINFO_PTR_ROM_REGION:               info->romregion = ROM_NAME(luxor_55_21046);               break;
1445      case DEVINFO_PTR_MACHINE_CONFIG:            info->machine_config = MACHINE_CONFIG_NAME(luxor_55_21046);   break;
1446
1447      /* --- the following bits of info are returned as pointers to data or functions --- */
1448      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(luxor_55_21046);         break;
1449      case DEVINFO_FCT_STOP:                     /* Nothing */                                    break;
1450      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(luxor_55_21046);         break;
1451
1452      /* --- the following bits of info are returned as NULL-terminated strings --- */
1453      case DEVINFO_STR_NAME:                     strcpy(info->s, "Luxor Conkort 55 21046-41");            break;
1454      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "Luxor ABC");                        break;
1455      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                              break;
1456      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);                           break;
1457      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright the MESS Team");             break;
1458   }
1459}
1460
1461/*-------------------------------------------------
1462    DEVICE_GET_INFO( abc830 )
1463-------------------------------------------------*/
1464
1465DEVICE_GET_INFO( abc830 )
1466{
1467   switch (state)
1468   {
1469      /* --- the following bits of info are returned as pointers --- */
1470      case DEVINFO_PTR_MACHINE_CONFIG:            info->machine_config = MACHINE_CONFIG_NAME(abc830);         break;
1471
1472      /* --- the following bits of info are returned as NULL-terminated strings --- */
1473      case DEVINFO_STR_NAME:                     strcpy(info->s, "Luxor ABC 830");                     break;
1474
1475      default:                                        DEVICE_GET_INFO_CALL(luxor_55_21046);                  break;
1476   }
1477}
1478
1479/*-------------------------------------------------
1480    DEVICE_GET_INFO( abc832 )
1481-------------------------------------------------*/
1482
1483DEVICE_GET_INFO( abc832 )
1484{
1485   switch (state)
1486   {
1487      /* --- the following bits of info are returned as pointers --- */
1488      case DEVINFO_PTR_MACHINE_CONFIG:            info->machine_config = MACHINE_CONFIG_NAME(abc832);         break;
1489
1490      /* --- the following bits of info are returned as NULL-terminated strings --- */
1491      case DEVINFO_STR_NAME:                     strcpy(info->s, "Luxor ABC 832");                     break;
1492
1493      default:                                        DEVICE_GET_INFO_CALL(luxor_55_21046);                  break;
1494   }
1495}
1496
1497/*-------------------------------------------------
1498    DEVICE_GET_INFO( abc838 )
1499-------------------------------------------------*/
1500
1501DEVICE_GET_INFO( abc838 )
1502{
1503   switch (state)
1504   {
1505      /* --- the following bits of info are returned as pointers --- */
1506      case DEVINFO_PTR_MACHINE_CONFIG:            info->machine_config = MACHINE_CONFIG_NAME(abc838);         break;
1507
1508      /* --- the following bits of info are returned as NULL-terminated strings --- */
1509      case DEVINFO_STR_NAME:                     strcpy(info->s, "Luxor ABC 838");                     break;
1510
1511      default:                                        DEVICE_GET_INFO_CALL(luxor_55_21046);                  break;
1512   }
1513}
1514
1515DEFINE_LEGACY_DEVICE(ABC830_PIO, abc830_pio);
1516DEFINE_LEGACY_DEVICE(ABC830, abc830);
1517DEFINE_LEGACY_DEVICE(ABC832, abc832);
1518DEFINE_LEGACY_DEVICE(ABC838, abc838);
src/mess/machine/abc830.h
r0r9137
1#ifndef __CONKORT__
2#define __CONKORT__
3
4#include "emu.h"
5#include "formats/flopimg.h"
6
7/***************************************************************************
8    MACROS / CONSTANTS
9***************************************************************************/
10
11DECLARE_LEGACY_DEVICE(ABC830_PIO, abc830_pio);
12DECLARE_LEGACY_DEVICE(ABC830, abc830);
13DECLARE_LEGACY_DEVICE(ABC832, abc832);
14DECLARE_LEGACY_DEVICE(ABC838, abc838);
15
16#define ADDRESS_ABC832   44
17#define ADDRESS_ABC830   45
18#define ADDRESS_ABC838   46
19
20#define MDRV_ABC830_PIO_ADD(_tag, _bus_tag) \
21   MDRV_DEVICE_ADD(_tag, ABC830_PIO, 0) \
22   MDRV_DEVICE_CONFIG_DATAPTR(conkort_config, bus_tag, _bus_tag) \
23    MDRV_DEVICE_CONFIG_DATA32(conkort_config, sw1, 0x03) \
24    MDRV_DEVICE_CONFIG_DATA32(conkort_config, address, ADDRESS_ABC830)
25
26#define MDRV_ABC830_ADD(_tag, _bus_tag) \
27   MDRV_DEVICE_ADD(_tag, ABC830, 0) \
28   MDRV_DEVICE_CONFIG_DATAPTR(conkort_config, bus_tag, _bus_tag) \
29    MDRV_DEVICE_CONFIG_DATA32(conkort_config, sw1, 0x03) \
30    MDRV_DEVICE_CONFIG_DATA32(conkort_config, sw2, 0) \
31    MDRV_DEVICE_CONFIG_DATA32(conkort_config, address, ADDRESS_ABC830)
32
33#define MDRV_ABC832_ADD(_tag, _bus_tag) \
34   MDRV_DEVICE_ADD(_tag, ABC832, 0) \
35   MDRV_DEVICE_CONFIG_DATAPTR(conkort_config, bus_tag, _bus_tag) \
36    MDRV_DEVICE_CONFIG_DATA32(conkort_config, sw1, 0x03) \
37    MDRV_DEVICE_CONFIG_DATA32(conkort_config, sw2, 0) \
38    MDRV_DEVICE_CONFIG_DATA32(conkort_config, address, ADDRESS_ABC832)
39
40#define MDRV_ABC838_ADD(_tag, _bus_tag) \
41   MDRV_DEVICE_ADD(_tag, ABC838, 0) \
42   MDRV_DEVICE_CONFIG_DATAPTR(conkort_config, bus_tag, _bus_tag) \
43    MDRV_DEVICE_CONFIG_DATA32(conkort_config, sw1, 0x03) \
44    MDRV_DEVICE_CONFIG_DATA32(conkort_config, sw2, 0) \
45    MDRV_DEVICE_CONFIG_DATA32(conkort_config, address, ADDRESS_ABC838)
46
47#define LUXOR_55_10828_ABCBUS(_tag) \
48   _tag, DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_cs_w), DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_stat_r), \
49   DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_inp_r), DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_utp_w), DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_c1_w), \
50   DEVCB_NULL, DEVCB_DEVICE_HANDLER(_tag, luxor_55_10828_c3_w), DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, luxor_55_10828_rst_w)
51
52#define LUXOR_55_21046_ABCBUS(_tag) \
53   _tag, DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_cs_w), DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_stat_r), \
54   DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_inp_r), DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_utp_w), DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_c1_w), \
55   DEVCB_NULL, DEVCB_DEVICE_HANDLER(_tag, luxor_55_21046_c3_w), DEVCB_NULL, DEVCB_DEVICE_LINE(_tag, luxor_55_21046_rst_w)
56
57/***************************************************************************
58    TYPE DEFINITIONS
59***************************************************************************/
60
61typedef struct _conkort_config conkort_config;
62struct _conkort_config
63{
64   const char *bus_tag;      /* bus device */
65   UINT8 sw1;               /* single/double sided/density */
66   UINT8 sw2;               /* drive type */
67   UINT8 address;            /* ABC bus address */
68};
69
70/***************************************************************************
71    PROTOTYPES
72***************************************************************************/
73
74/* configuration dips */
75INPUT_PORTS_EXTERN( luxor_55_10828 );
76INPUT_PORTS_EXTERN( luxor_55_21046 );
77
78/* ABC bus interface */
79WRITE8_DEVICE_HANDLER( luxor_55_10828_cs_w );
80WRITE_LINE_DEVICE_HANDLER( luxor_55_10828_rst_w );
81READ8_DEVICE_HANDLER( luxor_55_10828_stat_r );
82READ8_DEVICE_HANDLER( luxor_55_10828_inp_r );
83WRITE8_DEVICE_HANDLER( luxor_55_10828_utp_w );
84WRITE8_DEVICE_HANDLER( luxor_55_10828_c1_w );
85WRITE8_DEVICE_HANDLER( luxor_55_10828_c3_w );
86
87WRITE8_DEVICE_HANDLER( luxor_55_21046_cs_w );
88WRITE_LINE_DEVICE_HANDLER( luxor_55_21046_rst_w );
89READ8_DEVICE_HANDLER( luxor_55_21046_stat_r );
90READ8_DEVICE_HANDLER( luxor_55_21046_inp_r );
91WRITE8_DEVICE_HANDLER( luxor_55_21046_utp_w );
92WRITE8_DEVICE_HANDLER( luxor_55_21046_c1_w );
93WRITE8_DEVICE_HANDLER( luxor_55_21046_c3_w );
94
95#endif
src/mess/mess.mak
r9136r9137
10531053   $(MESS_MACHINE)/abcbus.o   \
10541054   $(MESS_MACHINE)/abc77.o      \
10551055   $(MESS_MACHINE)/abc99.o      \
1056   $(MESS_MACHINE)/conkort.o   \
1056   $(MESS_MACHINE)/abc830.o   \
10571057
10581058$(MESSOBJ)/magnavox.a:         \
10591059   $(MESS_MACHINE)/odyssey2.o   \
src/mess/drivers/abc80.c
r9136r9137
8484#include "machine/z80pio.h"
8585#include "sound/sn76477.h"
8686#include "machine/abcbus.h"
87#include "machine/conkort.h"
87#include "machine/abc830.h"
8888
8989/* Devices */
9090#include "devices/flopdrv.h"
r9136r9137
537537
538538   /* Luxor Conkort 55-10828 */
539539   MDRV_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy, Z80_TAG)
540   MDRV_LUXOR_55_10828_ADD("luxor_55_10828", ABCBUS_TAG)
540   MDRV_ABC830_PIO_ADD("luxor_55_10828", ABCBUS_TAG)
541541
542542   /* video hardware */
543543   MDRV_FRAGMENT_ADD(abc80_video)
src/mess/drivers/abc80x.c
r9136r9137
150150#include "machine/abcbus.h"
151151#include "machine/e0516.h"
152152#include "machine/abc77.h"
153#include "machine/conkort.h"
153#include "machine/abc830.h"
154154#include "video/mc6845.h"
155155#include "sound/discrete.h"
156156
r9136r9137
11811181
11821182   /* ABC bus */
11831183   MDRV_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy, Z80_TAG)
1184   MDRV_LUXOR_55_21046_ADD("luxor_55_21046", ABCBUS_TAG)
1184   MDRV_ABC830_ADD("luxor_55_21046", ABCBUS_TAG)
11851185
11861186   /* fake keyboard */
11871187   MDRV_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, USEC(2500))
r9136r9137
12231223
12241224   /* ABC bus */
12251225   MDRV_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy, Z80_TAG)
1226   MDRV_LUXOR_55_21046_ADD("luxor_55_21046", ABCBUS_TAG)
1226   MDRV_ABC830_ADD("luxor_55_21046", ABCBUS_TAG)
12271227
12281228   /* fake keyboard */
12291229   MDRV_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, USEC(2500))
r9136r9137
12651265
12661266   /* ABC bus */
12671267   MDRV_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy, Z80_TAG)
1268   MDRV_LUXOR_55_21046_ADD("luxor_55_21046", ABCBUS_TAG)
1268   MDRV_ABC832_ADD("luxor_55_21046", ABCBUS_TAG)
12691269
12701270   /* fake keyboard */
12711271   MDRV_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, USEC(2500))
r9136r9137
13041304
13051305   /* ABC bus */
13061306   MDRV_ABCBUS_ADD(ABCBUS_TAG, abcbus_daisy, Z80_TAG)
1307   MDRV_LUXOR_55_21046_ADD("luxor_55_21046", ABCBUS_TAG)
1307   MDRV_ABC832_ADD("luxor_55_21046", ABCBUS_TAG)
13081308
13091309   /* fake keyboard */
13101310   MDRV_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, USEC(2500))

Previous 15994 Revisions Next


© 1998-2018 The MESS Team