Hot Chilli: Reworked, improved and simplify inputs, banking and interrupts.

Also switched to screen raw parameters and cleaned up the driver.
This commit is contained in:
Roberto Fresca 2022-05-09 21:33:09 +02:00
parent 56e2cdf453
commit bafca0461b

View File

@ -8,7 +8,7 @@
Driver by Roberto Fresca & Grull Osgo. Driver by Roberto Fresca & Grull Osgo.
One of the most beautiful designs for 8bit slots machines. One of the most beautiful designs for 8bit slots machines. Very rare.
The reverse-engineering was made seeing a few PCB pictures, and following the code. The reverse-engineering was made seeing a few PCB pictures, and following the code.
After all these exhaustive analysis we finally got the inputs working, but they are After all these exhaustive analysis we finally got the inputs working, but they are
@ -157,7 +157,6 @@
#include "video/seta001.h" #include "video/seta001.h"
#include "machine/nvram.h" #include "machine/nvram.h"
#include "machine/ram.h" #include "machine/ram.h"
#include "machine/bankdev.h"
#include "emupal.h" #include "emupal.h"
#include "screen.h" #include "screen.h"
#include "speaker.h" #include "speaker.h"
@ -177,15 +176,16 @@ public:
, m_maincpu(*this, "maincpu") , m_maincpu(*this, "maincpu")
, m_seta001(*this, "spritegen") , m_seta001(*this, "spritegen")
, m_palette(*this, "palette") , m_palette(*this, "palette")
, m_mainbank(*this, "mainbank") , m_screen(*this, "screen")
, m_bank(*this, "bank")
, m_ram(*this, RAM_TAG) , m_ram(*this, RAM_TAG)
, m_nvram(*this, "nvram") , m_nvram(*this, "nvram")
, m_inp0(*this, "IN0")
, m_lamp(*this, "lamp%u", 0U) , m_lamp(*this, "lamp%u", 0U)
{ {
} }
void hotchili(machine_config &config); void hotchili(machine_config &config);
void hotchili_mainbank(machine_config &config);
void init_hc(); void init_hc();
@ -193,7 +193,6 @@ protected:
// driver_device overrides // driver_device overrides
virtual void machine_start() override; virtual void machine_start() override;
private: private:
// screen updates // screen updates
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
@ -209,7 +208,6 @@ private:
uint16_t m_addr_mask, m_addr_latch; uint16_t m_addr_mask, m_addr_latch;
void hc_map(address_map &map); void hc_map(address_map &map);
void mainbank_map(address_map &map);
void bankswitch_w(uint8_t data); void bankswitch_w(uint8_t data);
//inports //inports
@ -224,15 +222,14 @@ private:
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
required_device<seta001_device> m_seta001; required_device<seta001_device> m_seta001;
required_device<palette_device> m_palette; required_device<palette_device> m_palette;
required_device<address_map_bank_device> m_mainbank; required_device<screen_device> m_screen;
required_memory_bank m_bank;
required_device<ram_device> m_ram; required_device<ram_device> m_ram;
required_device<nvram_device> m_nvram; required_device<nvram_device> m_nvram;
required_ioport m_inp0;
output_finder<40> m_lamp; output_finder<40> m_lamp;
DECLARE_WRITE_LINE_MEMBER(vblank_irq);
uint8_t m_meters = 0; uint8_t m_meters = 0;
uint8_t m_frame = 0;
}; };
@ -280,22 +277,7 @@ uint32_t hotchili_state::screen_update( screen_device &screen, bitmap_ind16 &bit
void hotchili_state::bankswitch_w(uint8_t data) void hotchili_state::bankswitch_w(uint8_t data)
{ {
uint8_t bank, hibit, high; m_bank->set_entry((data & 0x80) ? (data & 0x03) : 0);
high = data & 0x03;
hibit = data >> 7;
bank = hibit ? 4 + high : 4;
m_mainbank->set_bank(bank);
}
void hotchili_state::mainbank_map(address_map &map)
{
map(0x000000, 0x07fff).rom().region(":maincpu", 0x0000);
map(0x008000, 0x0ffff).rom().region(":maincpu", 0x8000);
}
void hotchili_state::hotchili_mainbank(machine_config &config)
{
ADDRESS_MAP_BANK(config, "mainbank").set_map(&hotchili_state::mainbank_map).set_options(ENDIANNESS_LITTLE, 8, 16, 0x2000);
} }
@ -306,7 +288,7 @@ void hotchili_state::hotchili_mainbank(machine_config &config)
void hotchili_state::hc_map(address_map &map) void hotchili_state::hc_map(address_map &map)
{ {
map(0x0000, 0x7fff).rom(); map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).m(m_mainbank, FUNC(address_map_bank_device::amap8)); map(0x8000, 0x9fff).bankr("bank");
map(0xa000, 0xafff).ram().rw(m_seta001, FUNC(seta001_device::spritecodelow_r8), FUNC(seta001_device::spritecodelow_w8)); map(0xa000, 0xafff).ram().rw(m_seta001, FUNC(seta001_device::spritecodelow_r8), FUNC(seta001_device::spritecodelow_w8));
map(0xb000, 0xbfff).ram().rw(m_seta001, FUNC(seta001_device::spritecodehigh_r8), FUNC(seta001_device::spritecodehigh_w8)); map(0xb000, 0xbfff).ram().rw(m_seta001, FUNC(seta001_device::spritecodehigh_r8), FUNC(seta001_device::spritecodehigh_w8));
map(0xc000, 0xdfff).ram(); map(0xc000, 0xdfff).ram();
@ -405,13 +387,14 @@ INPUT_PORTS_END
uint8_t hotchili_state::inport0_r() uint8_t hotchili_state::inport0_r()
{ {
if(m_frame == 8) if( (m_screen->frame_number() & 7) == 0)
{ {
m_frame = 0; return m_inp0->read() & 0xf9; // enables alternate inputs read
return ioport("IN0")->read() & 0xf9; // enables alternate inputs read }
else
{
return m_inp0->read();
} }
return ioport("IN0")->read();
} }
@ -425,7 +408,6 @@ uint8_t hotchili_state::inport3_r()
* Lamps and Outputs * * Lamps and Outputs *
*******************************************/ *******************************************/
void hotchili_state::outp1_w(offs_t offset, uint8_t data) void hotchili_state::outp1_w(offs_t offset, uint8_t data)
{ {
offset = (offset >> 2) & 0x03; offset = (offset >> 2) & 0x03;
@ -439,7 +421,7 @@ void hotchili_state::outp1_w(offs_t offset, uint8_t data)
m_lamp[4] = BIT(data,4); // 5th Start m_lamp[4] = BIT(data,4); // 5th Start
m_lamp[5] = BIT(data,5); m_lamp[5] = BIT(data,5);
m_lamp[6] = BIT(data,6); m_lamp[6] = BIT(data,6);
m_lamp[7] = BIT(data,7); // motor hopper m_lamp[7] = BIT(data,7); // Motor Hopper
break; break;
case 1: case 1:
@ -466,14 +448,14 @@ void hotchili_state::outp1_w(offs_t offset, uint8_t data)
case 3: case 3:
m_meters = data; m_meters = data;
m_lamp[24] = BIT(data,0); machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); // Coin 1 m_lamp[24] = BIT(data,0); machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); // Meter 1
m_lamp[25] = BIT(data,1); machine().bookkeeping().coin_counter_w(1, BIT(data, 1)); // Coin 2 m_lamp[25] = BIT(data,1); machine().bookkeeping().coin_counter_w(1, BIT(data, 1)); // Meter 2
m_lamp[26] = BIT(data,2); machine().bookkeeping().coin_counter_w(2, BIT(data, 2)); // Coin 3 Credits Played m_lamp[26] = BIT(data,2); machine().bookkeeping().coin_counter_w(2, BIT(data, 2)); // Meter 3 - Credits Played
m_lamp[27] = BIT(data,3); machine().bookkeeping().coin_counter_w(3, BIT(data, 3)); // Coin 4 Credits Won m_lamp[27] = BIT(data,3); machine().bookkeeping().coin_counter_w(3, BIT(data, 3)); // Meter 4 - Credits Won
m_lamp[28] = BIT(data,4); machine().bookkeeping().coin_counter_w(4, BIT(data, 4)); // Coin 5 Credits to Cash Box m_lamp[28] = BIT(data,4); machine().bookkeeping().coin_counter_w(4, BIT(data, 4)); // Meter 5 - Credits to Cash Box
m_lamp[29] = BIT(data,5); machine().bookkeeping().coin_counter_w(5, BIT(data, 5)); // Coin 6 Creditos Cancelados (Hand Pay) m_lamp[29] = BIT(data,5); machine().bookkeeping().coin_counter_w(5, BIT(data, 5)); // Meter 6 - Cancelled Credits (Hand Pay)
m_lamp[30] = BIT(data,6); machine().bookkeeping().coin_counter_w(6, BIT(data, 6)); // Coin 7 Games m_lamp[30] = BIT(data,6); machine().bookkeeping().coin_counter_w(6, BIT(data, 6)); // Meter 7 - Games
m_lamp[31] = BIT(data,7); machine().bookkeeping().coin_counter_w(7, BIT(data, 7)); // Coin 8 m_lamp[31] = BIT(data,7); machine().bookkeeping().coin_counter_w(7, BIT(data, 7)); // Meter 8
break; break;
} }
} }
@ -490,11 +472,11 @@ void hotchili_state::outp2_w(offs_t offset, uint8_t data)
m_lamp[39] = BIT(data,7); m_lamp[39] = BIT(data,7);
} }
/********************************************* /*********************************************
* Graphics Layouts * * Graphics Layouts *
*********************************************/ *********************************************/
static const gfx_layout charlayout = static const gfx_layout charlayout =
{ {
16,16, 16,16,
@ -513,9 +495,8 @@ static const gfx_layout charlayout =
* Graphics Decode Information * * Graphics Decode Information *
**************************************************/ **************************************************/
static GFXDECODE_START( gfx_hotchili ) static GFXDECODE_START( gfx_hotchili )
GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0x0, 32 ) GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 32 )
GFXDECODE_END GFXDECODE_END
@ -523,7 +504,6 @@ GFXDECODE_END
* Universal External RAM Module * * Universal External RAM Module *
**************************************************/ **************************************************/
void hotchili_state::extram_w(offs_t offset, uint8_t data) void hotchili_state::extram_w(offs_t offset, uint8_t data)
{ {
//logerror("external_memory_w:%x: data:%x\n", offset, data); //logerror("external_memory_w:%x: data:%x\n", offset, data);
@ -567,7 +547,6 @@ uint8_t hotchili_state::extram_r(offs_t offset)
* Machine Start * * Machine Start *
******************************************/ ******************************************/
void hotchili_state::machine_start() void hotchili_state::machine_start()
{ {
m_lamp.resolve(); m_lamp.resolve();
@ -575,47 +554,25 @@ void hotchili_state::machine_start()
} }
/******************************************
* Interrupts Handling *
******************************************/
WRITE_LINE_MEMBER(hotchili_state::vblank_irq)
{
m_maincpu->set_input_line(0, HOLD_LINE);
if(state)
{
m_frame++;
}
}
/********************************************* /*********************************************
* Machine Drivers * * Machine Drivers *
*********************************************/ *********************************************/
void hotchili_state::hotchili(machine_config &config) void hotchili_state::hotchili(machine_config &config)
{ {
// basic machine hardware // basic machine hardware
Z80(config, m_maincpu, MAIN_CLOCK / 2); Z80(config, m_maincpu, MAIN_CLOCK / 2);
m_maincpu->set_addrmap(AS_PROGRAM, &hotchili_state::hc_map); m_maincpu->set_addrmap(AS_PROGRAM, &hotchili_state::hc_map);
hotchili_mainbank(config);
RAM(config, m_ram).set_default_size("2K").set_default_value(0); RAM(config, m_ram).set_default_size("2K").set_default_value(0);
NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0);
// video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); m_screen->set_raw( MAIN_CLOCK / 2, 260, 0, 256, 256, 16, 239);
screen.set_refresh_hz(60); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); m_screen->set_screen_update(FUNC(hotchili_state::screen_update));
screen.set_size(32*8, 32*8); m_screen->screen_vblank().set_inputline(m_maincpu, 0, HOLD_LINE);
screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1); m_screen->set_palette(m_palette);
screen.set_screen_update(FUNC(hotchili_state::screen_update));
screen.screen_vblank().set(FUNC(hotchili_state::vblank_irq));
screen.set_palette(m_palette);
SETA001_SPRITE(config, m_seta001, 16'000'000, m_palette, gfx_hotchili); SETA001_SPRITE(config, m_seta001, 16'000'000, m_palette, gfx_hotchili);
m_seta001->set_fg_yoffsets( -0x12, 0x0e ); m_seta001->set_fg_yoffsets( -0x12, 0x0e );
@ -636,7 +593,6 @@ void hotchili_state::hotchili(machine_config &config)
* Rom Load * * Rom Load *
*********************************************/ *********************************************/
ROM_START( hotchili ) ROM_START( hotchili )
ROM_REGION( 0x10000, "maincpu", 0 ) ROM_REGION( 0x10000, "maincpu", 0 )
ROM_LOAD( "h.chilli_95103_v0191__27c512.ic32", 0x0000, 0x10000, CRC(54b7c675) SHA1(7ce0348ae9561784519cdb99e33a57922520941c) ) ROM_LOAD( "h.chilli_95103_v0191__27c512.ic32", 0x0000, 0x10000, CRC(54b7c675) SHA1(7ce0348ae9561784519cdb99e33a57922520941c) )
@ -663,6 +619,7 @@ ROM_END
void hotchili_state::init_hc() void hotchili_state::init_hc()
{ {
uint8_t *ROM = memregion("maincpu")->base(); uint8_t *ROM = memregion("maincpu")->base();
m_bank->configure_entries(0, 4, &ROM[0x8000], 0x2000);
ROM[0x05bc] = 0x00; // Avoids ram error flag setup ROM[0x05bc] = 0x00; // Avoids ram error flag setup
ROM[0x06c1] = 0x20; // Skip Rom Error ROM[0x06c1] = 0x20; // Skip Rom Error
@ -678,5 +635,5 @@ void hotchili_state::init_hc()
* Game Drivers * * Game Drivers *
*********************************************/ *********************************************/
// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS // YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT
GAMEL( 1995, hotchili, 0, hotchili, hotchili, hotchili_state, init_hc, ROT0, "Pacific Gaming Pty Ltd.", "Hot Chilli (95103, v0104)", 0 , layout_hotchili ) GAMEL( 1995, hotchili, 0, hotchili, hotchili, hotchili_state, init_hc, ROT0, "Pacific Gaming Pty Ltd.", "Hot Chilli (95103, v0104)", 0 , layout_hotchili )