Previous 15994 Revisions Next

r2815 Thursday 5th June, 2008 at 15:25:39 UTC by Curt Coder
[NEWBRAIN] Added bits and pieces.
[src/mess]mess.mak
[src/mess/drivers]newbrain.c
[src/mess/includes]newbrain.h
[src/mess/video]newbrain.c*

src/mess/includes/newbrain.h
r2814r2815
66typedef struct _newbrain_state newbrain_state;
77struct _newbrain_state
88{
9   /* processor state */
10   int pwrup;            /* power up */
11
912   /* COP420 state */
1013   UINT8 cop_bus;         /* data bus */
1114   int cop_so;            /* serial out */
12   int cop_tdo;         /* ? */
13   int cop_tdi;         /* ? */
15   int cop_tdo;         /* tape data output */
16   int cop_tdi;         /* tape data input */
1417   int cop_rd;            /* memory read */
1518   int cop_wr;            /* memory write */
1619   int cop_access;         /* COP access */
20   int cop_int;         /* COP interrupt */
1721
18   /* fluorescent display state */
19   int segment_data[16];   /* segment data */
20
2122   /* keyboard state */
2223   int keylatch;         /* keyboard row */
2324   int keydata;         /* keyboard column */
2425
2526   /* floppy state */
2627   int fdc_int;         /* interrupt */
28
29   /* video state */
30   int segment_data[16];   /* VF segment data */
31   int clk_int;         /* clock interrupt */
32   int clk;            /* clock interrupt enable */
33   int tvp;            /*  */
34
35   /* serial state */
36   int v24_rts;         /* V.24 ready to send */
37   int v24_txd;         /* V.24 transmit */
38   int prt_txd;         /* printer transmit */
39
40   /* timers */
41   emu_timer *reset_timer;   /* power on reset timer */
42   emu_timer *pwrup_timer;   /* power up timer */
2743};
2844
45/* ---------- defined in video/newbrain.c ---------- */
46
47MACHINE_DRIVER_EXTERN( newbrain_video );
48
2949#endif
src/mess/video/newbrain.c
r0r2815
1#include "driver.h"
2#include "includes/newbrain.h"
3 
4static VIDEO_START( newbrain )
5{
6//   newbrain_state *state = machine->driver_data;
7 
8   /* register for state saving */
9 
10//   state_save_register_global(state->);
11}
12 
13static VIDEO_UPDATE( newbrain )
14{
15   return 0;
16}
17 
18/* Machine Drivers */
19 
20MACHINE_DRIVER_START( newbrain_video )
21   MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
22   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
23   MDRV_SCREEN_REFRESH_RATE(50)
24   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
25   MDRV_SCREEN_SIZE(640, 400)
26   MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 399)
27 
28   MDRV_PALETTE_LENGTH(2)
29   MDRV_PALETTE_INIT(black_and_white)
30 
31   MDRV_VIDEO_START(newbrain)
32   MDRV_VIDEO_UPDATE(newbrain)
33MACHINE_DRIVER_END
src/mess/mess.mak
r2814r2815
12721272   $(MESS_DRIVERS)/bw2.o \
12731273
12741274$(MESSOBJ)/grundy.a: \
1275   $(MESS_DRIVERS)/newbrain.o
1275   $(MESS_DRIVERS)/newbrain.o \
1276   $(MESS_VIDEO)/newbrain.o
12761277
12771278#-------------------------------------------------
12781279# layout dependencies
src/mess/drivers/newbrain.c
r2814r2815
88#include "machine/z80dart.h"
99#include "machine/z80sio.h"
1010#include "includes/newbrain.h"
11#include "includes/serial.h"
1112#include "devices/basicdsk.h"
1213#include "devices/cassette.h"
14#include "rescap.h"
1315
1416/*
1517
r2814r2815
2729   MC6850 ACIA (459)
2830   Z80CTC (458)
2931   ADC0809 (427)
32   DAC0808 (461)
3033
3134*/
3235
r2814r2815
3538   TODO:
3639
3740   - escape key
38   - main z80 interrupt from COP420
41   - COP420 microbus
3942   - video
4043   - tape
4144   - layout for the 16-segment displays
r2814r2815
5053
5154*/
5255
56static int acia_irq;
57static UINT8 acia_rxd = 1, acia_txd = 1;
58
59static const device_config *cassette_device_image(int index)
60{
61   return image_from_devtype_and_index(IO_CASSETTE, index);
62}
63
64/* COP420 */
65
5366static READ8_HANDLER( newbrain_cop_l_r )
5467{
5568   // connected to the Z80 data bus
r2814r2815
7487
7588      bit      description
7689     
77      G0      inverted to _COPINT
78      G1     
79      G2     
80      G3     
90      G0      _COPINT
91      G1      _TM1
92      G2      not connected
93      G3      _TM2
8194
8295   */
8396
8497   // _Z80INT = ((_CLK | _CLKINT) & _COPINT)
98   //cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, BIT(data, 0) ? HOLD_LINE : CLEAR_LINE);
8599
86   cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, BIT(data, 0) ? HOLD_LINE : CLEAR_LINE);
100   newbrain_state *state = machine->driver_data;
101
102   state->cop_int = BIT(data, 0);
103
104   /* tape motor enable */
105
106   cassette_change_state(cassette_device_image(0), BIT(data, 1) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
107   cassette_change_state(cassette_device_image(1), BIT(data, 3) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
87108}
88109
89110static READ8_HANDLER( newbrain_cop_g_r )
r2814r2815
92113
93114      bit      description
94115     
95      G0     
116      G0      not connected
96117      G1      K9
97118      G2      K7
98119      G3      K3
r2814r2815
113134      D0      inverted to K4 -> CD4024 pin 2 (reset)
114135      D1      TDO
115136      D2      inverted to K6 -> CD4024 pin 1 (clock), CD4076 pin 7 (clock), inverted to DS8881 pin 3 (enable)
116      D3     
137      D3      not connected
117138
118139   */
119140
120141   newbrain_state *state = machine->driver_data;
121142
143   /* keyboard row reset */
144
122145   if (!BIT(data, 0))
123146   {
124147      state->keylatch = 0;
125148   }
126149
150   /* tape data output */
151
127152   state->cop_tdo = BIT(data, 1);
128153
154   cassette_output(cassette_device_image(0), state->cop_tdo ? -1.0 : +1.0);
155   cassette_output(cassette_device_image(1), state->cop_tdo ? -1.0 : +1.0);
156
157   /* keyboard and display clock */
158
129159   if (!BIT(data, 2))
130160   {
131161      char port[4];
r2814r2815
188218
189219   newbrain_state *state = machine->driver_data;
190220
221   state->cop_tdi = ((cassette_input(cassette_device_image(0)) > +1.0) || (cassette_input(cassette_device_image(1)) > +1.0)) ^ state->cop_tdo;
222
191223   return state->cop_tdi;
192224}
193225
194#ifdef UNUSED_CODE
195static WRITE8_HANDLER( fdc_io_w )
196{
197   /*
226/* Floppy Disc Controller */
198227
199      bit      description
200
201      0      PAGING
202      1     
203      2      MA16
204      3      MPM
205      4     
206      5      _FDC RESET
207      6     
208      7      FDC ATT
209
210   */
211}
212
213228static WRITE8_HANDLER( fdc_io2_w )
214229{
215230   /*
r2814r2815
235250   nec765_set_tc_state(BIT(data, 2));
236251}
237252
253static WRITE8_HANDLER( fdc_io_w )
254{
255   /*
256
257      bit      description
258
259      0      PAGING
260      1     
261      2      HA16
262      3      MPM
263      4     
264      5      _FDC RESET
265      6     
266      7      FDC ATT
267
268   */
269
270   if (!BIT(data, 5))
271   {
272      fdc_io2_w(machine, 0, 0);
273   }
274}
275
238276static READ8_HANDLER( fdc_io3_r )
239277{
240278   /*
r2814r2815
257295   return state->fdc_int << 5;
258296}
259297
260static WRITE8_HANDLER( io_w )
298static WRITE8_HANDLER( tvctl_w )
261299{
262300   /*
263301
264302      bit      description
265303
304      0      RV
305      1      FS
306      2      32/_40
307      3      UCR
308      4     
309      5     
310      6      80L
311      7     
312
313   */
314}
315
316static READ8_HANDLER( clclk_r )
317{
318   newbrain_state *state = machine->driver_data;
319
320   state->clk_int = 1;
321
322   return 0xff;
323}
324
325static WRITE8_HANDLER( clclk_w )
326{
327   newbrain_state *state = machine->driver_data;
328
329   state->clk_int = 1;
330}
331
332static WRITE8_HANDLER( enrg_w )
333{
334   /*
335
336      bit      description
337
338      0      _CLK
339      1     
340      2      TVP
341      3     
342      4      _RTSD (V24 Ready to Send)
343      5      DO (V24 TxD)
344      6     
345      7      PO (Printer TxD)
346
347   */
348
349   newbrain_state *state = machine->driver_data;
350
351   state->clk = BIT(data, 0);
352   state->tvp = BIT(data, 2);
353   state->v24_rts = BIT(data, 4);
354   state->v24_txd = BIT(data, 5);
355   state->prt_txd = BIT(data, 7);
356}
357
358static READ8_HANDLER( ust_r )
359{
360   /*
361
362      bit      description
363
364      0      tied to +5V
365      1      PWRUP
366      2     
367      3     
368      4     
369      5      _CLKINT
370      6     
371      7      _COPINT
372
373   */
374
375   newbrain_state *state = machine->driver_data;
376
377   return (state->cop_int << 7) || (state->clk_int << 5) | (state->pwrup << 1) | 0x01;
378}
379
380static READ8_HANDLER( ust2_r )
381{
382   /*
383
384      bit      description
385
386      0      RDDK (V24 RxD)
387      1      _CTSD (V24 Clear to Send)
388      2     
389      3     
390      4     
391      5      TPIN
392      6     
393      7      _CTSP (Printer Clear to Send)
394
395   */
396
397   return 0;
398}
399
400static READ8_HANDLER( cop_r )
401{
402   newbrain_state *state = machine->driver_data;
403   UINT8 data;
404
405   state->cop_rd = 0;
406   state->cop_wr = 1;
407   state->cop_access = 0;
408
409   data = state->cop_bus;
410
411   state->cop_rd = 1;
412   state->cop_wr = 1;
413   state->cop_access = 1;
414
415   return data;
416}
417
418static WRITE8_HANDLER( cop_w )
419{
420   newbrain_state *state = machine->driver_data;
421
422   state->cop_rd = 1;
423   state->cop_wr = 0;
424   state->cop_access = 0;
425
426   state->cop_bus = data;
427
428   state->cop_rd = 1;
429   state->cop_wr = 1;
430   state->cop_access = 1;
431}
432
433/* Expansion Box */
434
435static WRITE8_HANDLER( enrg2_w )
436{
437   /*
438
439      bit      description
440
266441      0      _USERP
267442      1      ANP
268443      2      MLTMD
269444      3      MSPD
270      4      ENOR
445      4      ENOR (enable output receive)
271446      5      ANSW
272      6      ENOT
447      6      ENOT (enable output transmit)
273448      7     
274449
275450   */
451
452   if (BIT(data, 4))
453   {
454      // ACIA RxD connected to Printer
455   }
456   else
457   {
458      // ACIA RxD connected to V24
459   }
460
461   if (BIT(data, 6))
462   {
463      // ACIA TxD connected to Printer
464   }
465   else
466   {
467      // ACIA TxD connected to V24
468   }
276469}
277#endif
278470
471static READ8_HANDLER( st0_r )
472{
473   /*
474
475      bit      description
476
477      0     
478      1     
479      2      tied to 0V
480      3      _USRINT0
481      4      _USRINT
482      5     
483      6      _ACINT
484      7     
485
486   */
487
488   return acia_irq << 6;
489}
490
491static READ8_HANDLER( st1_r )
492{
493   /*
494
495      bit      description
496
497      0     
498      1      TVCNSL
499      2     
500      3      40/_80
501      4      _ANCH
502      5      N/_RV
503      6     
504      7     
505
506   */
507
508   return 0;
509}
510
511static READ8_HANDLER( st2_r )
512{
513   /*
514
515      bit      description
516
517      0     
518      1     
519      2     
520      3     
521      4     
522      5     
523      6     
524      7     
525
526   */
527
528   return 0;
529}
530
531static READ8_HANDLER( usbs_r )
532{
533   return 0xff;
534}
535
279536/* Memory Maps */
280537
281538static ADDRESS_MAP_START( newbrain_map, ADDRESS_SPACE_PROGRAM, 8 )
282539   ADDRESS_MAP_UNMAP_HIGH
283   AM_RANGE(0x0000, 0x7fff) AM_RAM
540   AM_RANGE(0x0000, 0x7fff) AM_RAMBANK(1)
284541   AM_RANGE(0xa000, 0xffff) AM_ROM
285542ADDRESS_MAP_END
286543
287544static ADDRESS_MAP_START( newbrain_io_map, ADDRESS_SPACE_IO, 8 )
545   ADDRESS_MAP_UNMAP_HIGH
546//   ADDRESS_MAP_GLOBAL_MASK(0xff)
547//   AM_RANGE(0x00, 0x00) AM_READWRITE(clusr)
548   AM_RANGE(0x01, 0x01) AM_WRITE(enrg2_w)
549//   AM_RANGE(0x02, 0x02) AM_READWRITE(pr)
550//   AM_RANGE(0x03, 0x03) AM_READWRITE(user)
551   AM_RANGE(0x04, 0x04) AM_READWRITE(clclk_r, clclk_w)
552//   AM_RANGE(0x05, 0x05) AM_WRITE(cldma)
553   AM_RANGE(0x06, 0x06) AM_READWRITE(cop_r, cop_w)
554   AM_RANGE(0x07, 0x07) AM_WRITE(enrg_w)
555//   AM_RANGE(0x08, 0x08) AM_READWRITE(tvl)
556   AM_RANGE(0x0c, 0x0c) AM_WRITE(tvctl_w)
557//   AM_RANGE(0x10, 0x10) AM_READ(anin_r)
558   AM_RANGE(0x14, 0x14) AM_READ(ust_r)
559   AM_RANGE(0x16, 0x16) AM_READ(ust2_r)
560   AM_RANGE(0x18, 0x18) AM_READWRITE(acia6850_0_stat_r, acia6850_0_ctrl_w)
561   AM_RANGE(0x19, 0x19) AM_READWRITE(acia6850_0_data_r, acia6850_0_data_w)
562   AM_RANGE(0x1c, 0x1c) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
288563ADDRESS_MAP_END
289564
565static ADDRESS_MAP_START( newbrain_extension_io_map, ADDRESS_SPACE_IO, 8 )
566   ADDRESS_MAP_UNMAP_HIGH
567   ADDRESS_MAP_GLOBAL_MASK(0xff)
568//   AM_RANGE(0x00, 0x00) AM_READWRITE(clusr)
569   AM_RANGE(0x01, 0x01) AM_WRITE(enrg2_w)
570//   AM_RANGE(0x02, 0x02) AM_READWRITE(pr)
571//   AM_RANGE(0x03, 0x03) AM_READWRITE(user)
572//   AM_RANGE(0x04, 0x04) AM_READWRITE(clclk)
573//   AM_RANGE(0x05, 0x05) AM_WRITE(anout_w)
574   AM_RANGE(0x06, 0x06) AM_READWRITE(cop_r, cop_w)
575   AM_RANGE(0x07, 0x07) AM_WRITE(enrg_w)
576//   AM_RANGE(0x08, 0x08) AM_READWRITE(tvl)
577   AM_RANGE(0x0c, 0x0c) AM_WRITE(tvctl_w)
578//   AM_RANGE(0x10, 0x10) AM_READ(anin_r)
579   AM_RANGE(0x14, 0x14) AM_READ(st0_r)
580   AM_RANGE(0x15, 0x15) AM_READ(st1_r)
581   AM_RANGE(0x16, 0x16) AM_READ(st2_r)
582   AM_RANGE(0x17, 0x17) AM_READ(usbs_r)
583   AM_RANGE(0x18, 0x18) AM_READWRITE(acia6850_0_stat_r, acia6850_0_ctrl_w)
584   AM_RANGE(0x19, 0x19) AM_READWRITE(acia6850_0_data_r, acia6850_0_data_w)
585   AM_RANGE(0x1c, 0x1c) AM_READWRITE(z80ctc_0_r, z80ctc_0_w)
586   AM_RANGE(0x02ff, 0x02ff) AM_WRITE(fdc_io_w)
587ADDRESS_MAP_END
588
290589static ADDRESS_MAP_START( newbrain_cop_map, ADDRESS_SPACE_PROGRAM, 8 )
291590   AM_RANGE(0x000, 0x3ff) AM_ROM
292591ADDRESS_MAP_END
r2814r2815
303602
304603static ADDRESS_MAP_START( newbrain_fdc_map, ADDRESS_SPACE_PROGRAM, 8 )
305604   ADDRESS_MAP_UNMAP_HIGH
306   AM_RANGE(0xe000, 0xffff) AM_ROM
605   AM_RANGE(0x0000, 0x1fff) AM_ROM
307606ADDRESS_MAP_END
308607
309608static ADDRESS_MAP_START( newbrain_fdc_io_map, ADDRESS_SPACE_IO, 8 )
609   ADDRESS_MAP_UNMAP_HIGH
610   ADDRESS_MAP_GLOBAL_MASK(0xff)
611   AM_RANGE(0x20, 0x20) AM_WRITE(fdc_io2_w)
612   AM_RANGE(0x40, 0x40) AM_READ(fdc_io3_r)
310613ADDRESS_MAP_END
311614
312615/* Input Ports */
r2814r2815
409712   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CONTROL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) // GL
410713INPUT_PORTS_END
411714
412/* Video */
715/* Machine Initialization */
413716
414static VIDEO_START( newbrain )
415{
416}
417
418static VIDEO_UPDATE( newbrain )
419{
420   return 0;
421}
422
423/* */
424
425static int acia_irq;
426static UINT8 rxd = 1, txd = 1;
427
428717static void acia_interrupt(int state)
429718{
430719   acia_irq = state;
r2814r2815
434723{
435724   500000, // ???
436725   500000, // ???
437   &rxd,
438   &txd,
726   &acia_rxd,
727   &acia_txd,
439728   NULL,
440729   NULL,
441730   NULL,
r2814r2815
455744   NULL
456745};
457746
747static z80ctc_interface newbrain_ctc_intf =
748{
749   1,                  /* clock */
750   0,                    /* timer disables */
751   NULL,                 /* interrupt handler */
752   NULL,               /* ZC/TO0 callback */
753   NULL,                   /* ZC/TO1 callback */
754   NULL               /* ZC/TO2 callback */
755};
756
757static TIMER_CALLBACK( reset_tick )
758{
759   cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, CLEAR_LINE);
760   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, CLEAR_LINE);
761}
762
763static TIMER_CALLBACK( pwrup_tick )
764{
765   newbrain_state *state = machine->driver_data;
766
767   state->pwrup = 0;
768
769   memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
770
771   memory_set_bank(1, 1);
772}
773
774INLINE int get_reset_t(void)
775{
776   return RES_K(220) * CAP_U(10) * 1000; // t = R128 * C125
777}
778
779INLINE int get_pwrup_t(void)
780{
781   return RES_K(560) * CAP_U(10) * 1000; // t = R129 * C127
782}
783
458784static MACHINE_START( newbrain )
459785{
786   newbrain_state *state = machine->driver_data;
787
788   /* memory banking */
789
790   memory_configure_bank(1, 0, 1, memory_region(REGION_CPU1) + 0xa000, 0);
791   memory_configure_bank(1, 1, 1, mess_ram, 0);
792
793   memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x1fff, 0, 0x6000, SMH_BANK1, SMH_UNMAP);
794
795   memory_set_bank(1, 0);
796
797   /* initialize devices */
798
460799   nec765_init(&newbrain_nec765_interface, NEC765A, NEC765_RDY_PIN_NOT_CONNECTED);
461800   acia6850_config(0, &newbrain_acia_intf);
801   z80ctc_init(0, &newbrain_ctc_intf);
802
803   /* allocate reset timer */
804   
805   state->reset_timer = timer_alloc(reset_tick, NULL);
806
807   /* allocate power up timer */
808   
809   state->pwrup_timer = timer_alloc(pwrup_tick, NULL);
810   timer_adjust_oneshot(state->reset_timer, ATTOTIME_IN_MSEC(get_pwrup_t()), 0);
811   state->pwrup = 1;
812
813   /* register for state saving */
462814}
463815
464816static MACHINE_RESET( newbrain )
465817{
818   newbrain_state *state = machine->driver_data;
819
820   cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, HOLD_LINE);
821   cpunum_set_input_line(machine, 1, INPUT_LINE_RESET, HOLD_LINE);
822
823   timer_adjust_oneshot(state->reset_timer, ATTOTIME_IN_MSEC(get_reset_t()), 0);
466824}
467825
468826static const struct z80_irq_daisy_chain newbrain_daisy_chain[] =
r2814r2815
476834   cpunum_set_input_line(machine, 0, INPUT_LINE_IRQ0, HOLD_LINE);
477835}
478836
837static COP400_INTERFACE( newbrain_cop_intf )
838{
839   COP400_CKI_DIVISOR_16, // ???
840   COP400_CKO_OSCILLATOR_OUTPUT,
841   COP400_MICROBUS_ENABLED
842};
843
479844/* Machine Drivers */
480845
481846static MACHINE_DRIVER_START( newbrain )
r2814r2815
491856   MDRV_CPU_ADD_TAG("cop", COP420, XTAL_16MHz/8)
492857   MDRV_CPU_PROGRAM_MAP(newbrain_cop_map, 0)
493858   MDRV_CPU_IO_MAP(newbrain_cop_io_map, 0)
859   MDRV_CPU_CONFIG(newbrain_cop_intf)
494860
495861   MDRV_CPU_ADD_TAG("fdc", Z80, XTAL_4MHz)
496862   MDRV_CPU_PROGRAM_MAP(newbrain_fdc_map, 0)
r2814r2815
501867
502868   // video hardware
503869
504   MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
505   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
506   MDRV_SCREEN_REFRESH_RATE(50)
507   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
508   MDRV_SCREEN_SIZE(640, 400)
509   MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 399)
510
511   MDRV_PALETTE_LENGTH(2)
512   MDRV_PALETTE_INIT(black_and_white)
513
514   MDRV_VIDEO_START(newbrain)
515   MDRV_VIDEO_UPDATE(newbrain)
870   MDRV_IMPORT_FROM(newbrain_video)
516871MACHINE_DRIVER_END
517872
518873static MACHINE_DRIVER_START( newbraid )
r2814r2815
547902   ROM_LOAD( "cop420.419", 0x000, 0x400, NO_DUMP )
548903
549904   ROM_REGION( 0x10000, REGION_CPU3, 0 )
550   ROM_LOAD( "d417-2.417", 0xe000, 0x2000, CRC(e8bda8b9) SHA1(c85a76a5ff7054f4ef4a472ce99ebaed1abd269c) )
905   ROM_LOAD( "d417-2.417", 0x0000, 0x2000, CRC(e8bda8b9) SHA1(c85a76a5ff7054f4ef4a472ce99ebaed1abd269c) )
906
907   ROM_REGION( 0x1000, REGION_GFX1, 0 )
908   ROM_LOAD( "8248r7.453", 0x0000, 0x1000, NO_DUMP )
551909ROM_END
552910
553911#define rom_newbraid rom_newbrain
r2814r2815
561919   ROM_LOAD( "cop420.419", 0x000, 0x400, NO_DUMP )
562920
563921   ROM_REGION( 0x10000, REGION_CPU3, 0 ) // TODO: remove this
564   ROM_LOAD( "d417-2.417", 0xe000, 0x2000, CRC(e8bda8b9) SHA1(c85a76a5ff7054f4ef4a472ce99ebaed1abd269c) )
922   ROM_LOAD( "d417-2.417", 0x0000, 0x2000, CRC(e8bda8b9) SHA1(c85a76a5ff7054f4ef4a472ce99ebaed1abd269c) )
923
924   ROM_REGION( 0x1000, REGION_GFX1, 0 )
925   ROM_LOAD( "8248r7.453", 0x0000, 0x1000, NO_DUMP )
565926ROM_END
566927
567928/* System Configuration */
r2814r2815
610971   }
611972}
612973
974static DEVICE_IMAGE_LOAD( newbrain_serial )
975{
976   /* filename specified */
977   if (device_load_serial_device(image)==INIT_PASS)
978   {
979      /* setup transmit parameters */
980      serial_device_setup(image, 9600, 8, 1, SERIAL_PARITY_NONE);
981
982      serial_device_set_protocol(image, SERIAL_PROTOCOL_NONE);
983
984      /* and start transmit */
985      serial_device_set_transmit_state(image, 1);
986
987      return INIT_PASS;
988   }
989
990   return INIT_FAIL;
991}
992
993static void newbrain_serial_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
994{
995   /* serial */
996   switch(state)
997   {
998      /* --- the following bits of info are returned as 64-bit signed integers --- */
999      case MESS_DEVINFO_INT_TYPE:                     info->i = IO_SERIAL; break;
1000      case MESS_DEVINFO_INT_COUNT:                  info->i = 2; break;
1001
1002      /* --- the following bits of info are returned as pointers to data or functions --- */
1003      case MESS_DEVINFO_PTR_START:                  info->start = DEVICE_START_NAME(serial_device); break;
1004      case MESS_DEVINFO_PTR_LOAD:                     info->load = DEVICE_IMAGE_LOAD_NAME(newbrain_serial); break;
1005      case MESS_DEVINFO_PTR_UNLOAD:                  info->unload = DEVICE_IMAGE_UNLOAD_NAME(serial_device); break;
1006
1007      /* --- the following bits of info are returned as NULL-terminated strings --- */
1008      case MESS_DEVINFO_STR_FILE_EXTENSIONS:            strcpy(info->s = device_temp_str(), "txt"); break;
1009   }
1010}
1011
6131012SYSTEM_CONFIG_START( newbrain )
6141013   CONFIG_RAM_DEFAULT   (32 * 1024)
6151014   CONFIG_DEVICE(newbrain_cassette_getinfo)
6161015   CONFIG_DEVICE(newbrain_floppy_getinfo)
1016   CONFIG_DEVICE(newbrain_serial_getinfo)
6171017SYSTEM_CONFIG_END
6181018
6191019/* System Drivers */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team