Previous 199869 Revisions Next

r29504 Wednesday 9th April, 2014 at 19:03:17 UTC by hap
hmm, i can't get golgo13 gun aim working, something wrong with h8_adc?
[src/mame/drivers]namcos12.c

trunk/src/mame/drivers/namcos12.c
r29503r29504
14981498
14991499static ADDRESS_MAP_START( s12h8iomap, AS_IO, 16, namcos12_state )
15001500   AM_RANGE(h8_device::PORT_7, h8_device::PORT_7) AM_READ_PORT("DSW")
1501   AM_RANGE(h8_device::PORT_8, h8_device::PORT_8) AM_READ(s12_mcu_p8_r ) AM_WRITENOP
1502   AM_RANGE(h8_device::PORT_A, h8_device::PORT_A) AM_READWRITE(s12_mcu_pa_r, s12_mcu_pa_w )
1503   AM_RANGE(h8_device::PORT_B, h8_device::PORT_B) AM_READWRITE(s12_mcu_portB_r, s12_mcu_portB_w )
1501   AM_RANGE(h8_device::PORT_8, h8_device::PORT_8) AM_READ(s12_mcu_p8_r) AM_WRITENOP
1502   AM_RANGE(h8_device::PORT_A, h8_device::PORT_A) AM_READWRITE(s12_mcu_pa_r, s12_mcu_pa_w)
1503   AM_RANGE(h8_device::PORT_B, h8_device::PORT_B) AM_READWRITE(s12_mcu_portB_r, s12_mcu_portB_w)
15041504   AM_RANGE(h8_device::ADC_0, h8_device::ADC_0) AM_NOP
15051505   AM_RANGE(h8_device::ADC_1, h8_device::ADC_1) AM_NOP
15061506   AM_RANGE(h8_device::ADC_2, h8_device::ADC_2) AM_NOP
r29503r29504
15081508ADDRESS_MAP_END
15091509
15101510
1511/* Golgo 13 lightgun inputs
1512 *
1513 * Note: The H8/3002's ADC is 10 bits wide, but
1514 * it expects the 10-bit value to be left-justified
1515 * within the 16-bit word.
1516 */
1511// Golgo 13 lightgun inputs
15171512
15181513READ16_MEMBER(namcos12_state::s12_mcu_gun_h_r)
15191514{
1520   return ioport("LIGHT0_X")->read() << 2;
1515   return ioport("LIGHT0_X")->read();
15211516}
15221517
15231518READ16_MEMBER(namcos12_state::s12_mcu_gun_v_r)
15241519{
1525   return ioport("LIGHT0_Y")->read() << 2;
1520   return ioport("LIGHT0_Y")->read();
15261521}
15271522
15281523static ADDRESS_MAP_START( golgo13_h8iomap, AS_IO, 16, namcos12_state )
1529   AM_RANGE(h8_device::ADC_1, h8_device::ADC_1) AM_READ(s12_mcu_gun_h_r )
1530   AM_RANGE(h8_device::ADC_2, h8_device::ADC_2) AM_READ(s12_mcu_gun_v_r )
1524   AM_RANGE(h8_device::ADC_1, h8_device::ADC_1) AM_READ(s12_mcu_gun_h_r)
1525   AM_RANGE(h8_device::ADC_2, h8_device::ADC_2) AM_READ(s12_mcu_gun_v_r)
15311526
15321527   AM_IMPORT_FROM( s12h8iomap )
15331528ADDRESS_MAP_END

Previous 199869 Revisions Next


© 1997-2024 The MAME Team