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

« back to all changes in this revision

Viewing changes to src/mame/drivers/gamtor.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:
26
26
 
27
27
#include "emu.h"
28
28
#include "cpu/m68000/m68000.h"
29
 
#include "video/ramdac.h"
 
29
#include "video/pc_vga.h"
30
30
 
31
31
class gaminator_state : public driver_device
32
32
{
33
33
public:
34
34
        gaminator_state(const machine_config &mconfig, device_type type, const char *tag)
35
 
                : driver_device(mconfig, type, tag) { }
36
 
 
37
 
        UINT32* m_vram;
38
 
        UINT32* m_tmapram1;
39
 
        UINT32* m_tmapram2;
40
 
 
41
 
        struct { int r,g,b,offs,offs_internal; } m_pal;
42
 
};
43
 
 
44
 
static WRITE32_HANDLER( gamtor_unk_w )
45
 
{
46
 
 
47
 
}
48
 
 
49
 
static READ32_HANDLER( gamtor_unk2_r )
50
 
{
51
 
        return space->machine().rand();
52
 
}
53
 
 
54
 
 
55
 
 
56
 
static WRITE32_HANDLER( gamtor_unk2_w )
57
 
{
58
 
 
59
 
}
60
 
 
61
 
static WRITE32_HANDLER( gamtor_unk3_w )
62
 
{
63
 
 
64
 
}
65
 
 
66
 
static READ32_HANDLER( gamtor_unk4_r )
67
 
{
68
 
        return space->machine().rand();
69
 
}
70
 
 
71
 
static WRITE32_HANDLER( gamtor_unk4_w )
72
 
{
73
 
 
74
 
}
75
 
 
76
 
static WRITE32_HANDLER( gamtor_unk6_w )
77
 
{
78
 
 
79
 
}
80
 
 
81
 
static READ32_HANDLER( gamtor_unk7_r )
82
 
{
83
 
        return space->machine().rand();
84
 
}
85
 
 
86
 
#define GAMTOR_NUM_TILES 0x4000000 / 8
87
 
 
88
 
static const gfx_layout gamtor_layout =
89
 
{
90
 
        8,8,
91
 
        GAMTOR_NUM_TILES,
92
 
        1,
93
 
        { 0 },
94
 
        { 0,1,2,3,4,5,6,7 },
95
 
        {  3*8, 2*8, 1*8, 0*8,  7*8, 6*8, 5*8, 4*8 },
96
 
        8*8
97
 
};
98
 
 
99
 
static WRITE32_HANDLER( gaminator_vram_w )
100
 
{
101
 
        gaminator_state *state = space->machine().driver_data<gaminator_state>();
102
 
 
103
 
        COMBINE_DATA(state->m_vram + offset);
104
 
        gfx_element_mark_dirty(space->machine().gfx[0], offset/8);
105
 
 
106
 
}
107
 
 
108
 
VIDEO_START( gamtor )
109
 
{
110
 
        gaminator_state *state = machine.driver_data<gaminator_state>();
111
 
 
112
 
        /* create the char set (gfx will then be updated dynamically from RAM) */
113
 
        machine.gfx[0] = gfx_element_alloc(machine, &gamtor_layout, (UINT8 *)state->m_vram, 1, 0);
114
 
 
115
 
}
116
 
 
117
 
SCREEN_UPDATE_IND16(gamtor)
118
 
{
119
 
        gaminator_state *state = screen.machine().driver_data<gaminator_state>();
120
 
 
121
 
        int tile_base = 0x00000;
122
 
 
123
 
        // where does the base address come from?
124
 
        if (!strcmp(screen.machine().system().name,"g4u5"))     tile_base = 0x31BE4 - 2;
125
 
        if (!strcmp(screen.machine().system().name,"llcharm"))  tile_base = 0x2f58d - 2;
126
 
 
127
 
 
128
 
 
129
 
        const gfx_element *gfx = screen.machine().gfx[0];
130
 
        int count = 0;
131
 
        for (int y=0;y<32;y++)
132
 
        {
133
 
                for (int x=0;x<80;x++)
134
 
                {
135
 
                        UINT32 chr = state->m_tmapram1[count];
136
 
 
137
 
 
138
 
                        int tile = ((chr>>24)&0xff)*2;
139
 
                        tile += tile_base;
140
 
 
141
 
                        drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*16);
142
 
                        drawgfx_opaque(bitmap,cliprect,gfx,tile+1,0,0,0,x*8,(y*16)+8);
143
 
 
144
 
                        count++;
145
 
                }
146
 
 
147
 
        }
148
 
 
149
 
        return 0;
150
 
}
151
 
 
152
 
 
153
 
 
154
 
 
155
 
 
156
 
static ADDRESS_MAP_START( gaminator_map, AS_PROGRAM, 32 )
 
35
                : driver_device(mconfig, type, tag){ }
 
36
        DECLARE_WRITE32_MEMBER(gamtor_unk_w);
 
37
};
 
38
 
 
39
WRITE32_MEMBER(gaminator_state::gamtor_unk_w)
 
40
{
 
41
 
 
42
}
 
43
 
 
44
 
 
45
 
 
46
static ADDRESS_MAP_START( gaminator_map, AS_PROGRAM, 32, gaminator_state )
157
47
        AM_RANGE(0x00000000, 0x07ffffff) AM_ROM
158
 
        AM_RANGE(0x08000000, 0x0bffffff) AM_RAM_WRITE(gaminator_vram_w) AM_BASE_MEMBER(gaminator_state, m_vram) // 0x083ea460 = some data
