Previous 15994 Revisions Next

r9401 Sunday 17th October, 2010 at 05:36:56 UTC by Robbbert
mbee - little more tidyup. Super80v - remove unneeded routine.
[src/mess/video]mbee.c super80.c

src/mess/video/mbee.c
r9400r9401
218218         if( port == 7 && bit == 1 ) data = 1;   /* Control */
219219         if( port == 0 && bit == 4 ) data = 1;   /* D */
220220      }
221#if 0
222      // this key doesn't appear on any keyboard afaik
221223      else
222224      if( extra & 0x10 )   /* extra: insert */
223225      {
224226         if( port == 7 && bit == 1 ) data = 1;   /* Control */
225227         if( port == 2 && bit == 6 ) data = 1;   /* V */
226228      }
229#endif
227230   }
228231
229232   if( data )
r9400r9401
254257   screen_device *screen = screen_first(*space->machine);
255258   const rectangle &visarea = screen->visible_area();
256259
257   UINT8 data = sy6545_status;
260   UINT8 data = sy6545_status; // bit 6 = lpen strobe, bit 7 = update strobe
258261   int y = space->machine->primary_screen->vpos();
259262
260263   if( y < visarea.min_y || y > visarea.max_y )
r9400r9401
265268
266269READ8_HANDLER ( m6545_data_r )
267270{
268   int addr, data = 0;
271   UINT16 addr;
272   UINT8 data = mc6845_register_r(mc6845, 0);
269273
270274   switch( sy6545_ind )
271275   {
r9400r9401
300304   switch( sy6545_ind )
301305   {
302306   case 12:
303      data &= 0x3f;
307      data &= 0x3f; // select alternate character set
304308      if( sy6545_reg[12] != data )
305309         memcpy(gfxram, memory_region(space->machine, "gfx") + (((data & 0x30) == 0x20) << 11), 0x800);
306310      break;
r9400r9401
412416
413417MC6845_ON_UPDATE_ADDR_CHANGED( mbee_update_addr )
414418{
415/* not sure what goes in here - parameters passed are device, addr, strobe */
419/* not sure what goes in here - parameters passed are device, address, strobe */
416420}
417421
418422MC6845_ON_UPDATE_ADDR_CHANGED( mbee256_update_addr )
src/mess/video/super80.c
r9400r9401
22
33/* Notes on using MAME MC6845 Device (MMD).
44    1. Speed of MMD is about 20% slower than pre-MMD coding
5    2. Undocumented cursor start and end-lines is not supported by MMD, so we do it here
6    3. MMD doesn't support auto-screen-resize, so we do it here. */
5    2. Undocumented cursor start and end-lines is not supported by MMD, so we do it here. */
76
87
98#include "emu.h"
r9400r9401
289288   FNT = memory_region(machine, "gfx1");
290289}
291290
291/**************************** I/O PORTS *****************************************************************/
292
293WRITE8_HANDLER( super80_f1_w )
294{
295   vidpg = (data & 0xfe) << 8;
296   current_charset = data & 1;
297}
298
292299/*---------------------------------------------------------------
293300
294301    Super-80R and Super-80V
r9400r9401
298305static UINT8 mc6845_cursor[16];            // cursor shape
299306static UINT8 mc6845_reg[20];            /* registers */
300307static UINT8 mc6845_ind;            /* register index */
301static const UINT8 mc6845_mask[]={0xff,0xff,0xff,0x0f,0x7f,0x1f,0x7f,0x7f,3,0x1f,0x7f,0x1f,0x3f,0xff,0x3f,0xff,0,0};
308static const UINT8 mc6845_mask[32]={0xff,0xff,0xff,0x0f,0x7f,0x1f,0x7f,0x7f,3,0x1f,0x7f,0x1f,0x3f,0xff,0x3f,0xff,0,0};
302309static running_device *mc6845;
303310static UINT8 framecnt=0;
304311static UINT8 speed,flash;
r9400r9401
390397   if (curs_type == 3) for (i = r11; i < r10;i++) mc6845_cursor[i]=0; // now take a bite out of the middle
391398}
392399
393/* Resize the screen within the limits of the hardware. Expand the image to fill the screen area */
394static void mc6845_screen_configure(running_machine *machine)
395{
396   rectangle visarea;
397
398   UINT16 width = mc6845_reg[1]*7-1;                     // width in pixels
399   UINT16 height = mc6845_reg[6]*(mc6845_reg[9]+1)-1;               // height in pixels
400   UINT16 bytes = mc6845_reg[1]*mc6845_reg[6]-1;                  // video ram needed -1
401
402   /* Resize the screen */
403   visarea.min_x = 0;
404   visarea.max_x = width-1;
405   visarea.min_y = 0;
406   visarea.max_y = height-1;
407   if ((width < 610) && (height < 460) && (bytes < 0x1000))   /* bounds checking to prevent an assert or violation */
408      machine->primary_screen->set_visible_area(0, width, 0, height);
409}
410
411400VIDEO_START( super80v )
412401{
413402   mc6845 = machine->device("crtc");
r9400r9401
492481
493482WRITE8_HANDLER( super80v_11_w )
494483{
495   if (mc6845_ind < 16) mc6845_reg[mc6845_ind] = data & mc6845_mask[mc6845_ind];   /* save data in register */
496   if ((mc6845_ind == 1) || (mc6845_ind == 6) || (mc6845_ind == 9)) mc6845_screen_configure(space->machine); /* adjust screen size */
497   if ((mc6845_ind > 8) && (mc6845_ind < 12)) mc6845_cursor_configure();      /* adjust cursor shape - remove when mame fixed */
484   mc6845_reg[mc6845_ind] = data & mc6845_mask[mc6845_ind];   /* save data in register */
498485   mc6845_register_w( mc6845, 0, data );
486   if ((mc6845_ind > 8) && (mc6845_ind < 12)) mc6845_cursor_configure();      /* adjust cursor shape - remove when mame fixed */
499487}
500
501WRITE8_HANDLER( super80_f1_w )
502{
503   vidpg = (data & 0xfe) << 8;
504   current_charset = data & 1;
505}
506

Previous 15994 Revisions Next


© 1998-2018 The MESS Team