Previous 15994 Revisions Next

r3476 Monday 20th October, 2008 at 17:39:19 UTC by Curt Coder
[ABC80X] Added serial communications dip switch, connected CTC and SIO/2 interrupts, added fake keyboard to all models, fixed vsync polarity, fixed IO maps.
[ABC806] Fixed vsync delay.
[src/mess/drivers]abc80x.c
[src/mess/includes]abc80x.h
[src/mess/video]abc802.c abc806.c abc80x.c

src/mess/video/abc80x.c
r3475r3476
199199{
200200   abc800_state *state = device->machine->driver_data;
201201
202   z80dart_set_ri(state->z80dart, 1, vsync);
202   /* signal _DEW to DART */
203   z80dart_set_ri(state->z80dart, 1, !vsync);
203204}
204205
205206static MC6845_UPDATE_ROW( abc800c_update_row )
src/mess/video/abc802.c
r3475r3476
232232      }
233233   }
234234 
235   z80dart_set_ri(state->z80dart, 1, vsync);
235   /* signal _DEW to DART */
236   z80dart_set_ri(state->z80dart, 1, !vsync);
236237}
237238 
238239/* MC6845 Interfaces */
src/mess/video/abc806.c
r3475r3476
347347
348348      /* clock current vsync value into the shift register */
349349      state->vsync_shift <<= 1;
350      state->vsync_shift = (state->vsync_shift & 0xfffffffffffffffell) | state->vsync;
350      state->vsync_shift = (state->vsync_shift & 0xfffffffel) | state->vsync;
351351
352352      vsync = BIT(state->vsync_shift, state->sync);
353353
354      if (vsync)
354      if (!state->d_vsync && vsync)
355355      {
356356         /* clear V50 address */
357357         state->v50_addr = 0;
358358      }
359      else
359      else if (state->d_vsync && !vsync)
360360      {
361361         /* flash clock */
362362         if (state->flshclk_ctr == 31)
r3475r3476
371371         }
372372      }
373373
374      /* _DEW signal to DART */
375      z80dart_set_ri(state->z80dart, 1, vsync);
374      if (state->d_vsync != vsync)
375      {
376         /* signal _DEW to DART */
377         z80dart_set_ri(state->z80dart, 1, !vsync);
378      }
379
380      state->d_vsync = vsync;
376381   }
377382}
378383
r3475r3476
476481   }
477482
478483   state->sync = 10;
484   state->d_vsync = 1;
485   state->vsync = 1;
479486
480487   /* find devices */
481488
r3475r3476
511518   state_save_register_global(state->hru2_a8);
512519   state_save_register_global(state->vsync_shift);
513520   state_save_register_global(state->vsync);
521   state_save_register_global(state->d_vsync);
514522}
515523
516524/* Video Update */
src/mess/includes/abc80x.h
r3475r3476
9797   UINT8 sync;            /* line synchronization delay */
9898   UINT8 v50_addr;         /* vertical sync PROM address */
9999   int hru2_a8;         /* HRU II PROM address line 8 */
100   UINT64 vsync_shift;      /* vertical sync shift register */
100   UINT32 vsync_shift;      /* vertical sync shift register */
101101   int vsync;            /* vertical sync */
102   int d_vsync;         /* delayed vertical sync */
102103
103104   /* devices */
104105   const device_config *z80ctc;
src/mess/drivers/abc80x.c
r3475r3476
5555
5656    TODO:
5757
58   - rewrite Z80DART for bit level serial I/O
59   - connect ABC77 keyboard to DART
60    - COM port DIP switch
58   - CTC interrupt breaks ABC802/806
59   - bit level accurate Z80 DART (keyboard)
60   - bit level accurate Z80 SIO/2 (cassette)
6161    - floppy controller board
6262    - Facit DTC (recased ABC-800?)
6363    - hard disks (ABC-850 10MB, ABC-852 20MB, ABC-856 60MB)
r3475r3476
8686#include "devices/cassette.h"
8787#include "devices/printer.h"
8888
89static const device_config *cassette_device_image(running_machine *machine)
90{
91   return device_list_find_by_tag( machine->config->devicelist, CASSETTE, "cassette" );
92}
93
8994/* Keyboard HACK */
9095
9196static int keylatch;
r3475r3476
129134   { 0x5f, 0x09, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00 }
130135};
131136
132static void abc800_keyboard_scan(running_machine *machine)
137static void scan_keyboard(running_machine *machine)
133138{
134139   UINT8 keycode = 0;
135140   UINT8 data;
r3475r3476
168173   {
169174      if (!keylatch)
170175      {
171         abc800_state *state = machine->driver_data;
176         const device_config *z80dart = devtag_get_device(machine, Z80DART, Z80DART_TAG);
172177
173         z80dart_set_dcd(state->z80dart, 1, 1);
174         z80dart_receive_data(state->z80dart, 1, keycode);
178         z80dart_set_dcd(z80dart, 1, 1);
179         z80dart_receive_data(z80dart, 1, keycode);
180
175181         keylatch = keycode;
176182      }
177183   }
r3475r3476
179185   {
180186      if (keylatch)
181187      {
182         abc800_state *state = machine->driver_data;
188         const device_config *z80dart = devtag_get_device(machine, Z80DART, Z80DART_TAG);
183189
184         z80dart_set_dcd(state->z80dart, 1, 0);
185         z80dart_receive_data(state->z80dart, 1, 0);
190         z80dart_set_dcd(z80dart, 1, 0);
191         z80dart_receive_data(z80dart, 1, 0);
192
186193         keylatch = 0;
187194      }
188195   }
189196}
190197
191static TIMER_DEVICE_CALLBACK( abc800_keyboard_tick )
198static TIMER_DEVICE_CALLBACK( keyboard_tick )
192199{
193   abc800_keyboard_scan(timer->machine);
200   scan_keyboard(timer->machine);
194201}
195202
196203/* Read/Write Handlers */
r3475r3476
508515static ADDRESS_MAP_START( abc802_io_map, ADDRESS_SPACE_IO, 8 )
509516   ADDRESS_MAP_UNMAP_HIGH
510517   ADDRESS_MAP_GLOBAL_MASK(0xff)
511   AM_RANGE(0x00, 0x00) AM_READWRITE(abcbus_data_r, abcbus_data_w)
512   AM_RANGE(0x01, 0x01) AM_READWRITE(abcbus_status_r, abcbus_channel_w)
513   AM_RANGE(0x02, 0x05) AM_WRITE(abcbus_command_w)
514   AM_RANGE(0x07, 0x07) AM_READ(abcbus_reset_r)
515   AM_RANGE(0x20, 0x23) AM_DEVREADWRITE(Z80DART, Z80DART_TAG, dart_r, dart_w)
516   AM_RANGE(0x31, 0x31) AM_DEVREAD(MC6845, MC6845_TAG, mc6845_register_r)
517   AM_RANGE(0x32, 0x35) AM_DEVREADWRITE(Z80SIO, Z80SIO_TAG, sio2_r, sio2_w)
518   AM_RANGE(0x38, 0x38) AM_DEVWRITE(MC6845, MC6845_TAG, mc6845_address_w)
519   AM_RANGE(0x39, 0x39) AM_DEVWRITE(MC6845, MC6845_TAG, mc6845_register_w)
520   AM_RANGE(0x60, 0x63) AM_DEVREADWRITE(Z80CTC, Z80CTC_TAG, z80ctc_r, z80ctc_w)
521   AM_RANGE(0x80, 0xff) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w)
518   AM_RANGE(0x00, 0x00) AM_MIRROR(0x08) AM_READWRITE(abcbus_data_r, abcbus_data_w)
519   AM_RANGE(0x01, 0x01) AM_MIRROR(0x08) AM_READWRITE(abcbus_status_r, abcbus_channel_w)
520   AM_RANGE(0x02, 0x05) AM_MIRROR(0x08) AM_WRITE(abcbus_command_w)
521//   AM_RANGE(0x05, 0x05) AM_MIRROR(0x08) AM_READ(pling_r)
522   AM_RANGE(0x07, 0x07) AM_MIRROR(0x08) AM_READ(abcbus_reset_r)
523   AM_RANGE(0x20, 0x23) AM_MIRROR(0x0c) AM_DEVREADWRITE(Z80DART, Z80DART_TAG, dart_r, dart_w)
524   AM_RANGE(0x31, 0x31) AM_MIRROR(0x06) AM_DEVREAD(MC6845, MC6845_TAG, mc6845_register_r)
525   AM_RANGE(0x38, 0x38) AM_MIRROR(0x06) AM_DEVWRITE(MC6845, MC6845_TAG, mc6845_address_w)
526   AM_RANGE(0x39, 0x39) AM_MIRROR(0x06) AM_DEVWRITE(MC6845, MC6845_TAG, mc6845_register_w)
527   AM_RANGE(0x40, 0x43) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80SIO, Z80SIO_TAG, sio2_r, sio2_w)
528   AM_RANGE(0x60, 0x63) AM_MIRROR(0x1c) AM_DEVREADWRITE(Z80CTC, Z80CTC_TAG, z80ctc_r, z80ctc_w)
529   AM_RANGE(0x80, 0x80) AM_MIRROR(0x7f) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w)
522530ADDRESS_MAP_END
523531
524532// ABC 806
r3475r3476
559567   AM_RANGE(0x37, 0x37) AM_MIRROR(0xff00) AM_MASK(0xff00) AM_READWRITE(abc806_cli_r, abc806_sso_w)
560568   AM_RANGE(0x38, 0x38) AM_MIRROR(0xff06) AM_DEVWRITE(MC6845, MC6845_TAG, mc6845_address_w)
561569   AM_RANGE(0x39, 0x39) AM_MIRROR(0xff06) AM_DEVWRITE(MC6845, MC6845_TAG, mc6845_register_w)
562   AM_RANGE(0x40, 0x41) AM_MIRROR(0xff1c) AM_DEVREADWRITE(Z80SIO, Z80SIO_TAG, sio2_r, sio2_w)
570   AM_RANGE(0x40, 0x43) AM_MIRROR(0xff1c) AM_DEVREADWRITE(Z80SIO, Z80SIO_TAG, sio2_r, sio2_w)
563571   AM_RANGE(0x60, 0x63) AM_MIRROR(0xff1c) AM_DEVREADWRITE(Z80CTC, "z80ctc", z80ctc_r, z80ctc_w)
564572   AM_RANGE(0x80, 0x80) AM_MIRROR(0xff7f) AM_READWRITE(abcbus_strobe_r, abcbus_strobe_w)
565573ADDRESS_MAP_END
r3475r3476
687695   PORT_DIPSETTING(    0x2c, "ABC 832/834/850" )
688696   PORT_DIPSETTING(    0x2d, "ABC 830" )
689697   PORT_DIPSETTING(    0x2e, "ABC 838" )
698
699   PORT_START("SB")
700   PORT_DIPNAME( 0xff, 0xaa, "Serial Communications" ) PORT_DIPLOCATION("SB:1,2,3,4,5,6,7,8")
701   PORT_DIPSETTING(    0xaa, "Asynchronous, Single Speed" )
702   PORT_DIPSETTING(    0x2e, "Asynchronous, Split Speed" )
703   PORT_DIPSETTING(    0x50, "Synchronous" )
704   PORT_DIPSETTING(    0x8b, "ABC NET" )
690705INPUT_PORTS_END
691706
692707static INPUT_PORTS_START( abc802 )
693   PORT_INCLUDE(abc77)
708   PORT_INCLUDE(abc800)
694709INPUT_PORTS_END
695710
696711static INPUT_PORTS_START( abc806 )
697   PORT_INCLUDE(abc77)
712   PORT_INCLUDE(abc800)
698713INPUT_PORTS_END
699714
700/* Machine Initialization */
715/* ABC 77 */
701716
702717static ABC77_ON_TXD_CHANGED( abc800_abc77_txd_changed )
703718{
r3475r3476
706721   state->abc77_txd = level;
707722}
708723
709static ABC77_ON_CLOCK_CHANGED( abc800_abc77_clock_changed )
724static ABC77_ON_CLOCK_CHANGED( abc77_clock_changed )
710725{
711//   abc800_state *state = device->machine->driver_data;
726//   const device_config *z80dart = devtag_get_device(device->machine, Z80DART, Z80DART_TAG);
712727
713   /* clock into DART RxTxCB (Receiver/Transmitter Clock B) */
728   /* connected to DART channel B RxTxCB (pin ) */
729   //z80dart_rxtxc_w(z80dart, 1, level);
714730}
715731
716static ABC77_ON_KEYDOWN_CHANGED( abc800_abc77_keydown_changed )
732static ABC77_ON_KEYDOWN_CHANGED( abc77_keydown_changed )
717733{
718   abc800_state *state = device->machine->driver_data;
734   const device_config *z80dart = devtag_get_device(device->machine, Z80DART, Z80DART_TAG);
719735
720   z80dart_set_dcd(state->z80dart, 1, level);
736   /* connected to DART channel B DCD (pin ) */
737   z80dart_set_dcd(z80dart, 1, level);
721738}
722739
723740static ABC77_INTERFACE( abc800_abc77_intf )
724741{
725742   abc800_abc77_txd_changed,
726   abc800_abc77_clock_changed,
727   abc800_abc77_keydown_changed
743   abc77_clock_changed,
744   abc77_keydown_changed
728745};
729746
730static WRITE8_DEVICE_HANDLER( abc800_ctc_z2_w )
747static ABC77_ON_TXD_CHANGED( abc802_abc77_txd_changed )
731748{
732   //abc800_state *state = device->machine->driver_data;
749   abc802_state *state = device->machine->driver_data;
733750
734   /* write to DART channel A RxC/TxC */
751   state->abc77_txd = level;
735752}
736753
737static const z80ctc_interface abc800_ctc_intf =
754static ABC77_INTERFACE( abc802_abc77_intf )
738755{
739   Z80_TAG,            /* cpu */
740   ABC800_X01/2/2,         /* clock */
741   0,                    /* timer disables */
742   0,                    /* interrupt handler */
743   0,                  /* ZC/TO0 callback */
744   0,                    /* ZC/TO1 callback */
745   abc800_ctc_z2_w          /* ZC/TO2 callback */
756   abc802_abc77_txd_changed,
757   abc77_clock_changed,
758   abc77_keydown_changed
746759};
747760
748static WRITE8_DEVICE_HANDLER( sio_serial_transmit )
761static ABC77_ON_TXD_CHANGED( abc806_abc77_txd_changed )
749762{
750}
763   abc806_state *state = device->machine->driver_data;
751764
752static int sio_serial_receive( const device_config *device, int channel )
753{
754   return -1;
765   state->abc77_txd = level;
755766}
756767
757static z80sio_interface abc800_sio_intf =
768static ABC77_INTERFACE( abc806_abc77_intf )
758769{
759   Z80_TAG,            /* cpu */
760   ABC800_X01/2/2,         /* clock */
761   0,                  /* interrupt handler */
762   0,                  /* DTR changed handler */
763   0,                  /* RTS changed handler */
764   0,                  /* BREAK changed handler */
765   sio_serial_transmit,   /* transmit handler */
766   sio_serial_receive      /* receive handler */
770   abc806_abc77_txd_changed,
771   abc77_clock_changed,
772   abc77_keydown_changed
767773};
768774
769static WRITE8_DEVICE_HANDLER( dart_serial_transmit )
770{
771}
775/* Z80 CTC */
772776
773static int dart_serial_receive(const device_config *device, int ch)
777static TIMER_DEVICE_CALLBACK( ctc_tick )
774778{
775   return -1;
776}
779   const device_config *z80ctc = devtag_get_device(timer->machine, Z80CTC, Z80CTC_TAG);
777780
778static void dart_interrupt(const device_config *device, int state)
779{
780   cpunum_set_input_line(device->machine, 0, 0, state);
781}
782
783static const z80dart_interface abc800_dart_intf =
784{
785   Z80_TAG,            /* cpu */
786   ABC800_X01/2/2,         /* clock */
787   dart_interrupt,         /* interrupt handler */
788   0,                  /* DTR changed handler */
789   0,                  /* RTS changed handler */
790   0,                  /* BREAK changed handler */
791   dart_serial_transmit,   /* transmit handler */
792   dart_serial_receive      /* receive handler */
793};
794
795static const z80_daisy_chain abc800_daisy_chain[] =
796{
797   { Z80CTC, "z80ctc" },
798   { Z80SIO, Z80SIO_TAG },
799   { Z80DART, Z80DART_TAG },
800   { NULL }
801};
802
803static void abc800_ctc_trg_w(const device_config *z80ctc)
804{
805781   z80ctc_trg_w(z80ctc, 0, 1);
806782   z80ctc_trg_w(z80ctc, 0, 0);
807783
r3475r3476
812788   z80ctc_trg_w(z80ctc, 2, 0);
813789}
814790
815static TIMER_DEVICE_CALLBACK( abc800_ctc_tick )
791static void ctc_interrupt(const device_config *device, int state)
816792{
817   abc800_state *state = timer->machine->driver_data;
818
819   abc800_ctc_trg_w(state->z80ctc);
793   cpunum_set_input_line(device->machine, 0, INPUT_LINE_IRQ0, state);
820794}
821795
822static MACHINE_START( abc800 )
796static WRITE8_DEVICE_HANDLER( ctc_z0_w )
823797{
824   abc800_state *state = machine->driver_data;
798   //const device_config *z80sio = devtag_get_device(machine, Z80SIO, Z80SIO_TAG);
825799
826   /* find devices */
800   UINT8 sb = input_port_read(device->machine, "SB");
827801
828   state->z80ctc = devtag_get_device(machine, Z80CTC, Z80CTC_TAG);
829   state->z80dart = devtag_get_device(machine, Z80DART, Z80DART_TAG);
830   state->z80sio = devtag_get_device(machine, Z80SIO, Z80SIO_TAG);
831   //state->abc77 = devtag_get_device(machine, ABC77, ABC77_TAG);
832}
802   if (BIT(sb, 2))
803   {
804      /* connected to SIO/2 TxCA, CTC CLK/TRG3 */
805      //z80sio_txc_w(z80sio, 0, data);
806      z80ctc_trg_w(device, 3, data);
807   }
833808
834// ABC802
809   /* connected to SIO/2 RxCB through a thingy */
810   //z80sio_rxcb = ?
811   //z80sio_rxc_w(z80sio, 1, z80sio_rxcb);
835812
836static ABC77_ON_TXD_CHANGED( abc802_abc77_txd_changed )
837{
838   abc802_state *state = device->machine->driver_data;
839
840   state->abc77_txd = level;
813   /* connected to SIO/2 TxCB through a JK divide by 2 */
814   //z80sio_txcb = !z80sio_txcb;
815   //z80sio_txc_w(z80sio, 1, z80sio_txcb);
841816}
842817
843static ABC77_ON_CLOCK_CHANGED( abc802_abc77_clock_changed )
818static WRITE8_DEVICE_HANDLER( ctc_z1_w )
844819{
845//   abc802_state *state = device->machine->driver_data;
820   //const device_config *z80sio = devtag_get_device(machine, Z80SIO, Z80SIO_TAG);
846821
847   /* clock into DART RxTxCB (Receiver/Transmitter Clock B) */
822   UINT8 sb = input_port_read(device->machine, "SB");
823
824   if (BIT(sb, 3))
825   {
826      /* connected to SIO/2 RxCA */
827      //z80sio_rxc_w(z80sio, 0, data);
828   }
829
830   if (BIT(sb, 8))
831   {
832      /* connected to SIO/2 TxCA, CTC CLK/TRG3 */
833      //z80sio_txc_w(z80sio, 0, data);
834      z80ctc_trg_w(device, 3, data);
835   }
848836}
849837
850static ABC77_ON_KEYDOWN_CHANGED( abc802_abc77_keydown_changed )
838static WRITE8_DEVICE_HANDLER( ctc_z2_w )
851839{
852   abc802_state *state = device->machine->driver_data;
840//   const device_config *z80dart = devtag_get_device(machine, Z80DART, Z80DART_TAG);
853841
854   z80dart_set_dcd(state->z80dart, 1, level);
842   /* connected to DART RxCA/TxCA (pin ) */
843   //z80dart_rxtxc_w(z80dart, 0, data);
855844}
856845
857static ABC77_INTERFACE( abc802_abc77_intf )
846static const z80ctc_interface ctc_intf =
858847{
859   abc802_abc77_txd_changed,
860   abc802_abc77_clock_changed,
861   abc802_abc77_keydown_changed
848   Z80_TAG,         /* cpu */
849   ABC800_X01/2/2,      /* clock */
850   0,                 /* timer disables */
851   ctc_interrupt,      /* interrupt handler */
852   ctc_z0_w,         /* ZC/TO0 callback */
853   ctc_z1_w,         /* ZC/TO1 callback */
854   ctc_z2_w          /* ZC/TO2 callback */
862855};
863856
864static WRITE8_DEVICE_HANDLER( abc802_dart_dtr_w )
857/* Z80 SIO/2 */
858
859static void sio_interrupt(const device_config *device, int state)
865860{
861   cpunum_set_input_line(device->machine, 0, INPUT_LINE_IRQ0, state);
862}
863
864static WRITE8_DEVICE_HANDLER( sio_dtr_w )
865{
866866   if (offset == 1)
867867   {
868      memory_set_bank(1, data);
868      /* cassette motor control */
869      cassette_change_state(cassette_device_image(device->machine), data ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
869870   }
870871}
871872
872static WRITE8_DEVICE_HANDLER( abc802_dart_rts_w )
873static WRITE8_DEVICE_HANDLER( sio_serial_transmit )
873874{
874   abc802_state *state = device->machine->driver_data;
875
876875   if (offset == 1)
877876   {
878      state->mux80_40 = !BIT(data, 0);
877      /* cassette dfd out */
879878   }
880879}
881880
882static const z80dart_interface abc802_dart_intf =
881static int sio_serial_receive( const device_config *device, int channel )
883882{
884   Z80_TAG,            /* cpu */
885   ABC800_X01/2/2,         /* clock */
886   0,                  /* interrupt handler */
887   abc802_dart_dtr_w,      /* DTR changed handler */
888   abc802_dart_rts_w,      /* RTS changed handler */
889   0,                  /* BREAK changed handler */
890   dart_serial_transmit,   /* transmit handler */
891   dart_serial_receive      /* receive handler */
892};
883   if (channel == 1)
884   {
885      /* cassette dfd in */
886   }
893887
894static TIMER_DEVICE_CALLBACK( abc802_ctc_tick )
895{
896   abc802_state *state = timer->machine->driver_data;
897
898   abc800_ctc_trg_w(state->z80ctc);
888   return -1;
899889}
900890
901static WRITE8_DEVICE_HANDLER( abc802_ctc_z2_w )
891static z80sio_interface sio_intf =
902892{
903//   abc802_state *state = device->machine->driver_data;
904
905   /* write to DART channel A RxC/TxC */
906}
907
908static const z80ctc_interface abc802_ctc_intf =
909{
910893   Z80_TAG,            /* cpu */
911894   ABC800_X01/2/2,         /* clock */
912   0,                    /* timer disables */
913   0,                    /* interrupt handler */
914   0,                  /* ZC/TO0 callback */
915   0,                    /* ZC/TO1 callback */
916   abc802_ctc_z2_w          /* ZC/TO2 callback */
895   sio_interrupt,         /* interrupt handler */
896   sio_dtr_w,            /* DTR changed handler */
897   0,                  /* RTS changed handler */
898   0,                  /* BREAK changed handler */
899   sio_serial_transmit,   /* transmit handler */
900   sio_serial_receive      /* receive handler */
917901};
918902
919static MACHINE_START( abc802 )
903/* Z80 DART */
904
905static WRITE8_DEVICE_HANDLER( dart_serial_transmit )
920906{
921   abc802_state *state = machine->driver_data;
922
923   /* find devices */
924
925   state->z80ctc = devtag_get_device(machine, Z80CTC, Z80CTC_TAG);
926   state->z80dart = devtag_get_device(machine, Z80DART, Z80DART_TAG);
927   state->z80sio = devtag_get_device(machine, Z80SIO, Z80SIO_TAG);
928   state->abc77 = devtag_get_device(machine, ABC77, ABC77_TAG);
929
930   /* configure memory */
931
932   memory_configure_bank(1, 0, 1, memory_region(machine, Z80_TAG), 0);
933   memory_configure_bank(1, 1, 1, mess_ram, 0);
934907}
935908
936static MACHINE_RESET( abc802 )
909static int dart_serial_receive(const device_config *device, int ch)
937910{
938   memory_set_bank(1, 0);
911   return -1;
939912}
940913
941// ABC806
942
943static ABC77_ON_TXD_CHANGED( abc806_abc77_txd_changed )
914static void dart_interrupt(const device_config *device, int state)
944915{
945   abc806_state *state = device->machine->driver_data;
946
947   state->abc77_txd = level;
916   cpunum_set_input_line(device->machine, 0, INPUT_LINE_IRQ0, state);
948917}
949918
950static ABC77_ON_CLOCK_CHANGED( abc806_abc77_clock_changed )
919static const z80dart_interface abc800_dart_intf =
951920{
952//   abc806_state *state = device->machine->driver_data;
921   Z80_TAG,            /* cpu */
922   ABC800_X01/2/2,         /* clock */
923   dart_interrupt,         /* interrupt handler */
924   0,                  /* DTR changed handler */
925   0,                  /* RTS changed handler */
926   0,                  /* BREAK changed handler */
927   dart_serial_transmit,   /* transmit handler */
928   dart_serial_receive      /* receive handler */
929};
953930
954   /* clock into DART RxTxCB (Receiver/Transmitter Clock B) */
931static WRITE8_DEVICE_HANDLER( abc802_dart_dtr_w )
932{
933   if (offset == 1)
934   {
935      /* _LRS */
936      memory_set_bank(1, data);
937   }
955938}
956939
957static ABC77_ON_KEYDOWN_CHANGED( abc806_abc77_keydown_changed )
940static WRITE8_DEVICE_HANDLER( abc802_dart_rts_w )
958941{
959   abc806_state *state = device->machine->driver_data;
942   abc802_state *state = device->machine->driver_data;
960943
961   z80dart_set_dcd(state->z80dart, 1, level);
944   if (offset == 1)
945   {
946      /* _MUX 80/40 */
947      state->mux80_40 = !BIT(data, 0);
948   }
962949}
963950
964static ABC77_INTERFACE( abc806_abc77_intf )
951static const z80dart_interface abc802_dart_intf =
965952{
966   abc806_abc77_txd_changed,
967   abc806_abc77_clock_changed,
968   abc806_abc77_keydown_changed
953   Z80_TAG,            /* cpu */
954   ABC800_X01/2/2,         /* clock */
955   0,                  /* interrupt handler */
956   abc802_dart_dtr_w,      /* DTR changed handler */
957   abc802_dart_rts_w,      /* RTS changed handler */
958   0,                  /* BREAK changed handler */
959   dart_serial_transmit,   /* transmit handler */
960   dart_serial_receive      /* receive handler */
969961};
970962
971static const e0516_interface abc806_e0516_intf =
972{
973   ABC806_X02
974};
975
976963static WRITE8_DEVICE_HANDLER( abc806_dart_dtr_w )
977964{
978965   abc806_state *state = device->machine->driver_data;
r3475r3476
995982   dart_serial_receive      /* receive handler */
996983};
997984
998static TIMER_DEVICE_CALLBACK( abc806_ctc_tick )
985/* E05-16 */
986
987static const e0516_interface abc806_e0516_intf =
999988{
1000   abc806_state *state = timer->machine->driver_data;
989   ABC806_X02
990};
1001991
1002   abc800_ctc_trg_w(state->z80ctc);
992/* Z80 Daisy Chain */
993
994static const z80_daisy_chain abc800_daisy_chain[] =
995{
996   { Z80CTC, Z80CTC_TAG },
997   { Z80SIO, Z80SIO_TAG },
998   { Z80DART, Z80DART_TAG },
999   { NULL }
1000};
1001
1002/* Machine Initialization */
1003
1004static MACHINE_START( abc800 )
1005{
1006   abc800_state *state = machine->driver_data;
1007
1008   /* find devices */
1009
1010   state->z80ctc = devtag_get_device(machine, Z80CTC, Z80CTC_TAG);
1011   state->z80dart = devtag_get_device(machine, Z80DART, Z80DART_TAG);
1012   state->z80sio = devtag_get_device(machine, Z80SIO, Z80SIO_TAG);
1013   //state->abc77 = devtag_get_device(machine, ABC77, ABC77_TAG);
10031014}
10041015
1005static WRITE8_DEVICE_HANDLER( abc806_ctc_z2_w )
1016static MACHINE_START( abc802 )
10061017{
1007//   abc806_state *state = device->machine->driver_data;
1018   abc802_state *state = machine->driver_data;
10081019
1009   /* write to DART channel A RxC/TxC */
1020   /* find devices */
1021
1022   state->z80ctc = devtag_get_device(machine, Z80CTC, Z80CTC_TAG);
1023   state->z80dart = devtag_get_device(machine, Z80DART, Z80DART_TAG);
1024   state->z80sio = devtag_get_device(machine, Z80SIO, Z80SIO_TAG);
1025//   state->abc77 = devtag_get_device(machine, ABC77, ABC77_TAG);
1026
1027   /* configure memory */
1028
1029   memory_configure_bank(1, 0, 1, memory_region(machine, Z80_TAG), 0);
1030   memory_configure_bank(1, 1, 1, mess_ram, 0);
10101031}
10111032
1012static const z80ctc_interface abc806_ctc_intf =
1033static MACHINE_RESET( abc802 )
10131034{
1014   Z80_TAG,            /* cpu */
1015   ABC800_X01/2/2,         /* clock */
1016   0,                    /* timer disables */
1017   0,                    /* interrupt handler */
1018   0,                  /* ZC/TO0 callback */
1019   0,                    /* ZC/TO1 callback */
1020   abc806_ctc_z2_w          /* ZC/TO2 callback */
1021};
1035   abc802_state *state = machine->driver_data;
10221036
1037   /* memory banking */
1038   memory_set_bank(1, 0);
1039
1040   /* clear screen time out (S1) */
1041   z80sio_set_dcd(state->z80sio, 1, 0);
1042
1043   /* unknown (S2) */
1044   z80sio_set_cts(state->z80sio, 1, 0);
1045
1046   /* 40/80 char (S3) */
1047   z80dart_set_ri(state->z80dart, 0, 0); // 0 = 40, 1 = 80
1048
1049   /* 50/60 Hz */
1050   z80dart_set_cts(state->z80dart, 1, 0); // 0 = 50Hz, 1 = 60Hz ???
1051}
1052
10231053static MACHINE_START( abc806 )
10241054{
10251055   abc806_state *state = machine->driver_data;
r3475r3476
10331063   state->z80dart = devtag_get_device(machine, Z80DART, Z80DART_TAG);
10341064   state->z80sio = devtag_get_device(machine, Z80SIO, Z80SIO_TAG);
10351065   state->e0516 = devtag_get_device(machine, E0516, E0516_TAG);
1036   state->abc77 = devtag_get_device(machine, ABC77, ABC77_TAG);
1066   //state->abc77 = devtag_get_device(machine, ABC77, ABC77_TAG);
10371067
10381068   /* setup memory banking */
10391069
r3475r3476
10851115   MDRV_MACHINE_START(abc800)
10861116
10871117   /* fake keyboard */
1088   MDRV_TIMER_ADD_PERIODIC("keyboard", abc800_keyboard_tick, USEC(2500))
1118   MDRV_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, USEC(2500))
10891119
10901120   /* ABC-77 keyboard */
1091/*   MDRV_SPEAKER_STANDARD_MONO("mono")
1092   MDRV_DEVICE_ADD(ABC77_TAG, ABC77)
1093   MDRV_DEVICE_CONFIG(abc800_abc77_intf)*/
1121//   MDRV_ABC77_ADD(abc800_abc77_intf)
10941122
10951123   /* video hardware */
10961124   MDRV_IMPORT_FROM(abc800m_video)
10971125   
10981126   /* Z80 CTC */
1099   MDRV_Z80CTC_ADD( Z80CTC_TAG, abc800_ctc_intf )
1100   MDRV_TIMER_ADD_PERIODIC("ctc", abc800_ctc_tick, HZ(ABC800_X01/2/2/2))
1127   MDRV_Z80CTC_ADD(Z80CTC_TAG, ctc_intf)
1128   MDRV_TIMER_ADD_PERIODIC("ctc", ctc_tick, HZ(ABC800_X01/2/2/2))
11011129
11021130   /* Z80 SIO/2 */
1103   MDRV_Z80SIO_ADD( Z80SIO_TAG, abc800_sio_intf )
1131   MDRV_Z80SIO_ADD(Z80SIO_TAG, sio_intf)
11041132
11051133   /* Z80 DART */
1106   MDRV_Z80DART_ADD( Z80DART_TAG, abc800_dart_intf )
1134   MDRV_Z80DART_ADD(Z80DART_TAG, abc800_dart_intf)
11071135
11081136   /* printer */
11091137   MDRV_DEVICE_ADD("printer", PRINTER)
r3475r3476
11241152   MDRV_MACHINE_START(abc800)
11251153
11261154   /* fake keyboard */
1127   MDRV_TIMER_ADD_PERIODIC("keyboard", abc800_keyboard_tick, USEC(2500))
1155   MDRV_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, USEC(2500))
11281156
11291157   /* ABC-77 keyboard */
1130/*   MDRV_SPEAKER_STANDARD_MONO("mono")
1131   MDRV_DEVICE_ADD(ABC77_TAG, ABC77)
1132   MDRV_DEVICE_CONFIG(abc800_abc77_intf)*/
1158//   MDRV_ABC77_ADD(abc800_abc77_intf)
11331159
11341160   /* video hardware */
11351161   MDRV_IMPORT_FROM(abc800c_video)
11361162
11371163   /* Z80 CTC */
1138   MDRV_Z80CTC_ADD( Z80CTC_TAG, abc800_ctc_intf )
1139   MDRV_TIMER_ADD_PERIODIC("ctc", abc800_ctc_tick, HZ(ABC800_X01/2/2/2))
1164   MDRV_Z80CTC_ADD(Z80CTC_TAG, ctc_intf)
1165   MDRV_TIMER_ADD_PERIODIC("ctc", ctc_tick, HZ(ABC800_X01/2/2/2))
11401166
11411167   /* Z80 SIO/2 */
1142   MDRV_Z80SIO_ADD( Z80SIO_TAG, abc800_sio_intf )
1168   MDRV_Z80SIO_ADD(Z80SIO_TAG, sio_intf)
11431169
11441170   /* Z80 DART */
1145   MDRV_Z80DART_ADD( Z80DART_TAG, abc800_dart_intf )
1171   MDRV_Z80DART_ADD(Z80DART_TAG, abc800_dart_intf)
11461172
11471173   /* printer */
11481174   MDRV_DEVICE_ADD("printer", PRINTER)
r3475r3476
11631189   MDRV_MACHINE_START(abc802)
11641190   MDRV_MACHINE_RESET(abc802)
11651191
1192   /* fake keyboard */
1193   MDRV_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, USEC(2500))
1194
11661195   /* ABC-77 keyboard */
1167   MDRV_SPEAKER_STANDARD_MONO("mono")
1168   MDRV_DEVICE_ADD(ABC77_TAG, ABC77)
1169   MDRV_DEVICE_CONFIG(abc802_abc77_intf)
1196//   MDRV_ABC77_ADD(abc802_abc77_intf)
11701197
11711198   /* video hardware */
11721199   MDRV_IMPORT_FROM(abc802_video)
11731200
11741201   /* Z80 CTC */
1175   MDRV_Z80CTC_ADD( Z80CTC_TAG, abc802_ctc_intf )
1176   MDRV_TIMER_ADD_PERIODIC("ctc", abc802_ctc_tick, HZ(ABC800_X01/2/2/2))
1202   MDRV_Z80CTC_ADD(Z80CTC_TAG, ctc_intf)
1203   MDRV_TIMER_ADD_PERIODIC("ctc", ctc_tick, HZ(ABC800_X01/2/2/2))
11771204
11781205   /* Z80 SIO/2 */
1179   MDRV_Z80SIO_ADD( Z80SIO_TAG, abc800_sio_intf )
1206   MDRV_Z80SIO_ADD(Z80SIO_TAG, sio_intf)
11801207
11811208   /* Z80 DART */
1182   MDRV_Z80DART_ADD( Z80DART_TAG, abc800_dart_intf )
1209   MDRV_Z80DART_ADD(Z80DART_TAG, abc802_dart_intf)
11831210
11841211   /* printer */
11851212   MDRV_DEVICE_ADD("printer", PRINTER)
r3475r3476
11991226
12001227   MDRV_MACHINE_START(abc806)
12011228   MDRV_MACHINE_RESET(abc806)
1229   
1230   /* fake keyboard */
1231   MDRV_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, USEC(2500))
12021232
12031233   /* ABC-77 keyboard */
1204   MDRV_SPEAKER_STANDARD_MONO("mono")
1205   MDRV_DEVICE_ADD(ABC77_TAG, ABC77)
1206   MDRV_DEVICE_CONFIG(abc806_abc77_intf)
1234   //MDRV_ABC77_ADD(abc806_abc77_intf)
12071235
12081236   /* video hardware */
12091237   MDRV_IMPORT_FROM(abc806_video)
12101238
12111239   /* Z80 CTC */
1212   MDRV_Z80CTC_ADD( Z80CTC_TAG, abc806_ctc_intf )
1213   MDRV_TIMER_ADD_PERIODIC("ctc", abc806_ctc_tick, HZ(ABC800_X01/2/2/2))
1240   MDRV_Z80CTC_ADD(Z80CTC_TAG, ctc_intf)
1241   MDRV_TIMER_ADD_PERIODIC("ctc", ctc_tick, HZ(ABC800_X01/2/2/2))
12141242
12151243   /* Z80 SIO/2 */
1216   MDRV_Z80SIO_ADD( Z80SIO_TAG, abc800_sio_intf )
1244   MDRV_Z80SIO_ADD(Z80SIO_TAG, sio_intf)
12171245
12181246   /* Z80 DART */
1219   MDRV_Z80DART_ADD( Z80DART_TAG, abc800_dart_intf )
1247   MDRV_Z80DART_ADD(Z80DART_TAG, abc806_dart_intf)
12201248
12211249   /* real time clock */
12221250   MDRV_DEVICE_ADD(E0516_TAG, E0516)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team