nyny: correct ay clocks,

yakyuken: add nvram
This commit is contained in:
hap 2024-12-06 13:30:00 +01:00
parent 45354976d3
commit 36b80f2ae7
4 changed files with 62 additions and 61 deletions

View File

@ -653,7 +653,7 @@ void ampoker2_state::io_map(address_map &map)
map(0x36, 0x36).w(FUNC(ampoker2_state::port36_w)); /* see write handlers */
map(0x37, 0x37).w(FUNC(ampoker2_state::watchdog_reset_w));
map(0x38, 0x39).w("aysnd", FUNC(ay8910_device::address_data_w));
map(0x3A, 0x3A).r("aysnd", FUNC(ay8910_device::data_r));
map(0x3a, 0x3a).r("aysnd", FUNC(ay8910_device::data_r));
}
/*

View File

@ -37,10 +37,12 @@ Tomasz Slanina 20050225
*/
#include "emu.h"
#include "cpu/z80/z80.h"
#include "machine/i8255.h"
#include "machine/nvram.h"
#include "sound/ay8910.h"
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
@ -52,8 +54,8 @@ namespace {
class vroulet_state : public driver_device
{
public:
vroulet_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
vroulet_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
@ -64,6 +66,9 @@ public:
void vroulet(machine_config &config);
protected:
virtual void video_start() override ATTR_COLD;
private:
required_device<cpu_device> m_maincpu;
required_device<gfxdecode_device> m_gfxdecode;
@ -85,8 +90,6 @@ private:
TILE_GET_INFO_MEMBER(get_bg_tile_info);
virtual void video_start() override ATTR_COLD;
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void vroulet_io_map(address_map &map) ATTR_COLD;
void vroulet_map(address_map &map) ATTR_COLD;
@ -95,7 +98,6 @@ private:
/* video */
void vroulet_state::paletteram_w(offs_t offset, uint8_t data)
{
/*
@ -103,15 +105,15 @@ void vroulet_state::paletteram_w(offs_t offset, uint8_t data)
but... each palette has 8 colors only, not 16 as expected...
*/
int i,j,a,b;
m_generic_paletteram_8[offset]=data;
for(i=0;i<32;i++)
for (int i = 0; i < 32; i++)
{
for(j=0;j<16;j++)
for (int j = 0; j < 16; j++)
{
a=m_generic_paletteram_8[((i*8+j)*2)&0xff ];
b=m_generic_paletteram_8[((i*8+j)*2+1)&0xff ];
m_palette->set_pen_color(i*16+j,pal4bit(b),pal4bit(b>>4),pal4bit(a));
int a = m_generic_paletteram_8[((i * 8 + j) * 2) & 0xff];
int b = m_generic_paletteram_8[((i * 8 + j) * 2 + 1) & 0xff];
m_palette->set_pen_color(i * 16 + j, pal4bit(b), pal4bit(b >> 4), pal4bit(a));
}
}
}
@ -151,6 +153,7 @@ uint32_t vroulet_state::screen_update(screen_device &screen, bitmap_ind16 &bitma
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, 0x320, 1, 0, 0,
m_ball[1], m_ball[0] - 12, 0);
return 0;
}
@ -271,21 +274,21 @@ static const gfx_layout charlayout =
/* Graphics Decode Information */
static GFXDECODE_START( gfx_vroulet )
GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 32 )
GFXDECODE_ENTRY( "gfx1", 0x0000, charlayout, 0, 32 )
GFXDECODE_END
/* PPI8255 Interface */
void vroulet_state::ppi8255_a_w(uint8_t data) {}// watchdog ?
void vroulet_state::ppi8255_b_w(uint8_t data) {}// lamps ?
void vroulet_state::ppi8255_c_w(uint8_t data) {}
void vroulet_state::ppi8255_a_w(uint8_t data) { } // watchdog ?
void vroulet_state::ppi8255_b_w(uint8_t data) { } // lamps ?
void vroulet_state::ppi8255_c_w(uint8_t data) { }
/* Machine Driver */
void vroulet_state::vroulet(machine_config &config)
{
// basic machine hardware
Z80(config, m_maincpu, 4000000); //???
Z80(config, m_maincpu, 4000000); // ???
m_maincpu->set_addrmap(AS_PROGRAM, &vroulet_state::vroulet_map);
m_maincpu->set_addrmap(AS_IO, &vroulet_state::vroulet_io_map);
m_maincpu->set_vblank_int("screen", FUNC(vroulet_state::irq0_line_hold));

View File

@ -5,8 +5,9 @@
Bootleg of Omori's - The Yakyuken
It's a cocktail cabinet, each side has 7 buttons. One of the buttons is
apparently for relinquishing controls to the other side.
It's a strip rock-paper-scissors game in a cocktail cabinet, each side has
7 buttons. One of the buttons apparently is for relinquishing controls to
the other side.
PCB is marked 20282 and LC (stands for "lato componenti", so components side)
with a small riser board marked W 15482 plugged into one of the main CPU ROMs'
@ -24,7 +25,7 @@ Bank of 8 switches
The riser board has a pair of HM4334 1K*4 static RAMs and a quad 2-input NAND gate.
TODO:
- remaining DIPs
- find out win rate dipswitch values, or is it max payout rate?
- doesn't it have a hopper?
- game sometimes leaves gaps when the lady is undressing
- colors aren't 100% correct (see i.e. the stripes in the curtains)
@ -38,6 +39,7 @@ TODO:
#include "cpu/z80/z80.h"
#include "machine/gen_latch.h"
#include "machine/nvram.h"
#include "sound/ay8910.h"
#include "emupal.h"
@ -165,7 +167,7 @@ uint32_t yakyuken_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
void yakyuken_state::main_program_map(address_map &map)
{
map(0x0000, 0x37ff).rom();
map(0x6400, 0x67ff).ram();
map(0x6400, 0x67ff).ram().share("nvram");
map(0x7000, 0x73ff).select(0xc00).w(FUNC(yakyuken_state::vram_w));
}
@ -242,15 +244,15 @@ static INPUT_PORTS_START( yakyuken )
PORT_DIPNAME( 0x04, 0x04, "Max Bet" ) PORT_DIPLOCATION("SW:3")
PORT_DIPSETTING( 0x04, "10" )
PORT_DIPSETTING( 0x00, "30" )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW:4") // some combination of the following 3 seems to affect win probability
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW:5")
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW:6")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x38, 0x38, "Win Rate" ) PORT_DIPLOCATION("SW:4,5,6")
PORT_DIPSETTING( 0x38, "?%" )
PORT_DIPSETTING( 0x30, "?%" )
PORT_DIPSETTING( 0x28, "?%" )
PORT_DIPSETTING( 0x20, "?%" )
PORT_DIPSETTING( 0x18, "?%" )
PORT_DIPSETTING( 0x10, "?%" )
PORT_DIPSETTING( 0x08, "?%" )
PORT_DIPSETTING( 0x00, "100%" ) // test
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Service_Mode ) ) PORT_DIPLOCATION("SW:7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
@ -282,6 +284,8 @@ void yakyuken_state::yakyuken(machine_config &config)
config.set_maximum_quantum(attotime::from_hz(600));
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
// video hardware
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(60);

View File

@ -17,6 +17,7 @@
* What is the main CPU clock? 11.2Mhz / 16 goes through
a MC4044 and a MC4024 analog chips before going to the EXTAL
pin of the M6809
* Stars are blinking too fast.
Notes:
* The Sigma set has Japanese voice samples, while the Gottlieb
@ -85,15 +86,6 @@
namespace {
#define MAIN_CPU_MASTER_CLOCK XTAL(11'200'000)
#define PIXEL_CLOCK (MAIN_CPU_MASTER_CLOCK / 2)
#define CRTC_CLOCK (MAIN_CPU_MASTER_CLOCK / 16)
#define AUDIO_1_MASTER_CLOCK XTAL(4'000'000)
#define AUDIO_CPU_1_CLOCK AUDIO_1_MASTER_CLOCK
#define AUDIO_2_MASTER_CLOCK XTAL(4'000'000)
#define AUDIO_CPU_2_CLOCK AUDIO_2_MASTER_CLOCK
class nyny_state : public driver_device
{
public:
@ -323,9 +315,10 @@ MC6845_END_UPDATE( nyny_state::crtc_end_update )
for (int x = cliprect.min_x; x <= cliprect.max_x; x++)
{
/* check if the star status */
if (m_star_enable && (bitmap.pix(y, x) == m_palette->pen_color(0)) &&
((m_star_shift_reg & 0x80ff) == 0x00ff) &&
(((y & 0x01) ^ m_flipscreen) ^ (((x & 0x08) >> 3) ^ m_flipscreen)))
const bool enabled = m_star_enable && (bitmap.pix(y, x) == m_palette->pen_color(0));
const int flip = m_flipscreen ? 1 : 0;
if (enabled && ((m_star_shift_reg & 0x80ff) == 0x00ff) && (((y & 0x01) ^ flip) ^ (((x & 0x08) >> 3) ^ flip)))
{
uint8_t color = ((m_star_shift_reg & 0x0100) >> 8) | /* R */
((m_star_shift_reg & 0x0400) >> 9) | /* G */
@ -602,27 +595,28 @@ void nyny_state::machine_reset()
void nyny_state::nyny(machine_config &config)
{
/* basic machine hardware */
MC6809(config, m_maincpu, 5600000); /* 1.40 MHz? The clock signal is generated by analog chips */
// basic machine hardware
MC6809(config, m_maincpu, 5'600'000); // 5.6 MHz? The clock signal is generated by analog chips
m_maincpu->set_addrmap(AS_PROGRAM, &nyny_state::main_map);
m_maincpu->set_periodic_int(FUNC(nyny_state::update_pia_1), attotime::from_hz(25));
M6802(config, m_audiocpu, AUDIO_CPU_1_CLOCK);
M6802(config, m_audiocpu, 4_MHz_XTAL);
m_audiocpu->set_addrmap(AS_PROGRAM, &nyny_state::audio_1_map);
M6802(config, m_audiocpu2, AUDIO_CPU_2_CLOCK);
M6802(config, m_audiocpu2, 4_MHz_XTAL); // physically a different XTAL
m_audiocpu2->set_addrmap(AS_PROGRAM, &nyny_state::audio_2_map);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
/* video hardware */
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_raw(PIXEL_CLOCK, 360, 0, 256, 276, 0, 224);
screen.set_video_attributes(VIDEO_ALWAYS_UPDATE);
screen.set_raw(11.2_MHz_XTAL / 2, 360, 0, 256, 276, 0, 224);
screen.set_screen_update("crtc", FUNC(mc6845_device::screen_update));
PALETTE(config, m_palette, palette_device::RGB_3BIT);
MC6845(config, m_mc6845, CRTC_CLOCK); // HD46505P
MC6845(config, m_mc6845, 11.2_MHz_XTAL / 16); // HD46505P
m_mc6845->set_screen("screen");
m_mc6845->set_show_border_area(false);
m_mc6845->set_char_width(8);
@ -630,15 +624,15 @@ void nyny_state::nyny(machine_config &config)
m_mc6845->set_end_update_callback(FUNC(nyny_state::crtc_end_update));
m_mc6845->out_de_callback().set(m_ic48_1, FUNC(ttl74123_device::a_w));
/* 74LS123: This timer is responsible for delaying the setting of PIA2's CA1 line. */
/* This delay ensures that CA1 is only changed in the VBLANK region, but not in HBLANK. */
// 74LS123: This timer is responsible for delaying the setting of PIA2's CA1 line.
// This delay ensures that CA1 is only changed in the VBLANK region, but not in HBLANK.
TTL74123(config, m_ic48_1, 0);
m_ic48_1->set_connection_type(TTL74123_GROUNDED); /* the hook up type */
m_ic48_1->set_resistor_value(RES_K(22)); /* resistor connected to RCext */
m_ic48_1->set_capacitor_value(CAP_U(0.01)); /* capacitor connected to Cext and RCext */
m_ic48_1->set_a_pin_value(1); /* A pin - driven by the CRTC */
m_ic48_1->set_b_pin_value(1); /* B pin - pulled high */
m_ic48_1->set_clear_pin_value(1); /* Clear pin - pulled high */
m_ic48_1->set_connection_type(TTL74123_GROUNDED); // the hook up type
m_ic48_1->set_resistor_value(RES_K(22)); // resistor connected to RCext
m_ic48_1->set_capacitor_value(CAP_U(0.01)); // capacitor connected to Cext and RCext
m_ic48_1->set_a_pin_value(1); // A pin - driven by the CRTC
m_ic48_1->set_b_pin_value(1); // B pin - pulled high
m_ic48_1->set_clear_pin_value(1); // Clear pin - pulled high
m_ic48_1->out_cb().set(m_pia2, FUNC(pia6821_device::ca1_w));
PIA6821(config, m_pia1);
@ -655,24 +649,24 @@ void nyny_state::nyny(machine_config &config)
m_pia2->irqa_handler().set(FUNC(nyny_state::main_cpu_firq));
m_pia2->irqb_handler().set(FUNC(nyny_state::main_cpu_irq));
/* audio hardware */
// audio hardware
SPEAKER(config, "speaker").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
GENERIC_LATCH_8(config, m_soundlatch2);
GENERIC_LATCH_8(config, m_soundlatch3);
ay8910_device &ay1(AY8910(config, "ay1", AUDIO_CPU_1_CLOCK));
ay8910_device &ay1(AY8910(config, "ay1", 4_MHz_XTAL / 4));
ay1.port_a_write_callback().set(FUNC(nyny_state::ay8910_37_port_a_w));
ay1.port_b_write_callback().set(FUNC(nyny_state::ay8910_37_port_b_w));
ay1.add_route(ALL_OUTPUTS, "speaker", 0.25);
ay8910_device &ay2(AY8910(config, "ay2", AUDIO_CPU_1_CLOCK));
ay8910_device &ay2(AY8910(config, "ay2", 4_MHz_XTAL / 4));
ay2.port_a_read_callback().set_ioport("SW2");
ay2.port_b_read_callback().set_ioport("SW1");
ay2.add_route(ALL_OUTPUTS, "speaker", 0.25);
AY8910(config, "ay3", AUDIO_CPU_2_CLOCK).add_route(ALL_OUTPUTS, "speaker", 0.03);
AY8910(config, "ay3", 4_MHz_XTAL / 4).add_route(ALL_OUTPUTS, "speaker", 0.1);
DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "speaker", 0.25); // unknown DAC
}