Previous 15994 Revisions Next

r7447 Tuesday 23rd February, 2010 at 12:23:26 UTC by Curt Coder
[TANDY2K] Fixed ROM mapping and added CRT9007 skeleton.
[src/mess]mess.mak
[src/mess/drivers]tandy2k.c
[src/mess/video]crt9007.c* crt9007.h*

src/mess/video/crt9007.c
r0r7447
1/**********************************************************************
2 
3    SMC CRT9007 CRT Video Processor and Controller VPAC emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************/
9 
10#include "emu.h"
11#include "crt9007.h"
12 
13/***************************************************************************
14    PARAMETERS
15***************************************************************************/
16 
17#define LOG 1
18 
19/***************************************************************************
20    TYPE DEFINITIONS
21***************************************************************************/
22 
23typedef struct _crt9007_t crt9007_t;
24struct _crt9007_t
25{
26   devcb_resolved_read8      in_vd_func;
27   devcb_resolved_write_line   out_int_func;
28   devcb_resolved_write_line   out_hs_func;
29   devcb_resolved_write_line   out_vs_func;
30};
31 
32/***************************************************************************
33    INLINE FUNCTIONS
34***************************************************************************/
35 
36INLINE crt9007_t *get_safe_token(running_device *device)
37{
38   assert(device != NULL);
39   assert(device->token != NULL);
40   return (crt9007_t *)device->token;
41}
42 
43INLINE const crt9007_interface *get_interface(running_device *device)
44{
45   assert(device != NULL);
46   assert(device->type == CRT9007);
47   return (const crt9007_interface *) device->baseconfig().static_config;
48}
49 
50/***************************************************************************
51    IMPLEMENTATION
52***************************************************************************/
53/*-------------------------------------------------
54    crt9007_r - register read
55-------------------------------------------------*/
56 
57READ8_DEVICE_HANDLER( crt9007_r )
58{
59//   crt9007_t *crt9007 = get_safe_token(device);
60 
61   UINT8 data = 0;
62 
63   return data;
64}
65 
66/*-------------------------------------------------
67    crt9007_w - register write
68-------------------------------------------------*/
69 
70WRITE8_DEVICE_HANDLER( crt9007_w )
71{
72//   crt9007_t *crt9007 = get_safe_token(device);
73}
74 
75/*-------------------------------------------------
76    DEVICE_START( crt9007 )
77-------------------------------------------------*/
78 
79static DEVICE_START( crt9007 )
80{
81   crt9007_t *crt9007 = (crt9007_t *)device->token;
82   const crt9007_interface *intf = get_interface(device);
83 
84   /* resolve callbacks */
85   devcb_resolve_read8(&crt9007->in_vd_func, &intf->in_vd_func, device);
86   devcb_resolve_write_line(&crt9007->out_int_func, &intf->out_int_func, device);
87   devcb_resolve_write_line(&crt9007->out_hs_func, &intf->out_hs_func, device);
88   devcb_resolve_write_line(&crt9007->out_vs_func, &intf->out_vs_func, device);
89 
90   /* register for state saving */
91//   state_save_register_device_item(device, 0, crt9007->);
92}
93 
94/*-------------------------------------------------
95    DEVICE_RESET( crt9007 )
96-------------------------------------------------*/
97 
98static DEVICE_RESET( crt9007 )
99{
100//   crt9007_t *crt9007 = (crt9007_t *)device->token;
101}
102 
103/*-------------------------------------------------
104    DEVICE_GET_INFO( crt9007 )
105-------------------------------------------------*/
106 
107DEVICE_GET_INFO( crt9007 )
108{
109   switch (state)
110   {
111      /* --- the following bits of info are returned as 64-bit signed integers --- */
112      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
113      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;         break;
114      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(crt9007_t);            break;
115 
116      /* --- the following bits of info are returned as pointers to data or functions --- */
117      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(crt9007);   break;
118      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
119      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(crt9007);   break;
120 
121      /* --- the following bits of info are returned as NULL-terminated strings --- */
122      case DEVINFO_STR_NAME:                     strcpy(info->s, "SMC CRT9007");            break;
123      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "SMC CRT9007");            break;
124      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                  break;
125      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);               break;
126      case DEVINFO_STR_CREDITS:                  strcpy(info->s, "Copyright the MESS Team");   break;
127   }
128}
src/mess/video/crt9007.h
r0r7447
1/**********************************************************************
2 
3    SMC CRT9007 CRT Video Processor and Controller VPAC emulation
4 
5    Copyright MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8**********************************************************************
9                            _____   _____
10                   VA2   1 |*    \_/     | 40  GND
11                  VA10   2 |             | 39  VA9
12                   VA3   3 |             | 38  VA1
13                  VA11   4 |             | 37  VA8
14                  VA12   5 |             | 36  VA0
15                   VA4   6 |             | 35  CBLANK
16                  VA13   7 |             | 34  CURS
17                   VA5   8 |             | 33  ACK/_TSC
18                   VA6   9 |             | 32  _CSYNC/LPSTB
19                   VA7  10 |   CRT9007   | 31  SLD/SL0
20                   VLT  11 |             | 30  _SLG/SL1
21                   _VS  12 |             | 29  WBEN/SL2/_CSYNC
22                   _HS  13 |             | 28  DMAR/SL3/VBLANK
23                 _CCLK  14 |             | 27  INT
24                  _DRB  15 |             | 26  _RST
25                   VD7  16 |             | 25  _CS
26                   VD6  17 |             | 24  VD0
27                   VD5  18 |             | 23  VD1
28                   VD4  19 |             | 22  VD2
29                   VD3  20 |_____________| 21  +5V
30 
31**********************************************************************/
32 
33#ifndef __CRT9007__
34#define __CRT9007__
35 
36#include "emu.h"
37 
38/***************************************************************************
39    MACROS / CONSTANTS
40***************************************************************************/
41 
42#define CRT9007 DEVICE_GET_INFO_NAME( crt9007 )
43 
44#define MDRV_CRT9007_ADD(_tag, _clock, _config) \
45   MDRV_DEVICE_ADD((_tag), CRT9007, _clock)   \
46   MDRV_DEVICE_CONFIG(_config)
47 
48#define CRT9007_INTERFACE(name) \
49   const crt9007_interface (name) =
50 
51/***************************************************************************
52    TYPE DEFINITIONS
53***************************************************************************/
54 
55typedef struct _crt9007_interface crt9007_interface;
56struct _crt9007_interface
57{
58   devcb_write_line      out_int_func;
59 
60   devcb_write_line      out_hs_func;
61   devcb_write_line      out_vs_func;
62 
63   devcb_read8            in_vd_func;
64};
65 
66/***************************************************************************
67    PROTOTYPES
68***************************************************************************/
69 
70/* device interface */
71DEVICE_GET_INFO( crt9007 );
72 
73/* register access */
74READ8_DEVICE_HANDLER( crt9007_r );
75WRITE8_DEVICE_HANDLER( crt9007_w );
76 
77#endif
src/mess/mess.mak
r7446r7447
493493   $(MESS_MACHINE)/z80sti.o   \
494494   $(MESS_VIDEO)/cdp1861.o      \
495495   $(MESS_VIDEO)/cdp1862.o      \
496   $(MESS_VIDEO)/crt9007.o      \
496497   $(MESS_VIDEO)/crtc6845.o   \
497498   $(MESS_VIDEO)/dl1416.o      \
498499   $(MESS_VIDEO)/dm9368.o      \
src/mess/drivers/tandy2k.c
r7446r7447
3737#include "machine/pic8259.h"
3838#include "machine/upd765.h"
3939#include "sound/speaker.h"
40#include "video/crt9007.h"
4041 
4142/* Read/Write Handlers */
4243 
r7446r7447
4748   speaker_level_w(state->speaker, level);
4849}
4950 
51static READ8_HANDLER( enable_r )
52{
53   /*
54 
55      bit      signal      description
56 
57      0               RS-232 ring indicator
58      1               RS-232 carrier detect
59      2       
60      3       
61      4       
62      5       
63      6       
64      7      _ACLOW       
65 
66   */
67 
68   return 0x80;
69}
70 
5071static WRITE8_HANDLER( enable_w )
5172{
5273   /*
r7446r7447
123144   upd765_tc_w(device, 0);
124145}
125146 
147static WRITE8_HANDLER( addr_ctrl_w )
148{
149   /*
150 
151      bit      description
152 
153      8      A15 of video access
154      9      A16 of video access
155      10      A17 of video access
156      11      A18 of video access
157      12      A19 of video access
158      13      clock speed (0 = 22.4 MHz, 1 = 28 MHz)
159      14      dots/char (0 = 10 [800x400], 1 = 8 [640x400])
160      15      vidout-sel, selects the video source for display on monochrome monitor
161 
162   */
163}
164 
126165static READ8_HANDLER( keyboard_x0_r )
127166{
128167   /*
r7446r7447
209248/* Memory Maps */
210249 
211250static ADDRESS_MAP_START( tandy2k_mem, ADDRESS_SPACE_PROGRAM, 16 )
251   ADDRESS_MAP_UNMAP_HIGH
212252   AM_RANGE(0x00000, 0x1ffff) AM_RAM
213   AM_RANGE(0xf8000, 0xfbfff) AM_RAM // char ram
214   AM_RANGE(0xfc000, 0xfdfff) AM_MIRROR(0x2000) AM_ROM
253//   AM_RANGE(0x20000, 0xdffff) AM_RAM // expanded RAM
254//   AM_RANGE(0xe0000, 0xf7fff) AM_RAM // hires graphics
255   AM_RANGE(0xf8000, 0xfbfff) AM_RAM // character generator
256   AM_RANGE(0xfc000, 0xfdfff) AM_MIRROR(0x2000) AM_ROM AM_REGION(I80186_TAG, 0)
215257ADDRESS_MAP_END
216258 
217259static ADDRESS_MAP_START( tandy2k_io, ADDRESS_SPACE_IO, 16 )
218   AM_RANGE(0x00000, 0x00001) AM_WRITE8(enable_w, 0xff00)
260   ADDRESS_MAP_UNMAP_HIGH
261   AM_RANGE(0x00000, 0x00001) AM_READWRITE8(enable_r, enable_w, 0xff00)
219262   AM_RANGE(0x00002, 0x00003) AM_WRITE8(dma_mux_w, 0xff00)
220263   AM_RANGE(0x00004, 0x00005) AM_DEVREADWRITE8(I8272A_TAG, fldtc_r, fldtc_w, 0xff00)
221   AM_RANGE(0x00010, 0x0001f) AM_DEVREADWRITE8(I8251A_TAG, msm8251_data_r, msm8251_data_w, 0xff00)
264   AM_RANGE(0x00010, 0x00013) AM_DEVREADWRITE8(I8251A_TAG, msm8251_data_r, msm8251_data_w, 0xff00)
222265   AM_RANGE(0x00030, 0x00031) AM_DEVREAD8(I8272A_TAG, upd765_status_r, 0xff00)
223266   AM_RANGE(0x00032, 0x00033) AM_DEVREADWRITE8(I8272A_TAG, upd765_data_r, upd765_data_w, 0xff00)
224   AM_RANGE(0x00040, 0x0004f) AM_DEVREADWRITE8(I8253_TAG, pit8253_r, pit8253_w, 0xff00)
267   AM_RANGE(0x00040, 0x00047) AM_DEVREADWRITE8(I8253_TAG, pit8253_r, pit8253_w, 0xff00)
225268   AM_RANGE(0x00050, 0x00057) AM_DEVREADWRITE8(I8255A_TAG, i8255a_r, i8255a_w, 0xff00)
226   AM_RANGE(0x00060, 0x0006f) AM_DEVREADWRITE8(I8259A_0_TAG, pic8259_r, pic8259_w, 0xff00)
227   AM_RANGE(0x00070, 0x0007f) AM_DEVREADWRITE8(I8259A_1_TAG, pic8259_r, pic8259_w, 0xff00)
228   AM_RANGE(0x00080, 0x0009f) AM_DEVREADWRITE8(I8272A_TAG, upd765_dack_r, upd765_dack_w, 0xff00)
269   AM_RANGE(0x00060, 0x00063) AM_DEVREADWRITE8(I8259A_0_TAG, pic8259_r, pic8259_w, 0xff00)
270   AM_RANGE(0x00070, 0x00073) AM_DEVREADWRITE8(I8259A_1_TAG, pic8259_r, pic8259_w, 0xff00)
271   AM_RANGE(0x00080, 0x00081) AM_DEVREADWRITE8(I8272A_TAG, upd765_dack_r, upd765_dack_w, 0xff00)
272   AM_RANGE(0x00100, 0x0017f) AM_DEVREADWRITE8(CRT9007_TAG, crt9007_r, crt9007_w, 0xff00)
273   AM_RANGE(0x00100, 0x0017f) AM_WRITE8(addr_ctrl_w, 0x00ff)
274//   AM_RANGE(0x00180, 0x00180) AM_READ8(hires_status_r, 0x00ff)
275//   AM_RANGE(0x00180, 0x001bf) AM_WRITE(hires_palette_w)
276//   AM_RANGE(0x001a0, 0x001a0) AM_READ8(hires_plane_w, 0x00ff)
229277ADDRESS_MAP_END
230278 
231279static ADDRESS_MAP_START( tandy2k_hd_io, ADDRESS_SPACE_IO, 16 )
r7446r7447
376424    return 0;
377425}
378426 
427static CRT9007_INTERFACE( crt9007_intf )
428{
429   DEVCB_NULL,
430   DEVCB_NULL,
431   DEVCB_NULL
432};
433 
379434/* Intel 8251A Interface */
380435 
381436static WRITE_LINE_DEVICE_HANDLER( rxrdy_w )
r7446r7447
671726    MDRV_CPU_PROGRAM_MAP(tandy2k_mem)
672727    MDRV_CPU_IO_MAP(tandy2k_io)
673728 
674   MDRV_CPU_ADD(I8048_TAG, I8048, 1000000) // ?
675   MDRV_CPU_IO_MAP(keyboard_io)
729//   MDRV_CPU_ADD(I8048_TAG, I8048, 1000000) // ?
730//   MDRV_CPU_IO_MAP(keyboard_io)
676731 
677732    MDRV_MACHINE_START(tandy2k)
678733    MDRV_MACHINE_RESET(tandy2k)
r7446r7447
689744    MDRV_PALETTE_INIT(black_and_white)
690745   MDRV_VIDEO_START(tandy2k)
691746    MDRV_VIDEO_UPDATE(tandy2k)
747   MDRV_CRT9007_ADD(CRT9007_TAG, XTAL_16MHz*28/16, crt9007_intf)
692748 
693749   /* sound hardware */
694750   MDRV_SPEAKER_STANDARD_MONO("mono")
r7446r7447
707763 
708764   /* internal ram */
709765   MDRV_RAM_ADD("messram")
710   MDRV_RAM_DEFAULT_SIZE("128K,256K")
766   MDRV_RAM_DEFAULT_SIZE("128K")
767   MDRV_RAM_EXTRA_OPTIONS("256K,384K,512K,640K,768K,896K")
711768MACHINE_DRIVER_END
712769 
713770static MACHINE_DRIVER_START( tandy2k_hd )
r7446r7447
724781/* ROMs */
725782 
726783ROM_START( tandy2k )
727   ROM_REGION( 0x100000, I80186_TAG, 0 )
728   ROM_LOAD16_BYTE( "484a00.u48", 0xfe000, 0x1000, CRC(a5ee3e90) SHA1(4b1f404a4337c67065dd272d62ff88dcdee5e34b) )
729   ROM_LOAD16_BYTE( "474600.u47", 0xfe001, 0x1000, CRC(345701c5) SHA1(a775cbfa110b7a88f32834aaa2a9b868cbeed25b) )
784   ROM_REGION( 0x2000, I80186_TAG, 0 )
785   ROM_LOAD16_BYTE( "484a00.u48", 0x0000, 0x1000, CRC(a5ee3e90) SHA1(4b1f404a4337c67065dd272d62ff88dcdee5e34b) )
786   ROM_LOAD16_BYTE( "474600.u47", 0x0001, 0x1000, CRC(345701c5) SHA1(a775cbfa110b7a88f32834aaa2a9b868cbeed25b) )
730787 
731788   ROM_REGION( 0x400, I8048_TAG, 0 )
732789   ROM_LOAD( "keyboard.m1", 0x0000, 0x0400, NO_DUMP )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team