/* BMC Bowling (c) 1994.05 BMC, Ltd - TS 2004.10.22 - analog[at]op.pl Game is almost playable, especially with NVRAM_HACK (undefine it to get real nvram access, but sometimes it's impossible to get back to title screen ). Controls: press START(1) OR BUTTON1 to start game , also START(1) or BUTTON1 to bowl / start ( 5 to insert coin(s) , B to bet , D to pay out (?) etc...) press ANALIZER(0) durning boot to enter test menu, then : STOP1+STOP2 - sound test menu BIG(G) - cycle options , DOUBLE(H) - play STOP1(X),STOP2(C) - change TAKE(A) - color test START(1) - exit BET(B)+START(1) - other tests START(1) - next test press START(1)+HP(S) durning boot to see stats press CONFIRM(N) durning boot, to enter settings BET(B) - change page STOP1(X)/STOP3(V) - modify START(1)/SMALL(F) - move KEY DOWN(D) - default ? TODO: - scroll (writes to $91800 and VIA port A - not used in game (only in test mode)) - music - writes ($20-$30 bytes) to $93000-$93003 range - VIA 6522(interrupt gen , ports) - Crt - interrupts - missing gfx elements --- Chips: MC68000P10 Goldstar GM68B45S (same as Hitachi HD6845 CTR Controller)* Winbond WF19054 (same as AY3-8910) MK28 (appears to be a AD-65, AKA OKI6295) next to rom 10 Synertek SY6522 VIA 9325-AG (Elliptical Filter) KDA0476BCN-66 (RAMDAC) part # scratched 64 pin PLCC next to 7EX & 8 EX Ram: Goldstar GM76C28A (2Kx8 SRAM) x3 HM62256LP-12 x6 OSC: GREAT1 21.47727 13.3M 3.579545 DIPS: Place for 4 8 switch dips dips 1 & 3 are all connected via resitors dips 2 & 4 are standard 8 switch dips EEPROM Label Use ---------------------------------------- ST M27C1001 bmc_8ex.bin - 68K code 0x00 ST M27C1001 bmc_7ex.bin - 68K code 0x01 ST M27C512 bmc_3.bin\ ST M27C512 bmc_4.bin | Graphics ST M27C512 bmc_5.bin | ST M27C512 bmc_6.bin/ HM27C101AG bmc_10.bin - Sound samples BrianT * There is a MESS driver for this chip (gm68b45s CTR controller): http://cvs.mess.org:6502/cgi-bin/viewcvs.cgi/mess/video/m6845.c?rev=1.10 Top board: --- Edge Connection --- GS9403 7EX 8EX Part # Misc HD74LS374p Scratched HM62256 HM62256 PLC OKI ST T74L6245BI PEEl 18CV8P 10 Main board: --- Edge Connection --- JAMMA Connection 68K GM76C28A 3 5 GMC76C28A GM76C28A 4 6 GM68B45S BATTERY 21.47727MHz WF19054 DIP1 13.3Mhz DIP2 SY6522 HM62256 x4 3.579545MHz 9325-AG DIP3 KDA0476BCN-66 DIP4 */ #include "driver.h" #include "deprecat.h" #include "cpu/m68000/m68000.h" #include "machine/6522via.h" #include "sound/ay8910.h" #include "sound/okim6295.h" static UINT16 *bmcbowl_vid1; static UINT16 *bmcbowl_vid2; static UINT8 *stats_ram; static size_t stats_ram_size; static int clr_offset=0; static int bmc_input=0; #define NVRAM_HACK static VIDEO_START( bmcbowl ) { } static VIDEO_UPDATE( bmcbowl ) { /* 280x230,4 bitmap layers, 8bpp, missing scroll and priorities (maybe fixed ones) */ int x,y,z,pixdat; fillbitmap(bitmap,get_black_pen(screen->machine),cliprect); z=0; for (y=0;y<230;y++) { for (x=0;x<280;x+=2) { pixdat = bmcbowl_vid2[0x8000+z]; if(pixdat&0xff) *BITMAP_ADDR16(bitmap, y, x+1) = (pixdat&0xff); if(pixdat>>8) *BITMAP_ADDR16(bitmap, y, x) = (pixdat>>8); pixdat = bmcbowl_vid2[z]; if(pixdat&0xff) *BITMAP_ADDR16(bitmap, y, x+1) = (pixdat&0xff); if(pixdat>>8) *BITMAP_ADDR16(bitmap, y, x) = (pixdat>>8); pixdat = bmcbowl_vid1[0x8000+z]; if(pixdat&0xff) *BITMAP_ADDR16(bitmap, y, x+1) = (pixdat&0xff); if(pixdat>>8) *BITMAP_ADDR16(bitmap, y, x) = (pixdat>>8); pixdat = bmcbowl_vid1[z]; if(pixdat&0xff) *BITMAP_ADDR16(bitmap, y, x+1) = (pixdat&0xff); if(pixdat>>8) *BITMAP_ADDR16(bitmap, y, x) = (pixdat>>8); z++; } } return 0; } static READ16_HANDLER( bmc_random_read ) { return mame_rand(machine); } static READ16_HANDLER( bmc_protection_r ) { switch(activecpu_get_previouspc()) { case 0xca68: switch(activecpu_get_reg(M68K_D2)) { case 0: return 0x37<<8; case 0x1013: return 0; default: return 0x46<<8; } break; } logerror("Protection read @ %X\n",activecpu_get_previouspc()); return mame_rand(machine); } static WRITE16_HANDLER( bmc_RAMDAC_offset_w ) { clr_offset=data*3; } static WRITE16_HANDLER( bmc_RAMDAC_color_w ) { colorram[clr_offset]=data; palette_set_color_rgb(machine,clr_offset/3,pal6bit(colorram[(clr_offset/3)*3]),pal6bit(colorram[(clr_offset/3)*3+1]),pal6bit(colorram[(clr_offset/3)*3+2])); clr_offset=(clr_offset+1)%768; } static WRITE16_HANDLER( scroll_w ) { //TODO - scroll } static READ16_HANDLER(via_r) { return via_0_r(machine,offset); } static WRITE16_HANDLER(via_w) { via_0_w(machine,offset,data); } static READ8_HANDLER(via_b_in) { return input_port_read(machine, "IN3"); } static WRITE8_HANDLER(via_a_out) { // related to video hw ? BG scroll ? } static WRITE8_HANDLER(via_b_out) { //used } static WRITE8_HANDLER(via_ca2_out) { //used } static void via_irq(running_machine *machine, int state) { //used } // 'working' NVRAM #ifdef NVRAM_HACK static const UINT8 bmc_nv1[]= { 0x00,0x00,0x55,0x55,0x00,0x00,0x55,0x55,0x00,0x00,0x55,0x55,0x00,0x00,0x55,0x55,0x13,0x88,0x46,0xDD,0x0F,0xA0, 0x5A,0xF5,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x6E,0x55, 0x55,0x55,0x3B,0x00,0x00,0x00,0x06,0x55,0x55,0x55,0x53,0x00,0x00,0x00,0x00,0x55,0x55,0x55,0x55,0x00,0x00,0x00, 0x00,0x55,0x55,0x55,0x55,0x00,0x00,0x00,0x6E,0x55,0x55,0x55,0x3B,0x00,0x00,0x00,0x06,0x55,0x55,0x55,0x53,0x00, 0x00,0x00,0x00,0x55,0x55,0x55,0x55,0x00,0x00,0x00,0x00,0x55,0x55,0x55,0x55,0x00,0x00,0x00,0x00,0x55,0x55,0x55, 0x55,0x00,0x00,0x00,0x00,0x55,0x55,0x55,0x55,0x00,0x00,0x00,0x00,0x55,0x55,0x55,0x55,0xFF,0x00,0x0A,0x00,0x0A, 0x00,0x32,0x00,0x02,0x28,0x32,0x5C,0x0A,0x03,0x03,0xD6,0x66,0xFF,0xFF,0xFF,0xFF,0x5D,0xED,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x25,0xD5,0x25,0x1C,0x00,0x00,0x00,0x00, 0x00,0x96,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6E, 0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x96,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0xDC,0x00,0xFF,0xFF,0xFF,0xFF }; static const UINT8 bmc_nv2[]= { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x03,0x00,0x09,0x00,0x00,0x2B,0xF1, 0xFE,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF }; static const UINT8 bmc_nv3[]= { 0xFA,0xFF,0x01,0x02,0x04,0x0A,0x1E,0xC8,0x02,0x01,0xFF,0xFF,0xFF,0xFF,0xFF }; static void init_stats(const UINT8 *table, int table_len, int address) { int i; for (i=0; i