28
28
#include "cpu/m68000/m68000.h"
29
#include "video/ramdac.h"
29
#include "video/pc_vga.h"
31
31
class gaminator_state : public driver_device
34
34
gaminator_state(const machine_config &mconfig, device_type type, const char *tag)
35
: driver_device(mconfig, type, tag) { }
41
struct { int r,g,b,offs,offs_internal; } m_pal;
44
static WRITE32_HANDLER( gamtor_unk_w )
49
static READ32_HANDLER( gamtor_unk2_r )
51
return space->machine().rand();
56
static WRITE32_HANDLER( gamtor_unk2_w )
61
static WRITE32_HANDLER( gamtor_unk3_w )
66
static READ32_HANDLER( gamtor_unk4_r )
68
return space->machine().rand();
71
static WRITE32_HANDLER( gamtor_unk4_w )
76
static WRITE32_HANDLER( gamtor_unk6_w )
81
static READ32_HANDLER( gamtor_unk7_r )
83
return space->machine().rand();
86
#define GAMTOR_NUM_TILES 0x4000000 / 8
88
static const gfx_layout gamtor_layout =
95
{ 3*8, 2*8, 1*8, 0*8, 7*8, 6*8, 5*8, 4*8 },
99
static WRITE32_HANDLER( gaminator_vram_w )
101
gaminator_state *state = space->machine().driver_data<gaminator_state>();
103
COMBINE_DATA(state->m_vram + offset);
104
gfx_element_mark_dirty(space->machine().gfx[0], offset/8);
108
VIDEO_START( gamtor )
110
gaminator_state *state = machine.driver_data<gaminator_state>();
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);
117
SCREEN_UPDATE_IND16(gamtor)
119
gaminator_state *state = screen.machine().driver_data<gaminator_state>();
121
int tile_base = 0x00000;
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;
129
const gfx_element *gfx = screen.machine().gfx[0];
131
for (int y=0;y<32;y++)
133
for (int x=0;x<80;x++)
135
UINT32 chr = state->m_tmapram1[count];
138
int tile = ((chr>>24)&0xff)*2;
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);
156
static ADDRESS_MAP_START( gaminator_map, AS_PROGRAM, 32 )
35
: driver_device(mconfig, type, tag){ }
36
DECLARE_WRITE32_MEMBER(gamtor_unk_w);
39
WRITE32_MEMBER(gaminator_state::gamtor_unk_w)
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 )
161
51
AM_RANGE(0x20000000, 0x2003ffff) AM_RAM
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 )
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?)
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?)
176
59
AM_RANGE(0xe0000000, 0xe00001ff) AM_RAM // nvram?
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)
190
static RAMDAC_INTERFACE( ramdac_intf )
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
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)
208
MCFG_PALETTE_LENGTH(0x100)
210
MCFG_RAMDAC_ADD("ramdac", ramdac_intf, ramdac_map)
213
MCFG_VIDEO_START(gamtor)
74
MCFG_FRAGMENT_ADD( pcvideo_vga )
215
76
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
216
77
/* unknown sound */