Previous 199869 Revisions Next

r31254 Friday 11th July, 2014 at 09:00:22 UTC by Robbbert
babypac : Added nvram and joystick. Game is playable but no sound.
[src/mame/drivers]byvid.c

trunk/src/mame/drivers/byvid.c
r31253r31254
77    A blend of arcade video game, and pinball.
88
99ToDo (babypac):
10- You can play the video portion but try not to use the lower
11  escape chutes. If you do, alternate between pressing X and
12  right-shift until you are returned to the maze.
1013- No sound
11- No inputs
14- Playfield inputs
1215- Mechanical
1316- Artwork
14- Beeper needs to be replaced by a red LED when artwork gets done.
17- Beeper needs to be replaced by a red LED when artwork is done.
1518
1619ToDo (granny):
1720- All of the above, plus:
r31253r31254
1922- It has 2xTMS9928 but only 1 screen. The outputs need to be
2023  blended with transparency. The '9' test screen will have
2124  coloured stripes overlaid with the text names.
22- The RAM layout is incorrect.
2325- No schematic found.
2426- DIP names are different.
2527
r31253r31254
3234#include "video/tms9928a.h"
3335#include "machine/6821pia.h"
3436#include "sound/dac.h"
37#include "machine/nvram.h"
3538#include "sound/beep.h"
3639
3740class by133_state : public driver_device
r31253r31254
109112   AM_RANGE(0x0000, 0x007f) AM_RAM // 128x8 in MC6810 U7 MPU
110113   AM_RANGE(0x0088, 0x008b) AM_DEVREADWRITE("pia_u10", pia6821_device, read, write) // PIA U10 MPU
111114   AM_RANGE(0x0090, 0x0093) AM_DEVREADWRITE("pia_u11", pia6821_device, read, write) // PIA U11 MPU
112   AM_RANGE(0x0200, 0x03ff) AM_RAM // 256x4 in 5101L U8 MPU, battery backed (D4-7 are data, A4-8 are address)
115   AM_RANGE(0x0200, 0x03ff) AM_RAM AM_SHARE("nvram") // 256x4 in 5101L U8 MPU, battery backed (D4-7 are data, A4-8 are address)
113116   AM_RANGE(0x1000, 0x17ff) AM_ROM AM_REGION("roms", 0x0000)
114117   AM_RANGE(0x1800, 0x1fff) AM_ROM AM_REGION("roms", 0x1000)
115118   AM_RANGE(0x5000, 0x57ff) AM_ROM AM_REGION("roms", 0x0800)
r31253r31254
134137   AM_RANGE(0x0005, 0x0005) AM_DEVREADWRITE("crtc2", tms9928a_device, register_read, register_write)
135138   AM_RANGE(0x0006, 0x0007) AM_WRITE(granny_crtc_w) // can write to both at once
136139   AM_RANGE(0x0008, 0x000b) AM_DEVREADWRITE("pia_u7", pia6821_device, read, write)
137   AM_RANGE(0x0300, 0x3fff) AM_RAM
140   AM_RANGE(0x2000, 0x27ff) AM_RAM
141   AM_RANGE(0x2801, 0x2801) AM_READNOP // The '9' test reads this location constantly and throws away the result
138142   AM_RANGE(0x4000, 0xffff) AM_ROM
139143ADDRESS_MAP_END
140144
r31253r31254
144148
145149static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, by133_state )
146150   AM_RANGE(M6801_PORT1, M6801_PORT1) AM_DEVWRITE("dac", dac_device, write_unsigned8) // P10-P17
147   AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(m6803_port2_r, m6803_port2_w) // P20-P24
151   AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(m6803_port2_r, m6803_port2_w) // P20-P24 sound command in
148152ADDRESS_MAP_END
149153
150154
r31253r31254
160164      m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
161165}
162166
163// doesn't appear to do anything
164167INPUT_CHANGED_MEMBER( by133_state::activity_test )
165168{
166169   if(newval)
r31253r31254
178181   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Sound Test") PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, by133_state, sound_test, 0)
179182   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE3 ) PORT_NAME("Activity") PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, by133_state, activity_test, 0)
180183   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE4 ) PORT_NAME("Self Test") PORT_IMPULSE(1) PORT_CHANGED_MEMBER(DEVICE_SELF, by133_state, self_test, 0)
184   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_F2) PORT_NAME("Power")
181185
182186   PORT_START("DSW0")
183187   PORT_DIPNAME( 0x01, 0x00, "S01") // S1-5: 32 combinations of coins/credits of a coin slot. S9-13 other slot.
r31253r31254
280284   PORT_DIPSETTING(    0x80, "4")
281285   PORT_DIPSETTING(    0x40, "5")
282286
287   PORT_START("JOY")
288   PORT_BIT( 0x0f, IP_ACTIVE_HIGH, IPT_UNUSED )
289   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
290   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
291   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
292   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
293
283294   PORT_START("X0")
284   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right Flipper EOS")
295   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right Flipper EOS") PORT_CODE(KEYCODE_RSHIFT)
285296   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED )
286297   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START2 )
287298   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
288299   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Rebounds")
289   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1)
300   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_START1 )
290301   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Right Spinner")
291302   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Left Spinner")
292303
r31253r31254
316327   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("#3 Drop Target")
317328   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("#2 Drop Target")
318329   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("#1 Drop Target (L.)")
319   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Outhole")
330   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Outhole") PORT_CODE(KEYCODE_X)
320331   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("R. Maze Saucer")
321332   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("L. Maze Saucer")
322333INPUT_PORTS_END
r31253r31254
337348}
338349
339350READ8_MEMBER( by133_state::sound_data_r )
340{//printf("%X ",m_mpu_to_vid);
351{
341352   return m_mpu_to_vid;
342353}
343354
r31253r31254
348359
349360READ8_MEMBER( by133_state::m6803_port2_r )
350361{
351   //printf("%X %s\n",m_u7_b,machine().describe_context());
352362   //machine().scheduler().synchronize();
353363   return (m_u7_b << 1) | 0;
354364}
r31253r31254
380390   // red led
381391   m_beep->set_frequency(950);
382392   m_beep->set_state(state);
383   //address_space &space = m_audiocpu->space(AS_PROGRAM);
384   //m_audiocpu->m6801_io_r(space, 3, ((m_u7_b << 1) | (UINT8)state) );
385   m_audiocpu->set_input_line(M6801_TIN_LINE, state ? ASSERT_LINE : CLEAR_LINE);
386393}
387394
388395WRITE_LINE_MEMBER( by133_state::u10_cb2_w )
r31253r31254
408415
409416READ8_MEMBER( by133_state::u7_b_r )
410417{
418   if (BIT(m_u7_a, 7)) // bits 6 and 7 work; pinmame uses 7
419      m_u7_b |= ioport("JOY")->read();
420
421   if (BIT(m_u7_a, 6)) // Granny has a power button? according to Pinmame
422      m_u7_b = ioport("TEST")->read() & 0x80;
423
411424   return m_u7_b;
412425}
413426
r31253r31254
533546   MCFG_CPU_PROGRAM_MAP(sound_map)
534547   MCFG_CPU_IO_MAP(sound_portmap)
535548
549   MCFG_NVRAM_ADD_0FILL("nvram")
550
536551   MCFG_DEVICE_ADD("pia_u7", PIA6821, 0)
537552   MCFG_PIA_READPA_HANDLER(READ8(by133_state, u7_a_r))
538553   MCFG_PIA_WRITEPA_HANDLER(WRITE8(by133_state, u7_a_w))

Previous 199869 Revisions Next


© 1997-2024 The MAME Team