Skip to content

Commit

Permalink
Cocktail mode support for Asteroids and Asteroids Deluxe (#71)
Browse files Browse the repository at this point in the history
* asteroids cocktail mode

* cocktail mode to asteroid

* astdelux cocktail mode

* changed visible area of asteroids because of incorrect flipping in cocktail mode

* changed visible area size for correct flipping

* Reset flip when changing dip switch

* space duel led output

* Added RAMSEL signal to LED2 for Asteroid/Deluxe cocktail mode support

* Added RAMSEL signal to LED2 for Asteroid/Deluxe cocktail mode support

* Added Cosmic Chasm, Star Castle, Space Wars and Omega Race to the BW list

* Incremented build number

* Added DEMON to BW game. Removed Cosmic Chasm

* Added flip for cocktail

* default script for led3

* Mhavoc PE support

* changed 0x1a opcode from ILL to NOP
  • Loading branch information
Goldfinch2 authored and amadvance committed Jul 21, 2022
1 parent 9d41949 commit 321fb1a
Show file tree
Hide file tree
Showing 14 changed files with 187 additions and 49 deletions.
41 changes: 24 additions & 17 deletions advance/osd/dvg.c
Expand Up @@ -56,7 +56,7 @@

// 0-15
#define DVG_RELEASE 0
#define DVG_BUILD 0
#define DVG_BUILD 1
#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
#define CMD_BUF_SIZE 0x20000
#define FLAG_COMPLETE 0x0
Expand Down Expand Up @@ -141,26 +141,33 @@ static uint32_t s_vertical_display;
static game_info_t s_games[] = {
{"armora", 0, GAME_ARMORA, 1},
{"armorap", 0, GAME_ARMORA, 1},
{"armorar", 0, GAME_ARMORA, 1},
{"asteroid", 0, GAME_NONE, 1},
{"asteroi1", 0, GAME_NONE, 1},
{"astdelux", 0, GAME_NONE, 1},
{"astdelu1", 0, GAME_NONE, 1},
{"armorar", 0, GAME_ARMORA, 1},
{"asteroid", 0, GAME_NONE, 1},
{"asteroi1", 0, GAME_NONE, 1},
{"astdelux", 0, GAME_NONE, 1},
{"astdelu1", 0, GAME_NONE, 1},
{"llander", 0, GAME_NONE, 1},
{"llander1", 0, GAME_NONE, 1},
{"demon", 0, GAME_NONE, 1},
{"barrier", 0, GAME_NONE, 1},
{"bzone", 0, GAME_NONE, 1},
{"bzone2", 0, GAME_NONE, 1},
{"bzonec", 0, GAME_NONE, 1},
{"redbaron", 0, GAME_NONE, 1},
{"ripoff", 0, GAME_NONE, 1},
{"bzone", 0, GAME_NONE, 1},
{"bzone2", 0, GAME_NONE, 1},
{"bzonec", 0, GAME_NONE, 1},
{"redbaron", 0, GAME_NONE, 1},
{"omegrace", 0, GAME_NONE, 1},
{"ripoff", 0, GAME_NONE, 1},
{"solarq", 0, GAME_NONE, 1},
{"speedfrk", 0, GAME_NONE, 1},
{"starhawk", 0, GAME_NONE, 1},
{"sundance", 0, GAME_NONE, 1},
{"tailg", 0, GAME_NONE, 1},
{"warrior", 0, GAME_WARRIOR, 1},
{"wotw", 0, GAME_NONE, 1},
{"speedfrk", 0, GAME_NONE, 1},
{"starhawk", 0, GAME_NONE, 1},
{"sundance", 0, GAME_NONE, 1},
{"tailg", 0, GAME_NONE, 1},
{"warrior", 0, GAME_WARRIOR, 1},
{"wotw", 0, GAME_NONE, 1},
{"spacewar", 0, GAME_NONE, 1},
{"starcas", 0, GAME_NONE, 1},
{"starcas1", 0, GAME_NONE, 1},
{"starcasp", 0, GAME_NONE, 1},
{"starcase", 0, GAME_NONE, 1},
{"starwars", 1, GAME_NONE, 0},
{"starwar1", 1, GAME_NONE, 0},
{"esb", 1, GAME_NONE, 0}
Expand Down
2 changes: 1 addition & 1 deletion advance/osd/glue.c
Expand Up @@ -1002,7 +1002,7 @@ static struct glue_keyboard_name GLUE_KEYBOARD_STD[] = {
KR2("period", "period", ".")
KR2("slash", "slash", "/")
KR2("colon", "colon", ":")
KR2("pound", "pound", "£")
KR2("pound", "pound", "£")
KR2("doublequote", "doublequote", "\"")
KR2("diesis", "diessi", "#")

Expand Down
4 changes: 2 additions & 2 deletions advance/osd/hscript.c
Expand Up @@ -451,7 +451,7 @@ int hardware_script_init(adv_conf* context)
conf_string_register_default(context, "script_play", "");
conf_string_register_default(context, "script_led1", "on(kdb, 0b1); wait(!event()); off(kdb, 0b1);");
conf_string_register_default(context, "script_led2", "on(kdb, 0b10); wait(!event()); off(kdb, 0b10);");
conf_string_register_default(context, "script_led3", "");
conf_string_register_default(context, "script_led3", "on(kdb, 0b100); wait(!event()); off(kdb, 0b100);");
conf_string_register_default(context, "script_coin1", "");
conf_string_register_default(context, "script_coin2", "");
conf_string_register_default(context, "script_coin3", "");
Expand All @@ -476,7 +476,7 @@ int hardware_script_init(adv_conf* context)
conf_string_register_default(context, "script_event12", "");
conf_string_register_default(context, "script_event13", "");
conf_string_register_default(context, "script_event14", "");
conf_string_register_default(context, "script_knocker", "on(kdb, 0b100); wait(!event()); off(kdb, 0b100);");
conf_string_register_default(context, "script_knocker", "");

STATE.active_flag = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/cpu/m6502/t6502.c
Expand Up @@ -222,7 +222,7 @@ OP(aa) { m6502_ICount -= 2; TAX; } /* 2 TAX */
OP(ca) { m6502_ICount -= 2; DEX; } /* 2 DEX */
OP(ea) { m6502_ICount -= 2; NOP; } /* 2 NOP */

OP(1a) { m6502_ICount -= 2; ILL; } /* 2 ILL */
OP(1a) { m6502_ICount -= 2; NOP; } /* 2 NOP */
OP(3a) { m6502_ICount -= 2; ILL; } /* 2 ILL */
OP(5a) { m6502_ICount -= 2; ILL; } /* 2 ILL */
OP(7a) { m6502_ICount -= 2; ILL; } /* 2 ILL */
Expand Down
14 changes: 13 additions & 1 deletion src/drivers/asteroid.c
Expand Up @@ -302,6 +302,12 @@ INPUT_PORTS_START( asteroid )
PORT_DIPSETTING ( 0x80, DEF_STR( 1C_1C ) )
PORT_DIPSETTING ( 0x40, DEF_STR( 1C_2C ) )
PORT_DIPSETTING ( 0x00, DEF_STR( Free_Play ) )

PORT_START_TAG("COCKTAIL")
PORT_DIPNAME(1, 0, DEF_STR(Cabinet))
PORT_DIPSETTING(0, DEF_STR(Upright))
PORT_DIPSETTING(1, DEF_STR(Cocktail))

INPUT_PORTS_END


Expand Down Expand Up @@ -475,6 +481,12 @@ INPUT_PORTS_START( astdelux )
PORT_DIPSETTING ( 0xa0, "1 each 4" )
PORT_DIPSETTING ( 0xc0, "1 each 2" )
PORT_DIPSETTING ( 0xe0, DEF_STR( None ) )

PORT_START_TAG("COCKTAIL")
PORT_DIPNAME(1, 0, DEF_STR(Cabinet))
PORT_DIPSETTING(0, DEF_STR(Upright))
PORT_DIPSETTING(1, DEF_STR(Cocktail))

INPUT_PORTS_END


Expand Down Expand Up @@ -608,7 +620,7 @@ static MACHINE_DRIVER_START( asteroid )
/* video hardware */
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_VECTOR | VIDEO_RGB_DIRECT)
MDRV_SCREEN_SIZE(400,300)
MDRV_VISIBLE_AREA(0, 1040, 70, 950)
MDRV_VISIBLE_AREA(0, 1032, 0, 1050)
MDRV_PALETTE_LENGTH(32768)

MDRV_PALETTE_INIT(avg_white)
Expand Down
11 changes: 7 additions & 4 deletions src/drivers/bwidow.c
Expand Up @@ -244,7 +244,7 @@ Typically, only the high 2 bits are read.
*/

static READ8_HANDLER( spacduel_IN3_r )
static READ8_HANDLER( spacduel_IN3_r )
{
int res;
int res1;
Expand Down Expand Up @@ -301,8 +301,8 @@ static READ8_HANDLER( spacduel_IN3_r )
WRITE8_HANDLER( bwidow_misc_w )
{
/*
0x10 = p1 led
0x20 = p2 led
0x10 = p1 led (space duel: select led)
0x20 = p2 led (space duel: start led)
0x01 = coin counter 1
0x02 = coin counter 2
*/
Expand All @@ -318,6 +318,8 @@ WRITE8_HANDLER( bwidow_misc_w )





/*************************************
*
* Main CPU memory handlers
Expand Down Expand Up @@ -351,7 +353,7 @@ static ADDRESS_MAP_START( spacduel_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0900, 0x0907) AM_READ(spacduel_IN3_r) /* IN1 */
AM_RANGE(0x0905, 0x0906) AM_WRITE(MWA8_NOP) /* ignore? */
AM_RANGE(0x0a00, 0x0a00) AM_READ(atari_vg_earom_r)
// AM_RANGE(0x0c00, 0x0c00) AM_WRITE(coin_counter_w) /* coin out */
AM_RANGE(0x0c00, 0x0c00) AM_WRITE(bwidow_misc_w)
AM_RANGE(0x0c80, 0x0c80) AM_WRITE(avgdvg_go_w)
AM_RANGE(0x0d00, 0x0d00) AM_WRITE(MWA8_NOP) /* watchdog clear */
AM_RANGE(0x0d80, 0x0d80) AM_WRITE(avgdvg_reset_w)
Expand All @@ -367,6 +369,7 @@ ADDRESS_MAP_END




/*************************************
*
* Port definitions
Expand Down
93 changes: 87 additions & 6 deletions src/drivers/mhavoc.c
Expand Up @@ -181,6 +181,7 @@
#include "vidhrdw/avgdvg.h"
#include "vidhrdw/vector.h"
#include "sound/pokey.h"
#include "sound/okim6295.h"
#include "mhavoc.h"


Expand Down Expand Up @@ -311,6 +312,16 @@ static ADDRESS_MAP_START( gamma_writemem, ADDRESS_SPACE_PROGRAM, 8 )
ADDRESS_MAP_END


static ADDRESS_MAP_START( gamma_mhavocpe_writemem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x07ff) AM_WRITE(MWA8_RAM) /* Program RAM (2K) */
AM_RANGE(0x0800, 0x1fff) AM_WRITE(mhavoc_gammaram_w) AM_BASE(&gammaram) /* wraps to 0x000-0x7ff */
AM_RANGE(0x2000, 0x203f) AM_WRITE(quad_pokey_w) /* Quad Pokey write */
AM_RANGE(0x4000, 0x4000) AM_WRITE(mhavoc_gamma_irq_ack_w) /* IRQ Acknowledge */
AM_RANGE(0x4800, 0x4800) AM_WRITE(mhavoc_out_1_w) /* Coin Counters */
AM_RANGE(0x5000, 0x5000) AM_WRITE(mhavoc_alpha_w) /* Alpha Comm. Write Port */
AM_RANGE(0x5900, 0x5900) AM_WRITE(OKIM6295_data_0_w)
AM_RANGE(0x6000, 0x61ff) AM_WRITE(MWA8_RAM) AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) /* EEROM */
ADDRESS_MAP_END

/*************************************
*
Expand Down Expand Up @@ -357,6 +368,28 @@ ADDRESS_MAP_END




static ADDRESS_MAP_START( alpha_mhavocpe_writemem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x01ff) AM_WRITE(MWA8_RAM) /* 0.5K Program Ram */
AM_RANGE(0x0200, 0x07ff) AM_WRITE(MWA8_BANK1) /* 3K Paged Program RAM */
AM_RANGE(0x0800, 0x09ff) AM_WRITE(MWA8_RAM) /* 0.5K Program RAM */
AM_RANGE(0x1200, 0x1200) AM_WRITE(MWA8_NOP) /* don't care */
AM_RANGE(0x1400, 0x141f) AM_WRITE(mhavoc_colorram_w) /* ColorRAM */
AM_RANGE(0x1600, 0x1600) AM_WRITE(mhavoc_out_0_w) /* Control Signals */
AM_RANGE(0x1640, 0x1640) AM_WRITE(avgdvg_go_w) /* Vector Generator GO */
AM_RANGE(0x1680, 0x1680) AM_WRITE(watchdog_reset_w) /* Watchdog Clear */
AM_RANGE(0x16c0, 0x16c0) AM_WRITE(avgdvg_reset_w) /* Vector Generator Reset */
AM_RANGE(0x1700, 0x1700) AM_WRITE(mhavoc_alpha_irq_ack_w)/* IRQ ack */
AM_RANGE(0x1740, 0x1740) AM_WRITE(mhavocpe_rom_banksel_w)/* Program ROM Page Select */
AM_RANGE(0x1780, 0x1780) AM_WRITE(mhavoc_ram_banksel_w)/* Program RAM Page Select */
AM_RANGE(0x17c0, 0x17c0) AM_WRITE(mhavoc_gamma_w) /* Gamma Communication Write Port */
AM_RANGE(0x1800, 0x1fff) AM_WRITE(MWA8_RAM) /* Shared Beta Ram */
AM_RANGE(0x2000, 0x3fff) AM_WRITE(MWA8_ROM) /* Major Havoc writes here.*/
AM_RANGE(0x4000, 0x4fff) AM_WRITE(MWA8_RAM) AM_BASE(&vectorram) AM_SIZE(&vectorram_size) AM_REGION(REGION_CPU1, 0x4000)/* Vector Generator RAM */
AM_RANGE(0x6000, 0xffff) AM_WRITE(MWA8_ROM)
ADDRESS_MAP_END


/*************************************
*
* Port definitions
Expand Down Expand Up @@ -610,6 +643,19 @@ static MACHINE_DRIVER_START( alphaone )
MACHINE_DRIVER_END


static MACHINE_DRIVER_START( mhavocpe )
/* basic machine hardware */
MDRV_IMPORT_FROM(mhavoc)
MDRV_CPU_MODIFY("alpha")
MDRV_CPU_PROGRAM_MAP(alpha_readmem, alpha_mhavocpe_writemem)
MDRV_CPU_MODIFY("gamma")
MDRV_CPU_PROGRAM_MAP(gamma_readmem, gamma_mhavocpe_writemem)

MDRV_SOUND_ADD_TAG("oki", OKIM6295, 12000)
MDRV_SOUND_CONFIG(okim6295_interface_region_1)
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_DRIVER_END


/*************************************
*
Expand All @@ -625,11 +671,12 @@ MACHINE_DRIVER_END
* are supported as "mhavocrv".
* Prototype is supported as "mhavocp"
* Alpha one is a single-board prototype
* "The Promised End" - CAX Pre-Release version released by Owen Rubin and Jess Askey in 2018 it is "mhavocpex"
*/

ROM_START( mhavoc )
/* Alpha Processor ROMs */
ROM_REGION( 0x21000, REGION_CPU1, 0 ) /* 152KB for ROMs */
ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 160KB for ROMs */
/* Vector Generator ROM */
ROM_LOAD( "136025.210", 0x05000, 0x2000, CRC(c67284ca) SHA1(d9adad80c266d36429444f483cac4ebcf1fec7b8) )

Expand All @@ -654,7 +701,7 @@ ROM_END

ROM_START( mhavoc2 )
/* Alpha Processor ROMs */
ROM_REGION( 0x21000, REGION_CPU1, 0 )
ROM_REGION( 0x40000, REGION_CPU1, 0 )
/* Vector Generator ROM */
ROM_LOAD( "136025.110", 0x05000, 0x2000, CRC(16eef583) SHA1(277252bd716dd96d5b98ec5e33a3a6a3bc1a9abf) )

Expand All @@ -681,7 +728,7 @@ ROM_END

ROM_START( mhavocrv )
/* Alpha Processor ROMs */
ROM_REGION( 0x21000, REGION_CPU1, 0 ) /* 152KB for ROMs */
ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 160KB for ROMs */
/* Vector Generator ROM */
ROM_LOAD( "136025.210", 0x05000, 0x2000, CRC(c67284ca) SHA1(d9adad80c266d36429444f483cac4ebcf1fec7b8) )

Expand All @@ -706,7 +753,7 @@ ROM_END

ROM_START( mhavocp )
/* Alpha Processor ROMs */
ROM_REGION( 0x21000, REGION_CPU1, 0 )
ROM_REGION( 0x40000, REGION_CPU1, 0 )
/* Vector Generator ROM */
ROM_LOAD( "136025.010", 0x05000, 0x2000, CRC(3050c0e6) SHA1(f19a9538996d949cdca7e6abd4f04e8ff6e0e2c1) )

Expand All @@ -732,7 +779,7 @@ ROM_END


ROM_START( alphaone )
ROM_REGION( 0x21000, REGION_CPU1, 0 )
ROM_REGION( 0x40000, REGION_CPU1, 0 )
/* Vector Generator ROM */
ROM_LOAD( "vec5000.tw", 0x05000, 0x1000, CRC(2a4c149f) SHA1(b60a0b29958bee9b5f7c1d88163680b626bb76dd) )

Expand All @@ -755,7 +802,7 @@ ROM_END


ROM_START( alphaona )
ROM_REGION( 0x21000, REGION_CPU1, 0 )
ROM_REGION( 0x40000, REGION_CPU1, 0 )
/* Vector Generator ROM */
ROM_LOAD( "vec5000.tw", 0x05000, 0x1000, CRC(2a4c149f) SHA1(b60a0b29958bee9b5f7c1d88163680b626bb76dd) )

Expand All @@ -777,6 +824,39 @@ ROM_START( alphaona )
ROM_END


ROM_START( mhavocpex7 )
/* Alpha Processor ROMs */
ROM_REGION( 0x40000, REGION_CPU1, 0 )
/* Vector ROM */
ROM_LOAD( "mhavocpex7.6kl", 0x05000, 0x2000, CRC(ef7843f8) SHA1(bfd096b0db69188f9032578839c9bd91367f7aae) )

/* Program ROM */
ROM_LOAD( "mhavocpex7.1mn", 0x08000, 0x4000, CRC(f043dcaf) SHA1(3f20c20ea601190a52dac50d3281ed09a18a4948) )
ROM_LOAD( "mhavocpex7.1l", 0x0c000, 0x4000, CRC(da963eab) SHA1(b10872898b12d79cd6cf0651ec61962315b5aff9) )

/* Paged Program ROM - switched to 2000-3fff */
ROM_LOAD( "mhavocpex7.1q", 0x30000, 0x8000, CRC(57499813) SHA1(ff53f65fc34c5f4b8d4af78776fb242ac59d536a) )
ROM_LOAD( "mhavocpex7.1np", 0x38000, 0x8000, CRC(0d362096) SHA1(dccc0509aac7003fee11bf7eeabff81360c226a8) )

/* Paged Vector Generator ROM */
ROM_LOAD( "mhavocpex7.6h", 0x18000, 0x4000, CRC(4129d0e9) SHA1(6fd168de59d684f216a0a0ac45aed0782b18f900) )
ROM_LOAD( "mhavocpex7.6jk", 0x1c000, 0x4000, CRC(9361ed01) SHA1(ea07f8430f7e97e0c62d8df2963bb7b66a45b698) )
/* the last 0x1000 is used for the 2 RAM pages */


/* Gamma Processor ROM */
ROM_REGION( 0x10000, REGION_CPU2, 0 )
ROM_LOAD( "mhavocpex7.9s", 0x8000, 0x4000, CRC(9703c51f) SHA1(c010021e0dabc568af2eb1d516726ac21a1c9c98) )
ROM_RELOAD( 0x0c000, 0x4000 ) /* reset+interrupt vectors */

ROM_REGION( 0x40000, REGION_SOUND1, 0 )
ROM_LOAD( "mhavocpex7.x1", 0x000000, 0x040000, CRC(5cfa1865) SHA1(ab520b4af6a9ffc2593223798fee8026266a722e) )

ROM_END





/*************************************
*
Expand All @@ -790,3 +870,4 @@ GAME( 1983, mhavocrv, mhavoc, mhavoc, mhavoc, 0, ROT0, "hack", "Major Havoc
GAME( 1983, mhavocp, mhavoc, mhavoc, mhavocp, 0, ROT0, "Atari", "Major Havoc (prototype)", 0 )
GAME( 1983, alphaone, mhavoc, alphaone, alphaone, 0, ROT0, "Atari", "Alpha One (prototype, 3 lives)", 0 )
GAME( 1983, alphaona, mhavoc, alphaone, alphaone, 0, ROT0, "Atari", "Alpha One (prototype, 5 lives)", 0 )
GAME( 2021, mhavocpex7,mhavoc, mhavocpe, mhavoc, 0, ROT0, "JMA","Major Havoc-The Promised End (BETA 0.78)", 0 )
1 change: 1 addition & 0 deletions src/drivers/tempest.c
Expand Up @@ -227,6 +227,7 @@ static WRITE8_HANDLER( tempest_led_w )
set_led_status(0, ~data & 0x02);
set_led_status(1, ~data & 0x01);
/* FLIP is bit 0x04 */
set_led_status(2, data & 0x04);
}


Expand Down
1 change: 1 addition & 0 deletions src/includes/mhavoc.h
Expand Up @@ -30,6 +30,7 @@ READ8_HANDLER( mhavoc_gamma_r );

WRITE8_HANDLER( mhavoc_ram_banksel_w );
WRITE8_HANDLER( mhavoc_rom_banksel_w );
WRITE8_HANDLER( mhavocpe_rom_banksel_w );

READ8_HANDLER( mhavoc_port_0_r );
READ8_HANDLER( alphaone_port_0_r );
Expand Down

0 comments on commit 321fb1a

Please sign in to comment.