~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to src/mame/drivers/quasar.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Emmanuel Kasper, Jordi Mallach
  • Date: 2012-06-05 20:02:23 UTC
  • mfrom: (0.3.1) (0.1.4)
  • Revision ID: package-import@ubuntu.com-20120605200223-gnlpogjrg6oqe9md
Tags: 0.146-1
[ Emmanuel Kasper ]
* New upstream release
* Drop patch to fix man pages section and patches to link with flac 
  and jpeg system lib: all this has been pushed upstream by Cesare Falco
* Add DM-Upload-Allowed: yes field.

[ Jordi Mallach ]
* Create a "gnu" TARGETOS stanza that defines NO_AFFINITY_NP.
* Stop setting TARGETOS to "unix" in d/rules. It should be autodetected,
  and set to the appropriate value.
* mame_manpage_section.patch: Change mame's manpage section to 6 (games),
  in the TH declaration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#include "cpu/mcs48/mcs48.h"
33
33
#include "sound/dac.h"
34
34
#include "video/s2636.h"
35
 
#include "includes/cvs.h"
 
35
#include "includes/quasar.h"
36
36
 
37
37
/************************************************************************
38
38
 
44
44
 
45
45
************************************************************************/
46
46
 
47
 
static WRITE8_HANDLER( video_page_select_w )
48
 
{
49
 
        quasar_state *state = space->machine().driver_data<quasar_state>();
50
 
        state->m_page = offset & 0x03;
51
 
}
52
 
 
53
 
static WRITE8_HANDLER( io_page_select_w )
54
 
{
55
 
        quasar_state *state = space->machine().driver_data<quasar_state>();
56
 
        state->m_io_page = offset & 0x03;
57
 
}
58
 
 
59
 
static WRITE8_HANDLER( quasar_video_w )
60
 
{
61
 
        quasar_state *state = space->machine().driver_data<quasar_state>();
62
 
 
63
 
        switch (state->m_page)
 
47
WRITE8_MEMBER(quasar_state::video_page_select_w)
 
48
{
 
49
        m_page = offset & 0x03;
 
50
}
 
51
 
 
52
WRITE8_MEMBER(quasar_state::io_page_select_w)
 
53
{
 
54
        m_io_page = offset & 0x03;
 
55
}
 
56
 
 
57
WRITE8_MEMBER(quasar_state::quasar_video_w)
 
58
{
 
59
 
 
60
        switch (m_page)
64
61
        {
65
 
        case 0:  state->m_video_ram[offset] = data; break;
66
 
        case 1:  state->m_color_ram[offset] = data & 7; break;  // 3 bits of ram only - 3 x 2102
67
 
        case 2:  state->m_effectram[offset] = data; break;
68
 
        case 3:  state->m_effectcontrol = data; break;
 
62
        case 0:  m_video_ram[offset] = data; break;
 
63
        case 1:  m_color_ram[offset] = data & 7; break; // 3 bits of ram only - 3 x 2102
 
64
        case 2:  m_effectram[offset] = data; break;
 
65
        case 3:  m_effectcontrol = data; break;
69
66
        }
70
67
}
71
68
 
72
 
static READ8_HANDLER( quasar_IO_r )
 
69
READ8_MEMBER(quasar_state::quasar_IO_r)
73
70
{
74
 
        quasar_state *state = space->machine().driver_data<quasar_state>();
75
71
        UINT8 ans = 0;
76
72
 
77
 
        switch (state->m_io_page)
 
73
        switch (m_io_page)
78
74
        {
79
 
        case 0:  ans = input_port_read(space->machine(), "IN0"); break;
80
 
        case 1:  ans = input_port_read(space->machine(), "IN1"); break;
81
 
        case 2:  ans = input_port_read(space->machine(), "DSW0"); break;
82
 
        case 3:  ans = input_port_read(space->machine(), "DSW1"); break;
 
75
        case 0:  ans = ioport("IN0")->read(); break;
 
76
        case 1:  ans = ioport("IN1")->read(); break;
 
77
        case 2:  ans = ioport("DSW0")->read(); break;
 
78
        case 3:  ans = ioport("DSW1")->read(); break;
83
79
        }
84
80
 
85
81
        return ans;
86
82
}
87
83
 
88
 
static WRITE8_HANDLER( quasar_bullet_w )
 
84
WRITE8_MEMBER(quasar_state::quasar_bullet_w)
89
85
{
90
 
        quasar_state *state = space->machine().driver_data<quasar_state>();
91
 
        state->m_bullet_ram[offset] = (data ^ 0xff);
 
86
        m_bullet_ram[offset] = (data ^ 0xff);
92
87
}
93
88
 
94
 
static WRITE8_HANDLER( quasar_sh_command_w )
 
89
WRITE8_MEMBER(quasar_state::quasar_sh_command_w)
95
90
{
96
91
        // bit 4 = Sound Invader : Linked to an NE555V circuit
97
92
        // Not handled yet
99
94
        // lower nibble = command to I8035
100
95
        // not necessarily like this, but it seems to work better than direct mapping
101
96
        // (although schematics has it as direct - but then the schematics are wrong elsewhere to!)
102
 
        soundlatch_w(space, 0, (data & 8) + ((data >> 1) & 3) + ((data << 2) & 4));
103
 
}
104
 
 
105
 
static READ8_HANDLER( quasar_sh_command_r )
106
 
{
107
 
        return soundlatch_r(space, 0) + (input_port_read(space->machine(), "DSW2") & 0x30);
108
 
}
109
 
 
110
 
static READ8_HANDLER( audio_t1_r )
111
 
{
112
 
        return (soundlatch_r(space, 0) == 0);
 
97
        soundlatch_byte_w(space, 0, (data & 8) + ((data >> 1) & 3) + ((data << 2) & 4));
 
98
}
 
99
 
 
100
READ8_MEMBER(quasar_state::quasar_sh_command_r)
 
101
{
 
102
        return soundlatch_byte_r(space, 0) + (ioport("DSW2")->read() & 0x30);
 
103
}
 
104
 
 
105
READ8_MEMBER(quasar_state::audio_t1_r)
 
106
{
 
107
        return (soundlatch_byte_r(space, 0) == 0);
113
108
}
114
109
 
115
110
// memory map taken from the manual
116
111
 
117
 
static ADDRESS_MAP_START( quasar, AS_PROGRAM, 8 )
 
112
static ADDRESS_MAP_START( quasar, AS_PROGRAM, 8, quasar_state )
118
113
        AM_RANGE(0x0000, 0x13ff) AM_ROM
119
 
        AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_bullet_ram_or_palette_r, quasar_bullet_w) AM_BASE_MEMBER(quasar_state, m_bullet_ram)
 
