mirror of
https://github.com/holub/mame
synced 2025-05-25 07:15:25 +03:00
Removed dual layout, added Map base video register and fixed transparent issues in the Jackpot Cards driver [Angelo Salese]
This commit is contained in:
parent
3818630dd8
commit
f81dab2b56
@ -10,9 +10,8 @@ Notes:
|
||||
|
||||
TODO:
|
||||
-Correct NVRAM emulation (and default eeprom too?);
|
||||
-Doesn't accept coins? (might be related to the eeprom);
|
||||
-Transparent pen issue on the text layer? (might be a btanb);
|
||||
-Understand master-slave comms properly;
|
||||
-Doesn't accept coins? (likely to be related to the eeprom);
|
||||
-UART;
|
||||
|
||||
*******************************************************************************************/
|
||||
|
||||
@ -20,90 +19,53 @@ TODO:
|
||||
#include "cpu/m68000/m68000.h"
|
||||
#include "sound/okim6295.h"
|
||||
#include "machine/eeprom.h"
|
||||
#include "rendlay.h"
|
||||
|
||||
|
||||
static UINT16 *sc0_vram;
|
||||
static UINT16 *sc1_vram;
|
||||
static UINT16 *sc2_vram;
|
||||
static UINT16 *sc3_vram;
|
||||
|
||||
static UINT16 *jackpool_vram;
|
||||
static UINT8 map_vreg;
|
||||
static UINT16 *jackpool_io;
|
||||
|
||||
|
||||
static VIDEO_START(jackpool)
|
||||
{
|
||||
}
|
||||
|
||||
static VIDEO_UPDATE(jackpool)
|
||||
{
|
||||
const device_config *left_screen = devtag_get_device(screen->machine, "lscreen");
|
||||
const device_config *right_screen = devtag_get_device(screen->machine, "rscreen");
|
||||
const gfx_element *gfx = screen->machine->gfx[0];
|
||||
int count;// = 0x00000/2;
|
||||
|
||||
int y,x;
|
||||
|
||||
if(screen == left_screen)
|
||||
{
|
||||
count = 0x0000/2;
|
||||
count = map_vreg*(0x4000/2);
|
||||
for (y=0;y<32;y++)
|
||||
{
|
||||
for (x=0;x<64;x++)
|
||||
{
|
||||
int tile = (sc1_vram[count] & 0x7fff);
|
||||
int attr = (sc1_vram[count+0x800] & 0x1f00)>>8;
|
||||
//int t_pen = (sc1_vram[count+0x800] & 0x2000);
|
||||
//int colour = tile>>12;
|
||||
int tile = (jackpool_vram[count+(0x2000/2)] & 0x7fff);
|
||||
int attr = (jackpool_vram[count+(0x2000/2)+0x800] & 0x1f00)>>8;
|
||||
|
||||
drawgfx_opaque(bitmap,cliprect,gfx,tile,attr,0,0,x*8,y*8);
|
||||
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
count = 0x0000/2;
|
||||
count = map_vreg*(0x4000/2);
|
||||
for (y=0;y<32;y++)
|
||||
{
|
||||
for (x=0;x<64;x++)
|
||||
{
|
||||
int tile = (sc0_vram[count] & 0x7fff);
|
||||
int attr = (sc0_vram[count+0x800] & 0x1f00)>>8;
|
||||
/*might just be sloppy coding,colors are enabled as 0x20-0x3f*/
|
||||
int t_pen = (sc0_vram[count+0x800] & 0x2000);
|
||||
//int colour = tile>>12;
|
||||
drawgfx_transpen(bitmap,cliprect,gfx,tile,attr,0,0,x*8,y*8,(t_pen) ? -1 : 0);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
int tile = (jackpool_vram[count] & 0x7fff);
|
||||
|
||||
if(screen == right_screen)
|
||||
{
|
||||
count = 0x0000/2;
|
||||
for (y=0;y<32;y++)
|
||||
{
|
||||
for (x=0;x<64;x++)
|
||||
{
|
||||
int tile = (sc2_vram[count] & 0x7fff);
|
||||
int attr = (sc2_vram[count+0x800] & 0x1f00)>>8;
|
||||
//int t_pen = (sc1_vram[count+0x800] & 0x2000);
|
||||
//int colour = tile>>12;
|
||||
drawgfx_opaque(bitmap,cliprect,gfx,tile,attr,0,0,x*8,y*8);
|
||||
if(tile != 0)
|
||||
{
|
||||
int attr = (jackpool_vram[count+0x800] & 0x1f00)>>8;
|
||||
int t_pen = (jackpool_vram[count+0x800] & 0x1000);
|
||||
|
||||
count++;
|
||||
}
|
||||
}
|
||||
drawgfx_transpen(bitmap,cliprect,gfx,tile,attr,0,0,x*8,y*8,(t_pen) ? 0 : -1);
|
||||
}
|
||||
|
||||
count = 0x0000/2;
|
||||
for (y=0;y<32;y++)
|
||||
{
|
||||
for (x=0;x<64;x++)
|
||||
{
|
||||
int tile = (sc3_vram[count] & 0x7fff);
|
||||
int attr = (sc3_vram[count+0x800] & 0x1f00)>>8;
|
||||
/*might just be sloppy coding,colors are enabled as 0x20-0x3f*/
|
||||
int t_pen = (sc3_vram[count+0x800] & 0x2000);
|
||||
//int colour = tile>>12;
|
||||
drawgfx_transpen(bitmap,cliprect,gfx,tile,attr,0,0,x*8,y*8,(t_pen) ? -1 : 0);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@ -122,11 +84,13 @@ static READ16_HANDLER( jackpool_io_r )
|
||||
{
|
||||
switch(offset*2)
|
||||
{
|
||||
case 0x0: return input_port_read(space->machine,"COIN1");
|
||||
case 0x8: return input_port_read(space->machine,"SERVICE1");
|
||||
case 0xa: return input_port_read(space->machine,"SERVICE2");//probably not a button
|
||||
case 0xc: return input_port_read(space->machine,"PAYOUT");
|
||||
case 0xe: return input_port_read(space->machine,"START2");
|
||||
case 0x00: return input_port_read(space->machine,"COIN1");
|
||||
case 0x04: return input_port_read(space->machine,"UNK1");
|
||||
case 0x06: return input_port_read(space->machine,"UNK2");
|
||||
case 0x08: return input_port_read(space->machine,"SERVICE1");
|
||||
case 0x0a: return input_port_read(space->machine,"SERVICE2");//probably not a button, remote?
|
||||
case 0x0c: return input_port_read(space->machine,"PAYOUT");
|
||||
case 0x0e: return input_port_read(space->machine,"START2");
|
||||
case 0x10: return input_port_read(space->machine,"HOLD3");
|
||||
case 0x12: return input_port_read(space->machine,"HOLD4");
|
||||
case 0x14: return input_port_read(space->machine,"HOLD2");
|
||||
@ -134,8 +98,9 @@ static READ16_HANDLER( jackpool_io_r )
|
||||
case 0x18: return input_port_read(space->machine,"HOLD5");
|
||||
case 0x1a: return input_port_read(space->machine,"START1");
|
||||
case 0x1c: return input_port_read(space->machine,"BET");
|
||||
// case 0x2c: eeprom 1 r?
|
||||
// case 0x2e: eeprom 2 r?
|
||||
case 0x2c: break;//return mame_rand(space->machine);//eeprom_read_bit();
|
||||
case 0x2e: break;//return mame_rand(space->machine);//eeprom_read_bit();
|
||||
default: printf("R %02x\n",offset*2); break;
|
||||
}
|
||||
|
||||
// printf("R %02x\n",offset*2);
|
||||
@ -144,9 +109,30 @@ static READ16_HANDLER( jackpool_io_r )
|
||||
|
||||
static WRITE16_HANDLER( jackpool_io_w )
|
||||
{
|
||||
// printf("W %02x %02x\n",offset*2,data);
|
||||
COMBINE_DATA(&jackpool_io[offset]);
|
||||
|
||||
switch(offset*2)
|
||||
{
|
||||
case 0x30: /* ---- ---x HOLD3 lamp */ break;
|
||||
case 0x32: /* ---- ---x HOLD4 lamp */ break;
|
||||
case 0x34: /* ---- ---x HOLD2 lamp */ break;
|
||||
case 0x36: /* ---- ---x HOLD1 lamp */ break;
|
||||
case 0x38: /* ---- ---x HOLD5 lamp */ break;
|
||||
case 0x3a: /* ---- ---x START1 lamp */ break;
|
||||
case 0x3c: /* ---- ---x BET lamp */ break;
|
||||
case 0x3e: break;
|
||||
case 0x40: /* ---- ---x PAYOUT lamp */ break;
|
||||
case 0x46: /* ---- ---x coin counter */break;
|
||||
case 0x4e: map_vreg = data & 1; break;
|
||||
// case 0x50: eeprom_set_cs_line((data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
|
||||
// case 0x52: eeprom_set_clock_line((data & 1) ? ASSERT_LINE : CLEAR_LINE ); break;
|
||||
// case 0x54: eeprom_write_bit(data & 1); break;
|
||||
// case 0x5a: eeprom_set_cs_line((data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
|
||||
// case 0x5c: eeprom_set_cs_line((data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
|
||||
case 0x60: break;
|
||||
// default: printf("[%02x] <- %02x W\n",offset*2,data); break;
|
||||
}
|
||||
|
||||
#if 0
|
||||
if(offset*2 == 0x54)
|
||||
{
|
||||
@ -170,20 +156,13 @@ static ADDRESS_MAP_START( jackpool_mem, ADDRESS_SPACE_PROGRAM, 16 )
|
||||
AM_RANGE(0x000000, 0x03ffff) AM_ROM
|
||||
AM_RANGE(0x100000, 0x10ffff) AM_RAM
|
||||
AM_RANGE(0x120000, 0x1200ff) AM_RAM
|
||||
AM_RANGE(0x340000, 0x341fff) AM_RAM AM_BASE(&sc0_vram)
|
||||
AM_RANGE(0x342000, 0x343fff) AM_RAM AM_BASE(&sc1_vram)
|
||||
AM_RANGE(0x344000, 0x345fff) AM_RAM AM_BASE(&sc2_vram)
|
||||
AM_RANGE(0x346000, 0x347fff) AM_RAM AM_BASE(&sc3_vram)
|
||||
/* are the ones below used? */
|
||||
AM_RANGE(0x348000, 0x349fff) AM_RAM
|
||||
AM_RANGE(0x34a000, 0x34bfff) AM_RAM
|
||||
AM_RANGE(0x34c000, 0x34dfff) AM_RAM
|
||||
AM_RANGE(0x34e000, 0x34ffff) AM_RAM
|
||||
AM_RANGE(0x340000, 0x347fff) AM_RAM AM_BASE(&jackpool_vram)
|
||||
AM_RANGE(0x348000, 0x34ffff) AM_RAM //<- vram banks 2 & 3?
|
||||
|
||||
AM_RANGE(0x360000, 0x3603ff) AM_RAM_WRITE(paletteram16_xxxxBBBBGGGGRRRR_word_w) AM_BASE(&paletteram16)
|
||||
AM_RANGE(0x380000, 0x380061) AM_READWRITE(jackpool_io_r,jackpool_io_w) AM_BASE(&jackpool_io)//AM_READ(jackpool_io_r)
|
||||
|
||||
AM_RANGE(0x800000, 0x80000f) AM_READ(jackpool_ff_r) AM_WRITENOP
|
||||
AM_RANGE(0x800000, 0x80000f) AM_READ(jackpool_ff_r) AM_WRITENOP //UART
|
||||
AM_RANGE(0xa00000, 0xa00001) AM_DEVREADWRITE8("oki", okim6295_r, okim6295_w, 0x00ff)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
@ -225,6 +204,11 @@ static INPUT_PORTS_START( jackpool )
|
||||
PORT_START("HOLD5")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD5 )
|
||||
PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
/* these two both crashes the CPU*/
|
||||
PORT_START("UNK1")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
PORT_START("UNK2")
|
||||
PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
@ -254,21 +238,13 @@ static INTERRUPT_GEN( jackpool_interrupt )
|
||||
static MACHINE_DRIVER_START( jackpool )
|
||||
MDRV_CPU_ADD("maincpu", M68000, 12000000) // ?
|
||||
MDRV_CPU_PROGRAM_MAP(jackpool_mem)
|
||||
MDRV_CPU_VBLANK_INT("lscreen",jackpool_interrupt) // ?
|
||||
MDRV_CPU_VBLANK_INT("screen",jackpool_interrupt) // ?
|
||||
|
||||
MDRV_GFXDECODE(jackpool)
|
||||
MDRV_DEFAULT_LAYOUT(layout_dualhsxs)
|
||||
|
||||
MDRV_SCREEN_ADD("lscreen", RASTER)
|
||||
MDRV_SCREEN_ADD("screen", RASTER)
|
||||
MDRV_SCREEN_REFRESH_RATE(60)
|
||||
MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
|
||||
MDRV_SCREEN_SIZE(64*8, 64*8)
|
||||
MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
|
||||
|
||||
MDRV_SCREEN_ADD("rscreen", RASTER)
|
||||
MDRV_SCREEN_REFRESH_RATE(60)
|
||||
MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
|
||||
MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
|
||||
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
|
||||
MDRV_SCREEN_SIZE(64*8, 64*8)
|
||||
MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
|
||||
|
Loading…
Reference in New Issue
Block a user