Jump to content

driver for snowbro3


Recommended Posts

Nevermind I figured it out for myself. For those who need it, here ya go

 

 

 

 

put this in the video update section.

 

VIDEO_UPDATE( snowbro3 );

-------------------------------------

put this in the static machine driver

 

start/end section after 4in1

 

static MACHINE_DRIVER_START( snowbro3

 

)

/* basic machine hardware */

MDRV_CPU_ADD_TAG("main", M

 

68000, 16000000) /* 16mhz or 12mhz ?

 

*/

MDRV_CPU_PROGRAM_MAP(readmem

 

3,writemem3)

MDRV_CPU_VBLANK_INT(

 

snowbros_interrupt,3)

 

MDRV_FRAMES_PER_SECOND(60)

MDRV_VBLANK_DURATION(

 

DEFAULT_60HZ_VBLANK_DURATION)

 

/* video hardware */

MDRV_VIDEO_ATTRIBUTES(

 

VIDEO_TYPE_RASTER)

MDRV_SCREEN_SIZE(32*8, 32*:blink:

MDRV_VISIBLE_AREA(0*8, 32*8-

 

1, 2*8, 30*8-1)

MDRV_GFXDECODE(sb3

 

_gfxdecodeinfo)

MDRV_PALETTE_LENGTH(512)

 

MDRV_VIDEO_UPDATE(snowbro3)

 

/* sound hardware */

/* oki for sound */

MACHINE_DRIVER_END

------------------------------------

put this in the rom start, rom end

 

section under /* semicom games */

 

ROM_START( snowbro3 )

ROM_REGION( 0x40000,

 

REGION_CPU1, 0 ) /* 68000 code

 

*/

ROM_LOAD16_BYTE( "ur4", 0x

 

00000, 0x20000, CRC(19c13ffd) SHA1(4

 

f9db70354bd410b7bcafa96be4591de8dc33

 

d90) )

ROM_LOAD16_BYTE( "ur3", 0x

 

00001, 0x20000, CRC(3f32fa15) SHA1(

 

1402c173c1df142ff9dd7b859689c075813a

 

50e5) )

 

/* is sound cpu code missing

 

or is it driven by the main cpu? */

 

ROM_REGION( 0x80000,

 

REGION_GFX1, ROMREGION_DISPOSE )

ROM_LOAD( "ua5",

 

0x000000, 0x80000, CRC(0604e385) SHA

 

1(96acbc65a8db89a7be100f852dc07ba9a

 

0313167) ) /* 16x16 tiles */

 

ROM_REGION( 0x400000,

 

REGION_GFX2, ROMREGION_DISPOSE ) /*

 

16x16 BG Tiles */

ROM_LOAD( "un7",

 

0x000000, 0x200000, CRC(4a79da4c)

 

SHA1(59207d116d39b9ee25c51affe520f5

 

fdff34e536) )

ROM_LOAD( "un8",

 

0x200000, 0x200000, CRC(7a4561a4)

 

SHA1(1dd823369c09368d1f0ec8e1cb85d

 

700f10ff448) )

 

ROM_REGION( 0x080000,

 

REGION_SOUND1, 0 ) /* OKIM6295

 

samples */

ROM_LOAD( "us5", 0x00000,

 

0x80000, CRC(7c6368ef) SHA1(53393c

 

570c605f7582b61c630980041e2ed32e2d) )

ROM_END

------------------------------------

put this at the end of the driver

 

init section of snowbro.c driver.

 

static DRIVER_INIT(snowbro3)

{

unsigned char *buffer;

data8_t *src = memory_region

 

(REGION_CPU1);

int len =

 

memory_region_length(REGION_CPU1);

 

/* strange order */

if ((buffer = malloc(len)))

{

int i;

for (i = 0;i < len;

 

i++)

buffer =

 

src[bITSWAP24(i,23,22,21,20,19,18,17

 

,16,15,14,13,12,11,10,9,8,7,6,5,3,4,

 

1,2,0)];

memcpy(

 

src,buffer,len);

free(buffer);

}

}

-------------------------------------

put this under /* semicom games */

 

GAMEX(2002, snowbro3, 0,

 

snowbro3, snowbroj, snowbro3, ROT0,

 

"Syrmex / hack?", "Snow Brothers 3 -

 

Magical Adventure", GAME_NO_SOUND )

 

// its basically snowbros code?...

 

------------------------------------

put this at the end of src/vidhrdw/

 

snowbro.c

 

VIDEO_UPDATE( snowbro3 )

{

int sx=0, sy=0, x=0, y=0,

 

offs;

 

 

/*

* Sprite Tile Format

* ------------------

*

* Byte | Bit(s) | Use

* -----+-76543210-+--------

 

--------

* 0-5 | -------- |

 

?

* 6 | -------- |

 

?

* 7 | xxxx.... |

 

Palette Bank

* 7 |.......x |

 

XPos - Sign Bit

* 9 | xxxxxxxx |

 

XPos

* 7 |......x. |

 

YPos - Sign Bit

* B | xxxxxxxx |

 

YPos

* 7 |.....x.. |

 

Use Relative offsets

* C | -------- |

 

?

* D | xxxxxxxx |

 

Sprite Number (low 8 bits)

* E | -------- |

 

?

* F |....xxxx |

 

Sprite Number (high 4 bits)

* F | x....... |

 

Flip Sprite Y-Axis

* F |.x...... |

 

Flip Sprite X-Axis

*/

 

/* This clears & redraws the

 

entire screen each pass */

 

fillbitmap(

 

bitmap,get_black_pen(),&Machine-

 

>visible_area);

 

for (offs = 0;offs <

 

spriteram_size/2;offs += :D

{

struct GfxElement *

 

gfx = Machine->gfx[0];

int dx = spriteram16

 

[offs+4] & 0xff;

int dy = spriteram16

 

[offs+5] & 0xff;

int tilecolour =

 

spriteram16[offs+3];

int attr = spriteram

 

16[offs+7];

int flipx = attr &

 

0x80;

int flipy = (attr &

 

0x40) << 1;

int tile = ((attr &

 

0xff) << ;) + (spriteram16[offs+6] &

 

0xff);

 

if (tilecolour & 1)

 

dx = -1 - (dx ^ 0xff);

if (tilecolour & 2)

 

dy = -1 - (dy ^ 0xff);

if (tilecolour & 4)

{

x += dx;

y += dy;

}

else

{

x = dx;

y = dy;

}

 

if (x > 511) x &= 0x

 

1ff;

if (y > 511) y &= 0x

 

1ff;

 

if (flip_screen)

{

sx = 240 - x;

sy = 240 - y;

flipx = !

 

flipx;

flipy = !

 

flipy;

}

else

{

sx = x;

sy = y;

}

 

if (offs < 0x800) /*

 

i guess this is the right way */

{

gfx =

 

Machine->gfx[1];

tilecolour =

 

0x10;

}

 

drawgfx(bitmap,gfx,

tile,

(

 

tilecolour & 0xf0) >> 4,

 

 

flipx, flipy,

 

 

sx,sy,

 

 

&Machine-

 

>visible_area,TRANSPARENCY_PEN,0);

}

}

-------------------------------------

add this to src/driver.c under /*

 

semicom games */

 

DRIVER( snowbro3 ) /* © 2002

 

Syrmex (hack) */

Link to comment
Share on other sites

  • 1 month later...
<------------------------

In SRC/DRIVERS/snowbros.c

<------------------------

 

VIDEO_UPDATE( snowbro3 );

 

 

-------------------------

 

 

static MACHINE_DRIVER_START( snowbro3 )

 

/* basic machine hardware */

MDRV_CPU_ADD(M68000, 16000000) /* 16mhz or 12mhz ? */

MDRV_CPU_MEMORY(readmem3,writemem3)

MDRV_CPU_VBLANK_INT(snowbros_interrupt,3)

 

MDRV_FRAMES_PER_SECOND(60)

MDRV_VBLANK_DURATION(DEFAULT_60HZ_VBLANK_DURATION)

 

/* video hardware */

MDRV_VIDEO_ATTRIBUTES(VIDEO_TYPE_RASTER)

MDRV_SCREEN_SIZE(32*8, 32*;)

MDRV_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)

MDRV_GFXDECODE(sb3_gfxdecodeinfo)

MDRV_PALETTE_LENGTH(512)

 

MDRV_VIDEO_UPDATE(snowbro3)

 

/* sound hardware */

/* oki for sound */

MACHINE_DRIVER_END

 

 

-----------------------------

 

 

ROM_START( snowbro3 )

ROM_REGION( 0x40000, REGION_CPU1, 0 ) /* 68000 code */

ROM_LOAD16_BYTE( "ur4",  0x00000, 0x20000, CRC(19c13ffd) SHA1(4f9db70354bd410b7bcafa96be4591de8dc33d90) )

ROM_LOAD16_BYTE( "ur3",  0x00001, 0x20000, CRC(3f32fa15) SHA1(1402c173c1df142ff9dd7b859689c075813a50e5) )

 

/* is sound cpu code missing or is it driven by the main cpu? */

 

ROM_REGION( 0x80000, REGION_GFX1, ROMREGION_DISPOSE )

ROM_LOAD( "ua5",  0x000000, 0x80000, CRC(0604e385) SHA1(96acbc65a8db89a7be100f852dc07ba9a0313167) ) /* 16x16 tiles */

 

ROM_REGION( 0x400000, REGION_GFX2, ROMREGION_DISPOSE ) /* 16x16 BG Tiles */

ROM_LOAD( "un7",  0x000000, 0x200000, CRC(4a79da4c) SHA1(59207d116d39b9ee25c51affe520f5fdff34e536) )

ROM_LOAD( "un8",  0x200000, 0x200000, CRC(7a4561a4) SHA1(1dd823369c09368d1f0ec8e1cb85d700f10ff448) )

 

ROM_REGION( 0x080000, REGION_SOUND1, 0 ) /* OKIM6295 samples */

ROM_LOAD( "us5",  0x00000, 0x80000, CRC(7c6368ef) SHA1(53393c570c605f7582b61c630980041e2ed32e2d) )

ROM_END

 

 

-------------------------------

 

static DRIVER_INIT(snowbro3)

{

unsigned char *buffer;

data8_t *src = memory_region(REGION_CPU1);

int len = memory_region_length(REGION_CPU1);

 

/* strange order */

if ((buffer = malloc(len)))

{

  int i;

  for (i = 0;i < len; i++)

buffer = src[bITSWAP24(i,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,3,4,1,2,0)];

  memcpy(src,buffer,len);

  free(buffer);

}

}

 

 

--------------------------------

 

GAMEX(2002, snowbro3, 0,        snowbro3, snowbroj, snowbro3, ROT0, "Syrmex / hack?", "Snow Brothers 3 - Magical Adventure", GAME_NO_SOUND ) // its basically snowbros code?...

/* the following don't work, they either point the interrupts at an area of ram probably shared by

some kind of mcu which puts 68k code there, or jump to the area in the interrupts */

 

--------------------------------

 

<--------------

In SRC/Driver.c

<--------------

 

Under DRIVER( wintbob )  /* bootleg */ ADD

 

 

DRIVER( snowbro3 ) /* © 2002 Syrmex (hack) */

Edited by james
Link to comment
Share on other sites

This is the missing part (mame32 0.79)

/*This Goes in Snowbros.c after the semicom memory map*/

 

 

static ADDRESS_MAP_START( readmem3, ADDRESS_SPACE_PROGRAM, 16 )

AM_RANGE(0x000000, 0x03ffff) AM_READ (MRA16_ROM)

AM_RANGE(0x100000, 0x103fff) AM_READ (MRA16_RAM)

// AM_RANGE(0x300000, 0x300001) AM_READ (OKIM6295_status_0_msb_r) // ?

AM_RANGE(0x500000, 0x500001) AM_READ (input_port_0_word_r)

AM_RANGE(0x500002, 0x500003) AM_READ (input_port_1_word_r)

AM_RANGE(0x500004, 0x500005) AM_READ (input_port_2_word_r)

AM_RANGE(0x600000, 0x6003ff) AM_READ (MRA16_RAM)

AM_RANGE(0x700000, 0x7021ff) AM_READ (MRA16_RAM)

ADDRESS_MAP_END

 

static ADDRESS_MAP_START( writemem3, ADDRESS_SPACE_PROGRAM, 16 )

AM_RANGE(0x000000, 0x03ffff) AM_WRITE (MWA16_ROM)

AM_RANGE(0x100000, 0x103fff) AM_WRITE (MWA16_RAM)

AM_RANGE(0x200000, 0x200001) AM_WRITE (watchdog_reset16_w)

// AM_RANGE(0x300000, 0x300001) AM_WRITE (OKIM6295_data_0_msb_w) // ?

AM_RANGE(0x400000, 0x400001) AM_WRITE (snowbros_flipscreen_w)

AM_RANGE(0x600000, 0x6003ff) AM_WRITE (paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)

AM_RANGE(0x700000, 0x7021ff) AM_WRITE (MWA16_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)

AM_RANGE(0x800000, 0x800001) AM_WRITE (MWA16_NOP) /* IRQ 4 acknowledge? */

AM_RANGE(0x900000, 0x900001) AM_WRITE (MWA16_NOP) /* IRQ 3 acknowledge? */

AM_RANGE(0xa00000, 0xa00001) AM_WRITE (MWA16_NOP) /* IRQ 2 acknowledge? */

ADDRESS_MAP_END

 

 

/********************************************************************************

*****************************/

/*This goes after:

 

/* handler called by the 3812/2151 emulator when the internal timers cause an IRQ */

static void irqhandler(int irq)

{

cpu_set_irq_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE);

}

 

 

*/

 

/* snow bros 3 */

 

static struct GfxLayout sb3_tilebglayout =

{

16,16,

RGN_FRAC(1,1),

8,

{8, 9,10, 11, 0, 1, 2, 3 },

{ 0, 4, 16, 20, 32, 36, 48, 52,

512+0,512+4,512+16,512+20,512+32,512+36,512+48,512+52},

{ 0*64, 1*64, 2*64, 3*64, 4*64, 5*64, 6*64, 7*64,

1024+0*16,1024+1*64,1024+2*64,1024+3*64,1024+4*64,1024+5*64,1024+6*64,1024+7*64}

,

32*64

};

 

 

static struct GfxDecodeInfo sb3_gfxdecodeinfo[] =

{

{ REGION_GFX1, 0, &tilelayout, 0, 16 },

{ REGION_GFX2, 0, &sb3_tilebglayout, 0, 2 },

{ -1 } /* end of array */

};

 

 

/*The rest of the driver is ok, but note that where that you have to put " ;)" (just the eight and the bracket) where that emoticon appears*/

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...