Previous 15994 Revisions Next

r9305 Saturday 2nd October, 2010 at 19:21:35 UTC by Robbbert
[MBEE] Premium - some progress in getting the keyboard to work.
[src/mess/video]mbee.c

src/mess/video/mbee.c
r9304r9305
2929#include "emu.h"
3030#include "includes/mbee.h"
3131
32#define MBEE_WAIT_TIME 5000
33
3432typedef struct {       // CRTC 6545
3533   UINT8 horizontal_total;
3634    UINT8 horizontal_displayed;
r9304r9305
6159
6260static CRTC6545 crt;
6361static UINT8 framecnt = 0;
64static int mbee_wait_time = 0;
6562
6663static UINT8 *gfxram;
6764static UINT8 *colorram;
r9304r9305
265262}
266263
267264
268
269
270
271
272static void m6545_update_strobe(running_machine *machine, int param)
265static void mbee_video_kbd_scan( running_machine *machine, int param )
273266{
267   if ((param & 7) || (mbee_0b))
268      return;
269
274270   keyboard_matrix_r(machine, param);
275   crt.update_strobe = 1;
276271}
277272
273
278274READ8_HANDLER ( m6545_status_r )
279275{
280276   screen_device *screen = screen_first(*space->machine);
281277   const rectangle &visarea = screen->visible_area();
282278
283279   int data = 0, y = space->machine->primary_screen->vpos();
284   int x = space->machine->primary_screen->hpos();
285280
286   if (!mbee_wait_time)
287      m6545_update_strobe(space->machine, x+y*64);
288
289281   if( y < visarea.min_y ||
290282      y > visarea.max_y )
291283      data |= 0x20;   /* vertical blanking */
r9304r9305
342334      break;
343335   case 16:
344336      crt.lpen_strobe = 0;
345      crt.update_strobe = 0;
346337      data = crt.lpen_hi;
347338      break;
348339   case 17:
349340      crt.lpen_strobe = 0;
350      crt.update_strobe = 0;
351341      data = crt.lpen_lo;
352342      break;
353343   case 18:
r9304r9305
357347      data = crt.transp_lo;
358348      break;
359349   case 31:
360      /* shared memory latch */
350      /* This firstly pushes the contents of the transparent registers onto the MA lines,
351      then increments the address, then sets strobe on. */
361352      addr = (crt.transp_hi << 8) | crt.transp_lo;
362      m6545_update_strobe(space->machine, addr);
353      keyboard_matrix_r(space->machine, addr);
354      crt.transp_lo++;
355      if (!crt.transp_lo) crt.transp_hi++;
356      crt.update_strobe = 1;
363357      break;
364358   default:
365359      logerror("6545 read unmapped port $%X\n", crt.idx);
r9304r9305
471465      break;
472466   case 19:
473467      crt.transp_lo = data;
474      mbee_wait_time = MBEE_WAIT_TIME;
475468      break;
476469   case 31:
477      /* shared memory latch */
470      /* This firstly pushes the contents of the transparent registers onto the MA lines,
471      then increments the address, then sets strobe on. */
478472      addr = (crt.transp_hi << 8) | crt.transp_lo;
479      m6545_update_strobe(space->machine, addr);
473      keyboard_matrix_r(space->machine, addr);
474      crt.transp_lo++;
475      if (!crt.transp_lo) crt.transp_hi++;
476      crt.update_strobe = 1;
480477      break;
481478   default:
482479      logerror("6545 write unmapped port $%X <- $%02X\n", crt.idx, data);
r9304r9305
582579            mem = (x + screen_home) & 0x7ff;
583580            chr = videoram[mem];
584581
585            if ((x & 15) == 0)
586            {
587               if (mbee_wait_time)
588                  mbee_wait_time--;
589               else
590                  m6545_update_strobe(screen->machine, x);
591            }
582            mbee_video_kbd_scan(screen->machine, x);
592583
593584            /* process cursor */
594585            if ((((!flash) && (!speed)) ||               // (5,6)=(0,0) = cursor on always
r9304r9305
640631            chr = videoram[mem];
641632            col = colorram[mem] | colourm;               // read a byte of colour
642633
643            if ((x & 15) == 0)
644            {
645               if (mbee_wait_time)
646                  mbee_wait_time--;
647               else
648                  m6545_update_strobe(screen->machine, x);
649            }
634            mbee_video_kbd_scan(screen->machine, x);
650635
651636            /* process cursor */
652637            if ((((!flash) && (!speed)) ||               // (5,6)=(0,0) = cursor on always
r9304r9305
716701                  chr = 0x20;
717702            }
718703
719            if ((x & 15) == 0)
720            {
721               if (mbee_wait_time)
722                  mbee_wait_time--;
723               else
724                  m6545_update_strobe(screen->machine, x);
725            }
704            mbee_video_kbd_scan(screen->machine, x);
726705
727706            /* process cursor */
728707            if ((((!flash) && (!speed)) ||               // (5,6)=(0,0) = cursor on always

Previous 15994 Revisions Next


© 1998-2018 The MESS Team