summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/unichamp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/unichamp.c')
-rw-r--r--src/mame/drivers/unichamp.c98
1 files changed, 49 insertions, 49 deletions
diff --git a/src/mame/drivers/unichamp.c b/src/mame/drivers/unichamp.c
index 99f711c2766..4507bcc4677 100644
--- a/src/mame/drivers/unichamp.c
+++ b/src/mame/drivers/unichamp.c
@@ -5,13 +5,13 @@
*
* Driver from plgDavid (David Viens)
*
- * Thanks to Sylvain De Chantal (Sly D.C.) for the 2 test units,
+ * Thanks to Sylvain De Chantal (Sly D.C.) for the 2 test units,
* carts and FAQ: http://www.ccjvq.com/slydc/index/faq/2711
*
* Thanks to Paul Robson for the GIC font rom.
* (http://worstconsole.blogspot.ca/2012/12/the-worstconsoleever.html)
* Note a spare dead GIC has been given to Lord Nightmare and should be sent for decap!
- *
+ *
* The Unisonc Champion is the only known GI "Gimini Mid-Range 8950 Programmable Game Set"
* to ever reach the market, and only in limited quantities (aprox 500 units ever built)
*
@@ -21,18 +21,18 @@
* EXEC ROM : 9501-01009 (40 pin) at 0x0800 (factory mapped)
*
* The GIC generates the CPU Clock, the video signals and the audio.
- * The CPU does NOT access the GIC directly.
- * One way CPU->GIC 'communication' takes place through 256 bytes of shared RAM
+ * The CPU does NOT access the GIC directly.
+ * One way CPU->GIC 'communication' takes place through 256 bytes of shared RAM
* (using two 4x256 TMS4043NL-2 (2112-1) Static Rams at U3 and U4)
*
- * In this design the GIC only allows the CPU to use the BUS (and shared RAM)
+ * In this design the GIC only allows the CPU to use the BUS (and shared RAM)
* a fraction of the frame time. (4.33ms for each 16.69ms, or 26% of the time)
* (the real ratio of clocks is 7752/29868 )
*
* Boot: When the GIC let go of !RESET_OUT the EXEC Rom pushes 0x800 onto
* the bus for the CPU to fetch and place in R7 to start execution.
- * This first CPU slice only last 3ms, then the GIC sets the CPU's BUSRQ low,
- * stalling it for 12.36ms, then sets it high for 4.33ms etc...
+ * This first CPU slice only last 3ms, then the GIC sets the CPU's BUSRQ low,
+ * stalling it for 12.36ms, then sets it high for 4.33ms etc...
* 59.95 times a second - NTSC
************************************************************************/
@@ -62,7 +62,7 @@ public:
virtual void machine_start();
virtual void machine_reset();
DECLARE_PALETTE_INIT(unichamp);
-
+
DECLARE_READ8_MEMBER(bext_r);
DECLARE_READ16_MEMBER(unichamp_gicram_r);
@@ -70,7 +70,7 @@ public:
DECLARE_READ16_MEMBER(unichamp_trapl_r);
DECLARE_WRITE16_MEMBER(unichamp_trapl_w);
-
+
UINT32 screen_update_unichamp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
protected:
@@ -86,20 +86,20 @@ PALETTE_INIT_MEMBER(unichamp_state, unichamp)
palette.set_pen_color(GIC_GREEN, rgb_t(0x62, 0x95, 0x88));//(from box shot)
palette.set_pen_color(GIC_WHITE, rgb_t(0xFF, 0xFF, 0xFF));
*/
-
+
//using from intv.c instead as suggested by RB
palette.set_pen_color(GIC_BLACK, rgb_t(0x00, 0x00, 0x00));
palette.set_pen_color(GIC_RED, rgb_t(0xFF, 0x3D, 0x10));
- //palette.set_pen_color(GIC_GREEN, rgb_t(0x38, 0x6B, 0x3F)); //intv's DARK GREEN
- palette.set_pen_color(GIC_GREEN, rgb_t(0x00, 0xA7, 0x56)); //intv's GREEN
- palette.set_pen_color(GIC_WHITE, rgb_t(0xFF, 0xFC, 0xFF));
+ //palette.set_pen_color(GIC_GREEN, rgb_t(0x38, 0x6B, 0x3F)); //intv's DARK GREEN
+ palette.set_pen_color(GIC_GREEN, rgb_t(0x00, 0xA7, 0x56)); //intv's GREEN
+ palette.set_pen_color(GIC_WHITE, rgb_t(0xFF, 0xFC, 0xFF));
}
static ADDRESS_MAP_START( unichamp_mem, AS_PROGRAM, 16, unichamp_state )
ADDRESS_MAP_GLOBAL_MASK(0x1FFF) //B13/B14/B15 are grounded!
AM_RANGE(0x0000, 0x00FF) AM_READWRITE(unichamp_gicram_r, unichamp_gicram_w)
- AM_RANGE(0x0100, 0x07FF) AM_READWRITE(unichamp_trapl_r, unichamp_trapl_w)
+ AM_RANGE(0x0100, 0x07FF) AM_READWRITE(unichamp_trapl_r, unichamp_trapl_w)
AM_RANGE(0x0800, 0x17FF) AM_ROM AM_REGION("maincpu", 0x0800 << 1) // Carts and EXE ROM, 10-bits wide
ADDRESS_MAP_END
@@ -112,8 +112,8 @@ static INPUT_PORTS_START( unichamp )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S')// P2 NO (EBCA3)
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_UNUSED
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_UNUSED
- PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_UNUSED
- PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_UNUSED
+ PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_UNUSED
+ PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_UNUSED
INPUT_PORTS_END
@@ -129,7 +129,7 @@ READ8_MEMBER(unichamp_state::bext_r)
//and reads the ECBI input pin for HIGH or LOW signal to know whether or not to branch
//The unisonic control system couldnt be simpler in desing.
- //Each of the two player controllers has three buttons:
+ //Each of the two player controllers has three buttons:
//one tying !RESET(GIC pin 21) to ground when closed - resetting the WHOLE system.
//a YES button (connecting EBCA0 to EBCI for Player1 and EBC2 to EBCI for Player2)
//a NO button (connecting EBCA1 to EBCI for Player1 and EBC3 to EBCI for Player2)
@@ -138,7 +138,7 @@ READ8_MEMBER(unichamp_state::bext_r)
//EG: Any player can choose if one or two players are going to play the game for instance
UINT8 port = ioport("CTRLS")->read() & 0x0F; ////only lower nibble
-
+
//We need to return logical high or low on the EBCI pin
return (port & offset)>0?1:0;
}
@@ -152,8 +152,8 @@ DRIVER_INIT_MEMBER(unichamp_state,unichamp)
void unichamp_state::machine_start()
{
m_gic->set_shared_memory(m_ram);
-
- if (m_cart->exists()){
+
+ if (m_cart->exists()){
//flip endians in more "this surely exists in MAME" way?
//NOTE The unichamp roms have the same endianness as intv on disk and in memory
UINT8*ptr = m_cart->get_rom_base();
@@ -163,9 +163,9 @@ void unichamp_state::machine_start()
ptr[i] = ptr[i+1];
ptr[i+1] = TEMP;
}
-
- m_maincpu->space(AS_PROGRAM).install_read_handler(0x1000, 0x1800,
- read16_delegate(FUNC(generic_slot_device::read16_rom),(generic_slot_device*)m_cart));
+
+ m_maincpu->space(AS_PROGRAM).install_read_handler(0x1000, 0x1800,
+ read16_delegate(FUNC(generic_slot_device::read16_rom),(generic_slot_device*)m_cart));
}
}
@@ -174,14 +174,14 @@ void unichamp_state::machine_reset()
{
/*
the intv driver did not explain this but from the CP1600 manual:
- When MSYNC* goes inactive (high), the bus control signals issue lAB,
- and the CPU inputs from the bus into the PC the starting address of the main program.
+ When MSYNC* goes inactive (high), the bus control signals issue lAB,
+ and the CPU inputs from the bus into the PC the starting address of the main program.
Note that the initialization address can be defined by the user at any desired bus address or
- can be the default address resulting from the logical state of the non-driven bus
+ can be the default address resulting from the logical state of the non-driven bus
*/
-
+
//The Unisonic EXEC ROM chip (9501-01009) is self mapped at 0x0800
- //The cart ROMS are self mapped to 0x1000
+ //The cart ROMS are self mapped to 0x1000
//upon boot the EXEC ROM puts 0x0800 on the bus for the CPU to use as first INT vector
m_maincpu->set_input_line_vector(CP1610_RESET, 0x0800);
@@ -221,54 +221,54 @@ WRITE16_MEMBER( unichamp_state::unichamp_trapl_w )
static MACHINE_CONFIG_START( unichamp, unichamp_state )
/* basic machine hardware */
-
+
//The CPU is really clocked this way:
- //MCFG_CPU_ADD("maincpu", CP1610, XTAL_3_579545MHz/4)
+ //MCFG_CPU_ADD("maincpu", CP1610, XTAL_3_579545MHz/4)
//But since it is only running 7752/29868 th's of the time...
//TODO find a more accurate method? (the emulation will me the same though)
- MCFG_CPU_ADD("maincpu", CP1610, (int)((7752.0/29868.0)*XTAL_3_579545MHz/4))
-
+ MCFG_CPU_ADD("maincpu", CP1610, (int)((7752.0/29868.0)*XTAL_3_579545MHz/4))
+
MCFG_CPU_PROGRAM_MAP(unichamp_mem)
MCFG_QUANTUM_TIME(attotime::from_hz(60))
- MCFG_CP1610_BEXT_CALLBACK(READ8(unichamp_state, bext_r))
-
+ MCFG_CP1610_BEXT_CALLBACK(READ8(unichamp_state, bext_r))
+
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_RAW_PARAMS( XTAL_3_579545MHz,
- gic_device::LINE_CLOCKS,
- gic_device::START_ACTIVE_SCAN,
- gic_device::END_ACTIVE_SCAN,
- gic_device::LINES,
- gic_device::START_Y,
+ MCFG_SCREEN_RAW_PARAMS( XTAL_3_579545MHz,
+ gic_device::LINE_CLOCKS,
+ gic_device::START_ACTIVE_SCAN,
+ gic_device::END_ACTIVE_SCAN,
+ gic_device::LINES,
+ gic_device::START_Y,
gic_device::START_Y + gic_device::SCREEN_HEIGHT )
-
+
MCFG_SCREEN_UPDATE_DRIVER(unichamp_state, screen_update_unichamp)
MCFG_SCREEN_PALETTE("palette")
-
+
MCFG_PALETTE_ADD("palette", 4)
MCFG_PALETTE_INIT_OWNER(unichamp_state, unichamp)
-
+
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_GIC_ADD( "gic", XTAL_3_579545MHz, "screen" )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
-
+
/* cartridge */
MCFG_GENERIC_CARTSLOT_ADD("cartslot", generic_linear_slot, "unichamp_cart")
MCFG_GENERIC_EXTENSIONS("bin,rom")
MCFG_SOFTWARE_LIST_ADD("cart_list", "unichamp")
-
+
MACHINE_CONFIG_END
-ROM_START(unichamp)
+ROM_START(unichamp)
ROM_REGION(0x10000<<1,"maincpu", ROMREGION_ERASEFF)
-
+
ROM_LOAD16_WORD( "9501-01009.u2", 0x0800<<1, 0x1000, CRC(49a0bd8f) SHA1(f4d126d3462ad351da4b75d76c75942d5a6f27ef))
//these below are for local tests. you can use them in softlist or -cart
- //ROM_LOAD16_WORD( "pac-02.bin", 0x1000<<1, 0x1000, CRC(fe3213be) SHA1(5b9c407fe86865f3454d4be824a7f2bf53478f73))
- //ROM_LOAD16_WORD( "pac-03.bin", 0x1000<<1, 0x1000, CRC(f81f04bd) SHA1(82e2a0fda1787d5835c457ee5745b0db0cebe079))
+ //ROM_LOAD16_WORD( "pac-02.bin", 0x1000<<1, 0x1000, CRC(fe3213be) SHA1(5b9c407fe86865f3454d4be824a7f2bf53478f73))
+ //ROM_LOAD16_WORD( "pac-03.bin", 0x1000<<1, 0x1000, CRC(f81f04bd) SHA1(82e2a0fda1787d5835c457ee5745b0db0cebe079))
//ROM_LOAD16_WORD( "pac-04.bin", 0x1000<<1, 0x1000, CRC(cac09841) SHA1(bc9db83f26ed0810938156db6b104b4576754225))
//ROM_LOAD16_WORD( "pac-05.bin", 0x1000<<1, 0x1000, CRC(d54a6090) SHA1(e85593096f43dcf14b08fd2c9fda277008a8df8b))
ROM_END