Previous 15994 Revisions Next

r2571 Wednesday 7th May, 2008 at 14:08:26 UTC by Curt Coder
[TMC2000] Now boots but displays garbage only.
[src/mess/drivers]tmc1800.c
[src/mess/video]cdp1864.c

src/mess/video/cdp1864.c
r2570r2571
3131   /* video state */
3232   int disp;                  /* display on */
3333   int dmaout;                  /* DMA request active */
34   int dmaptr;                  /* DMA pointer */
3534   int bgcolor;               /* background color */
3635
3736   /* sound state */
r2570r2571
7069      if (cdp1864->disp)
7170      {
7271         cdp1864->intf->on_int_changed(device, HOLD_LINE);
73         cdp1864->dmaptr = 0;
7472      }
7573
7674      timer_adjust_oneshot(cdp1864->int_timer, video_screen_get_time_until_pos(cdp1864->screen, CDP1864_SCANLINE_INT_END, 0), 0);
r2570r2571
249247{
250248   cdp1864_t *cdp1864 = get_safe_token(device);
251249
250   UINT16 addr = activecpu_get_reg(CDP1802_R0);
251
252252   int sx = video_screen_get_hpos(cdp1864->screen) + 4;
253253   int y = video_screen_get_vpos(cdp1864->screen);
254254   int x;
r2570r2571
259259
260260      if (data & 0x80)
261261      {
262         color = cdp1864->intf->color_ram_r(device, cdp1864->dmaptr);
262         color = cdp1864->intf->color_ram_r(device, addr);
263263      }
264264
265265      *BITMAP_ADDR16(cdp1864->bitmap, y, sx + x) = color;
266266
267267      data <<= 1;
268268   }
269
270   cdp1864->dmaptr++;
271269}
272270
273271/* Sound Update */
r2570r2571
375373
376374   state_save_register_item(unique_tag, 0, cdp1864->disp);
377375   state_save_register_item(unique_tag, 0, cdp1864->dmaout);
378   state_save_register_item(unique_tag, 0, cdp1864->dmaptr);
379376   state_save_register_item(unique_tag, 0, cdp1864->bgcolor);
380377
381378   state_save_register_item(unique_tag, 0, cdp1864->audio);
r2570r2571
396393   
397394   cdp1864->disp = 0;
398395   cdp1864->dmaout = 0;
399   cdp1864->dmaptr = 0;
400396   cdp1864->bgcolor = 0;
401397
402398   cdp1864->intf->on_int_changed(device, CLEAR_LINE);
src/mess/drivers/tmc1800.c
r2570r2571
1414    RAM:        2 KB (4 KB)
1515    ROM:        512 B
1616
17    Video:      OSM-200 (1 KB videoram, 10.2 MHz xtal)
17   Video:      CDP1861
1818
1919    Designer:   Osmo Kainulainen
2020    Keyboard:   OS-70 A (QWERTY, hexadecimal keypad)
2121
2222
23    Oscom 1000B
23    OSCOM 1000B
2424    -----------
25    (c) 197? Oscom Oy, Finland
25    (c) 197? OSCOM Oy, Finland
2626
2727    CPU:        CDP1802A    ? MHz
2828
29    Video:      OSM-200 (1 KB videoram, 10.2 MHz xtal)
30
2931    Enhanced Telmac 1800 with built-in CRT board (OSM-200).
3032
3133
r2570r2571
4648    Keyboard:   ASCII, KB-16, KB-64
4749
4850
49    Telmac 2000E
50    ------------
51    (c) 1980 Telercas Oy, Finland
51    OSCOM Nano
52    ----------
53    (c) 1981 OSCOM Oy, Finland
5254
5355    CPU:        CDP1802A    1.75 MHz
54    RAM:        8 KB
55    ROM:        8 KB
56    ROM:        512 B / 1 KB
57   RAM:      4 KB
5658
57    Video:      CDP1864     1.75 MHz
58    Color RAM:  1 KB
59   Video:      CDP1864      1.75 MHz
5960
60    Colors:     8 fg, 4 bg
61    Resolution: 64x192
62    Sound:      frequency control, volume on/off
63    Keyboard:   ASCII (RCA VP-601/VP-611), KB-16/KB-64
64
65    SBASIC:     24.0
66
67
68    Oscom Nano
69    ----------
70    (c) 1981 Oscom Oy, Finland
71
72    CPU:        CDP1802A    ? MHz
73    ROM:        512 B / 1 KB
74
7561    Small form factor version of Telmac 1800. Combined text and graphics output.
7662
63*/
7764
78    Telmac TMC-121/111/112
79    ----------------------
80    (c) 198? Telercas Oy, Finland
65/*
8166
82    CPU:        CDP1802A    ? MHz
67   TODO:
8368
84    Built from Telmac 2000 series cards. Huge metal box.
69   - tmc2000: fix display
70   - tmc2000: add missing keys
71   - tmc2000: TOOL-2000 rom banking
8572
8673*/
8774
8875#include "driver.h"
8976#include "cpu/cdp1802/cdp1802.h"
77#include "video/cdp1861.h"
9078#include "video/cdp1864.h"
9179#include "devices/cassette.h"
9280#include "sound/beep.h"
9381#include "rescap.h"
9482
9583#define SCREEN_TAG "main"
84#define CDP1861_TAG "cdp1861"
9685#define CDP1864_TAG "cdp1864"
9786
9887extern VIDEO_START( osm200 );
9988extern VIDEO_UPDATE( osm200 );
10089
90static const device_config *cassette_device_image(void)
91{
92   return image_from_devtype_and_index(IO_CASSETTE, 0);
93}
94
10195/* Read/Write Handlers */
10296
10397static int keylatch;
10498
105static WRITE8_HANDLER( keyboard_latch_w )
99static WRITE8_HANDLER( tmc1800_keylatch_w )
106100{
107101   keylatch = data;
108102}
109103
104static WRITE8_HANDLER( tmc2000_keylatch_w )
105{
106   /*
107
108      bit      description
109     
110      0      X0
111      1      X1
112      2      X2
113      3      Y0
114      4      Y1
115      5      Y2
116      6      EXP1
117      7      EXP2
118
119   */
120
121   keylatch = data & 0x3f;
122}
123
110124static WRITE8_DEVICE_HANDLER( tmc2000_bankswitch_w )
111125{
112   memory_set_bank(1, data & 0x01);
126   int bank = data & 0x01;
113127
128   // enable RAM
129
130   memory_set_bank(1, 1);
131
132   if (bank)
133   {
134      // enable Color RAM
135
136      memory_install_readwrite8_handler(device->machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x81ff, 0, 0x0e00, SMH_UNMAP, SMH_BANK2);
137   }
138   else
139   {
140      // enable ROM
141
142      memory_install_readwrite8_handler(device->machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x81ff, 0, 0x0e00, SMH_BANK2, SMH_UNMAP);
143   }
144
145   memory_set_bank(2, bank);
146
114147   cdp1864_tone_latch_w(device, 0, data);
115148}
116149
150static WRITE8_DEVICE_HANDLER( oscnano_bankswitch_w )
151{
152   memory_set_bank(1, 1);
153
154   cdp1864_tone_latch_w(device, 0, data);
155}
156
117157/* Memory Maps */
118158
119159// Telmac 1800
r2570r2571
124164ADDRESS_MAP_END
125165
126166static ADDRESS_MAP_START( tmc1800_io_map, ADDRESS_SPACE_IO, 8 )
127   AM_RANGE(0x02, 0x02) AM_WRITE(keyboard_latch_w)
167   AM_RANGE(0x01, 0x01) AM_DEVREADWRITE(CDP1861, CDP1861_TAG, cdp1861_dispon_r, cdp1861_dispoff_w)
168   AM_RANGE(0x02, 0x02) AM_WRITE(tmc1800_keylatch_w)
128169ADDRESS_MAP_END
129170
171// OSCOM 1000B
172
173static ADDRESS_MAP_START( osc1000b_map, ADDRESS_SPACE_PROGRAM, 8 )
174   AM_RANGE(0x0000, 0x07ff) AM_RAM
175   AM_RANGE(0x8000, 0x81ff) AM_ROM
176ADDRESS_MAP_END
177
178static ADDRESS_MAP_START( osc1000b_io_map, ADDRESS_SPACE_IO, 8 )
179   AM_RANGE(0x02, 0x02) AM_WRITE(tmc1800_keylatch_w)
180ADDRESS_MAP_END
181
130182// Telmac 2000
131183
132184static ADDRESS_MAP_START( tmc2000_map, ADDRESS_SPACE_PROGRAM, 8 )
133   AM_RANGE(0x0000, 0x3fff) AM_RAM
134   AM_RANGE(0x8000, 0x87ff) AM_RAMBANK(1)
185   ADDRESS_MAP_UNMAP_HIGH
186   AM_RANGE(0x0000, 0x7fff) AM_RAMBANK(1)
187   AM_RANGE(0x8000, 0xffff) AM_RAMBANK(2)
135188ADDRESS_MAP_END
136189
137190static ADDRESS_MAP_START( tmc2000_io_map, ADDRESS_SPACE_IO, 8 )
191   ADDRESS_MAP_UNMAP_HIGH
138192   AM_RANGE(0x01, 0x01) AM_DEVREADWRITE(CDP1864, CDP1864_TAG, cdp1864_dispon_r, cdp1864_step_bgcolor_w)
139   AM_RANGE(0x02, 0x02) AM_WRITE(keyboard_latch_w)
193   AM_RANGE(0x02, 0x02) AM_WRITE(tmc2000_keylatch_w)
140194   AM_RANGE(0x04, 0x04) AM_DEVREADWRITE(CDP1864, CDP1864_TAG, cdp1864_dispoff_r, tmc2000_bankswitch_w)
141195ADDRESS_MAP_END
142196
197// OSCOM Nano
198
199static ADDRESS_MAP_START( oscnano_map, ADDRESS_SPACE_PROGRAM, 8 )
200   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK(1)
201   AM_RANGE(0x8000, 0x83ff) AM_ROM
202ADDRESS_MAP_END
203
204static ADDRESS_MAP_START( oscnano_io_map, ADDRESS_SPACE_IO, 8 )
205   AM_RANGE(0x01, 0x01) AM_DEVREADWRITE(CDP1864, CDP1864_TAG, cdp1864_dispon_r, cdp1864_step_bgcolor_w)
206   AM_RANGE(0x02, 0x02) AM_WRITE(tmc1800_keylatch_w)
207   AM_RANGE(0x04, 0x04) AM_DEVREADWRITE(CDP1864, CDP1864_TAG, cdp1864_dispoff_r, oscnano_bankswitch_w)
208ADDRESS_MAP_END
209
143210/* Input Ports */
144211
145212static INPUT_PORTS_START( tmc1800 )
r2570r2571
167234   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Run/Reset") PORT_CODE(KEYCODE_R) PORT_TOGGLE
168235INPUT_PORTS_END
169236
237static INPUT_PORTS_START( tmc2000 )
238   PORT_INCLUDE(tmc1800)
239
240   PORT_START_TAG("IN2")
241   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G')
242   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H')
243   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I')
244   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J')
245   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K')
246   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L')
247   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M')
248   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N')
249
250   PORT_START_TAG("IN3")
251   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O')
252   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P')
253   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
254   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R')
255   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S')
256   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T')
257   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U')
258   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V')
259
260   PORT_START_TAG("IN4")
261   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W')
262   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X')
263   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
264   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z')
265   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
266   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
267   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
268   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
269
270   PORT_START_TAG("IN5")
271   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
272   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
273   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
274   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
275   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
276   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
277   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
278   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
279
280   PORT_START_TAG("IN6")
281   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
282   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
283   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
284   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
285   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
286   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
287   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
288   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
289
290   PORT_START_TAG("IN7")
291   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD )
292   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD )
293   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD )
294   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD )
295   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD )
296   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD )
297   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD )
298   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD )
299INPUT_PORTS_END
300
301static INPUT_PORTS_START( oscnano )
302   PORT_INCLUDE(tmc1800)
303
304   PORT_MODIFY("RUN")
305   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Monitor") PORT_CODE(KEYCODE_M) PORT_TOGGLE
306INPUT_PORTS_END
307
170308/* Video */
171309
310// Telmac 1800
311
312static int cdp1861_efx;
313
314static CDP1861_ON_INT_CHANGED( tmc1800_int_w )
315{
316   cpunum_set_input_line(device->machine, 0, CDP1802_INPUT_LINE_INT, level);
317}
318
319static CDP1861_ON_DMAO_CHANGED( tmc1800_dmao_w )
320{
321   cpunum_set_input_line(device->machine, 0, CDP1802_INPUT_LINE_DMAOUT, level);
322}
323
324static CDP1861_ON_EFX_CHANGED( tmc1800_efx_w )
325{
326   cdp1861_efx = level;
327}
328
329static const cdp1861_interface tmc1800_cdp1861_intf =
330{
331   SCREEN_TAG,
332   XTAL_1_75MHz,
333   tmc1800_int_w,
334   tmc1800_dmao_w,
335   tmc1800_efx_w
336};
337
338static VIDEO_UPDATE( tmc1800 )
339{
340   const device_config *cdp1861 = device_list_find_by_tag(screen->machine->config->devicelist, CDP1861, CDP1861_TAG);
341
342   cdp1861_update(cdp1861, bitmap, cliprect);
343
344   return 0;
345}
346
347// Telmac 2000
348
172349static int cdp1864_efx;
173350
174351static CDP1864_ON_INT_CHANGED( tmc2000_int_w )
r2570r2571
188365
189366static CDP1864_COLOR_RAM_READ( tmc2000_colorram_r )
190367{
191   UINT8 data = colorram[addr]; // 0x04 = ~B, 0x02 = ~R, 0x01 = ~G
192
193   return ~(((data & 0x04) >> 1) + ((data & 0x02) << 1) + (data & 0x01)) & 0x07;
368   return (~colorram[addr & 0x1ff]) & 0x07;
194369}
195370
196371static const cdp1864_interface tmc2000_cdp1864_intf =
r2570r2571
239414
240415   /*
241416        EF1     ?
242        EF2     keyboard
243        EF3     ?
417        EF2     tape in
418        EF3     keyboard
244419        EF4     ?
245420    */
246421
422   // tape in
423
424   if (cassette_input(cassette_device_image()) > +1.0) flags -= EF2;
425
247426   // keyboard
427
248428   sprintf(port, "IN%d", keylatch / 8);
249   if (~input_port_read(machine, port) & (1 << (keylatch % 8))) flags -= EF2;
429   if (~input_port_read(machine, port) & (1 << (keylatch % 8))) flags -= EF3;
250430
251431   return flags;
252432}
253433
254434static CDP1802_Q_WRITE( tmc1800_q_w )
255435{
436   cassette_output(cassette_device_image(), level ? -1.0 : +1.0);
256437}
257438
439static CDP1802_DMA_WRITE( tmc1800_dma_w )
440{
441   const device_config *cdp1861 = device_list_find_by_tag(machine->config->devicelist, CDP1861, CDP1861_TAG);
442
443   cdp1861_dma_w(cdp1861, data);
444}
445
258446static const cdp1802_interface tmc1800_config =
259447{
260448   tmc1800_mode_r,
r2570r2571
262450   NULL,
263451   tmc1800_q_w,
264452   NULL,
453   tmc1800_dma_w
454};
455
456static const cdp1802_interface osc1000b_config =
457{
458   tmc1800_mode_r,
459   tmc1800_ef_r,
460   NULL,
461   tmc1800_q_w,
462   NULL,
265463   NULL
266464};
267465
268466// Telmac 2000
269467
468static CDP1802_MODE_READ( tmc2000_mode_r )
469{
470   if (input_port_read(machine, "RUN") & 0x01)
471   {
472      return CDP1802_MODE_RUN;
473   }
474   else
475   {
476      // enable ROM at 0x0000
477
478      memory_set_bank(1, 0);
479
480      return CDP1802_MODE_RESET;
481   }
482}
483
270484static CDP1802_EF_READ( tmc2000_ef_r )
271485{
272486   int flags = 0x0f;
273487   char port[4];
274488
275489   /*
276        EF1     ?
277        EF2     keyboard
278        EF3     ?
490        EF1     CDP1864
491        EF2     tape in
492        EF3     keyboard
279493        EF4     ?
280494    */
281495
496   // CDP1864
497
498   if (!cdp1864_efx) flags -= EF1;
499
500   // tape in
501
502   if (cassette_input(cassette_device_image()) > +1.0) flags -= EF2;
503
282504   // keyboard
505
283506   sprintf(port, "IN%d", keylatch / 8);
284   if (~input_port_read(machine, port) & (1 << (keylatch % 8))) flags -= EF2;
507   if (~input_port_read(machine, port) & (1 << (keylatch % 8))) flags -= EF3;
285508
286509   return flags;
287510}
r2570r2571
291514   const device_config *cdp1864 = device_list_find_by_tag(machine->config->devicelist, CDP1864, CDP1864_TAG);
292515
293516   // turn CDP1864 sound generator on/off
517
294518   cdp1864_aoe_w(cdp1864, level);
295519
296520   // set Q led status
521
297522   set_led_status(1, level);
523
524   // tape out
525
526   cassette_output(cassette_device_image(), level ? -1.0 : +1.0);
298527}
299528
300529static CDP1802_DMA_WRITE( tmc2000_dma_w )
r2570r2571
306535
307536static const cdp1802_interface tmc2000_config =
308537{
309   tmc1800_mode_r,
538   tmc2000_mode_r,
310539   tmc2000_ef_r,
311540   NULL,
312541   tmc2000_q_w,
r2570r2571
314543   tmc2000_dma_w
315544};
316545
546// OSCOM Nano
547
548static CDP1802_MODE_READ( oscnano_mode_r )
549{
550   if (input_port_read(machine, "RUN") & 0x01)
551   {
552      return CDP1802_MODE_RUN;
553   }
554   else
555   {
556      // enable ROM at 0x0000
557
558      memory_set_bank(1, 0);
559
560      return CDP1802_MODE_RESET;
561   }
562}
563
564static CDP1802_EF_READ( oscnano_ef_r )
565{
566   int flags = 0x0f;
567   char port[4];
568
569   /*
570        EF1     CDP1864
571        EF2     tape in
572        EF3     keyboard
573        EF4     monitor
574    */
575
576   // CDP1864
577
578   if (cdp1864_efx) flags -= EF1;
579
580   // tape in
581
582   if (cassette_input(cassette_device_image()) > +1.0) flags -= EF2;
583
584   // keyboard
585
586   sprintf(port, "IN%d", keylatch / 8);
587   if (~input_port_read(machine, port) & (1 << (keylatch % 8))) flags -= EF3;
588
589   // monitor
590
591   if (input_port_read(machine, "RUN") & 0x02) flags -= EF4;
592
593   return flags;
594}
595
596static CDP1802_Q_WRITE( oscnano_q_w )
597{
598   const device_config *cdp1864 = device_list_find_by_tag(machine->config->devicelist, CDP1864, CDP1864_TAG);
599
600   // turn CDP1864 sound generator on/off
601
602   cdp1864_aoe_w(cdp1864, level);
603
604   // set Q led status
605
606   set_led_status(1, level);
607
608   // tape out
609
610   cassette_output(cassette_device_image(), level ? -1.0 : +1.0);
611}
612
613static CDP1802_DMA_WRITE( oscnano_dma_w )
614{
615   const device_config *cdp1864 = device_list_find_by_tag(machine->config->devicelist, CDP1864, CDP1864_TAG);
616
617   cdp1864_dma_w(cdp1864, data);
618}
619
620static const cdp1802_interface oscnano_config =
621{
622   oscnano_mode_r,
623   oscnano_ef_r,
624   NULL,
625   oscnano_q_w,
626   NULL,
627   oscnano_dma_w
628};
629
317630/* Machine Initialization */
318631
632// Telmac 1800
633
319634static MACHINE_START( tmc1800 )
320635{
321636   state_save_register_global(keylatch);
r2570r2571
323638
324639static MACHINE_RESET( tmc1800 )
325640{
641   const device_config *cdp1861 = device_list_find_by_tag(machine->config->devicelist, CDP1861, CDP1861_TAG);
642   cdp1861->reset(cdp1861);
643
326644   cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE);
327645}
328646
647// OSCOM 1000B
648
649static MACHINE_RESET( osc1000b )
650{
651   cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE);
652}
653
654// Telmac 2000
655
329656static MACHINE_START( tmc2000 )
330657{
331658   state_save_register_global(keylatch);
332659
660   // RAM banking
661
333662   memory_configure_bank(1, 0, 1, memory_region(REGION_CPU1) + 0x8000, 0);
334   memory_configure_bank(1, 1, 1, &colorram, 0);
663   memory_configure_bank(1, 1, 1, &mess_ram, 0);
664
665   switch (mess_ram_size)
666   {
667   case 16*1024:
668      memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1, SMH_BANK1);
669      memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_UNMAP, SMH_UNMAP);
670      break;
671
672   case 32*1024:
673      memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
674      break;
675   }
676
677   // ROM/ColorRAM banking
678
679   colorram = auto_malloc(0x200);
680
681   memory_configure_bank(2, 0, 1, memory_region(REGION_CPU1) + 0x8000, 0);
682   memory_configure_bank(2, 1, 1, &colorram, 0);
683
684   memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8000, 0x81ff, 0, 0x0e00, SMH_BANK2, SMH_UNMAP);
335685}
336686
337687static MACHINE_RESET( tmc2000 )
r2570r2571
341691
342692   cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE);
343693
344   // set program counter to 0x8000
345694   memory_set_bank(1, 0);
695   memory_set_bank(2, 0);
346696}
347697
698// OSCOM Nano
699
700static MACHINE_START( oscnano )
701{
702   state_save_register_global(keylatch);
703
704   // RAM banking
705
706   memory_configure_bank(1, 0, 1, memory_region(REGION_CPU1) + 0x8000, 0);
707   memory_configure_bank(1, 1, 1, &mess_ram, 0);
708}
709
710static MACHINE_RESET( oscnano )
711{
712   const device_config *cdp1864 = device_list_find_by_tag(machine->config->devicelist, CDP1864, CDP1864_TAG);
713   cdp1864->reset(cdp1864);
714
715   cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, PULSE_LINE);
716
717   memory_set_bank(1, 0);
718}
719
348720/* Machine Drivers */
349721
350722static MACHINE_DRIVER_START( tmc1800 )
r2570r2571
362734
363735   MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
364736   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
737   MDRV_SCREEN_RAW_PARAMS(XTAL_1_75MHz, CDP1861_SCREEN_WIDTH, CDP1861_HBLANK_END, CDP1861_HBLANK_START, CDP1861_TOTAL_SCANLINES, CDP1861_SCANLINE_VBLANK_END, CDP1861_SCANLINE_VBLANK_START)
738
739   MDRV_PALETTE_LENGTH(2)
740   MDRV_PALETTE_INIT(black_and_white)
741   MDRV_VIDEO_UPDATE(tmc1800)
742
743   MDRV_DEVICE_ADD(CDP1861_TAG, CDP1861)
744   MDRV_DEVICE_CONFIG(tmc1800_cdp1861_intf)
745MACHINE_DRIVER_END
746
747static MACHINE_DRIVER_START( osc1000b )
748   // basic system hardware
749
750   MDRV_CPU_ADD(CDP1802, XTAL_1_75MHz)
751   MDRV_CPU_PROGRAM_MAP(osc1000b_map, 0)
752   MDRV_CPU_IO_MAP(osc1000b_io_map, 0)
753   MDRV_CPU_CONFIG(osc1000b_config)
754
755   MDRV_MACHINE_START(tmc1800)
756   MDRV_MACHINE_RESET(osc1000b)
757
758   // video hardware
759
760   MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
761   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
365762   MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 199)
366763
367764   MDRV_PALETTE_LENGTH(2)
r2570r2571
401798   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
402799MACHINE_DRIVER_END
403800
801static MACHINE_DRIVER_START( oscnano )
802   // basic system hardware
803
804   MDRV_CPU_ADD(CDP1802, XTAL_1_75MHz)
805   MDRV_CPU_PROGRAM_MAP(oscnano_map, 0)
806   MDRV_CPU_IO_MAP(oscnano_io_map, 0)
807   MDRV_CPU_CONFIG(oscnano_config)
808
809   MDRV_MACHINE_START(oscnano)
810   MDRV_MACHINE_RESET(oscnano)
811
812   // video hardware
813
814   MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
815   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
816   MDRV_SCREEN_RAW_PARAMS(CDP1864_CLK_FREQ, CDP1864_SCREEN_WIDTH, CDP1864_HBLANK_END, CDP1864_HBLANK_START, CDP1864_TOTAL_SCANLINES, CDP1864_SCANLINE_VBLANK_END, CDP1864_SCANLINE_VBLANK_START)
817
818   MDRV_PALETTE_LENGTH(8)
819   MDRV_VIDEO_UPDATE(tmc2000)
820
821   MDRV_DEVICE_ADD(CDP1864_TAG, CDP1864)
822   MDRV_DEVICE_CONFIG(tmc2000_cdp1864_intf)
823
824   // sound hardware
825
826   MDRV_SPEAKER_STANDARD_MONO("mono")
827
828   MDRV_SOUND_ADD(BEEP, 0)
829   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
830MACHINE_DRIVER_END
831
404832/* ROMs */
405833
406834ROM_START( tmc1800 )
407835   ROM_REGION( 0x10000, REGION_CPU1, 0 )
408   ROM_LOAD( "82s141.ic2", 0x8000, 0x0200, NO_DUMP ) // MMI 6341-1
836   ROM_LOAD( "mmi6341-1.ic2", 0x8000, 0x0200, NO_DUMP ) // equivalent to 82S141
837ROM_END
409838
839ROM_START( osc1000b )
840   ROM_REGION( 0x10000, REGION_CPU1, 0 )
841   ROM_LOAD( "mmi6341-1.ic2", 0x8000, 0x0200, NO_DUMP ) // equivalent to 82S141
842
410843   ROM_REGION( 0x400, REGION_GFX1, ROMREGION_DISPOSE )
411   ROM_LOAD( "82s147.5d",   0x0000, 0x0200, NO_DUMP ) // MMI 6349
412   ROM_LOAD( "82s147.5c",   0x0200, 0x0200, NO_DUMP ) // MMI 6349
844   ROM_LOAD( "mmi6349.5d",   0x0000, 0x0200, NO_DUMP ) // equivalent to 82S147
845   ROM_LOAD( "mmi6349.5c",   0x0200, 0x0200, NO_DUMP ) // equivalent to 82S147
413846ROM_END
414847
415848ROM_START( tmc2000 )
416849   ROM_REGION( 0x10000, REGION_CPU1, 0 )
417   ROM_SYSTEM_BIOS( 0, "default",  "Monitor" )
850   ROM_SYSTEM_BIOS( 0, "default",  "PROM N:o 200" )
418851   ROMX_LOAD( "200.m5",    0x8000, 0x0200, BAD_DUMP CRC(53BDDF1A) SHA1(3691741A6921A2E2333B697E80D4936BE41DCDA8), ROM_BIOS(1) ) // typed in from the manual
419   ROM_SYSTEM_BIOS( 1, "tool2000", "TOOL-2000" )
420   ROMX_LOAD( "tool2000",   0x8000, 0x0800, NO_DUMP, ROM_BIOS(2) )
852   ROM_SYSTEM_BIOS( 1, "prom202",  "PROM N:o 202" )
853   ROMX_LOAD( "202.m5",    0x8000, 0x0200, NO_DUMP, ROM_BIOS(2) )
854   ROM_SYSTEM_BIOS( 2, "tool2000", "TOOL-2000" )
855   ROMX_LOAD( "tool2000",   0x8000, 0x0800, NO_DUMP, ROM_BIOS(3) )
421856ROM_END
422857
858ROM_START( oscnano )
859   ROM_REGION( 0x10000, REGION_CPU1, 0 )
860   ROM_LOAD( "mmi6349.ic", 0x8000, 0x0200, NO_DUMP ) // equivalent to 82S141
861ROM_END
862
423863/* System Configuration */
424864
425865static void tmc1800_cassette_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
r2570r2571
428868   switch(state)
429869   {
430870      /* --- the following bits of info are returned as 64-bit signed integers --- */
431      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
871      case MESS_DEVINFO_INT_COUNT:               info->i = 1; break;
872      case MESS_DEVINFO_INT_CASSETTE_DEFAULT_STATE:   info->i = CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED; break;
432873
433874      default:                              cassette_device_getinfo(devclass, state, info); break;
434875   }
r2570r2571
440881   CONFIG_DEVICE(tmc1800_cassette_getinfo)
441882SYSTEM_CONFIG_END
442883
443static void tmc2000_cassette_getinfo(const mess_device_class *devclass, UINT32 state, union devinfo *info)
444{
445   /* cassette */
446   switch(state)
447   {
448      /* --- the following bits of info are returned as 64-bit signed integers --- */
449      case MESS_DEVINFO_INT_COUNT:                     info->i = 1; break;
884SYSTEM_CONFIG_START( osc1000b )
885   CONFIG_RAM_DEFAULT   ( 2 * 1024)
886   CONFIG_RAM         ( 4 * 1024)
887   CONFIG_DEVICE(tmc1800_cassette_getinfo)
888SYSTEM_CONFIG_END
450889
451      default:                              cassette_device_getinfo(devclass, state, info); break;
452   }
453}
454
455890SYSTEM_CONFIG_START( tmc2000 )
456891   CONFIG_RAM_DEFAULT   (16 * 1024)
457892   CONFIG_RAM         (32 * 1024)
458   CONFIG_DEVICE(tmc2000_cassette_getinfo)
893   CONFIG_DEVICE(tmc1800_cassette_getinfo)
459894SYSTEM_CONFIG_END
460895
896SYSTEM_CONFIG_START( oscnano )
897   CONFIG_RAM_DEFAULT   (4 * 1024)
898   CONFIG_DEVICE(tmc1800_cassette_getinfo)
899SYSTEM_CONFIG_END
900
461901/* Driver Initialization */
462902
463903static TIMER_CALLBACK(setup_beep)
r2570r2571
471911   timer_set(attotime_zero, NULL, 0, setup_beep);
472912}
473913
474static DRIVER_INIT( tmc2000 )
475{
476   timer_set(attotime_zero, NULL, 0, setup_beep);
477}
478
479914/* System Drivers */
480915
481916/*    YEAR  NAME        PARENT  COMPAT  MACHINE     INPUT       INIT        CONFIG      COMPANY         FULLNAME        FLAGS */
482917COMP( 1977, tmc1800,    0,      0,      tmc1800,    tmc1800,    tmc1800,    tmc1800,    "Telercas Oy",  "Telmac 1800",  GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
483COMP( 1980, tmc2000,    0,      0,      tmc2000,    tmc1800,    tmc2000,    tmc2000,    "Telercas Oy",  "Telmac 2000",  GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
918COMP( 1977, osc1000b,   tmc1800,0,      osc1000b,   tmc1800,    tmc1800,    tmc1800,    "OSCOM Oy",      "OSCOM 1000B",  GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
919COMP( 1980, oscnano,   0,      0,      oscnano,   oscnano,   tmc1800,   oscnano,   "OSCOM Oy",      "OSCOM Nano",  GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
920COMP( 1980, tmc2000,    0,      0,      tmc2000,    tmc2000,    tmc1800,    tmc2000,    "Telercas Oy",  "Telmac 2000",  GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team