Previous 15994 Revisions Next

r15326 Sunday 27th May, 2012 at 12:36:57 UTC by Robbbert
Trying out some ideas.
[src/mess/drivers]ptcsol.c sorcerer.c
[src/mess/includes]sorcerer.h
[src/mess/machine]sorcerer.c

src/mess/machine/sorcerer.c
r15325r15326
176176      m_serial_timer->adjust(attotime::zero);
177177#endif
178178
179      UINT8 sound = ioport("CONFIG")->read() & 8;
179      bool sound = BIT(m_iop_config->read(), 3);
180180
181181      m_cass1->change_state(
182         ((BIT(data,4)) && (sound)) ? CASSETTE_SPEAKER_ENABLED : CASSETTE_SPEAKER_MUTED, CASSETTE_MASK_SPEAKER);
182         (BIT(data,4) & sound) ? CASSETTE_SPEAKER_ENABLED : CASSETTE_SPEAKER_MUTED, CASSETTE_MASK_SPEAKER);
183183
184184      m_cass2->change_state(
185         ((BIT(data,5)) && (sound)) ? CASSETTE_SPEAKER_ENABLED : CASSETTE_SPEAKER_MUTED, CASSETTE_MASK_SPEAKER);
185         (BIT(data,5) & sound) ? CASSETTE_SPEAKER_ENABLED : CASSETTE_SPEAKER_MUTED, CASSETTE_MASK_SPEAKER);
186186
187187      /* cassette 1 motor */
188188      m_cass1->change_state(
r15325r15326
216216WRITE8_MEMBER(sorcerer_state::sorcerer_ff_w)
217217{
218218   /* reading the config switch */
219   switch (ioport("CONFIG")->read() & 0x06)
219   switch (m_iop_config->read() & 0x06)
220220   {
221221      case 0: /* speaker */
222222         dac_data_w(m_dac, data);
r15325r15326
269269     - tied high, allowing PARIN and PAROUT bios routines to run */
270270
271271   UINT8 data = 0xc0;
272   static const char *const keynames[] = {
273      "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7",
274      "LINE8", "LINE9", "LINE10", "LINE11", "LINE12", "LINE13", "LINE14", "LINE15"
275   };
272   char kbdrow[6];
276273
277   /* bit 5 - vsync (inverted) */
278   data |= (((~ioport("VS")->read()) & 0x01)<<5);
274   sprintf(kbdrow,"X%X",m_keyboard_line);
279275
276   /* bit 5 - vsync */
277   data |= m_iop_vs->read();
278
280279   /* bits 4..0 - keyboard data */
281   data |= (ioport(keynames[m_keyboard_line])->read() & 0x1f);
280   data |= ioport(kbdrow)->read();
282281
283282   return data;
284283}
src/mess/includes/sorcerer.h
r15325r15326
2222#include "machine/micropolis.h"
2323
2424#define SORCERER_USING_RS232 0
25#define SCREEN_UPDATE_MEMBER(name) UINT32 name::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
26#define VIDEO_START_MEMBER(name) void name::video_start()
2527
26
2728typedef struct {
2829   struct {
2930      int length;      /* time cassette level is at input.level */
r15325r15326
5152   m_dac(*this, "dac"),
5253   m_uart(*this, "uart"),
5354   m_centronics(*this, "centronics"),
54   m_ram(*this, RAM_TAG)
55   m_ram(*this, RAM_TAG),
56   m_iop_config(*this, "CONFIG"),
57   m_iop_vs(*this, "VS")
5558   { }
5659
57   required_device<cpu_device> m_maincpu;
58   required_device<cassette_image_device> m_cass1;
59   required_device<cassette_image_device> m_cass2;
60   required_device<device_t> m_wave1;
61   required_device<device_t> m_wave2;
62   required_device<device_t> m_dac;
63   required_device<device_t> m_uart;
64   required_device<centronics_device> m_centronics;
65   required_device<ram_device> m_ram;
6660   DECLARE_READ8_MEMBER(sorcerer_fc_r);
6761   DECLARE_READ8_MEMBER(sorcerer_fd_r);
6862   DECLARE_READ8_MEMBER(sorcerer_fe_r);
r15325r15326
7367   DECLARE_WRITE8_MEMBER(sorcerer_ff_w);
7468   UINT8 m_fe;
7569   UINT8 m_keyboard_line;
70   const UINT8 *m_p_videoram;
7671   emu_timer *m_serial_timer;
7772   emu_timer *m_cassette_timer;
7873   cass_data_t m_cass_data;
74   virtual void video_start();
75   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
76   required_device<cpu_device> m_maincpu;
77   required_device<cassette_image_device> m_cass1;
78   required_device<cassette_image_device> m_cass2;
79   required_device<device_t> m_wave1;
80   required_device<device_t> m_wave2;
81   required_device<device_t> m_dac;
82   required_device<device_t> m_uart;
83   required_device<centronics_device> m_centronics;
84   required_device<ram_device> m_ram;
85   required_ioport m_iop_config;
86   required_ioport m_iop_vs;
7987};
8088
8189
src/mess/drivers/sorcerer.c
r15325r15326
192192static INPUT_PORTS_START(sorcerer)
193193   PORT_START("VS")
194194   /* vblank */
195   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen")
195   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_CUSTOM) PORT_VBLANK("screen")
196196
197197   /* line 0 */
198   PORT_START("LINE0")
198   PORT_START("X0")
199199   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
200200   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE
201201   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Control") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_SHIFT_2)
202202   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Graphic") PORT_CODE(KEYCODE_F1)
203203   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Stop") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27)
204204   /* line 1 */
205   PORT_START("LINE1")
205   PORT_START("X1")
206206   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("(Sel)") PORT_CODE(KEYCODE_F2) PORT_CHAR(27)
207207   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Skip") PORT_CODE(KEYCODE_TAB) PORT_CHAR(9)
208208   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
209209   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Repeat") PORT_CODE(KEYCODE_F4)
210210   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Clear") PORT_CODE(KEYCODE_F5) PORT_CHAR(12)
211211   /* line 2 */
212   PORT_START("LINE2")
212   PORT_START("X2")
213213   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
214214   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR('q') PORT_CHAR(0x11)
215215   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_CHAR('a') PORT_CHAR(0x01)
216216   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_CHAR('z') PORT_CHAR(0x1a)
217217   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X') PORT_CHAR('x') PORT_CHAR(0x18)
218218   /* line 3 */
219   PORT_START("LINE3")
219   PORT_START("X3")
220220   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"')
221221   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR('w') PORT_CHAR(0x17)
222222   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S') PORT_CHAR('s') PORT_CHAR(0x13)
223223   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_CHAR('d') PORT_CHAR(0x04)
224224   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_CHAR('c') PORT_CHAR(0x03)
225225   /* line 4 */
226   PORT_START("LINE4")
226   PORT_START("X4")
227227   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
228228   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
229229   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR('e') PORT_CHAR(0x05)
230230   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR('r') PORT_CHAR(0x12)
231231   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_CHAR('f') PORT_CHAR(0x06)
232232   /* line 5 */
233   PORT_START("LINE5")
233   PORT_START("X5")
234234   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
235235   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR('t') PORT_CHAR(0x14)
236236   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_CHAR('g') PORT_CHAR(0x07)
237237   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHAR('V') PORT_CHAR('v') PORT_CHAR(0x16)
238238   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_CHAR('b') PORT_CHAR(0x02)
239239   /* line 6 */
240   PORT_START("LINE6")
240   PORT_START("X6")
241241   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&')
242242   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('y') PORT_CHAR(0x19)
243243   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_CHAR('h') PORT_CHAR(0x08)
244244   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_CHAR('n') PORT_CHAR(0x0e)
245245   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('m') PORT_CHAR(0x0d)
246246   /* line 7 */
247   PORT_START("LINE7")
247   PORT_START("X7")
248248   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'')
249249   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('u') PORT_CHAR(0x15)
250250   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_CHAR('j') PORT_CHAR(0x0a)
251251   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i') PORT_CHAR(0x09)
252252   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('k') PORT_CHAR(0x0b)
253253   /* line 8 */
254   PORT_START("LINE8")
254   PORT_START("X8")
255255   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(')
256256   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')')
257257   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('o') PORT_CHAR(0x0f)
258258   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('l') PORT_CHAR(0x0c)
259259   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(",") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
260260   /* line 9 */
261   PORT_START("LINE9")
261   PORT_START("X9")
262262   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0')
263263   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_CHAR('p') PORT_CHAR(0x10)
264264   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("; +") PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+')
265265   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(". >") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
266266   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("/ ?") PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
267267   /* line 10 */
268   PORT_START("LINE10")
268   PORT_START("XA")
269269   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(": *") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*')
270270   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("[ {") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[')  PORT_CHAR('{')
271271   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("] }") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']')  PORT_CHAR('}')
272272   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("@ `") PORT_CODE(KEYCODE_F7) PORT_CHAR('@') PORT_CHAR('`')
273273   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\\ |") PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\')  PORT_CHAR('|')
274274   /* line 11 */
275   PORT_START("LINE11")
275   PORT_START("XB")
276276   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("- =") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=')
277277   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("^ ~") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('^') PORT_CHAR('~')
278278   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("LINE FEED") PORT_CODE(KEYCODE_F6) PORT_CHAR(10)
279279   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR(13)
280280   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("_ Rub") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR('_') PORT_CHAR(8)
281281   /* line 12 */
282   PORT_START("LINE12")
283   PORT_BIT (0x10, 0x10, IPT_UNUSED)
282   PORT_START("XC")
283   PORT_BIT(0x10, 0x10, IPT_UNUSED)
284284   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("- (PAD)") PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD))
285285   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("/ (PAD)") PORT_CODE(KEYCODE_SLASH_PAD)
286286   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("* (PAD)") PORT_CODE(KEYCODE_ASTERISK)
287287   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("+ (PAD)") PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD))
288288   /* line 13 */
289   PORT_START("LINE13")
289   PORT_START("XD")
290290   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 (PAD)") PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD))
291291   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 (PAD)") PORT_CODE(KEYCODE_8_PAD) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_CHAR(UCHAR_MAMEKEY(8_PAD))
292292   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 (PAD)") PORT_CODE(KEYCODE_4_PAD) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) PORT_CHAR(UCHAR_MAMEKEY(4_PAD))
293293   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 (PAD)") PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD))
294294   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 (PAD)") PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD))
295295   /* line 14 */
296   PORT_START("LINE14")
296   PORT_START("XE")
297297   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 (PAD)") PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD))
298298   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 (PAD)") PORT_CODE(KEYCODE_6_PAD) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CHAR(UCHAR_MAMEKEY(6_PAD))
299299   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 (PAD)") PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD))
300300   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 (PAD)") PORT_CODE(KEYCODE_2_PAD) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CHAR(UCHAR_MAMEKEY(2_PAD))
301301   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(". (PAD)") PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD))
302302   /* line 15 */
303   PORT_START("LINE15")
303   PORT_START("XF")
304304   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 (PAD)") PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD))
305305   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("= (PAD)") PORT_CODE(KEYCODE_NUMLOCK)
306   PORT_BIT (0x04, 0x04, IPT_UNUSED)
307   PORT_BIT (0x02, 0x02, IPT_UNUSED)
308   PORT_BIT (0x01, 0x01, IPT_UNUSED)
306   PORT_BIT(0x04, 0x04, IPT_UNUSED)
307   PORT_BIT(0x02, 0x02, IPT_UNUSED)
308   PORT_BIT(0x01, 0x01, IPT_UNUSED)
309309
310310   /* Enhanced options not available on real hardware */
311311   PORT_START("CONFIG")
r15325r15326
342342   GFXDECODE_ENTRY( "maincpu", 0xf800, sorcerer_charlayout, 0, 1 )
343343GFXDECODE_END
344344
345static SCREEN_UPDATE_IND16( sorcerer )
345VIDEO_START_MEMBER( sorcerer_state )
346346{
347   m_p_videoram = memregion("maincpu")->base()+0xf000;
348}
349
350SCREEN_UPDATE_MEMBER( sorcerer_state )
351{
347352   UINT8 y,ra,chr,gfx;
348   UINT16 sy=0,ma=0xf080,x;
349   UINT8 *RAM = screen.machine().root_device().memregion("maincpu")->base();
353   UINT16 sy=0,ma=0x80,x;
354   UINT16 *p;
350355
351356   for (y = 0; y < 30; y++)
352357   {
353358      for (ra = 0; ra < 8; ra++)
354359      {
355         UINT16 *p = &bitmap.pix16(sy++);
360         p = &bitmap.pix16(sy++);
356361
357362         for (x = ma; x < ma+64; x++)
358363         {
359            chr = RAM[x];
364            chr = m_p_videoram[x];
360365
361366            /* get pattern of pixels for that character scanline */
362            gfx = RAM[0xf800 | (chr<<3) | ra];
367            gfx = m_p_videoram[0x800 | (chr<<3) | ra];
363368
364369            /* Display a scanline of a character */
365370            *p++ = BIT(gfx, 7);
r15325r15326
429434   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(200))
430435   MCFG_SCREEN_SIZE(64*8, 30*8)
431436   MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 30*8-1)
432   MCFG_SCREEN_UPDATE_STATIC( sorcerer )
433
437   MCFG_SCREEN_UPDATE_DRIVER(sorcerer_state, screen_update)
434438   MCFG_GFXDECODE(sorcerer)
435439   MCFG_PALETTE_LENGTH(2)
436440   MCFG_PALETTE_INIT(black_and_white)
src/mess/drivers/ptcsol.c
r15325r15326
6868      - Most files are simple ascii which can be loaded via the Paste handler.
6969        These are ASC, ENT, BAS, ROM, BS5 and ECB. Most files require that the
7070        correct version of BASIC be loaded first. Paste works, but it is very
71        very slow, and has a noticeable buffer limitation. Perhaps we need
72        something faster such as what Solace has.
71        very slow. Perhaps we need something faster such as what Solace has.
7372      - SVT (Solace Virtual Tape) files are a representation of a cassette,
7473        usually holding about 4 games, just like a multifile tape. It will
7574        need a 'format' program to be written to convert it to be loadable
r15325r15326
136135   m_cass2(*this, CASSETTE2_TAG),
137136   m_uart(*this, "uart"),
138137   m_uart_s(*this, "uart_s"),
139   m_p_videoram(*this, "p_videoram"){ }
138   m_p_videoram(*this, "p_videoram"),
139   m_iop_arrows(*this, "ARROWS"),
140   m_iop_config(*this, "CONFIG"),
141   m_iop_s1(*this, "S1"),
142   m_iop_s2(*this, "S2"),
143   m_iop_s3(*this, "S3"),
144   m_iop_s4(*this, "S4")
145   { }
140146
141   required_device<cpu_device> m_maincpu;
142   required_device<cassette_image_device> m_cass1;
143   required_device<cassette_image_device> m_cass2;
144   required_device<device_t> m_uart;
145   required_device<device_t> m_uart_s;
146147   DECLARE_READ8_MEMBER( sol20_f8_r );
147148   DECLARE_READ8_MEMBER( sol20_f9_r );
148149   DECLARE_READ8_MEMBER( sol20_fa_r );
r15325r15326
157158   DECLARE_WRITE8_MEMBER( sol20_fe_w );
158159   DECLARE_WRITE8_MEMBER( kbd_put );
159160   UINT8 m_sol20_fa;
161   cass_data_t m_cass_data;
162   virtual void machine_reset();
163   virtual void machine_start();
164   virtual void video_start();
165   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
166   required_device<cpu_device> m_maincpu;
167   required_device<cassette_image_device> m_cass1;
168   required_device<cassette_image_device> m_cass2;
169   required_device<device_t> m_uart;
170   required_device<device_t> m_uart_s;
171   required_shared_ptr<const UINT8> m_p_videoram;
172   required_ioport m_iop_arrows;
173   required_ioport m_iop_config;
174   required_ioport m_iop_s1;
175   required_ioport m_iop_s2;
176   required_ioport m_iop_s3;
177   required_ioport m_iop_s4;
178
179private:
160180   UINT8 m_sol20_fc;
161181   UINT8 m_sol20_fe;
162182   const UINT8 *m_p_chargen;
163   required_shared_ptr<const UINT8> m_p_videoram;
164183   UINT8 m_framecnt;
165184   emu_timer *m_cassette_timer;
166   cass_data_t m_cass_data;
167   virtual void machine_reset();
168   virtual void machine_start();
169   virtual void video_start();
170   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
171185};
172186
173187
r15325r15326
311325   data |= ay31015_get_output_pin( m_uart, AY31015_FE   ) ? 0x08 : 0;
312326   ay31015_set_input_pin( m_uart, AY31015_SWE, 1 );
313327
314   bool arrowkey = ioport("ARROWS")->read() ? 0 : 1;
328   bool arrowkey = m_iop_arrows->read() ? 0 : 1;
315329   bool keydown = m_sol20_fa & 1;
316330
317331   return data | (arrowkey & keydown);
r15325r15326
327341
328342READ8_MEMBER( sol20_state::sol20_fc_r )
329343{
330   UINT8 data = ioport("ARROWS")->read();
344   UINT8 data = m_iop_arrows->read();
331345   if (BIT(data, 0)) return 0x32;
332346   if (BIT(data, 1)) return 0x34;
333347   if (BIT(data, 2)) return 0x36;
r15325r15326
400414   AM_RANGE(0Xd000, 0Xffff) AM_RAM   // optional s100 ram
401415ADDRESS_MAP_END
402416
403static ADDRESS_MAP_START( sol20_io , AS_IO, 8, sol20_state)
417static ADDRESS_MAP_START( sol20_io, AS_IO, 8, sol20_state)
404418   ADDRESS_MAP_UNMAP_HIGH
405419   ADDRESS_MAP_GLOBAL_MASK(0xff)
406420   AM_RANGE(0xf8, 0xf8) AM_READWRITE(sol20_f8_r,sol20_f8_w)
r15325r15326
555569   ay31015_set_input_pin( m_uart, AY31015_CS, 1 );
556570
557571   // set switched uart pins
558   data = ioport("S4")->read();
572   data = m_iop_s4->read();
559573   ay31015_set_input_pin( m_uart_s, AY31015_CS, 0 );
560574   ay31015_set_input_pin( m_uart_s, AY31015_NB1, BIT(data, 1) ? 1 : 0);
561575   ay31015_set_input_pin( m_uart_s, AY31015_NB2, BIT(data, 2) ? 1 : 0);
r15325r15326
565579   ay31015_set_input_pin( m_uart_s, AY31015_CS, 1 );
566580
567581   // set rs232 baud rate
568   data = ioport("S3")->read();
582   data = m_iop_s3->read();
569583
570584   if (data > 1)
571585      do
r15325r15326
575589      }
576590      while (!(data & 1) && (s_count < 7)); // find which switch is used
577591
578   if ((s_count == 7) && (ioport("CONFIG")->read()&1)) // if highest, look at jumper
592   if ( (s_count == 7) & BIT(m_iop_config->read(), 0) ) // if highest, look at jumper
579593      s_clock = 9600 << 4;
580594   else
581595      s_clock = s_bauds[s_count] << 4;
r15325r15326
607621// Each character is 9 pixels wide (blank ones at the right) and 13 lines deep.
608622// Note on blinking characters:
609623// any character with bit 7 set will blink. With DPMON, do DA C000 C2FF to see what happens
610   UINT8 s1 = ioport("S1")->read();
611   UINT16 which = (ioport("CONFIG")->read() & 2) << 10;
624   UINT16 which = (m_iop_config->read() & 2) << 10;
625   UINT8 s1 = m_iop_s1->read();
612626   UINT8 y,ra,chr,gfx;
613627   UINT16 sy=0,ma,x,inv;
614628   UINT8 polarity = (s1 & 8) ? 0xff : 0;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team