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

« back to all changes in this revision

Viewing changes to src/mame/drivers/ttchamp.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:
49
49
{
50
50
public:
51
51
        ttchamp_state(const machine_config &mconfig, device_type type, const char *tag)
52
 
                : driver_device(mconfig, type, tag) { }
 
52
                : driver_device(mconfig, type, tag) ,
 
53
                m_peno_vram(*this, "peno_vram"){ }
53
54
 
54
 
        UINT16 *m_peno_vram;
 
55
        required_shared_ptr<UINT16> m_peno_vram;
55
56
        UINT16 m_paloff;
 
57
        DECLARE_WRITE16_MEMBER(paloff_w);
 
58
        DECLARE_WRITE16_MEMBER(pcup_prgbank_w);
 
59
        DECLARE_WRITE16_MEMBER(paldat_w);
 
60
        DECLARE_READ16_MEMBER(peno_rand);
 
61
        DECLARE_READ16_MEMBER(peno_rand2);
56
62
};
57
63
 
58
64
 
81
87
//  }
82
88
 
83
89
        count=0;
 
90
        UINT8 *videoram = reinterpret_cast<UINT8 *>(state->m_peno_vram.target());
84
91
        for (y=0;y<yyy;y++)
85
92
        {
86
93
                for(x=0;x<xxx;x++)
87
94
                {
88
 
                        /*if(hotblock_port0&0x40)*/bitmap.pix16(y, x) = ((UINT8 *)state->m_peno_vram)[BYTE_XOR_LE(count)]+0x300;
 
95
                        /*if(hotblock_port0&0x40)*/bitmap.pix16(y, x) = videoram[BYTE_XOR_LE(count)]+0x300;
89
96
            count++;
90
97
        }
91
98
    }
93
100
}
94
101
 
95
102
 
96
 
static WRITE16_HANDLER( paloff_w )
 
103
WRITE16_MEMBER(ttchamp_state::paloff_w)
97
104
{
98
 
        ttchamp_state *state = space->machine().driver_data<ttchamp_state>();
99
 
    COMBINE_DATA(&state->m_paloff);
 
105
    COMBINE_DATA(&m_paloff);
100
106
}
101
107
 
102
108
#ifdef UNUSED_FUNCTION
103
 
static WRITE16_HANDLER( pcup_prgbank_w )
 
109
WRITE16_MEMBER(ttchamp_state::pcup_prgbank_w)
104
110
{
105
111
    int bank;
106
 
    UINT8 *ROM1 = space->machine().region("user1")->base();
 
112
    UINT8 *ROM1 = memregion("user1")->base();
107
113
 
108
114
    if (ACCESSING_BITS_0_7)
109
115
    {
110
116
        bank = (data>>4) &0x07;
111
 
        memory_set_bankptr(space->machine(), "bank2",&ROM1[0x80000*(bank)]);
 
117
        membank("bank2")->set_base(&ROM1[0x80000*(bank)]);
112
118
    }
113
119
}
114
120
#endif
115
121
 
116
 
static WRITE16_HANDLER( paldat_w )
 
122
WRITE16_MEMBER(ttchamp_state::paldat_w)
117
123
{
118
 
        ttchamp_state *state = space->machine().driver_data<ttchamp_state>();
119
 
    palette_set_color_rgb(space->machine(),state->m_paloff & 0x7fff,pal5bit(data>>0),pal5bit(data>>5),pal5bit(data>>10));
 
124
    palette_set_color_rgb(machine(),m_paloff & 0x7fff,pal5bit(data>>0),pal5bit(data>>5),pal5bit(data>>10));
120
125
}
121
126
 
122
 
static READ16_HANDLER( peno_rand )
 
127
READ16_MEMBER(ttchamp_state::peno_rand)
123
128
{
124
 
    return 0xffff;// space->machine().rand();
 
129
    return 0xffff;// machine().rand();
125
130
}
126
131
 
127
132
#ifdef UNUSED_FUNCTION
128
 
static READ16_HANDLER( peno_rand2 )
 
133
READ16_MEMBER(ttchamp_state::peno_rand2)
129
134
{
130
 
    return space->machine().rand();
 
135
    return machine().rand();
131
136
}
132
137
#endif
133
138
 
134
 
static ADDRESS_MAP_START( ttchamp_map, AS_PROGRAM, 16 )
 
139
static ADDRESS_MAP_START( ttchamp_map, AS_PROGRAM, 16, ttchamp_state )
135
140
    AM_RANGE(0x00000, 0x0ffff) AM_RAM
136
 
    AM_RANGE(0x10000, 0x1ffff) AM_RAM AM_BASE_MEMBER(ttchamp_state, m_peno_vram)
 
141
    AM_RANGE(0x10000, 0x1ffff) AM_RAM AM_SHARE("peno_vram")
137
142
    AM_RANGE(0x20000, 0x7ffff) AM_ROMBANK("bank1") // ?
138
143
    AM_RANGE(0x80000, 0xfffff) AM_ROMBANK("bank2") // ?
139
144
ADDRESS_MAP_END
140
145
 
141
 
static ADDRESS_MAP_START( ttchamp_io, AS_IO, 16 )
 
146
static ADDRESS_MAP_START( ttchamp_io, AS_IO, 16, ttchamp_state )
142
147
    AM_RANGE(0x0000, 0x0001) AM_WRITENOP
143
148
 
144
149
    AM_RANGE(0x0002, 0x0003) AM_READ_PORT("SYSTEM")
332
337
 
333
338
static DRIVER_INIT (ttchamp)
334
339
{
335
 
        UINT8 *ROM1 = machine.region("user1")->base();
336
 
        memory_set_bankptr(machine, "bank1",&ROM1[0x120000]);
337
 
        memory_set_bankptr(machine, "bank2",&ROM1[0x180000]);
 
340
        UINT8 *ROM1 = machine.root_device().memregion("user1")->base();
 
341
        machine.root_device().membank("bank1")->set_base(&ROM1[0x120000]);
 
342
        machine.root_device().membank("bank2")->set_base(&ROM1[0x180000]);
338
343
}
339
344
 
340
345
GAME( 199?, ttchamp, 0,        ttchamp, ttchamp, ttchamp, ROT0,  "Gamart?", "Table Tennis Champions (set 1)", GAME_NOT_WORKING|GAME_NO_SOUND )