159
 
        AM_RANGE(0x1e040008, 0x1e04000b) AM_WRITE( gamtor_unk_w )
 
48
        AM_RANGE(0x08000000, 0x0bffffff) AM_RAM
 
49
        AM_RANGE(0x1e040008, 0x1e04000b) AM_WRITE(gamtor_unk_w )
160
50
 
161
51
        AM_RANGE(0x20000000, 0x2003ffff) AM_RAM
162
52
 
163
 
        /* These are definitely VGA/SVGA ports, for example 0x3d4-0x3d5 = CRTC */
164
 
        AM_RANGE(0x400003c0, 0x400003c3) AM_WRITE( gamtor_unk3_w )
165
 
        AM_RANGE(0x400003c4, 0x400003c7) AM_READWRITE( gamtor_unk4_r, gamtor_unk4_w )
166
 
        AM_RANGE(0x400003c8, 0x400003cb) AM_DEVWRITE8_MODERN("ramdac", ramdac_device, index_w, 0x000000ff)
167
 
        AM_RANGE(0x400003c8, 0x400003cb) AM_DEVWRITE8_MODERN("ramdac", ramdac_device, pal_w,   0x0000ff00)
168
 
//  AM_RANGE(0x400003c8, 0x400003cb) AM_DEVWRITE8_MODERN("ramdac", ramdac_device, mask_w,  0x00ff0000)
169
 
        AM_RANGE(0x400003cc, 0x400003cf) AM_WRITE( gamtor_unk6_w )
170
 
        AM_RANGE(0x400003d4, 0x400003d7) AM_READWRITE( gamtor_unk2_r, gamtor_unk2_w )
171
 
        AM_RANGE(0x400003d8, 0x400003fb) AM_READ( gamtor_unk7_r )
172
 
 
173
 
        AM_RANGE(0x44000000, 0x44007fff) AM_RAM AM_BASE_MEMBER(gaminator_state, m_tmapram1) // puts strings here, looks almost like a tilemap, but where are the tiles?
174
 
        AM_RANGE(0x440a0000, 0x440a1fff) AM_RAM AM_BASE_MEMBER(gaminator_state, m_tmapram2) // beetlem (like above, mirror?)
 
53
        /* standard VGA */
 
54
//  AM_RANGE(0x40000000, 0x40000fff) AM_RAM // regs
 
55
        AM_RANGE(0x44000000, 0x4401ffff) AM_RAM // VRAM
 
56
//  AM_RANGE(0x44000000, 0x44007fff) AM_RAM AM_SHARE("tmapram1") // puts strings here, looks almost like a tilemap, but where are the tiles?
 
57
//  AM_RANGE(0x440a0000, 0x440a1fff) AM_RAM AM_SHARE("tmapram2") // beetlem (like above, mirror?)
175
58
 
176
59
        AM_RANGE(0xe0000000, 0xe00001ff) AM_RAM // nvram?
177
60
 
183
66
 
184
67
 
185
68
 
186
 
static ADDRESS_MAP_START( ramdac_map, AS_0, 8 )
187
 
        AM_RANGE(0x000, 0x3ff) AM_DEVREADWRITE_MODERN("ramdac",ramdac_device,ramdac_pal_r,ramdac_rgb666_w)
188
 
ADDRESS_MAP_END
189
 
 
190
 
static RAMDAC_INTERFACE( ramdac_intf )
191
 
{
192
 
        0
193
 
};
194
 
 
195
69
static MACHINE_CONFIG_START( gaminator, gaminator_state )
196
70
        MCFG_CPU_ADD("maincpu", MCF5206E, 40000000) /* definitely Coldfire, model / clock uncertain */
197
71
        MCFG_CPU_PROGRAM_MAP(gaminator_map)
198
72
        MCFG_CPU_VBLANK_INT("screen", irq6_line_hold) // irq6 seems to be needed to get past the ROM checking
199
73
 
200
 
 
201
 
        MCFG_SCREEN_ADD("screen", RASTER)
202
 
        MCFG_SCREEN_REFRESH_RATE(60)
203
 
        MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
204
 
        MCFG_SCREEN_SIZE(64*8, 32*8)
205
 
        MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1)
206
 
        MCFG_SCREEN_UPDATE_STATIC(gamtor)
207
 
 
208
 
        MCFG_PALETTE_LENGTH(0x100)
209
 
 
210
 
        MCFG_RAMDAC_ADD("ramdac", ramdac_intf, ramdac_map)
211
 
 
212
 
 
213
 
        MCFG_VIDEO_START(gamtor)
 
74
        MCFG_FRAGMENT_ADD( pcvideo_vga )
214
75
 
215
76
        MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
216
77
        /* unknown sound */
1386
1247
        ROM_LOAD( "llc_92_5.6-0", 0x0000, 0x2000000, CRC(c8c2a5d3) SHA1(ec23eff63871cc515ec58a894446d4d639d864e4) )
1387
1248
ROM_END
1388
1249
 
 
1250
static READ8_HANDLER( vga_setting ) { return 0xff; } // hard-code to color
1389
1251
 
1390
1252
 
1391
1253
DRIVER_INIT( gaminator )
1392
1254
{
1393
 
 
 
1255
        pc_vga_init(machine, vga_setting, NULL);
 
1256
        pc_vga_gamtor_io_init(machine, machine.device("maincpu")->memory().space(AS_PROGRAM), 0x44000000, machine.device("maincpu")->memory().space(AS_PROGRAM), 0x40000000);
1394
1257
}
1395
1258
 
1396
1259