114
        AM_RANGE(0x1400, 0x14ff) AM_MIRROR(0x6000) AM_READ(cvs_bullet_ram_or_palette_r) AM_WRITE(quasar_bullet_w) AM_SHARE("bullet_ram")
120
115
        AM_RANGE(0x1500, 0x15ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_0_or_character_ram_r, cvs_s2636_0_or_character_ram_w)
121
116
        AM_RANGE(0x1600, 0x16ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_1_or_character_ram_r, cvs_s2636_1_or_character_ram_w)
122
117
        AM_RANGE(0x1700, 0x17ff) AM_MIRROR(0x6000) AM_READWRITE(cvs_s2636_2_or_character_ram_r, cvs_s2636_2_or_character_ram_w)
123
 
        AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READWRITE(cvs_video_or_color_ram_r, quasar_video_w) AM_BASE_MEMBER(quasar_state, m_video_ram)
 
118
        AM_RANGE(0x1800, 0x1bff) AM_MIRROR(0x6000) AM_READ(cvs_video_or_color_ram_r) AM_WRITE(quasar_video_w) AM_SHARE("video_ram")
124
119
        AM_RANGE(0x1c00, 0x1fff) AM_MIRROR(0x6000) AM_RAM
125
120
        AM_RANGE(0x2000, 0x33ff) AM_ROM
126
121
        AM_RANGE(0x4000, 0x53ff) AM_ROM
127
122
        AM_RANGE(0x6000, 0x73ff) AM_ROM
128
123
ADDRESS_MAP_END
129
124
 
130
 
static ADDRESS_MAP_START( quasar_io, AS_IO, 8 )
 
125
static ADDRESS_MAP_START( quasar_io, AS_IO, 8, quasar_state )
131
126
        AM_RANGE(0x00, 0x03) AM_READWRITE(quasar_IO_r, video_page_select_w)
132
127
        AM_RANGE(0x08, 0x0b) AM_WRITE(io_page_select_w)
133
 
        AM_RANGE(S2650_DATA_PORT,  S2650_DATA_PORT) AM_READWRITE(cvs_collision_clear, quasar_sh_command_w)
 
128
        AM_RANGE(S2650_DATA_PORT,  S2650_DATA_PORT) AM_READ(cvs_collision_clear) AM_WRITE(quasar_sh_command_w)
134
129
        AM_RANGE(S2650_CTRL_PORT,  S2650_CTRL_PORT) AM_READ(cvs_collision_r) AM_WRITENOP
135
130
        AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ_PORT("SENSE")
136
 
        AM_RANGE(S2650_FO_PORT, S2650_FO_PORT) AM_RAM AM_BASE_MEMBER(quasar_state, m_fo_state)
 
131
        AM_RANGE(S2650_FO_PORT, S2650_FO_PORT) AM_RAM AM_SHARE("fo_state")
137
132
ADDRESS_MAP_END
138
133
 
139
134
/*************************************
142
137
 *
143
138
 *************************************/
144
139
 
145
 
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8 )
 
140
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, quasar_state )
146
141
        AM_RANGE(0x0000, 0x07ff) AM_ROM
147
142
ADDRESS_MAP_END
148
143
 
149
 
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8 )
 
144
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, quasar_state )
150
145
        AM_RANGE(0x00, 0x7f) AM_RAM
151
146
        AM_RANGE(0x80, 0x80) AM_READ(quasar_sh_command_r)
152
147
        AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(audio_t1_r)
153
 
        AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE("dac", dac_signed_w)
 
148
        AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_DEVWRITE_LEGACY("dac", dac_signed_w)
154
149
ADDRESS_MAP_END
155
150
 
156
151
/************************************************************************
225
220
        PORT_DIPSETTING(    0x00, "Wrap Around" )
226
221
 
227
222
        PORT_START("SENSE")
228
 
        PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
 
223
        PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
229
224
 
230
225
        PORT_START("DSW2")
231
226
#if 0
432
427
ROM_END
433
428
 
434
429
 
435
 
GAME( 1980, quasar,        0, quasar,   quasar,   0, ROT90, "Zelco / Zaccaria", "Quasar",             GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
436
 
GAME( 1980, quasara,  quasar, quasar,   quasar,   0, ROT90, "Zelco / Zaccaria", "Quasar (Alternate)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
 
430
GAME( 1980, quasar,   0,      quasar,   quasar,   0, ROT90, "Zaccaria / Zelco", "Quasar (set 1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
 
431
GAME( 1980, quasara,  quasar, quasar,   quasar,   0, ROT90, "Zaccaria / Zelco", "Quasar (set 2)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )