Previous 15994 Revisions Next

r9619 Saturday 20th November, 2010 at 11:26:30 UTC by Robbbert
[SOL20] Added rudimentary video driver and keyboard. The machine will respond to your commands. Make sure all input is in uppercase.
[src/mess/drivers]ptcsol.c

src/mess/drivers/ptcsol.c
r9618r9619
2626
2727#include "emu.h"
2828#include "cpu/i8085/i8085.h"
29#include "machine/terminal.h"
2930#include "devices/messram.h"
3031
32static UINT8 sol20_fa;
33static UINT8 sol20_fc;
34static UINT8 sol20_fe;
35static const UINT8 *FNT;
36static const UINT8 *videoram;
37
38static READ8_HANDLER( sol20_fa_r )
39{
40   return sol20_fa;
41}
42
43static READ8_HANDLER( sol20_fc_r )
44{
45   sol20_fa = 0xff;
46   return sol20_fc;
47}
48
49static WRITE8_HANDLER( sol20_fe_w )
50{
51   sol20_fe = data;
52}
53
3154static ADDRESS_MAP_START( sol20_mem, ADDRESS_SPACE_PROGRAM, 8)
3255   AM_RANGE(0X0000, 0Xbfff) AM_RAM   // optional s100 ram
3356   AM_RANGE(0xc000, 0xc7ff) AM_ROM
3457   AM_RANGE(0Xc800, 0Xcbff) AM_RAM   // system ram
35   AM_RANGE(0Xcc00, 0Xcfff) AM_RAM   // video ram
58   AM_RANGE(0Xcc00, 0Xcfff) AM_RAM   AM_REGION("maincpu", 0xcc00)// video ram
3659   AM_RANGE(0Xd000, 0Xffff) AM_RAM   // optional s100 ram
3760ADDRESS_MAP_END
3861
3962static ADDRESS_MAP_START( sol20_io , ADDRESS_SPACE_IO, 8)
4063   ADDRESS_MAP_UNMAP_HIGH
4164   ADDRESS_MAP_GLOBAL_MASK(0xff)
65   AM_RANGE(0xfa, 0xfa) AM_READ(sol20_fa_r)
66   AM_RANGE(0xfc, 0xfc) AM_READ(sol20_fc_r)
67   AM_RANGE(0xfe, 0xfe) AM_WRITE(sol20_fe_w)
4268/*  AM_RANGE(0xf8, 0xf8) serial status in (bit 6=data av, bit 7=tmbe)
4369    AM_RANGE(0xf9, 0xf9) serial data in, out
4470    AM_RANGE(0xfa, 0xfa) general status in (bit 0=keyb data av, bit 1=parin data av, bit 2=parout ready)
r9618r9619
5177
5278/* Input ports */
5379static INPUT_PORTS_START( sol20 )
80   PORT_INCLUDE(generic_terminal)
5481INPUT_PORTS_END
5582
5683
5784static MACHINE_RESET( sol20 )
5885{
86   sol20_fa=0xff;
87   sol20_fe=0;
5988}
6089
6190static VIDEO_START( sol20 )
6291{
92   FNT = memory_region(machine, "chargen");
93   videoram = memory_region(machine, "maincpu")+0xcc00;
6394}
6495
6596static VIDEO_UPDATE( sol20 )
6697{
6798/* visible screen is 64 x 16, with start position controlled by scroll register */
99   static UINT8 framecnt=0;
100   UINT8 y,ra,chr,gfx;
101   UINT16 sy=0,ma,x,inv;
102
103   framecnt++;
104
105   ma = sol20_fe << 6; // scroll register
106
107   for (y = 0; y < 16; y++)
108   {
109      for (ra = 0; ra < 13; ra++)
110      {
111         UINT16  *p = BITMAP_ADDR16(bitmap, sy++, 0);
112
113         for (x = ma; x < ma + 64; x++)
114         {
115            chr = videoram[x & 0x3ff];
116            inv = 0;
117
118            /* Take care of flashing characters */
119            if ((chr & 0x80) && (framecnt & 0x08))
120               inv ^= 0xff;
121
122            chr &= 0x7f;
123
124            if (ra == 0)
125               gfx = 0;
126            else
127            if (ra < 10)
128
129               gfx = FNT[(chr<<4) | (ra-1) ] ^ inv;
130            else
131               gfx = inv;
132
133            /* Display a scanline of a character */
134            *p++ = ( gfx & 0x80 ) ? 1 : 0;
135            *p++ = ( gfx & 0x40 ) ? 1 : 0;
136            *p++ = ( gfx & 0x20 ) ? 1 : 0;
137            *p++ = ( gfx & 0x10 ) ? 1 : 0;
138            *p++ = ( gfx & 0x08 ) ? 1 : 0;
139            *p++ = ( gfx & 0x04 ) ? 1 : 0;
140            *p++ = ( gfx & 0x02 ) ? 1 : 0;
141            *p++ = ( gfx & 0x01 ) ? 1 : 0;
142         }
143      }
144      ma+=64;
145   }
68146   return 0;
69147}
70148
149static WRITE8_DEVICE_HANDLER( sol20_kbd_put )
150{
151   sol20_fa &= 0xfe;
152   sol20_fc = data;
153}
154
155static GENERIC_TERMINAL_INTERFACE( sol20_terminal_intf )
156{
157   DEVCB_HANDLER(sol20_kbd_put)
158};
159
71160static MACHINE_CONFIG_START( sol20, driver_device )
72161   /* basic machine hardware */
73162   MDRV_CPU_ADD("maincpu",I8080, XTAL_14_31818MHz/7)
r9618r9619
81170   MDRV_SCREEN_REFRESH_RATE(50)
82171   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
83172   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
84   MDRV_SCREEN_SIZE(640, 480)
85   MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
173   MDRV_SCREEN_SIZE(512, 208)
174   MDRV_SCREEN_VISIBLE_AREA(0, 511, 0, 207)
86175   MDRV_PALETTE_LENGTH(2)
87176   MDRV_PALETTE_INIT(black_and_white)
88177
r9618r9619
93182//  MDRV_RAM_ADD("messram")
94183//  MDRV_RAM_DEFAULT_SIZE("8K")
95184//  MDRV_RAM_EXTRA_OPTIONS("16K,32K")
185   MDRV_GENERIC_TERMINAL_ADD("terminal", sol20_terminal_intf)
96186MACHINE_CONFIG_END
97187
98188/* ROM definition */
r9618r9619
100190   ROM_REGION( 0x10000, "maincpu", 0 )
101191   ROM_LOAD( "solos.rom", 0xc000, 0x0800, BAD_DUMP CRC(4d0af383) SHA1(ac4510c3380ed4a31ccf4f538af3cb66b76701ef) )   // from solace emu
102192   /* Character generator rom is missing */
193
194   /* character generator not dumped, using the one from 'c10' for now */
195   ROM_REGION( 0x2000, "chargen", 0 )
196   ROM_LOAD( "c10_char.bin", 0x0000, 0x2000, BAD_DUMP CRC(cb530b6f) SHA1(95590bbb433db9c4317f535723b29516b9b9fcbf))
103197ROM_END
104198
105199/* Driver */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team