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

« back to all changes in this revision

Viewing changes to src/mame/video/momoko.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:
12
12
#include "includes/momoko.h"
13
13
 
14
14
 
15
 
WRITE8_HANDLER ( momoko_fg_scrollx_w )
16
 
{
17
 
        momoko_state *state = space->machine().driver_data<momoko_state>();
18
 
        state->m_fg_scrollx = data;
19
 
}
20
 
 
21
 
WRITE8_HANDLER ( momoko_fg_scrolly_w )
22
 
{
23
 
        momoko_state *state = space->machine().driver_data<momoko_state>();
24
 
        state->m_fg_scrolly = data;
25
 
}
26
 
 
27
 
WRITE8_HANDLER ( momoko_fg_select_w )
28
 
{
29
 
        momoko_state *state = space->machine().driver_data<momoko_state>();
30
 
        state->m_fg_select = data & 0x0f;
31
 
        state->m_fg_mask = data & 0x10;
32
 
}
33
 
 
34
 
WRITE8_HANDLER ( momoko_text_scrolly_w )
35
 
{
36
 
        momoko_state *state = space->machine().driver_data<momoko_state>();
37
 
        state->m_text_scrolly = data;
38
 
}
39
 
 
40
 
WRITE8_HANDLER ( momoko_text_mode_w )
41
 
{
42
 
        momoko_state *state = space->machine().driver_data<momoko_state>();
43
 
        state->m_text_mode = data;
44
 
}
45
 
 
46
 
WRITE8_HANDLER ( momoko_bg_scrollx_w )
47
 
{
48
 
        momoko_state *state = space->machine().driver_data<momoko_state>();
49
 
        state->m_bg_scrollx[offset] = data;
50
 
}
51
 
 
52
 
WRITE8_HANDLER ( momoko_bg_scrolly_w )
53
 
{
54
 
        momoko_state *state = space->machine().driver_data<momoko_state>();
55
 
        state->m_bg_scrolly[offset] = data;
56
 
}
57
 
 
58
 
WRITE8_HANDLER( momoko_bg_select_w )
59
 
{
60
 
        momoko_state *state = space->machine().driver_data<momoko_state>();
61
 
        state->m_bg_select = data & 0x0f;
62
 
        state->m_bg_mask = data & 0x10;
63
 
}
64
 
 
65
 
WRITE8_HANDLER( momoko_bg_priority_w )
66
 
{
67
 
        momoko_state *state = space->machine().driver_data<momoko_state>();
68
 
        state->m_bg_priority = data & 0x01;
69
 
}
70
 
 
71
 
WRITE8_HANDLER( momoko_flipscreen_w )
72
 
{
73
 
        momoko_state *state = space->machine().driver_data<momoko_state>();
74
 
        state->m_flipscreen = data & 0x01;
 
15
WRITE8_MEMBER(momoko_state::momoko_fg_scrollx_w)
 
16
{
 
17
        m_fg_scrollx = data;
 
18
}
 
19
 
 
20
WRITE8_MEMBER(momoko_state::momoko_fg_scrolly_w)
 
21
{
 
22
        m_fg_scrolly = data;
 
23
}
 
24
 
 
25
WRITE8_MEMBER(momoko_state::momoko_fg_select_w)
 
26
{
 
27
        m_fg_select = data & 0x0f;
 
28
        m_fg_mask = data & 0x10;
 
29
}
 
30
 
 
31
WRITE8_MEMBER(momoko_state::momoko_text_scrolly_w)
 
32
{
 
33
        m_text_scrolly = data;
 
34
}
 
35
 
 
36
WRITE8_MEMBER(momoko_state::momoko_text_mode_w)
 
37
{
 
38
        m_text_mode = data;
 
39
}
 
40
 
 
41
WRITE8_MEMBER(momoko_state::momoko_bg_scrollx_w)
 
42
{
 
43
        m_bg_scrollx[offset] = data;
 
44
}
 
45
 
 
46
WRITE8_MEMBER(momoko_state::momoko_bg_scrolly_w)
 
47
{
 
48
        m_bg_scrolly[offset] = data;
 
49
}
 
50
 
 
51
WRITE8_MEMBER(momoko_state::momoko_bg_select_w)
 
52
{
 
53
        m_bg_select = data & 0x0f;
 
54
        m_bg_mask = data & 0x10;
 
55
}
 
56
 
 
57
WRITE8_MEMBER(momoko_state::momoko_bg_priority_w)
 
58
{
 
59
        m_bg_priority = data & 0x01;
 
60
}
 
61
 
 
62
WRITE8_MEMBER(momoko_state::momoko_flipscreen_w)
 
63
{
 
64
        m_flipscreen = data & 0x01;
75
65
}
76
66
 
77
67
/****************************************************************************/
81
71
        int xx, sx, sy, px, py, dot;
82
72
        UINT32 gfxadr;
83
73
        UINT8 d0, d1;
84
 
        UINT8 *BG_GFX = machine.region("gfx2")->base();
 
74
        UINT8 *BG_GFX = machine.root_device().memregion("gfx2")->base();
85
75
 
86
76
        for (sy = 0; sy < 8; sy++)
87
77
        {
117
107
        int x, y, dx, dy, rx, ry, radr, chr, sy, fx, fy, px, py, offs, col, pri, flip ;
118
108
        UINT8 *spriteram = state->m_spriteram;
119
109
 
120
 
        UINT8 *BG_MAP     = screen.machine().region("user1")->base();
121
 
        UINT8 *BG_COL_MAP = screen.machine().region("user2")->base();
122
 
        UINT8 *FG_MAP     = screen.machine().region("user3")->base();
123
 
        UINT8 *TEXT_COLOR = screen.machine().region("proms")->base();
124
 
 
125
 
 
126
 
        flip = state->m_flipscreen ^ (input_port_read(screen.machine(), "FAKE") & 0x01);
 
110
        UINT8 *BG_MAP     = screen.machine().root_device().memregion("user1")->base();
 
111
        UINT8 *BG_COL_MAP = screen.machine().root_device().memregion("user2")->base();
 
112
        UINT8 *FG_MAP     = screen.machine().root_device().memregion("user3")->base();
 
113
        UINT8 *TEXT_COLOR = state->memregion("proms")->base();
 
114
 
 
115
 
 
116
        flip = state->m_flipscreen ^ (screen.machine().root_device().ioport("FAKE")->read() & 0x01);
127
117
 
128
118
        /* draw BG layer */
129
119
        dx = (7 - state->m_bg_scrollx[0]) & 7;
229
219
 
230
220
 
231
221
        /* draw sprites (others) */
232
 
        for (offs = 9 * 4; offs < state->m_spriteram_size; offs += 4)
 
222
        for (offs = 9 * 4; offs < state->m_spriteram.bytes(); offs += 4)
233
223
        {
234
224
                chr = spriteram[offs + 1] | ((spriteram[offs + 2] & 0x60) << 3);
235
225
                chr = ((chr & 0x380) << 1) | (chr & 0x7f);