hng64: Start to document 3d / framebuffer video registers, implemented a quick hook-up that fixes Buriki One 3d model colors minus one case [Angelo Salese]

This commit is contained in:
Angelo Salese 2009-11-28 17:33:46 +00:00
parent 723bf8dfe3
commit d168f1b8c0
2 changed files with 53 additions and 27 deletions

View File

@ -27,11 +27,12 @@ Notes:
* The Japanese text on the Roads Edge network screen says : "waiting to connect network... please wait without touching machine" * The Japanese text on the Roads Edge network screen says : "waiting to connect network... please wait without touching machine"
ToDo: 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 * work out the purpose of the interrupts and how many are needed
* correct game speed (seems too fast) * 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: 2d:
* scroll (base registers?) * scroll (base registers?)
@ -469,6 +470,7 @@ extern WRITE32_HANDLER( hng64_videoram_w );
extern UINT32 *hng64_spriteram, *hng64_videoregs, *hng64_spriteregs ; extern UINT32 *hng64_spriteram, *hng64_videoregs, *hng64_spriteregs ;
extern UINT32 *hng64_videoram ; extern UINT32 *hng64_videoram ;
extern UINT32 *hng64_tcram ; extern UINT32 *hng64_tcram ;
extern UINT32 *hng64_3dregs;
extern UINT32 hng64_dls[2][0x81] ; extern UINT32 hng64_dls[2][0x81] ;
@ -792,7 +794,7 @@ static READ32_HANDLER( racing_io_r )
static READ32_HANDLER( hng64_dualport_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: command table:
@ -830,7 +832,7 @@ Beast Busters 2 outputs (all at offset == 0x1c):
static WRITE32_HANDLER( hng64_dualport_w ) 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]); COMBINE_DATA (&hng64_dualport[offset]);
} }
@ -898,7 +900,6 @@ static WRITE32_HANDLER( dl_control_w )
activeBuffer = 0; activeBuffer = 0;
if (data & 2) if (data & 2)
activeBuffer = 1; activeBuffer = 1;
} }
#ifdef UNUSED_FUNCTION #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) AM_RANGE(0x20300218, 0x2030021b) AM_READ(unk_vreg_r)
// 3d? // 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(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 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(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 */ 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(0x68000000, 0x68000003) AM_WRITENOP // ??
// AM_RANGE(0x68000004, 0x68000007) AM_READNOP // ?? // AM_RANGE(0x68000004, 0x68000007) AM_READNOP // ??
// AM_RANGE(0x68000008, 0x6800000b) AM_WRITENOP // ?? // AM_RANGE(0x68000008, 0x6800000b) AM_WRITENOP // ??
// AM_RANGE(0x6f000000, 0x6f000003) AM_WRITENOP // halt / reset line for the sound CPU
// Communications // Communications
AM_RANGE(0xc0000000, 0xc0000fff) AM_READWRITE(hng64_com_r, hng64_com_w) AM_BASE(&hng64_com_ram) AM_RANGE(0xc0000000, 0xc0000fff) AM_READWRITE(hng64_com_r, hng64_com_w) AM_BASE(&hng64_com_ram)

View File

@ -29,8 +29,10 @@ tilemap *hng64_tilemap3_16x16_alt;
UINT32 *hng64_spriteram; UINT32 *hng64_spriteram;
UINT32 *hng64_videoregs; UINT32 *hng64_videoregs;
UINT32 *hng64_spriteregs; UINT32 *hng64_spriteregs;
UINT32 *hng64_3dregs;
UINT32 *hng64_tcram ; UINT32 *hng64_tcram ;
@ -435,24 +437,25 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
/* Transition_Control Memory Region Map /* Transition_Control Memory Region Map
* ------------------------------ * ------------------------------
* *
* UINT32 | Bytes | Use * UINT32 | Bits | Use
* -------+-76543210-+---------- * | 3322 2222 2222 1111 1111 11 |
* 0 | | * -------+-1098-7654-3210-9876-5432-1098-7654-3210-+----------------
* 1 | | * 0 | |
* 2 | | * 1 | xxxx xxxx xxxx xxxx yyyy yyyy yyyy yyyy | Min X / Min Y visible area rectangle values
* 3 | | * 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)
* 4 | | * 3 | |
* 5 | | * 4 | |
* 6 | --xxxxxx | I popped into Buriki and saw some of these values changing to the same as 7. hmmmm... * 5 | |
* 7 | --xxxxxx | Almost certainly RGB darkening * 6 | ---- ---- xxxx xxxx xxxx xxxx xxxx xxxx | I popped into Buriki and saw some of these values changing to the same as 7. hmmmm...
* 8 | | * 7 | ---- ---- xxxx xxxx xxxx xxxx xxxx xxxx | Almost certainly RGB darkening
* 9 | | * 8 | |
* 10 | --xxxxxx | Almost certainly RGB brightening * 9 | |
* 11 | xxxxxxxx | Unknown - looks like an ARGB value - it seems to change when the scene changes * 10 | ---- ---- xxxx xxxx xxxx xxxx xxxx xxxx | Almost certainly RGB brightening
* 12 | | * 11 | xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx | Unknown - looks like an ARGB value - it seems to change when the scene changes
* 13 | | * 12 | |
* 14 | | * 13 | |
* 15 | | * 14 | |
* 15 | |
* *
* Various bits change depending on what is happening in the scene. * Various bits change depending on what is happening in the scene.
* These bits may set which 'layer' is affected by the blending. * 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 DrawWireframe(struct polygon *p, bitmap_t *bitmap) ;
static void DrawShaded(running_machine *machine, 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 ) 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 // 00110000 00000000 00000100 01000100 0400-0000 00007fff 00000000 00000020
// ---- pal ---- -------- -------- -------- not used (known) // ---- pal ---- -------- -------- -------- not used (known)
paletteState = (workingList[i+4] & 0xff000000) >> 24 ; 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 ; break ;
case 0x0100: case 0x0100:
@ -1723,7 +1741,7 @@ VIDEO_UPDATE( hng64 )
UINT16 tileflags0, tileflags1; UINT16 tileflags0, tileflags1;
UINT16 tileflags2, tileflags3; 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); bitmap_fill(screen->machine->priority_bitmap, cliprect, 0x00);
animmask = hng64_videoregs[0x0b]; animmask = hng64_videoregs[0x0b];
@ -1832,6 +1850,12 @@ VIDEO_UPDATE( hng64 )
hng64_videoregs[0x0e]); hng64_videoregs[0x0e]);
if (1) 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", 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[0x00/4],
hng64_tcram[0x04/4], hng64_tcram[0x04/4],