Previous 15994 Revisions Next

r5832 Monday 21st September, 2009 at 14:20:31 UTC by Roberto Zandonà
[jr200] implemented border
[src/mess/drivers]jr200.c

src/mess/drivers/jr200.c
r5831r5832
2020#include "cpu/m6800/m6800.h"
2121
2222static UINT8 *textram;
23static UINT8 *border;
2324static UINT8 io_reg[0x20] = {    0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2425                  0, 0, 0, 0, 0, 0, 0, 0, 0, 0   };
2526
r5831r5832
151152   AM_RANGE(0xa000, 0xbfff) AM_ROM
152153   AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_BASE(&textram)
153154   AM_RANGE(0xc800, 0xc81f) AM_READWRITE(io_reg_r, io_reg_w)
155   AM_RANGE(0xca00, 0xca00) AM_RAM AM_BASE(&border)
154156   AM_RANGE(0xe000, 0xffff) AM_ROM
155157ADDRESS_MAP_END
156158
r5831r5832
282284   int i,j;
283285   const gfx_element *gfx = screen->machine->gfx[0];
284286
287   bitmap_fill(bitmap, cliprect, border[0x0000] * 2 + 1);
288
285289   for (i = 0; i < 0x02ff; i += 0x20)
286290      for (j = 0; j < 0x20; j++)
287291      {
r5831r5832
294298            UINT8 pixel00 = (textram[0x0100 + i + j] >> 0) & 0x07;
295299            UINT8 pixel11 = (textram[0x0500 + i + j] >> 3) & 0x07;
296300            UINT8 pixel10 = (textram[0x0500 + i + j] >> 0) & 0x07;
297            plot_box(bitmap, j * 8    , (i >> 5) * 8    , 4, 4, pixel00 * 2 + 1);
298            plot_box(bitmap, j * 8 + 4, (i >> 5) * 8    , 4, 4, pixel01 * 2 + 1);
299            plot_box(bitmap, j * 8    , (i >> 5) * 8 + 4, 4, 4, pixel10 * 2 + 1);
300            plot_box(bitmap, j * 8 + 4, (i >> 5) * 8 + 4, 4, 4, pixel11 * 2 + 1);
301            plot_box(bitmap, 16 + j * 8    , 16 + (i >> 5) * 8    , 4, 4, pixel00 * 2 + 1);
302            plot_box(bitmap, 16 + j * 8 + 4, 16 + (i >> 5) * 8    , 4, 4, pixel01 * 2 + 1);
303            plot_box(bitmap, 16 + j * 8    , 16 + (i >> 5) * 8 + 4, 4, 4, pixel10 * 2 + 1);
304            plot_box(bitmap, 16 + j * 8 + 4, 16 + (i >> 5) * 8 + 4, 4, 4, pixel11 * 2 + 1);
301305         }
302306         else
303307         {
304            drawgfx_transpen(bitmap, cliprect, gfx, code, col & 0x3f, 0, 0, j * 8, (i >> 5) * 8, 15);
308            drawgfx_transpen(bitmap, cliprect, gfx, code, col & 0x3f, 0, 0, 16 + j * 8, 16 + (i >> 5) * 8, 15);
305309         }
306310      }
307311   return 0;
r5831r5832
339343   MDRV_CPU_PROGRAM_MAP(jr200_mem)
340344   MDRV_CPU_IO_MAP(jr200_io)
341345// MDRV_CPU_VBLANK_INT("screen", jr200_irq)
342MDRV_CPU_PERIODIC_INT(jr200_nmi,60)
346MDRV_CPU_PERIODIC_INT(jr200_nmi,10)
343347MDRV_CPU_PERIODIC_INT(jr200_irq,10)
344348/*
345349   MDRV_CPU_ADD("mn1544", MN1544, ?)
r5831r5832
351355   MDRV_SCREEN_REFRESH_RATE(50)
352356   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
353357   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
354   MDRV_SCREEN_SIZE(256, 192)
355   MDRV_SCREEN_VISIBLE_AREA(0, 256-1, 0, 192-1)
358   MDRV_SCREEN_SIZE(16 + 256 + 16, 16 + 192 + 16) /* border size not accurate */
359   MDRV_SCREEN_VISIBLE_AREA(0, 16 + 256 + 16 - 1, 0, 16 + 192 + 16 - 1)
356360
357361   MDRV_GFXDECODE(jr200)
358362   MDRV_PALETTE_LENGTH(128)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team