73
tile = videoram[tile_index + 0x400] + ((videoram[tile_index] & 0x7) << 8);
74
color = (videoram[tile_index] & 0x70) >> 4;
76
//if (tile & 0x300) tile -= 0x000;
77
//else if(tile & 0x200) tile -= 0x100;
78
//else if (tile & 0x100) tile -= 0x100;
75
tile = videoram[tile_index] + ((colorram[tile_index] & 0x7) << 8);
76
color = (colorram[tile_index] & 0x70) >> 4;
81
78
SET_TILE_INFO(0, tile, color, 0);
81
static TILE_GET_INFO( prosport_get_back_tile_info )
87
- flip y (handled with a +0x10 tile banking) depends only by position of the tile in the screen
88
- bits 0-3 are not used by gfx hardware; the value is the color of the pixel in the map (golf)
91
tile = (prosport_bg_vram[tile_index] & 0xf0)>>4;
93
if (tile_index & 0x8) tile += 0x10;
95
tile += deco16_io_ram[0]&0x20; //Pro Bowling bg tiles banking bit
97
SET_TILE_INFO(8, tile, 0, 0);
84
100
/***************************************************************************/
86
102
WRITE8_HANDLER( deco16_io_w )
132
WRITE8_HANDLER( prosoccr_io_w )
134
deco16_io_ram[offset] = data;
135
if (offset > 1 && offset < 6)
136
tilemap_mark_all_tiles_dirty(background_tilemap);
138
// popmessage("%02x %02x",deco16_io_ram[6],deco16_io_ram[7]);
142
case 6: /* unused here */
145
background_disable = ~data & 0x10;
146
//sprite_priority = (data & 0x80)>>7;
147
/* -x-- --xx used during gameplay */
148
/* x--- ---- used on the attract mode */
150
case 8: /* Irq ack */
151
cputag_set_input_line(space->machine, "maincpu", DECO16_IRQ_LINE, CLEAR_LINE);
154
soundlatch_w(space, 0, data);
155
cputag_set_input_line(space->machine, "audiocpu", M6502_IRQ_LINE, HOLD_LINE);
160
/* completely different i/o...*/
161
WRITE8_HANDLER( prosport_io_w )
163
deco16_io_ram[offset] = data;
168
//background_disable = ~data & 0x80;
169
flip_screen_set(space->machine, data & 0x80);
170
tilemap_mark_all_tiles_dirty(background_tilemap);
173
soundlatch_w(space, 0, data);
174
cputag_set_input_line(space->machine, "audiocpu", M6502_IRQ_LINE, HOLD_LINE);
176
case 4: /* Irq ack */
177
cputag_set_input_line(space->machine, "maincpu", DECO16_IRQ_LINE, CLEAR_LINE);
116
182
WRITE8_HANDLER( liberate_videoram_w )
118
184
videoram[offset] = data;
119
tilemap_mark_tile_dirty(fix_tilemap, offset & 0x3ff);
185
tilemap_mark_tile_dirty(fix_tilemap, offset);
188
WRITE8_HANDLER( liberate_colorram_w )
190
colorram[offset] = data;
191
tilemap_mark_tile_dirty(fix_tilemap, offset);
194
WRITE8_HANDLER( prosport_bg_vram_w )
196
prosport_bg_vram[offset] = data;
197
tilemap_mark_tile_dirty(background_tilemap, offset);
122
200
/***************************************************************************/
146
226
tilemap_set_transparent_pen(fix_tilemap,0);
229
VIDEO_START( prosport )
231
background_tilemap = tilemap_create(machine, prosport_get_back_tile_info,back_scan,16,16,32,32);
232
fix_tilemap = tilemap_create(machine, get_fix_tile_info,fix_scan,8,8,32,32);
234
tilemap_set_transparent_pen(fix_tilemap,0);
149
237
/***************************************************************************/
151
239
WRITE8_HANDLER( prosport_paletteram_w )
241
paletteram[offset] = data;
153
243
/* RGB output is inverted */
154
paletteram_BBGGGRRR_w(space,offset,~data);
244
palette_set_color_rgb(space->machine, offset, pal3bit(~data >> 0), pal3bit(~data >> 3), pal2bit(~data >> 6));
157
247
PALETTE_INIT( liberate )
241
drawgfx(bitmap,machine->gfx[1],
331
drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
246
cliprect,TRANSPARENCY_PEN,0);
248
drawgfx(bitmap,machine->gfx[1],
337
drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
253
cliprect,TRANSPARENCY_PEN,0);
257
345
static void prosport_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
259
int offs,multi,fx,fy,sx,sy,sy2,code,code2,color;
347
int offs,multi,fx,fy,sx,sy,sy2,code,code2,color,gfx_region;
261
349
for (offs = 0x000;offs < 0x800;offs += 4)
263
// if ((spriteram[offs+0]&1)!=1) continue;
351
if ((spriteram[offs+0]&1)!=1) continue;
265
353
code = spriteram[offs+1] + ((spriteram[offs+0]&0x3)<<8);
356
if(deco16_io_ram[0]&0x40) //dynamic ram-based gfxs for Pro Golf
359
gfx_region = ((deco16_io_ram[0]&0x30)>>4)+4;
268
362
multi = spriteram[offs+0] & 0x10;
270
364
sy=spriteram[offs+2];
273
367
// sy = (240-spriteram[offs+2]);//-16;
276
color = 1;//(spriteram[offs+0]&0x4)>>2;
370
color = 1;//(deco16_io_ram[4] & 2)+1;//(spriteram[offs+0]&0x4)>>2;
279
fy = spriteram[offs+0] & 0x04;
372
fy = spriteram[offs+0] & 0x02;
373
fx = spriteram[offs+0] & 0x04;
280
374
multi = 0;// spriteram[offs+0] & 0x10;
282
376
// if (multi) sy-=16;
283
if (fy && multi) { code2=code; code++; }
377
if ((fy && multi) || (fx && multi)) { code2=code; code++; }
285
379
if (flip_screen_get(machine))
298
drawgfx(bitmap,machine->gfx[1],
392
drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx_region],
303
cliprect,TRANSPARENCY_PEN,0);
305
drawgfx(bitmap,machine->gfx[1],
398
drawgfx_transpen(bitmap,cliprect,machine->gfx[gfx_region],
310
cliprect,TRANSPARENCY_PEN,0);
356
drawgfx(bitmap,machine->gfx[1],
448
drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
361
cliprect,TRANSPARENCY_PEN,0);
363
drawgfx(bitmap,machine->gfx[1],
454
drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
368
cliprect,TRANSPARENCY_PEN,0);
462
static void prosoccr_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
464
int offs,code,fx,fy,sx,sy;
466
for (offs = 0x000;offs < 0x400;offs += 4)
468
if ((spriteram[offs+0]&1)!=1) continue;
470
code = spriteram[offs+1];
471
sy = 240 - spriteram[offs+2];
472
sx = 240 - spriteram[offs+3];
473
fx = spriteram[offs+0] & 4;
474
fy = spriteram[offs+0] & 2;
476
drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
380
492
bitmap_fill(bitmap,cliprect,32);
382
494
tilemap_draw(bitmap,cliprect,background_tilemap,0,0);
383
boomrang_draw_sprites(screen->machine,bitmap,cliprect,0);
384
496
tilemap_draw(bitmap,cliprect,fix_tilemap,0,0);
497
prosoccr_draw_sprites(screen->machine,bitmap,cliprect);
388
502
VIDEO_UPDATE( prosport )
390
int mx,my,tile,color,offs;
504
int mx,my,tile,offs,gfx_region;
392
507
bitmap_fill(bitmap,cliprect,0);
394
prosport_draw_sprites(screen->machine,bitmap,cliprect);
510
/* TODO: what's bits 0 and 2 for? Internal scrolling state? */
511
scrolly = ((deco16_io_ram[0] & 0x8)<<5);
512
scrollx = ((deco16_io_ram[0] & 0x2)<<7) | (deco16_io_ram[1]);
514
tilemap_set_scrolly(background_tilemap,0,scrolly);
515
tilemap_set_scrollx(background_tilemap,0,-scrollx);
517
tilemap_draw(bitmap,cliprect,background_tilemap,0,0);
519
// popmessage("%d %02x %02x %02x %02x %02x %02x %02x %02x",scrollx,deco16_io_ram[0],deco16_io_ram[1],deco16_io_ram[2],deco16_io_ram[3]
520
// ,deco16_io_ram[4],deco16_io_ram[5],deco16_io_ram[6],deco16_io_ram[7]);
396
522
for (offs = 0;offs < 0x400;offs++)
398
tile=videoram[offs+0x400]+((videoram[offs]&0x3)<<8);
400
tile+=((deco16_io_ram[0]&0x30)<<6);
404
color=1;//(videoram[offs]&0x70)>>4;
524
tile=videoram[offs]+((colorram[offs]&0x3)<<8);
526
if(deco16_io_ram[0]&0x40) //dynamic ram-based gfxs for Pro Golf
529
gfx_region = ((deco16_io_ram[0]&0x30)>>4);
405
531
my = (offs) % 32;
406
532
mx = (offs) / 32;
408
drawgfx(bitmap,screen->machine->gfx[0],
409
tile,1,0,0,248-8*mx,8*my,
410
cliprect,TRANSPARENCY_PEN,0);
534
drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[gfx_region],
535
tile,1,0,0,248-8*mx,8*my,0);
538
prosport_draw_sprites(screen->machine,bitmap,cliprect);