mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
- removed tilemap, a bit more low level video hw emulation (with crt6845)
- fake colors
This commit is contained in:
parent
679ddd69b8
commit
89f4f42e51
@ -2,13 +2,14 @@
|
||||
'Swinging Singles' by Ent. Ent. Ltd
|
||||
driver by Tomasz Slanina
|
||||
|
||||
|
||||
Crap XXX game.
|
||||
Three roms contains text "BY YACHIYO"
|
||||
|
||||
Upper half of 7.bin = upper half of 8.bin = intentional or bad dump ?
|
||||
|
||||
TODO:
|
||||
- colors (proms ? one of unk writes?)
|
||||
- colors (missing prom(s) ?)
|
||||
- samples (at least two of unused roms contains samples (unkn. format , adpcm ?)
|
||||
- dips (one is tested in game (difficulty related?), another 2 are tested at start)
|
||||
|
||||
@ -17,54 +18,105 @@
|
||||
- mem $c000, $c001 = protection device ? if tests fails, game crashes (problems with stack - skipped code with "pop af")
|
||||
- i/o port $8 = data read used for $e command arg for one of AY chips (volume? - could be a sample player (based on volume changes?)
|
||||
- i/o port $1a = 1 or 0, rarely accessed, related to crt writes
|
||||
|
||||
*/
|
||||
|
||||
#include "driver.h"
|
||||
#include "sound/ay8910.h"
|
||||
#include "video/crtc6845.h"
|
||||
|
||||
static tilemap *ssingles_tilemap;
|
||||
static UINT8 *ssingles_vram;
|
||||
static UINT8 *ssingles_videoram;
|
||||
static UINT8 *ssingles_colorram;
|
||||
static UINT8 prot_data;
|
||||
|
||||
#define NUM_PENS (4*8)
|
||||
#define VMEM_SIZE 0x100
|
||||
static pen_t pens[NUM_PENS];
|
||||
|
||||
//fake palette
|
||||
static const UINT8 ssingles_colors[NUM_PENS*3]=
|
||||
{
|
||||
0x00,0x00,0x00, 0xff,0xff,0xff, 0xff,0x00,0x00, 0x80,0x00,0x00,
|
||||
0x00,0x00,0x00, 0xf0,0xf0,0xf0, 0xff,0xff,0x00, 0x40,0x40,0x40,
|
||||
0x00,0x00,0x00, 0xff,0xff,0xff, 0xff,0x00,0x00, 0xff,0xff,0x00,
|
||||
0x00,0x00,0x00, 0xff,0xff,0x00, 0xd0,0x00,0x00, 0x80,0x00,0x00,
|
||||
0x00,0x00,0x00, 0xff,0x00,0x00, 0xff,0xff,0x00, 0x80,0x80,0x00,
|
||||
0x00,0x00,0x00, 0xff,0x00,0x00, 0x40,0x40,0x40, 0xd0,0xd0,0xd0,
|
||||
0x00,0x00,0x00, 0x00,0x00,0xff, 0x60,0x40,0x30, 0xff,0xff,0x00,
|
||||
0x00,0x00,0x00, 0xff,0x00,0xff, 0x80,0x00,0x80, 0x40,0x00,0x40
|
||||
};
|
||||
|
||||
static void update_row(mame_bitmap *bitmap, const rectangle *cliprect,
|
||||
UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, void *param)
|
||||
{
|
||||
int cx,x;
|
||||
UINT32 tile_address;
|
||||
UINT16 cell,palette;
|
||||
UINT8 b0,b1;
|
||||
|
||||
for(cx=0;cx<x_count;++cx)
|
||||
{
|
||||
int address=((ma>>1)+(cx>>1))&0xff;
|
||||
|
||||
cell=ssingles_videoram[address]+(ssingles_colorram[address]<<8);
|
||||
|
||||
tile_address=((cell&0x3ff)<<4)+ra;
|
||||
palette=(cell>>10)&0x1c;
|
||||
|
||||
if(cx&1)
|
||||
{
|
||||
b0=memory_region(REGION_GFX1)[tile_address+0x0000]; /* 9.bin */
|
||||
b1=memory_region(REGION_GFX1)[tile_address+0x8000]; /* 11.bin */
|
||||
}
|
||||
else
|
||||
{
|
||||
b0=memory_region(REGION_GFX1)[tile_address+0x4000]; /* 10.bin */
|
||||
b1=memory_region(REGION_GFX1)[tile_address+0xc000]; /* 12.bin */
|
||||
}
|
||||
|
||||
for(x=7;x>=0;--x)
|
||||
{
|
||||
*BITMAP_ADDR32(bitmap, y, (cx<<3)|(x)) = pens[palette+((b1&1)|((b0&1)<<1))];
|
||||
b0>>=1;
|
||||
b1>>=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const crtc6845_interface crtc6845_intf =
|
||||
{
|
||||
0,
|
||||
1000000, /* the clock of the chip - guess */
|
||||
1000000, /* ? MHz */
|
||||
8,
|
||||
NULL,
|
||||
NULL,
|
||||
update_row,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
static TILE_GET_INFO( get_tile_info )
|
||||
static WRITE8_HANDLER(ssingles_videoram_w)
|
||||
{
|
||||
int code = ssingles_vram[tile_index]+256*(ssingles_vram[tile_index+0x800]);
|
||||
SET_TILE_INFO(
|
||||
0,
|
||||
code,
|
||||
0,
|
||||
0);
|
||||
ssingles_videoram[offset]=data;
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER(ssingles_vram_w)
|
||||
static WRITE8_HANDLER(ssingles_colorram_w)
|
||||
{
|
||||
ssingles_vram[offset]=data;
|
||||
ssingles_colorram[offset]=data;
|
||||
}
|
||||
|
||||
static VIDEO_START(ssingles)
|
||||
{
|
||||
ssingles_tilemap = tilemap_create( get_tile_info,tilemap_scan_rows,TILEMAP_TYPE_PEN,16,16,18,113 ); //smaller than 113
|
||||
crtc6845_config(0, &crtc6845_intf);
|
||||
|
||||
{
|
||||
int i;
|
||||
for(i=0;i<NUM_PENS;++i)
|
||||
{
|
||||
pens[i]=MAKE_RGB(ssingles_colors[3*i], ssingles_colors[3*i+1], ssingles_colors[3*i+2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static VIDEO_UPDATE(ssingles)
|
||||
{
|
||||
tilemap_mark_all_tiles_dirty(ssingles_tilemap);
|
||||
tilemap_draw(bitmap,cliprect,ssingles_tilemap,TILEMAP_DRAW_OPAQUE,0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static READ8_HANDLER(c000_r)
|
||||
{
|
||||
@ -99,7 +151,9 @@ static READ8_HANDLER(controls_r)
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( ssingles_map, ADDRESS_SPACE_PROGRAM, 8 )
|
||||
AM_RANGE(0x0000, 0x1fff) AM_READ( MRA8_ROM ) AM_WRITE(ssingles_vram_w)
|
||||
AM_RANGE(0x0000, 0x00ff) AM_WRITE(ssingles_videoram_w)
|
||||
AM_RANGE(0x0800, 0x08ff) AM_WRITE(ssingles_colorram_w)
|
||||
AM_RANGE(0x0000, 0x1fff) AM_READ( MRA8_ROM )
|
||||
AM_RANGE(0xc000, 0xc000) AM_READ( c000_r )
|
||||
AM_RANGE(0xc001, 0xc001) AM_READWRITE( c001_r, c001_w )
|
||||
AM_RANGE(0x6000, 0xbfff) AM_ROM
|
||||
@ -116,7 +170,7 @@ static ADDRESS_MAP_START( ssingles_io_map, ADDRESS_SPACE_IO, 8 )
|
||||
AM_RANGE(0x16, 0x16) AM_READ(input_port_2_r)
|
||||
AM_RANGE(0x18, 0x18) AM_READ(input_port_3_r)
|
||||
AM_RANGE(0x1c, 0x1c) AM_READ(controls_r)
|
||||
AM_RANGE(0x1a, 0x1a) AM_WRITENOP //video related
|
||||
AM_RANGE(0x1a, 0x1a) AM_WRITENOP //video/crt related
|
||||
AM_RANGE(0xfe, 0xfe) AM_WRITE(crtc6845_address_w)
|
||||
AM_RANGE(0xff, 0xff) AM_WRITE(crtc6845_register_w)
|
||||
|
||||
@ -193,22 +247,6 @@ PORT_DIPNAME( 0x80, 0x80, "UnkC" )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( Yes ) )
|
||||
INPUT_PORTS_END
|
||||
|
||||
static const gfx_layout charlayout =
|
||||
{
|
||||
16,16,
|
||||
RGN_FRAC(1,4),
|
||||
2,
|
||||
{ 0, RGN_FRAC(1,2) },
|
||||
{ RGN_FRAC(1,4),RGN_FRAC(1,4)+ 1,RGN_FRAC(1,4)+ 2,RGN_FRAC(1,4)+ 3,RGN_FRAC(1,4)+ 4,RGN_FRAC(1,4)+ 5,RGN_FRAC(1,4) + 6,RGN_FRAC(1,4) + 7,0,1,2,3,4,5,6,7 },
|
||||
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8},
|
||||
8*8*2
|
||||
};
|
||||
|
||||
static GFXDECODE_START( ssingles )
|
||||
GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0x0000, 1 )
|
||||
GFXDECODE_END
|
||||
|
||||
|
||||
static MACHINE_DRIVER_START( ssingles )
|
||||
MDRV_CPU_ADD(Z80,4000000) /* ? MHz */
|
||||
MDRV_CPU_PROGRAM_MAP(ssingles_map,0)
|
||||
@ -219,16 +257,13 @@ static MACHINE_DRIVER_START( ssingles )
|
||||
MDRV_SCREEN_VBLANK_TIME(DEFAULT_60HZ_VBLANK_DURATION)
|
||||
|
||||
MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER )
|
||||
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
|
||||
MDRV_SCREEN_SIZE(512, 256)
|
||||
MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
|
||||
MDRV_SCREEN_RAW_PARAMS(4000000, 256, 0, 256, 256, 0, 256) /* temporary, CRTC will configure screen */
|
||||
|
||||
MDRV_SCREEN_VISIBLE_AREA(0, 511, 0, 255)
|
||||
|
||||
MDRV_GFXDECODE(ssingles)
|
||||
MDRV_PALETTE_LENGTH(16*4) //guess
|
||||
MDRV_PALETTE_LENGTH(4) //guess
|
||||
|
||||
MDRV_VIDEO_START(ssingles)
|
||||
MDRV_VIDEO_UPDATE(ssingles)
|
||||
MDRV_VIDEO_UPDATE(crtc6845)
|
||||
|
||||
/* sound hardware */
|
||||
MDRV_SPEAKER_STANDARD_MONO("mono")
|
||||
@ -254,7 +289,7 @@ ROM_START( ssingles )
|
||||
ROM_LOAD( "11.bin", 0x8000, 0x4000, CRC(f7107b29) SHA1(a405926fd3cb4b3d2a1c705dcde25d961dba5884) )
|
||||
ROM_LOAD( "12.bin", 0xc000, 0x4000, CRC(e5585a93) SHA1(04d55699b56d869066f2be2c6ac48042aa6c3108) )
|
||||
|
||||
ROM_REGION( 0x010000, REGION_USER1, 0) /* samples ? */
|
||||
ROM_REGION( 0x08000, REGION_USER1, 0) /* samples ? data ?*/
|
||||
ROM_LOAD( "5.bin", 0x00000, 0x2000, CRC(242a8dda) SHA1(e140893cc05fb8cee75904d98b02626f2565ed1b) )
|
||||
ROM_LOAD( "6.bin", 0x02000, 0x2000, CRC(85ab8aab) SHA1(566f034e1ba23382442f27457447133a0e0f1cfc) )
|
||||
ROM_LOAD( "7.bin", 0x04000, 0x2000, CRC(57cc112d) SHA1(fc861c58ae39503497f04d302a9f16fca19b37fb) )
|
||||
@ -264,9 +299,12 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT(ssingles)
|
||||
{
|
||||
ssingles_vram=auto_malloc(0x2000);
|
||||
memset(ssingles_vram,0,0x2000);
|
||||
state_save_register_global_pointer(ssingles_vram, 0x2000);
|
||||
ssingles_videoram=auto_malloc(VMEM_SIZE);
|
||||
ssingles_colorram=auto_malloc(VMEM_SIZE);
|
||||
memset(ssingles_videoram,0,VMEM_SIZE);
|
||||
memset(ssingles_colorram,0,VMEM_SIZE);
|
||||
state_save_register_global_pointer(ssingles_videoram, VMEM_SIZE);
|
||||
state_save_register_global_pointer(ssingles_colorram, VMEM_SIZE);
|
||||
}
|
||||
|
||||
GAME ( 1983, ssingles, 0, ssingles, ssingles, ssingles, ROT90, "Ent. Ent. Ltd", "Swinging Singles", GAME_SUPPORTS_SAVE | GAME_WRONG_COLORS | GAME_IMPERFECT_SOUND )
|
||||
|
Loading…
Reference in New Issue
Block a user