Previous 199869 Revisions Next

r36381 Thursday 12th March, 2015 at 03:38:55 UTC by Robbbert
(MESS) mbee : more work on the old keyboard (nw)

Keyboard performance overall is much better, however Simply Write no longer works on mbee128p.
The 2 minute delay in booting mbee56 has been fixed.
[src/mess/drivers]mbee.c
[src/mess/includes]mbee.h
[src/mess/machine]mbee.c
[src/mess/video]mbee.c

trunk/src/mess/drivers/mbee.c
r244892r244893
55
66    system driver
77    Juergen Buchmueller, Jan 2000
8    Robbbert 2008-2015
89
9    Brett Selwood, Andrew Davies (technical assistance)
10    Assistance from:
11    Brett Selwood, Andrew Davies; E.J.Wordsworth (owner of Microbee Systems),
12    nama, ChickenMan, and the author of the "ubee512" emulator.
1013
11    Various additions by Robbbert.
14    Keyboard notes are in video/microbee.c
1215
13    Thanks to the author of the "ubee512" emulator for his help.
14
15    TeleTerm roms dumped by ejwords. The correct slots found by ubee512 author.
16    Swedish roms dumped by nama. The correct slots found by ubee512 author.
17
18    Please note: the rom version 1.31 which appears to fit the 256TC is actually
16    256tc: The 1.31 rom version which appears to fit the 256TC is actually
1917    part of the Z80 emulation in the Matilda model. If you fit this rom into a real
2018    256TC, the floppy disk will not be detected.
2119
r244892r244893
2422
2523    Floppy formats:
2624    - All disks are the standard CPCEMU 'dsk' format.
27    - Types are 9cm 80 track, and 13cm 40 track (single or double sided)
25    - Types are 9/13cm 40/80 track (single or double sided)
2826    - 13cm has been specified as QD to prevent a nasty crash if an 80-track disk was mounted
2927    - The tracks/sector layout is the same regardless of size
3028    - Although certain models came with particular drives as standard, users could add
r244892r244893
7775      intrq and drq are OR'd together, then gated to bit 7 of the data bus whenever
7876      port 48 is activated on read. There are no interrupts used.
7977
80    Tests of old keyboard. Start mbeeic.
81    1. Load ASTEROIDS PLUS, stay in attract mode, hold down spacebar,
82       it should only fire bullets. If it sometimes starts turning,
83       thrusting or using the shield, then there is a problem.
84
85    2. Load SCAVENGER and make sure it doesn't go to the next level
86       until you find the Exit.
87
88    3. At the Basic prompt, type in EDASM press enter. At the memory size
89       prompt press enter. Now, make sure the keyboard works properly.
90
9178    How to use the config switch for PIO B7:
9279    - Teleterm: Must use RTC. Anything else makes teleterm go crazy.
9380    - 256TC, 128, 128p: Doesn't seem to matter, leave at the default.
r244892r244893
9582    - Other rom-based models: "VS" to make the Telcom clock work, or "Tied high".
9683    - 56k: not sure yet, leave as "Tied high" until more is known.
9784
98    How to use programs that need functions keys on models that use the old
99    keyboard (for example, to run Simply Write on a 128k model).
100    Press Ctrl+Shift+number, eg for F1 press hold down Ctrl Shift, press 1.
101
10285***************************************************************************
10386
10487    TODO/not working:
10588
10689    - 256tc: Paste ignores shift key
107    - All others: Paste drops most characters, shift operates randomly.
90    - All others: Paste drops most characters.
10891
10992    - various fdc issues:
11093        - B drive doesn't work with most disks.
11194        - some disks cause MESS to freeze.
11295        - ENMF pin missing from wd_fdc.
11396        - incorrect timing for track register causes 256tc failure to boot a disk.
114        - 56k model takes 120 seconds to boot a disk if loaded via command line.
11597
116    - mbeeppc, mbee128p: In Basic, keyboard loses characters. Works fine in Wordbee.
98    - Simply Write has keyboard problems (in 128k, no keys work).
11799
118100    - 256tc: At the menu, if F2 pressed to activate the Monitor, the emulated machine
119101      crashes due to a bug in z80pio emulation.
r244892r244893
222204   ADDRESS_MAP_UNMAP_HIGH
223205   AM_RANGE(0x00, 0x03) AM_MIRROR(0x10) AM_DEVREADWRITE("z80pio", z80pio_device, read_alt, write_alt)
224206   AM_RANGE(0x0b, 0x0b) AM_MIRROR(0x10) AM_WRITE(port0b_w)
225   AM_RANGE(0x0c, 0x0c) AM_MIRROR(0x10) AM_READWRITE(m6545_status_r, m6545_index_w)
226   AM_RANGE(0x0d, 0x0d) AM_MIRROR(0x10) AM_READWRITE(m6545_data_r, m6545_data_w)
207   AM_RANGE(0x0c, 0x0c) AM_MIRROR(0x10) AM_DEVREAD("crtc", mc6845_device, status_r) AM_WRITE(m6545_index_w)
208   AM_RANGE(0x0d, 0x0d) AM_MIRROR(0x10) AM_DEVREAD("crtc", mc6845_device, register_r) AM_WRITE(m6545_data_w)
227209ADDRESS_MAP_END
228210
229211static ADDRESS_MAP_START(mbeeic_io, AS_IO, 8, mbee_state)
r244892r244893
234216   AM_RANGE(0x09, 0x09) AM_WRITENOP /* Listed as "Colour Wait Off" or "USART 2651" but doesn't appear in the schematics */
235217   AM_RANGE(0x0a, 0x0a) AM_MIRROR(0x10) AM_WRITE(port0a_w)
236218   AM_RANGE(0x0b, 0x0b) AM_MIRROR(0x10) AM_WRITE(port0b_w)
237   AM_RANGE(0x0c, 0x0c) AM_MIRROR(0x10) AM_READWRITE(m6545_status_r, m6545_index_w)
238   AM_RANGE(0x0d, 0x0d) AM_MIRROR(0x10) AM_READWRITE(m6545_data_r, m6545_data_w)
219   AM_RANGE(0x0c, 0x0c) AM_MIRROR(0x10) AM_DEVREAD("crtc", mc6845_device, status_r) AM_WRITE(m6545_index_w)
220   AM_RANGE(0x0d, 0x0d) AM_MIRROR(0x10) AM_DEVREAD("crtc", mc6845_device, register_r) AM_WRITE(m6545_data_w)
239221ADDRESS_MAP_END
240222
241223static ADDRESS_MAP_START(mbeepc_io, AS_IO, 8, mbee_state)
r244892r244893
244226   AM_RANGE(0x0008, 0x0008) AM_MIRROR(0xff10) AM_READWRITE(port08_r, port08_w)
245227   AM_RANGE(0x0009, 0x0009) AM_MIRROR(0xff00) AM_WRITENOP
246228   AM_RANGE(0x000b, 0x000b) AM_MIRROR(0xff10) AM_WRITE(port0b_w)
247   AM_RANGE(0x000c, 0x000c) AM_MIRROR(0xff10) AM_READWRITE(m6545_status_r, m6545_index_w)
248   AM_RANGE(0x000d, 0x000d) AM_MIRROR(0xff10) AM_READWRITE(m6545_data_r, m6545_data_w)
229   AM_RANGE(0x000c, 0x000c) AM_MIRROR(0xff10) AM_DEVREAD("crtc", mc6845_device, status_r) AM_WRITE(m6545_index_w)
230   AM_RANGE(0x000d, 0x000d) AM_MIRROR(0xff10) AM_DEVREAD("crtc", mc6845_device, register_r) AM_WRITE(m6545_data_w)
249231   AM_RANGE(0x000a, 0x000a) AM_MIRROR(0xfe10) AM_READWRITE(telcom_low_r, port0a_w)
250232   AM_RANGE(0x010a, 0x010a) AM_MIRROR(0xfe10) AM_READWRITE(telcom_high_r, port0a_w)
251233ADDRESS_MAP_END
r244892r244893
256238   AM_RANGE(0x0008, 0x0008) AM_MIRROR(0xff10) AM_READWRITE(port08_r, port08_w)
257239   AM_RANGE(0x0009, 0x0009) AM_MIRROR(0xff00) AM_WRITENOP
258240   AM_RANGE(0x000b, 0x000b) AM_MIRROR(0xff10) AM_WRITE(port0b_w)
259   AM_RANGE(0x000c, 0x000c) AM_MIRROR(0xff00) AM_READWRITE(m6545_status_r, m6545_index_w)
260   AM_RANGE(0x000d, 0x000d) AM_MIRROR(0xff10) AM_READWRITE(m6545_data_r, m6545_data_w)
241   AM_RANGE(0x000c, 0x000c) AM_MIRROR(0xff00) AM_DEVREAD("crtc", mc6845_device, status_r) AM_WRITE(m6545_index_w)
242   AM_RANGE(0x000d, 0x000d) AM_MIRROR(0xff10) AM_DEVREAD("crtc", mc6845_device, register_r) AM_WRITE(m6545_data_w)
261243   AM_RANGE(0x001c, 0x001c) AM_MIRROR(0xff00) AM_READWRITE(port1c_r, port1c_w)
262244   AM_RANGE(0x000a, 0x000a) AM_MIRROR(0xfe10) AM_READWRITE(telcom_low_r, port0a_w)
263245   AM_RANGE(0x010a, 0x010a) AM_MIRROR(0xfe10) AM_READWRITE(telcom_high_r, port0a_w)
r244892r244893
271253   AM_RANGE(0x0007, 0x0007) AM_MIRROR(0xff00) AM_READ(port07_r)
272254   AM_RANGE(0x0008, 0x0008) AM_MIRROR(0xff00) AM_READWRITE(port08_r, port08_w)
273255   AM_RANGE(0x000b, 0x000b) AM_MIRROR(0xff00) AM_WRITE(port0b_w)
274   AM_RANGE(0x000c, 0x000c) AM_MIRROR(0xff00) AM_READWRITE(m6545_status_r, m6545_index_w)
275   AM_RANGE(0x000d, 0x000d) AM_MIRROR(0xff00) AM_READWRITE(m6545_data_r, m6545_data_w)
256   AM_RANGE(0x000c, 0x000c) AM_MIRROR(0xff00) AM_DEVREAD("crtc", mc6845_device, status_r) AM_WRITE(m6545_index_w)
257   AM_RANGE(0x000d, 0x000d) AM_MIRROR(0xff00) AM_DEVREAD("crtc", mc6845_device, register_r) AM_WRITE(m6545_data_w)
276258   AM_RANGE(0x0018, 0x001b) AM_MIRROR(0xff00) AM_READ(port18_r)
277259   AM_RANGE(0x001c, 0x001f) AM_MIRROR(0xff00) AM_READWRITE(port1c_r, port1c_w)
278260   AM_RANGE(0x0009, 0x0009) AM_MIRROR(0xfe00) AM_READ(speed_low_r)
r244892r244893
289271   AM_RANGE(0x08, 0x08) AM_READWRITE(port08_r, port08_w)
290272   AM_RANGE(0x09, 0x09) AM_WRITENOP
291273   AM_RANGE(0x0b, 0x0b) AM_WRITE(port0b_w)
292   AM_RANGE(0x0c, 0x0c) AM_READWRITE(m6545_status_r, m6545_index_w)
293   AM_RANGE(0x0d, 0x0d) AM_READWRITE(m6545_data_r, m6545_data_w)
274   AM_RANGE(0x0c, 0x0c) AM_DEVREAD("crtc", mc6845_device, status_r) AM_WRITE(m6545_index_w)
275   AM_RANGE(0x0d, 0x0d) AM_DEVREAD("crtc", mc6845_device, register_r) AM_WRITE(m6545_data_w)
294276   AM_RANGE(0x44, 0x47) AM_DEVREADWRITE("fdc", wd2793_t, read, write)
295277   AM_RANGE(0x48, 0x4f) AM_READWRITE(fdc_status_r, fdc_motor_w)
296278ADDRESS_MAP_END
r244892r244893
305287   AM_RANGE(0x08, 0x08) AM_READWRITE(port08_r, port08_w)
306288   AM_RANGE(0x09, 0x09) AM_WRITENOP
307289   AM_RANGE(0x0b, 0x0b) AM_WRITE(port0b_w)
308   AM_RANGE(0x0c, 0x0c) AM_READWRITE(m6545_status_r, m6545_index_w)
309   AM_RANGE(0x0d, 0x0d) AM_READWRITE(m6545_data_r, m6545_data_w)
290   AM_RANGE(0x0c, 0x0c) AM_DEVREAD("crtc", mc6845_device, status_r) AM_WRITE(m6545_index_w)
291   AM_RANGE(0x0d, 0x0d) AM_DEVREAD("crtc", mc6845_device, register_r) AM_WRITE(m6545_data_w)
310292   AM_RANGE(0x1c, 0x1f) AM_READWRITE(port1c_r, port1c_w)
311293   AM_RANGE(0x44, 0x47) AM_DEVREADWRITE("fdc", wd2793_t, read, write)
312294   AM_RANGE(0x48, 0x4f) AM_READWRITE(fdc_status_r, fdc_motor_w)
r244892r244893
324306   AM_RANGE(0x0209, 0x0209) AM_MIRROR(0xfd00) AM_READ(speed_high_r)
325307   AM_RANGE(0x0009, 0x0009) AM_MIRROR(0xff00) AM_WRITENOP
326308   AM_RANGE(0x000b, 0x000b) AM_MIRROR(0xff00) AM_WRITE(port0b_w)
327   AM_RANGE(0x000c, 0x000c) AM_MIRROR(0xff00) AM_READWRITE(m6545_status_r, m6545_index_w)
328   AM_RANGE(0x000d, 0x000d) AM_MIRROR(0xff00) AM_READWRITE(m6545_data_r, m6545_data_w)
309   AM_RANGE(0x000c, 0x000c) AM_MIRROR(0xff00) AM_DEVREAD("crtc", mc6845_device, status_r) AM_WRITE(m6545_index_w)
310   AM_RANGE(0x000d, 0x000d) AM_MIRROR(0xff00) AM_DEVREAD("crtc", mc6845_device, register_r) AM_WRITE(m6545_data_w)
329311   // AM_RANGE(0x0010, 0x0013) AM_MIRROR(0xff00) Optional SN76489AN audio chip
330312   AM_RANGE(0x0018, 0x001b) AM_MIRROR(0xff00) AM_READ(port18_r)
331313   AM_RANGE(0x001c, 0x001f) AM_MIRROR(0xff00) AM_READWRITE(port1c_r, port1c_w)
r244892r244893
337319   // AM_RANGE(0x0068, 0x006f) AM_MIRROR(0xff00) Reserved for 8530 SCC (unused)
338320ADDRESS_MAP_END
339321
340static INPUT_PORTS_START( mbee )
322static INPUT_PORTS_START( oldkb )
341323   PORT_START("X.0") /* IN0 KEY ROW 0 [000] */
342324   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("@") PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR('@') PORT_CHAR('`')
343325   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') PORT_CHAR(0x01)
r244892r244893
417399   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
418400   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("(Right)") PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))
419401   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
402INPUT_PORTS_END
420403
404static INPUT_PORTS_START( mbee )
405
406   PORT_INCLUDE( oldkb )
407
421408   // Autorun on quickload
422409   PORT_START("CONFIG")
423410   PORT_CONFNAME( 0x01, 0x01, "Autorun on Quickload")
424411   PORT_CONFSETTING(    0x00, DEF_STR(No))
425412   PORT_CONFSETTING(    0x01, DEF_STR(Yes))
426413   // Wire links on motherboard
427   PORT_CONFNAME( 0xc0, 0x80, "PIO B7")
414   PORT_CONFNAME( 0xc0, 0x00, "PIO B7")
428415   PORT_CONFSETTING(    0x00, "VS") // sync pulse to enable telcom clock
429416   PORT_CONFSETTING(    0x40, "RTC") // optional board usually not fitted
430417   PORT_CONFSETTING(    0x80, "Tied high") // default resistor to vcc
431418   PORT_CONFSETTING(    0xc0, "Reserved for net")
432419INPUT_PORTS_END
433420
421static INPUT_PORTS_START( mbee128 )
422
423   PORT_INCLUDE( oldkb )
424
425   // Autorun on quickload
426   PORT_START("CONFIG")
427   PORT_CONFNAME( 0x01, 0x01, "Autorun on Quickload")
428   PORT_CONFSETTING(    0x00, DEF_STR(No))
429   PORT_CONFSETTING(    0x01, DEF_STR(Yes))
430   // Wire links on motherboard
431   PORT_CONFNAME( 0xc0, 0x40, "PIO B7")
432   PORT_CONFSETTING(    0x00, "VS") // sync pulse to enable telcom clock
433   PORT_CONFSETTING(    0x40, "RTC") // RTC IRQ for clock
434   PORT_CONFSETTING(    0x80, "Tied high") // default resistor to vcc
435   PORT_CONFSETTING(    0xc0, "Reserved for net")
436INPUT_PORTS_END
437
434438static INPUT_PORTS_START( mbee256 )
435439   PORT_START("Y.0") /* IN0 KEY ROW 0 [+00] */
436440   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F1") PORT_CODE(KEYCODE_F1)
r244892r244893
11341138COMP( 1986, mbeeppc,  mbee,     0,      mbeeppc,  mbee,     mbee_state,  mbeeppc,    "Applied Technology",  "Microbee Premium PC85" , 0 )
11351139COMP( 1986, mbeett,   mbee,     0,      mbeett,   mbee256,  mbee_state,  mbeett,     "Applied Technology",  "Microbee Teleterm" , GAME_NOT_WORKING )
11361140COMP( 1986, mbee56,   mbee,     0,      mbee56,   mbee,     mbee_state,  mbee56,     "Applied Technology",  "Microbee 56k" , GAME_NOT_WORKING )
1137COMP( 1986, mbee128,  mbee,     0,      mbee128,  mbee,     mbee_state,  mbee128,    "Applied Technology",  "Microbee 128k Standard" , GAME_NOT_WORKING )
1138COMP( 1986, mbee128p, mbee,     0,      mbee128p, mbee,     mbee_state,  mbee128,    "Applied Technology",  "Microbee 128k Premium" , GAME_NOT_WORKING )
1141COMP( 1986, mbee128,  mbee,     0,      mbee128,  mbee128,  mbee_state,  mbee128,    "Applied Technology",  "Microbee 128k Standard" , GAME_NOT_WORKING )
1142COMP( 1986, mbee128p, mbee,     0,      mbee128p, mbee128,  mbee_state,  mbee128,    "Applied Technology",  "Microbee 128k Premium" , GAME_NOT_WORKING )
11391143COMP( 1987, mbee256,  mbee,     0,      mbee256,  mbee256,  mbee_state,  mbee256,    "Applied Technology",  "Microbee 256TC" , GAME_NOT_WORKING )
trunk/src/mess/includes/mbee.h
r244892r244893
7272   DECLARE_READ8_MEMBER(telcom_high_r);
7373   DECLARE_READ8_MEMBER(speed_low_r);
7474   DECLARE_READ8_MEMBER(speed_high_r);
75   DECLARE_READ8_MEMBER(m6545_status_r);
7675   DECLARE_WRITE8_MEMBER(m6545_index_w);
77   DECLARE_READ8_MEMBER(m6545_data_r);
7876   DECLARE_WRITE8_MEMBER(m6545_data_w);
7977   DECLARE_READ8_MEMBER(video_low_r);
8078   DECLARE_READ8_MEMBER(video_high_r);
r244892r244893
138136   UINT8 m_mbee256_was_pressed[15];
139137   UINT8 m_mbee256_q[20];
140138   UINT8 m_mbee256_q_pos;
141   UINT8 m_sy6545_status;
142139   UINT8 m_sy6545_reg[32];
143140   UINT8 m_sy6545_ind;
144141   UINT8 m_fdc_rq;
trunk/src/mess/machine/mbee.c
r244892r244893
180180   if (m_b2)
181181      m_pio->port_b_write(pio_port_b_r(generic_space(),0,0xff));
182182
183   timer_set(attotime::from_hz(10), TIMER_MBEE_NEWKB);
183   timer_set(attotime::from_hz(50), TIMER_MBEE_NEWKB);
184184}
185185
186186READ8_MEMBER( mbee_state::port18_r )
trunk/src/mess/video/mbee.c
r244892r244893
66
77    Rewritten by Robbbert
88
9    Operation of old keyboard:
10    The design is taken from the SY6545 Application Note AN3. As the CRTC
11    renders the picture, the MA lines also scan the keyboard. When a keydown
12    is detected, the lightpen pin is activated, which sets bit 6 of the status
13    register. The CPU continuously monitors this register. Once bit 6 is set,
14    the CPU needs to determine which key is pressed. It firstly clears bit 6,
15    then sets port 0B to 1. This prevents the CRTC from scanning the keyboard
16    and causing interference. Next, the CPU writes an address to regs 18,19 and
17    then instigates the transparent access. This checks one keyboard row, which
18    if the pressed key is found, will once again set bit 6. If not found, the
19    next row will be checked. Once found, the CPU clears bit 6 and port 0B, then
20    works out the ascii key code of the pressed key.
21
22    Tests of old keyboard. Start mbeeic.
23    1. Load ASTEROIDS PLUS, stay in attract mode, hold down spacebar,
24       it should only fire bullets. If it sometimes starts turning,
25       thrusting or using the shield, then there is a problem.
26
27    2. Load SCAVENGER and make sure it doesn't go to the next level
28       until you find the Exit.
29
30    3. At the Basic prompt, type in EDASM press enter. At the memory size
31       prompt press enter. Now, make sure the keyboard works properly.
32
33    Old keyboard ToDo:
34    - Occasional characters dropped while typing
35    - Lots of characters dropped when pasting
36    - On mbee128p, Simply Write doesn't accept any input
37
38    New keyboard ToDo:
39    - On mbeett, various problems caused by phantom characters.
40
941****************************************************************************/
1042
1143
r244892r244893
156188{
157189   if (m_has_oldkb)
158190   {
159      offs &= 0x3f0; // safety check
160191      UINT8 port = (offs >> 7) & 7;
161192      UINT8 bit = (offs >> 4) & 7;
162193      UINT8 extra = 0;
163194      UINT8 data = m_io_oldkb[port]->read();
164      if ((port == 0) || (port == 2) || (port == 3))
165         extra = m_io_x7->read();
166      else
167      if (port == 7)
168         extra = data;
169     
170      bool keydown  = ( data >> bit ) & 1;
195      bool keydown  = BIT(data, bit);
171196
172197      // This adds premium-style cursor keys to the old keyboard.
173198      // They are used by the pc85 menu. Premium keyboards already
174199      // have these keys fitted.
175      if (!keydown && !m_is_premium && extra)
200      if (!keydown && !m_is_premium)
176201      {
177         if BIT(extra, 0) // cursor up
178         {
179            if( port == 7 && bit == 1 ) keydown = 1;
180            if( port == 0 && bit == 5 ) keydown = 1; // control E
181         }
202         if ((port == 0) || (port == 2) || (port == 3))
203            extra = m_io_x7->read();
182204         else
183         if BIT(extra, 2) // cursor down
205         if (port == 7)
206            extra = data;
207
208         if (extra)
184209         {
185            if( port == 7 && bit == 1 ) keydown = 1;
186            if( port == 3 && bit == 0 ) keydown = 1; // control X
210            if BIT(extra, 0) // cursor up
211            {
212               if( port == 7 && bit == 1 ) keydown = 1;
213               if( port == 0 && bit == 5 ) keydown = 1; // control E
214            }
215            else
216            if BIT(extra, 2) // cursor down
217            {
218               if( port == 7 && bit == 1 ) keydown = 1;
219               if( port == 3 && bit == 0 ) keydown = 1; // control X
220            }
221            else
222            if BIT(extra, 3) // cursor left
223            {
224               if( port == 7 && bit == 1 ) keydown = 1;
225               if( port == 2 && bit == 3 ) keydown = 1; // control S
226            }
227            else
228            if BIT(extra, 6) // cursor right
229            {
230               if( port == 7 && bit == 1 ) keydown = 1;
231               if( port == 0 && bit == 4 ) keydown = 1; // control D
232            }
187233         }
188         else
189         if BIT(extra, 3) // cursor left
190         {
191            if( port == 7 && bit == 1 ) keydown = 1;
192            if( port == 2 && bit == 3 ) keydown = 1; // control S
193         }
194         else
195         if BIT(extra, 6) // cursor right
196         {
197            if( port == 7 && bit == 1 ) keydown = 1;
198            if( port == 0 && bit == 4 ) keydown = 1; // control D
199         }
200234      }
201235
202236      if( keydown )
203      {
204         m_sy6545_reg[17] = offs;
205         m_sy6545_reg[16] = (offs >> 8) & 0x3f;
206         m_sy6545_status |= 0x40; //lpen_strobe
207      }
237         m_crtc->assert_light_pen_input(); //lpen_strobe
238
208239   }
209240}
210241
r244892r244893
223254
224255************************************************************/
225256
226READ8_MEMBER( mbee_state::m6545_status_r )
227{
228   const rectangle &visarea = m_screen->visible_area();
229
230   UINT8 data = m_sy6545_status; // bit 6 = lpen strobe, bit 7 = update strobe
231   int y = m_screen->vpos();
232
233   if( y < visarea.min_y || y > visarea.max_y )
234      data |= 0x20;   /* vertical blanking */
235
236   return data;
237}
238
239READ8_MEMBER( mbee_state::m6545_data_r )
240{
241   UINT16 addr;
242   UINT8 data = m_crtc->register_r( space, 0 );
243
244   switch( m_sy6545_ind )
245   {
246   case 16:
247   case 17:
248      m_sy6545_status &= 0x80; // turn off lpen_strobe
249      break;
250   case 31:
251      // This firstly pushes the contents of the transparent registers onto the MA lines,
252      // then increments the address, then sets update strobe on.
253      addr = (m_sy6545_reg[18] << 8) | m_sy6545_reg[19];
254      oldkb_matrix_r(addr);
255      m_sy6545_reg[19]++;
256      if (!m_sy6545_reg[19]) m_sy6545_reg[18]++;
257      m_sy6545_status |= 0x80; // update_strobe
258      break;
259   }
260   return data;
261}
262
263257WRITE8_MEMBER ( mbee_state::m6545_index_w )
264258{
265259   data &= 0x1f;
r244892r244893
270264WRITE8_MEMBER ( mbee_state::m6545_data_w )
271265{
272266   static const UINT8 sy6545_mask[32]={0xff,0xff,0xff,0x0f,0x7f,0x1f,0x7f,0x7f,3,0x1f,0x7f,0x1f,0x3f,0xff,0x3f,0xff,0,0,0x3f,0xff};
273   UINT16 addr = 0;
274267
275268   switch( m_sy6545_ind )
276269   {
r244892r244893
279272      if( m_sy6545_reg[12] != data )
280273         memcpy(m_p_gfxram, memregion("gfx")->base() + (((data & 0x30) == 0x20) << 11), 0x800);
281274      break;
282   case 31:
283      // This firstly pushes the contents of the transparent registers onto the MA lines,
284      // then increments the address, then sets update strobe on.
285      addr = (m_sy6545_reg[18] << 8) | m_sy6545_reg[19];
286      oldkb_matrix_r(addr);
287      m_sy6545_reg[19]++;
288      if (!m_sy6545_reg[19]) m_sy6545_reg[18]++;
289      m_sy6545_status |= 0x80; // update_strobe
290      break;
291275   }
292276   m_sy6545_reg[m_sy6545_ind] = data & sy6545_mask[m_sy6545_ind];  /* save data in register */
293277   m_crtc->register_w( space, 0, data );
r244892r244893
337321
338322MC6845_ON_UPDATE_ADDR_CHANGED( mbee_state::crtc_update_addr )
339323{
340// not sure what goes in here - parameters passed are device, address, strobe
324// parameters passed are device, address, strobe(always 0)
341325// not used on 256TC
326
327   oldkb_matrix_r(address);
342328}
343329
344330
r244892r244893
496482   UINT8 i, r, b, g;
497483
498484   /* set up 8 low intensity colours */
499   for (i = 0; i < 8; i++)
485   for (i = 0; i < 7; i++)
500486   {
501487      r = BIT(i, 0) ? 0xc0 : 0;
502488      g = BIT(i, 1) ? 0xc0 : 0;
r244892r244893
504490      palette.set_pen_color(i, rgb_t(r, g, b));
505491   }
506492
493   // colour 8 is dark grey, rather than black
494   palette.set_pen_color(8, rgb_t(96, 96, 96));
495
507496   /* set up 8 high intensity colours */
508497   for (i = 9; i < 16; i++)
509498   {


Previous 199869 Revisions Next


© 1997-2024 The MAME Team