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

« back to all changes in this revision

Viewing changes to src/mame/video/tatsumi.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:
4
4
 
5
5
/******************************************************************************/
6
6
 
7
 
WRITE16_HANDLER(tatsumi_sprite_control_w)
 
7
WRITE16_MEMBER(tatsumi_state::tatsumi_sprite_control_w)
8
8
{
9
 
        tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
10
 
        COMBINE_DATA(&state->m_sprite_control_ram[offset]);
 
9
        COMBINE_DATA(&m_sprite_control_ram[offset]);
11
10
 
12
11
        /* 0xe0 is bank switch, others unknown */
13
12
//  if ((offset==0xe0 && data&0xefff) || offset!=0xe0)
14
 
//      logerror("%08x:  Tatsumi TZB215 sprite control %04x %08x\n", cpu_get_pc(&space->device()), offset, data);
 
13
//      logerror("%08x:  Tatsumi TZB215 sprite control %04x %08x\n", cpu_get_pc(&space.device()), offset, data);
15
14
}
16
15
 
17
16
/******************************************************************************/
18
17
 
19
 
WRITE16_HANDLER( apache3_road_z_w )
 
18
WRITE16_MEMBER(tatsumi_state::apache3_road_z_w)
20
19
{
21
 
        tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
22
 
        state->m_apache3_road_z = data & 0xff;
 
20
        m_apache3_road_z = data & 0xff;
23
21
}
24
22
 
25
 
WRITE8_HANDLER( apache3_road_x_w )
 
23
WRITE8_MEMBER(tatsumi_state::apache3_road_x_w)
26
24
{
27
 
        tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
28
25
        // Note: Double buffered. Yes, this is correct :)
29
 
        state->m_apache3_road_x_ram[data] = offset;
30
 
}
31
 
 
32
 
READ16_HANDLER( roundup5_vram_r )
33
 
{
34
 
        tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
35
 
        offset+=((state->m_control_word&0x0c00)>>10) * 0xc000;
36
 
        return state->m_roundup5_vram[offset];
37
 
}
38
 
 
39
 
WRITE16_HANDLER( roundup5_vram_w )
40
 
{
41
 
        tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
42
 
        offset+=((state->m_control_word&0x0c00)>>10) * 0xc000;
 
26
        m_apache3_road_x_ram[data] = offset;
 
27
}
 
28
 
 
29
READ16_MEMBER(tatsumi_state::roundup5_vram_r)
 
30
{
 
31
        offset+=((m_control_word&0x0c00)>>10) * 0xc000;
 
32
        return m_roundup5_vram[offset];
 
33
}
 
34
 
 
35
WRITE16_MEMBER(tatsumi_state::roundup5_vram_w)
 
36
{
 
37
        offset+=((m_control_word&0x0c00)>>10) * 0xc000;
43
38
 
44
39
//  if (offset>=0x30000)
45
 
//      logerror("effective write to vram %06x %02x (control %04x)\n",offset,data,state->m_control_word);
 
40
//      logerror("effective write to vram %06x %02x (control %04x)\n",offset,data,m_control_word);
46
41
 
47
 
        COMBINE_DATA(&state->m_roundup5_vram[offset]);
 
42
        COMBINE_DATA(&m_roundup5_vram[offset]);
48
43
 
49
44
        offset=offset%0xc000;
50
45
 
51
 
        gfx_element_mark_dirty(space->machine().gfx[1],offset/0x10);
 
46
        gfx_element_mark_dirty(machine().gfx[1],offset/0x10);
52
47
}
53
48
 
54
49
 
55
 
WRITE16_HANDLER( roundup5_palette_w )
 
50
WRITE16_MEMBER(tatsumi_state::roundup5_palette_w)
56
51
{
57
52
//  static int hack=0;
58
53
        int word;
59
54
 
60
 
        COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
 
55
        COMBINE_DATA(&m_generic_paletteram_16[offset]);
61
56
 
62
57
//  if (offset==0xbfe)
63
58
//      hack++;
79
74
//  logerror("PAL: %04x %02x\n",offset,data);
80
75
 
81
76
        offset&=~1;
82
 
        word = ((space->machine().generic.paletteram.u16[offset] & 0xff)<<8) | (space->machine().generic.paletteram.u16[offset+1] & 0xff);
83
 
        palette_set_color_rgb(space->machine(),offset/2,pal5bit(word >> 10),pal5bit(word >> 5),pal5bit(word >> 0));
 
77
        word = ((m_generic_paletteram_16[offset] & 0xff)<<8) | (m_generic_paletteram_16[offset+1] & 0xff);
 
78
        palette_set_color_rgb(machine(),offset/2,pal5bit(word >> 10),pal5bit(word >> 5),pal5bit(word >> 0));
84
79
}
85
80
 
86
81
 
87
 
WRITE16_HANDLER( apache3_palette_w )
 
82
WRITE16_MEMBER(tatsumi_state::apache3_palette_w)
88
83
{
89
84
//  static int hack=0;
90
85
 
91
 
        COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
 
86
        COMBINE_DATA(&m_generic_paletteram_16[offset]);
92
87
 
93
88
//  if (offset==0xbfe)
94
89
//      hack++;
109
104
 
110
105
//  logerror("PAL: %04x %02x\n",offset,data);
111
106
 
112
 
        data = space->machine().generic.paletteram.u16[offset];
113
 
        palette_set_color_rgb(space->machine(),offset,pal5bit(data >> 10),pal5bit(data >> 5),pal5bit(data >> 0));
 
107
        data = m_generic_paletteram_16[offset];
 
108
        palette_set_color_rgb(machine(),offset,pal5bit(data >> 10),pal5bit(data >> 5),pal5bit(data >> 0));
114
109
}
115
110
 
