Previous 15994 Revisions Next

r1539 Saturday 19th January, 2008 at 01:45:40 UTC by Dirk Best
[P2000T] Removed usage of videoram_r/w and dirtybuffers
[src/mess/drivers]p2000t.c
[src/mess/includes]p2000t.h
[src/mess/video]p2000m.c

src/mess/includes/p2000t.h
r1538r1539
2323
2424/*----------- defined in video/p2000m.c -----------*/
2525
26extern void p2000m_vh_callback (void);
2726extern VIDEO_START( p2000m );
2827extern VIDEO_UPDATE( p2000m );
2928
src/mess/video/p2000m.c
r1538r1539
99#include "driver.h"
1010#include "includes/p2000t.h"
1111
12static   INT8   frame_count;
1312
13static INT8 frame_count;
14
15
1416VIDEO_START( p2000m )
1517{
1618   frame_count = 0;
1719   video_start_generic(machine);
1820}
1921
20void p2000m_vh_callback (void)
21{
2222
23   int   offs;
24
25   if (frame_count++ > 49) frame_count = 0;
26   if ((frame_count == 24) | !frame_count)
27   {
28      for (offs = 0; offs < 2047; offs++)
29      {
30         if (videoram[offs + 2048] & 0x40)
31            dirtybuffer[offs] = 1;
32      }
33   }
34}
35
3623VIDEO_UPDATE( p2000m )
3724{
3825   int offs, sx, sy, code, loop;
39   int full_refresh = 1;
4026
41   if (full_refresh)
42      memset (dirtybuffer, 1, videoram_size);
43
4427   for (offs = 0; offs < 80 * 24; offs++)
4528   {
46      if (dirtybuffer[offs] | dirtybuffer[offs + 2048])
29      sy = (offs / 80) * 10;
30      sx = (offs % 80) * 6;
31     
32      if ((frame_count > 25) && (videoram[offs + 2048] & 0x40))
33         code = 32;
34      else
4735      {
48         sy = (offs / 80) * 10;
49         sx = (offs % 80) * 6;
50         if ((frame_count > 25) && (videoram[offs + 2048] & 0x40)) code = 32;
51         else
36         code = videoram[offs];
37         if ((videoram[offs + 2048] & 0x01) && (code & 0x20))
5238         {
53            code = videoram[offs];
54            if ((videoram[offs + 2048] & 0x01) && (code & 0x20))
55            {
56               code += (code & 0x40) ? 64 : 96;
57            } else {
58               code &= 0x7f;
59            }
60            if (code < 32) code = 32;
39            code += (code & 0x40) ? 64 : 96;
40         } else {
41            code &= 0x7f;
6142         }
43         if (code < 32) code = 32;
44      }
6245
63         drawgfx (bitmap, machine->gfx[0], code,
64            videoram[offs + 2048] & 0x08 ? 0 : 1, 0, 0, sx, sy,
65            &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
66         if (videoram[offs] & 0x80)
46      drawgfx (bitmap, machine->gfx[0], code,
47         videoram[offs + 2048] & 0x08 ? 0 : 1, 0, 0, sx, sy,
48         &machine->screen[0].visarea, TRANSPARENCY_NONE, 0);
49
50      if (videoram[offs] & 0x80)
51      {
52         for (loop = 0; loop < 6; loop++)
6753         {
68            for (loop = 0; loop < 6; loop++)
69            {
70               *BITMAP_ADDR16(bitmap, sy + 9, sx + loop) = 1;
71            }
54            *BITMAP_ADDR16(bitmap, sy + 9, sx + loop) = 1;
7255         }
73         dirtybuffer[offs] = 0;
7456      }
7557   }
58
7659   return 0;
7760}
src/mess/drivers/p2000t.c
r1538r1539
5454static ADDRESS_MAP_START( p2000t_mem , ADDRESS_SPACE_PROGRAM, 8)
5555   AM_RANGE(0x0000, 0x0fff) AM_ROM
5656   AM_RANGE(0x1000, 0x4fff) AM_ROM
57   AM_RANGE(0x5000, 0x57ff) AM_READWRITE(videoram_r, videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
57   AM_RANGE(0x5000, 0x57ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
5858   AM_RANGE(0x5800, 0x9fff) AM_RAM
5959   AM_RANGE(0xa000, 0xffff) AM_NOP
6060ADDRESS_MAP_END
r1538r1539
6262static ADDRESS_MAP_START( p2000m_mem , ADDRESS_SPACE_PROGRAM, 8)
6363   AM_RANGE(0x0000, 0x0fff) AM_ROM
6464   AM_RANGE(0x1000, 0x4fff) AM_ROM
65   AM_RANGE(0x5000, 0x5fff) AM_READWRITE(videoram_r, videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
65   AM_RANGE(0x5000, 0x5fff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
6666   AM_RANGE(0x6000, 0x9fff) AM_RAM
6767   AM_RANGE(0xa000, 0xffff) AM_NOP
6868ADDRESS_MAP_END

Previous 15994 Revisions Next


© 1998-2018 The MESS Team