diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c index dee078724c0..55223445a11 100644 --- a/src/mame/drivers/hng64.c +++ b/src/mame/drivers/hng64.c @@ -27,11 +27,12 @@ Notes: * The Japanese text on the Roads Edge network screen says : "waiting to connect network... please wait without touching machine" ToDo: - * clean up I/O / MCU communication + * Buriki One / Xrally and Roads Edge doesn't coin it up, irq issue? + * sprite garbage in Beast Busters 2nd Nightmare, another irq issue? + * Samurai Shodown 64 2 puts "Press 1p & 2p button" msg in gameplay, known to be a MCU simulation issue, i/o port 4 doesn't + seem to be just an input port but controls program flow too. * work out the purpose of the interrupts and how many are needed * correct game speed (seems too fast) - * figure out what 'network' Road Edge needs to boot, it should run as a standalone - * make ss64 boot (io return 3 then 4 not just 4) then work out where the palette is 2d: * scroll (base registers?) @@ -469,6 +470,7 @@ extern WRITE32_HANDLER( hng64_videoram_w ); extern UINT32 *hng64_spriteram, *hng64_videoregs, *hng64_spriteregs ; extern UINT32 *hng64_videoram ; extern UINT32 *hng64_tcram ; +extern UINT32 *hng64_3dregs; extern UINT32 hng64_dls[2][0x81] ; @@ -792,7 +794,7 @@ static READ32_HANDLER( racing_io_r ) static READ32_HANDLER( hng64_dualport_r ) { - printf("dualport R %08x %08x (PC=%08x)\n", offset*4, hng64_dualport[offset], cpu_get_pc(space->cpu)); +// printf("dualport R %08x %08x (PC=%08x)\n", offset*4, hng64_dualport[offset], cpu_get_pc(space->cpu)); /* command table: @@ -830,7 +832,7 @@ Beast Busters 2 outputs (all at offset == 0x1c): static WRITE32_HANDLER( hng64_dualport_w ) { - printf("dualport WRITE %08x %08x (PC=%08x)\n", offset*4, hng64_dualport[offset], cpu_get_pc(space->cpu)); +// printf("dualport WRITE %08x %08x (PC=%08x)\n", offset*4, hng64_dualport[offset], cpu_get_pc(space->cpu)); COMBINE_DATA (&hng64_dualport[offset]); } @@ -898,7 +900,6 @@ static WRITE32_HANDLER( dl_control_w ) activeBuffer = 0; if (data & 2) activeBuffer = 1; - } #ifdef UNUSED_FUNCTION @@ -1071,7 +1072,7 @@ static ADDRESS_MAP_START( hng_map, ADDRESS_SPACE_PROGRAM, 32 ) AM_RANGE(0x20300218, 0x2030021b) AM_READ(unk_vreg_r) // 3d? -// AM_RANGE(0x30000000, 0x3000002f) AM_READWRITE(q2_r, q2_w) AM_BASE(&hng64_q2) + AM_RANGE(0x30000000, 0x3000002f) AM_RAM AM_BASE(&hng64_3dregs) AM_RANGE(0x30100000, 0x3015ffff) AM_READWRITE(hng64_3d_1_r,hng64_3d_2_w) AM_BASE(&hng64_3d_1) // 3D Display Buffer A AM_RANGE(0x30200000, 0x3025ffff) AM_READWRITE(hng64_3d_2_r,hng64_3d_2_w) AM_BASE(&hng64_3d_2) // 3D Display Buffer B @@ -1079,10 +1080,11 @@ static ADDRESS_MAP_START( hng_map, ADDRESS_SPACE_PROGRAM, 32 ) AM_RANGE(0x60000000, 0x601fffff) AM_RAM // Sound ?? AM_RANGE(0x60200000, 0x603fffff) AM_READWRITE(hng64_soundram_r, hng64_soundram_w) // uploads the v53 sound program here, elsewhere on ss64-2 */ - // ? + // These are sound ports of some sort // AM_RANGE(0x68000000, 0x68000003) AM_WRITENOP // ?? // AM_RANGE(0x68000004, 0x68000007) AM_READNOP // ?? // AM_RANGE(0x68000008, 0x6800000b) AM_WRITENOP // ?? +// AM_RANGE(0x6f000000, 0x6f000003) AM_WRITENOP // halt / reset line for the sound CPU // Communications AM_RANGE(0xc0000000, 0xc0000fff) AM_READWRITE(hng64_com_r, hng64_com_w) AM_BASE(&hng64_com_ram) diff --git a/src/mame/video/hng64.c b/src/mame/video/hng64.c index 835c80b7660..10dc4e75ae9 100644 --- a/src/mame/video/hng64.c +++ b/src/mame/video/hng64.c @@ -29,8 +29,10 @@ tilemap *hng64_tilemap3_16x16_alt; UINT32 *hng64_spriteram; + UINT32 *hng64_videoregs; UINT32 *hng64_spriteregs; +UINT32 *hng64_3dregs; UINT32 *hng64_tcram ; @@ -435,24 +437,25 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta /* Transition_Control Memory Region Map * ------------------------------ * - * UINT32 | Bytes | Use - * -------+-76543210-+---------- - * 0 | | - * 1 | | - * 2 | | - * 3 | | - * 4 | | - * 5 | | - * 6 | --xxxxxx | I popped into Buriki and saw some of these values changing to the same as 7. hmmmm... - * 7 | --xxxxxx | Almost certainly RGB darkening - * 8 | | - * 9 | | - * 10 | --xxxxxx | Almost certainly RGB brightening - * 11 | xxxxxxxx | Unknown - looks like an ARGB value - it seems to change when the scene changes - * 12 | | - * 13 | | - * 14 | | - * 15 | | + * UINT32 | Bits | Use + * | 3322 2222 2222 1111 1111 11 | + * -------+-1098-7654-3210-9876-5432-1098-7654-3210-+---------------- + * 0 | | + * 1 | xxxx xxxx xxxx xxxx yyyy yyyy yyyy yyyy | Min X / Min Y visible area rectangle values + * 2 | xxxx xxxx xxxx xxxx yyyy yyyy yyyy yyyy | Max X / Max Y visible area rectangle values (added up with the Min X / Min Y) + * 3 | | + * 4 | | + * 5 | | + * 6 | ---- ---- xxxx xxxx xxxx xxxx xxxx xxxx | I popped into Buriki and saw some of these values changing to the same as 7. hmmmm... + * 7 | ---- ---- xxxx xxxx xxxx xxxx xxxx xxxx | Almost certainly RGB darkening + * 8 | | + * 9 | | + * 10 | ---- ---- xxxx xxxx xxxx xxxx xxxx xxxx | Almost certainly RGB brightening + * 11 | xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx | Unknown - looks like an ARGB value - it seems to change when the scene changes + * 12 | | + * 13 | | + * 14 | | + * 15 | | * * Various bits change depending on what is happening in the scene. * These bits may set which 'layer' is affected by the blending. @@ -597,6 +600,19 @@ static void PerformFrustumClip(struct polygon *p) ; //static void DrawWireframe(struct polygon *p, bitmap_t *bitmap) ; static void DrawShaded(running_machine *machine, struct polygon *p, bitmap_t *bitmap) ; +/* 3D/framebuffer video registers + * ------------------------------ + * + * UINT32 | Bits | Use + * | 3322 2222 2222 1111 1111 11 | + * -------+-1098-7654-3210-9876-5432-1098-7654-3210-+---------------- + * 0 | ???? ???? ???? ???? ccc? ???? ???? ???? | framebuffer color base, 0x311800 in Fatal Fury WA, 0x313800 in Buriki One + * 1 | | + * 2 | ???? ???? ???? ???? ???? ???? ???? ???? | camera / framebuffer global x/y? Actively used by Samurai Shodown 64 2 + * 3 | ---- --?x ---- ---- ---- ---- ---- ---- | unknown, unsetted by Buriki One and setted by Fatal Fury WA, buffering mode? + * 4-11 | ---- ???? ---- ???? ---- ???? ---- ???? | Table filled with 0x0? data + * + */ static void draw3d(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) { @@ -749,6 +765,8 @@ static void draw3d(running_machine *machine, bitmap_t *bitmap, const rectangle * // 00110000 00000000 00000100 01000100 0400-0000 00007fff 00000000 00000020 // ---- pal ---- -------- -------- -------- not used (known) paletteState = (workingList[i+4] & 0xff000000) >> 24 ; + paletteState+=((hng64_3dregs[0x00/4] & 0x2000) >> 9); //framebuffer base color reg? Used by Buriki One + /* FIXME: Buriki One door colors in attract mode still aren't quite right, investigate... */ break ; case 0x0100: @@ -1723,7 +1741,7 @@ VIDEO_UPDATE( hng64 ) UINT16 tileflags0, tileflags1; UINT16 tileflags2, tileflags3; - bitmap_fill(bitmap, 0, screen->machine->pens[0]); //<- user selectable pen too? + bitmap_fill(bitmap, 0, screen->machine->pens[0]); //FIXME: Fatal Fury WA test mode doesn't use pen 0... bitmap_fill(screen->machine->priority_bitmap, cliprect, 0x00); animmask = hng64_videoregs[0x0b]; @@ -1832,6 +1850,12 @@ VIDEO_UPDATE( hng64 ) hng64_videoregs[0x0e]); if (1) + popmessage("3D: %08x %08x %08x %08x : %08x %08x %08x %08x : %08x %08x %08x %08x", + hng64_3dregs[0x00/4],hng64_3dregs[0x04/4],hng64_3dregs[0x08/4],hng64_3dregs[0x0c/4], + hng64_3dregs[0x10/4],hng64_3dregs[0x14/4],hng64_3dregs[0x18/4],hng64_3dregs[0x1c/4], + hng64_3dregs[0x20/4],hng64_3dregs[0x24/4],hng64_3dregs[0x28/4],hng64_3dregs[0x2c/4]); + + if (0) popmessage("TC: %08x %08x %08x %08x : %08x %08x %08x %08x : %08x %08x %08x %08x : %08x %08x %08x %08x : %08x %08x %08x %08x : %08x %08x %08x %08x", hng64_tcram[0x00/4], hng64_tcram[0x04/4],