116
111
 
117
 
WRITE16_HANDLER( roundup5_text_w )
 
112
WRITE16_MEMBER(tatsumi_state::roundup5_text_w)
118
113
{
119
 
        tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
120
 
        UINT16 *videoram = state->m_videoram;
 
114
        UINT16 *videoram = m_videoram;
121
115
        COMBINE_DATA(&videoram[offset]);
122
 
        state->m_tx_layer->mark_tile_dirty(offset);
123
 
}
124
 
 
125
 
READ16_HANDLER( cyclwarr_videoram0_r )
126
 
{
127
 
        tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
128
 
         return state->m_cyclwarr_videoram0[offset];
129
 
}
130
 
 
131
 
READ16_HANDLER( cyclwarr_videoram1_r )
132
 
{
133
 
        tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
134
 
         return state->m_cyclwarr_videoram1[offset];
135
 
}
136
 
 
137
 
WRITE16_HANDLER( cyclwarr_videoram0_w )
138
 
{
139
 
        tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
140
 
        COMBINE_DATA(&state->m_cyclwarr_videoram0[offset]);
141
 
        if (offset>=0x400)
142
 
        {
143
 
                state->m_layer0->mark_tile_dirty(offset-0x400);
144
 
                state->m_layer1->mark_tile_dirty(offset-0x400);
145
 
        }
146
 
}
147
 
 
148
 
WRITE16_HANDLER( cyclwarr_videoram1_w )
149
 
{
150
 
        tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
151
 
        COMBINE_DATA(&state->m_cyclwarr_videoram1[offset]);
152
 
        if (offset>=0x400)
153
 
        {
154
 
                state->m_layer2->mark_tile_dirty(offset-0x400);
155
 
                state->m_layer3->mark_tile_dirty(offset-0x400);
156
 
        }
157
 
}
158
 
 
159
 
WRITE16_HANDLER( roundup5_crt_w )
160
 
{
161
 
        tatsumi_state *state = space->machine().driver_data<tatsumi_state>();
 
116
        m_tx_layer->mark_tile_dirty(offset);
 
117
}
 
118
 
 
119
READ16_MEMBER(tatsumi_state::cyclwarr_videoram0_r)
 
120
{
 
121
         return m_cyclwarr_videoram0[offset];
 
122
}
 
123
 
 
124
READ16_MEMBER(tatsumi_state::cyclwarr_videoram1_r)
 
125
{
 
126
         return m_cyclwarr_videoram1[offset];
 
127
}
 
128
 
 
129
WRITE16_MEMBER(tatsumi_state::cyclwarr_videoram0_w)
 
130
{
 
131
        COMBINE_DATA(&m_cyclwarr_videoram0[offset]);
 
132
        if (offset>=0x400)
 
133
        {
 
134
                m_layer0->mark_tile_dirty(offset-0x400);
 
135
                m_layer1->mark_tile_dirty(offset-0x400);
 
136
        }
 
137
}
 
138
 
 
139
WRITE16_MEMBER(tatsumi_state::cyclwarr_videoram1_w)
 
140
{
 
141
        COMBINE_DATA(&m_cyclwarr_videoram1[offset]);
 
142
        if (offset>=0x400)
 
143
        {
 
144
                m_layer2->mark_tile_dirty(offset-0x400);
 
145
                m_layer3->mark_tile_dirty(offset-0x400);
 
146
        }
 
147
}
 
148
 
 
149
WRITE16_MEMBER(tatsumi_state::roundup5_crt_w)
 
150
{
162
151
        if (offset==0 && ACCESSING_BITS_0_7)
163
 
                state->m_roundupt_crt_selected_reg=data&0x3f;
 
152
                m_roundupt_crt_selected_reg=data&0x3f;
164
153
        if (offset==1 && ACCESSING_BITS_0_7) {
165
 
                state->m_roundupt_crt_reg[state->m_roundupt_crt_selected_reg]=data;
166
 
//      if (state->m_roundupt_crt_selected_reg!=0xa && state->m_roundupt_crt_selected_reg!=0xb && state->m_roundupt_crt_selected_reg!=29)
167
 
//      logerror("%08x:  Crt write %02x %02x\n",cpu_get_pc(&space->device()),state->m_roundupt_crt_selected_reg,data);
 
154
                m_roundupt_crt_reg[m_roundupt_crt_selected_reg]=data;
 
155
//      if (m_roundupt_crt_selected_reg!=0xa && m_roundupt_crt_selected_reg!=0xb && m_roundupt_crt_selected_reg!=29)
 
156
//      logerror("%08x:  Crt write %02x %02x\n",cpu_get_pc(&space.device()),m_roundupt_crt_selected_reg,data);
168
157
        }
169
158
}
170
159
 
984
973
        Each tile (0x4000 of them) has a lookup table in ROM to build an individual 3-bit palette
985
974
        from sets of 8 bit palettes!
986
975
    */
987
 
        const UINT8* tile_cluts = machine.region("gfx4")->base();
 
976
        const UINT8* tile_cluts = machine.root_device().memregion("gfx4")->base();
988
977
        const bitmap_ind16 &src_bitmap = src->pixmap();
989
978
        int src_y_mask=ysize-1;
990
979
        int src_x_mask=xsize-1;
1019
1008
{
1020
1009
        tatsumi_state *state = machine.driver_data<tatsumi_state>();
1021
1010
        int x, y;
1022
 
        const UINT8 *lut = machine.region("proms")->base();
 
1011
        const UINT8 *lut = state->memregion("proms")->base();
1023
1012
 
1024
1013
        UINT16 gva = 0x180; // TODO
1025
1014
        UINT8 sky_val = state->m_apache3_rotate_ctrl[1] & 0xff;