From 83e51e293f04d655eea37e6e8214f41de53a6a93 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Mon, 16 Jul 2012 03:44:19 +0000 Subject: [PATCH] Hooked temp drawing functions --- src/mame/drivers/kongambl.c | 86 ++++++++++++++++++++++++++----------- 1 file changed, 60 insertions(+), 26 deletions(-) diff --git a/src/mame/drivers/kongambl.c b/src/mame/drivers/kongambl.c index 9365173f5a2..8846fad994a 100644 --- a/src/mame/drivers/kongambl.c +++ b/src/mame/drivers/kongambl.c @@ -11,16 +11,7 @@ Thanks to palindrome for PCB scans. - 4e226 - 2bfb8 <- 0x109a7c / 0x109a84 VRAM DATA ROM - 0x4e5f6 - 0x4ef08 - - 0x10a1d4 - - ... - 0x55e42 - + 0x38606 */ #include "emu.h" @@ -39,7 +30,7 @@ public: m_vram(*this, "vram") { } - optional_shared_ptr m_vram; + optional_shared_ptr m_vram; DECLARE_READ32_MEMBER(eeprom_r); DECLARE_WRITE32_MEMBER(eeprom_w); DECLARE_WRITE8_MEMBER(kongambl_ff_w); @@ -64,6 +55,41 @@ static VIDEO_START(kongambl) static SCREEN_UPDATE_IND16(kongambl) { #if CUSTOM_DRAW + kongambl_state *state = screen.machine().driver_data(); + const gfx_element *gfx = screen.machine().gfx[0]; + UINT32 count; + + count = 0; + + for (int y=0;y<64;y++) + { + for (int x=0;x<128;x++) + { + UINT32 tile = state->m_vram[count] & 0xffff; + + if(screen.machine().primary_screen->visible_area().contains(x*8, y*8)) + drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*8); + + count++; + } + } + + count = 0x8000/4; + + for (int y=0;y<64;y++) + { + for (int x=0;x<128;x++) + { + UINT32 tile = state->m_vram[count] & 0xffff; + + if(screen.machine().primary_screen->visible_area().contains(x*8, y*8)) + drawgfx_transpen(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*8,0); + + count++; + } + } + + #else device_t *k056832 = screen.machine().device("k056832"); @@ -112,6 +138,11 @@ static READ32_HANDLER( test_r ) return -1;//space->machine().rand(); } +static READ32_HANDLER( rng_r ) +{ + return space->machine().rand(); +} + WRITE8_MEMBER(kongambl_state::kongambl_ff_w) { /* enables thru 0->1 */ @@ -162,11 +193,14 @@ static ADDRESS_MAP_START( kongambl_map, AS_PROGRAM, 32, kongambl_state ) AM_RANGE(0x4d0000, 0x4d0003) AM_WRITE8(kongambl_ff_w,0xff000000) AM_RANGE(0x500380, 0x500383) AM_READ_LEGACY(test_r) - AM_RANGE(0x500400, 0x500403) AM_NOP //dual port? - AM_RANGE(0x500420, 0x500423) AM_NOP //dual port? - AM_RANGE(0x500500, 0x500503) AM_NOP // reads sound ROM in here, polled from m68k? + AM_RANGE(0x500000, 0x5007ff) AM_RAM +// AM_RANGE(0x500400, 0x500403) AM_NOP //dual port? +// AM_RANGE(0x500420, 0x500423) AM_NOP //dual port? +// AM_RANGE(0x500500, 0x500503) AM_NOP // reads sound ROM in here, polled from m68k? AM_RANGE(0x580000, 0x580007) AM_READ_LEGACY(test_r) + AM_RANGE(0x600000, 0x60000f) AM_READ_LEGACY(test_r) + AM_RANGE(0x700000, 0x700003) AM_READ(eeprom_r) AM_RANGE(0x700004, 0x700007) AM_READ_PORT("IN1") AM_RANGE(0x700008, 0x70000b) AM_READ_PORT("IN3") @@ -221,10 +255,10 @@ static INPUT_PORTS_START( kongambl ) PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x04, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) // "RESET SIGNAL" + PORT_DIPNAME( 0x04, 0x00, "Reset Backup RAM" ) + PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) + PORT_DIPSETTING( 0x04, DEF_STR( No ) ) + PORT_DIPNAME( 0x08, 0x08, "Reset Signal" ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x08, DEF_STR( On ) ) PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) @@ -244,22 +278,22 @@ static INPUT_PORTS_START( kongambl ) PORT_DIPNAME( 0x01, 0x00, "SYSB" ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x01, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) // "NO BATTERY" + PORT_DIPNAME( 0x02, 0x02, "No Battery - 1" ) // "NO BATTERY" PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x02, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) // "NO BATTERY" + PORT_DIPNAME( 0x04, 0x04, "No Battery - 2" ) // "NO BATTERY" PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x04, DEF_STR( On ) ) PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) // IFU + PORT_DIPNAME( 0x10, 0x00, "IFU signal" ) // IFU PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) // LCU + PORT_DIPNAME( 0x20, 0x00, "LCU signal" ) // LCU PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x20, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) // VSB + PORT_DIPNAME( 0x40, 0x00, "VSB signal" ) // VSB PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x40, DEF_STR( On ) ) PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) @@ -546,7 +580,7 @@ static TIMER_DEVICE_CALLBACK( kongambl_vblank ) kongambl_state *state = timer.machine().driver_data(); int scanline = param; - if(scanline == 256) + if(scanline == 512) device_set_input_line(state->m_maincpu, 1, HOLD_LINE); // vblank? if(scanline == 0) @@ -567,8 +601,8 @@ static MACHINE_CONFIG_START( kongambl, kongambl_state ) MCFG_SCREEN_ADD("screen", RASTER) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) - MCFG_SCREEN_SIZE(64*8, 32*8+16) - MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1) + MCFG_SCREEN_SIZE(96*8, 64*8+16) + MCFG_SCREEN_VISIBLE_AREA(0*8, 80*8-1, 0*8, 64*8-1) MCFG_SCREEN_UPDATE_STATIC(kongambl) MCFG_PALETTE_LENGTH(0x8000)