Previous 15994 Revisions Next

r9779 Thursday 16th December, 2010 at 13:36:58 UTC by Robbbert
[CD2650] Added notes, keyboard, display. It sort-of runs.
[src/mess/drivers]cd2650.c

src/mess/drivers/cd2650.c
r9778r9779
11/***************************************************************************
22
3        cd2650
3        Central Data cd2650
44
55        08/04/2010 Skeleton driver.
66
7        No info available on this computer apart from a few newsletters.
8        The system only uses 1000-14FF for videoram and 17F0-17FF for
9        scratch ram. All other ram is optional.
10
11        All commands must be in upper case. They are A,B,C,D,E,I,L,R,V.
12        L,D,V appear to be commands to load, dump and verify tapes.
13        The in and output lines for tapes are SENSE and FLAG, which is
14        the usual with S2650 systems. The remaining commands have
15        unknown functions.
16
17        TODO
18        - Lots, probably. The computer is a complete mystery. No pictures,
19                manuals or schematics exist.
20        - Find out how the scrolling works - if it scrolls at all.
21        - Using the terminal keyboard, as it is unknown if it has its own.
22        - Cassette interface.
23
24        We used Winarcadia emulator to get an idea of what the computer
25        might possibly look like, but we DID NOT read the source code.
26
727****************************************************************************/
828
929#include "emu.h"
1030#include "cpu/s2650/s2650.h"
31#include "machine/terminal.h"
1132
1233
1334class cd2650_state : public driver_device
r9778r9779
1637   cd2650_state(running_machine &machine, const driver_device_config_base &config)
1738      : driver_device(machine, config) { }
1839
40   const UINT8 *charrom;
41   const UINT8 *videoram;
42   UINT8 term_data;
1943};
2044
2145
46static READ8_HANDLER( cd2650_keyin_r )
47{
48   cd2650_state *state = space->machine->driver_data<cd2650_state>();
49   UINT8 ret = state->term_data;
50   state->term_data = 0x80;
51   if ((ret > 0x60) && (ret < 0x7b))
52      ret -= 0x20; // upper case only
53   return ret;
54}
55
2256static ADDRESS_MAP_START(cd2650_mem, ADDRESS_SPACE_PROGRAM, 8)
2357   ADDRESS_MAP_UNMAP_HIGH
2458   AM_RANGE( 0x0000, 0x03ff) AM_ROM
25   AM_RANGE( 0x0400, 0x7fff) AM_RAM
59   AM_RANGE( 0x0400, 0x0fff) AM_RAM
60   AM_RANGE( 0x1000, 0x17ff) AM_RAM AM_BASE_MEMBER(cd2650_state, videoram)
61   AM_RANGE( 0x1800, 0x7fff) AM_RAM // expansion ram? the system doesn't use it
2662ADDRESS_MAP_END
2763
2864static ADDRESS_MAP_START( cd2650_io , ADDRESS_SPACE_IO, 8)
2965   ADDRESS_MAP_UNMAP_HIGH
66   AM_RANGE(S2650_DATA_PORT,S2650_DATA_PORT) AM_READ(cd2650_keyin_r)
67   //AM_RANGE(S2650_SENSE_PORT, S2650_FO_PORT) AM_READWRITE(cd2650_cass_in,cd2650_cass_out)
3068ADDRESS_MAP_END
3169
3270/* Input ports */
3371static INPUT_PORTS_START( cd2650 )
72   PORT_INCLUDE(generic_terminal)
3473INPUT_PORTS_END
3574
3675
3776static MACHINE_RESET(cd2650)
3877{
78   cd2650_state *state = machine->driver_data<cd2650_state>();
79   state->term_data = 0x80;
3980}
4081
4182static VIDEO_START( cd2650 )
4283{
84   cd2650_state *state = machine->driver_data<cd2650_state>();
85   state->charrom = memory_region(machine, "chargen");
4386}
4487
4588static VIDEO_UPDATE( cd2650 )
4689{
47    return 0;
90/* The video is unusual in that the characters in each line are spaced at 16 bytes in memory,
91    thus line 1 starts at 1000, line 2 at 1001, etc. There are 16 lines of 80 characters.
92    Further, the letters have bit 6 set low, thus the range is 01 to 1A.
93    When the bottom of the screen is reached, it does not scroll, it just wraps around.
94    There is no scroll register or any indication of how scrolling might be accomplished. */
95
96   cd2650_state *state = screen->machine->driver_data<cd2650_state>();
97   UINT16 offset = 0; // if we figure out how the scrolling works, that calculation goes here
98   UINT8 y,ra,chr,gfx;
99   UINT16 sy=0,x,mem;
100
101   for (y = 0; y < 16; y++)
102   {
103      for (ra = 0; ra < 10; ra++)
104      {
105         UINT16  *p = BITMAP_ADDR16(bitmap, sy++, 0);
106
107         for (x = 0; x < 80; x++)
108         {
109            gfx = 0;
110            if (ra < 9)
111            {
112               mem = offset + y + (x<<4);
113
114               if (mem > 0x4ff)
115                  mem -= 0x500;
116
117               chr = state->videoram[mem];
118
119               if (chr < 0x20)
120                  chr |= 0x40;
121
122               gfx = state->charrom[(chr<<4) | ra ];
123            }
124
125            /* Display a scanline of a character */
126            *p++ = ( gfx & 0x80 ) ? 1 : 0;
127            *p++ = ( gfx & 0x40 ) ? 1 : 0;
128            *p++ = ( gfx & 0x20 ) ? 1 : 0;
129            *p++ = ( gfx & 0x10 ) ? 1 : 0;
130            *p++ = ( gfx & 0x08 ) ? 1 : 0;
131            *p++ = ( gfx & 0x04 ) ? 1 : 0;
132            *p++ = ( gfx & 0x02 ) ? 1 : 0;
133            *p++ = ( gfx & 0x01 ) ? 1 : 0;
134         }
135      }
136   }
137   return 0;
48138}
49139
140static WRITE8_DEVICE_HANDLER( cd2650_kbd_put )
141{
142   cd2650_state *state = device->machine->driver_data<cd2650_state>();
143   state->term_data = data;
144}
145
146static GENERIC_TERMINAL_INTERFACE( cd2650_terminal_intf )
147{
148   DEVCB_HANDLER(cd2650_kbd_put)
149};
150
50151static MACHINE_CONFIG_START( cd2650, cd2650_state )
51    /* basic machine hardware */
52    MDRV_CPU_ADD("maincpu",S2650, XTAL_1MHz)
53    MDRV_CPU_PROGRAM_MAP(cd2650_mem)
54    MDRV_CPU_IO_MAP(cd2650_io)
152   /* basic machine hardware */
153   MDRV_CPU_ADD("maincpu",S2650, XTAL_1MHz)
154   MDRV_CPU_PROGRAM_MAP(cd2650_mem)
155   MDRV_CPU_IO_MAP(cd2650_io)
55156
56    MDRV_MACHINE_RESET(cd2650)
157   MDRV_MACHINE_RESET(cd2650)
57158
58    /* video hardware */
59    MDRV_SCREEN_ADD("screen", RASTER)
60    MDRV_SCREEN_REFRESH_RATE(50)
61    MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
62    MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
63    MDRV_SCREEN_SIZE(640, 480)
64    MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
65    MDRV_PALETTE_LENGTH(2)
66    MDRV_PALETTE_INIT(black_and_white)
159   /* video hardware */
160   MDRV_SCREEN_ADD("screen", RASTER)
161   MDRV_SCREEN_REFRESH_RATE(50)
162   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
163   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
164   MDRV_SCREEN_SIZE(640, 160)
165   MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 159)
166   MDRV_PALETTE_LENGTH(2)
167   MDRV_PALETTE_INIT(black_and_white)
67168
68    MDRV_VIDEO_START(cd2650)
69    MDRV_VIDEO_UPDATE(cd2650)
169   MDRV_VIDEO_START(cd2650)
170   MDRV_VIDEO_UPDATE(cd2650)
171
172   MDRV_GENERIC_TERMINAL_ADD("terminal", cd2650_terminal_intf) // keyboard only
70173MACHINE_CONFIG_END
71174
72175/* ROM definition */
73176ROM_START( cd2650 )
74    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
177   ROM_REGION( 0x8000, "maincpu", ROMREGION_ERASEFF )
75178   ROM_LOAD( "cd2650.rom", 0x0000, 0x0400, CRC(5397328e) SHA1(7106fdb60e1ad2bc5e8e45527f348c23296e8d6a))
179
180   /* character generator not dumped, using the one from 'c10' for now */
181   ROM_REGION( 0x2000, "chargen", 0 )
182   ROM_LOAD( "c10_char.bin", 0x0000, 0x2000, BAD_DUMP CRC(cb530b6f) SHA1(95590bbb433db9c4317f535723b29516b9b9fcbf))
76183ROM_END
77184
78185/* Driver */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team