mirror of
https://github.com/holub/mame
synced 2025-05-19 20:29:09 +03:00
Allow the game to interpretate the values
This commit is contained in:
parent
b92d532262
commit
bf1c10d54c
@ -477,11 +477,11 @@ static ADDRESS_MAP_START( DSP_map_data, AS_DATA, 16 )
|
|||||||
AM_RANGE(0x3404, 0x3404) AM_WRITE(dsp_frustum_left_w)
|
AM_RANGE(0x3404, 0x3404) AM_WRITE(dsp_frustum_left_w)
|
||||||
AM_RANGE(0x3405, 0x3405) AM_WRITE(dsp_x_eyecoord_w)
|
AM_RANGE(0x3405, 0x3405) AM_WRITE(dsp_x_eyecoord_w)
|
||||||
AM_RANGE(0x3406, 0x3406) AM_WRITE(dsp_z_eyecoord_w)
|
AM_RANGE(0x3406, 0x3406) AM_WRITE(dsp_z_eyecoord_w)
|
||||||
// AM_RANGE(0x3407, 0x3407) AM_READ(?)
|
AM_RANGE(0x3407, 0x3407) AM_READ(dsp_x_return_r)
|
||||||
AM_RANGE(0x3408, 0x3408) AM_WRITE(dsp_frustum_bottom_w)
|
AM_RANGE(0x3408, 0x3408) AM_WRITE(dsp_frustum_bottom_w)
|
||||||
AM_RANGE(0x3409, 0x3409) AM_WRITE(dsp_y_eyecoord_w)
|
AM_RANGE(0x3409, 0x3409) AM_WRITE(dsp_y_eyecoord_w)
|
||||||
AM_RANGE(0x340a, 0x340a) AM_WRITE(dsp_rasterize_w) /* Just a (lame) guess */
|
AM_RANGE(0x340a, 0x340a) AM_WRITE(dsp_rasterize_w) /* Just a (lame) guess */
|
||||||
// AM_RANGE(0x340b, 0x340b) AM_READ(dsp_projection_y_r)
|
AM_RANGE(0x340b, 0x340b) AM_READ(dsp_y_return_r)
|
||||||
// AM_RANGE(0x3418, 0x341a) AM_WRITE(dsp_sqrt_w)
|
// AM_RANGE(0x3418, 0x341a) AM_WRITE(dsp_sqrt_w)
|
||||||
// AM_RANGE(0x341b, 0x341b) AM_WRITE(dsp_sqrt_r)
|
// AM_RANGE(0x341b, 0x341b) AM_WRITE(dsp_sqrt_r)
|
||||||
// AM_RANGE(0x341c, 0x341c) AM_READ(dsp_sqrt_flags1_r)
|
// AM_RANGE(0x341c, 0x341c) AM_READ(dsp_sqrt_flags1_r)
|
||||||
|
@ -51,7 +51,7 @@ public:
|
|||||||
INT16 m_frustumBottom;
|
INT16 m_frustumBottom;
|
||||||
INT16 m_eyecoordBuffer[4]; /* homogeneous */
|
INT16 m_eyecoordBuffer[4]; /* homogeneous */
|
||||||
|
|
||||||
bitmap_t *m_buffer3d;
|
//bitmap_t *m_buffer3d;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -67,3 +67,6 @@ WRITE16_HANDLER( dsp_z_eyecoord_w );
|
|||||||
WRITE16_HANDLER( dsp_rasterize_w );
|
WRITE16_HANDLER( dsp_rasterize_w );
|
||||||
WRITE16_HANDLER( dsp_frustum_left_w );
|
WRITE16_HANDLER( dsp_frustum_left_w );
|
||||||
WRITE16_HANDLER( dsp_frustum_bottom_w );
|
WRITE16_HANDLER( dsp_frustum_bottom_w );
|
||||||
|
READ16_HANDLER( dsp_x_return_r );
|
||||||
|
READ16_HANDLER( dsp_y_return_r );
|
||||||
|
|
||||||
|
@ -518,6 +518,31 @@ WRITE16_HANDLER( dsp_rasterize_w )
|
|||||||
{
|
{
|
||||||
/* Does the pixel projection */
|
/* Does the pixel projection */
|
||||||
/* Presumably called when the eye coordinates are all loaded up in their x,y,z buffer */
|
/* Presumably called when the eye coordinates are all loaded up in their x,y,z buffer */
|
||||||
|
#if 0
|
||||||
|
taitoair_state *state = space->machine().driver_data<taitoair_state>();
|
||||||
|
|
||||||
|
/* Construct a frustum from the system's most recently set left and bottom extents */
|
||||||
|
float m[16];
|
||||||
|
airInfernoFrustum(state->m_frustumLeft, state->m_frustumBottom, m);
|
||||||
|
|
||||||
|
int result[2];
|
||||||
|
projectEyeCoordToScreen(m,
|
||||||
|
32*16, /* These are defined in the machine ctor */
|
||||||
|
28*16, /* not sure how to get them here or if they're even correct */
|
||||||
|
state->m_eyecoordBuffer,
|
||||||
|
result);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Do not splat invalid results */
|
||||||
|
//if (result[0] == -1 && result[1] == -1)
|
||||||
|
// return;
|
||||||
|
|
||||||
|
/* Splat a (any) non-translucent color */
|
||||||
|
//*BITMAP_ADDR16(state->m_buffer3d, result[1], result[0]) = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
READ16_HANDLER( dsp_x_return_r )
|
||||||
|
{
|
||||||
taitoair_state *state = space->machine().driver_data<taitoair_state>();
|
taitoair_state *state = space->machine().driver_data<taitoair_state>();
|
||||||
|
|
||||||
/* Construct a frustum from the system's most recently set left and bottom extents */
|
/* Construct a frustum from the system's most recently set left and bottom extents */
|
||||||
@ -531,15 +556,26 @@ WRITE16_HANDLER( dsp_rasterize_w )
|
|||||||
state->m_eyecoordBuffer,
|
state->m_eyecoordBuffer,
|
||||||
result);
|
result);
|
||||||
|
|
||||||
/* Do not splat invalid results */
|
return result[0];
|
||||||
if (result[0] == -1 && result[1] == -1)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* Splat a (any) non-translucent color */
|
|
||||||
*BITMAP_ADDR16(state->m_buffer3d, result[1], result[0]) = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
READ16_HANDLER( dsp_y_return_r )
|
||||||
|
{
|
||||||
|
taitoair_state *state = space->machine().driver_data<taitoair_state>();
|
||||||
|
|
||||||
|
/* Construct a frustum from the system's most recently set left and bottom extents */
|
||||||
|
float m[16];
|
||||||
|
airInfernoFrustum(state->m_frustumLeft, state->m_frustumBottom, m);
|
||||||
|
|
||||||
|
int result[2];
|
||||||
|
projectEyeCoordToScreen(m,
|
||||||
|
32*16, /* These are defined in the machine ctor */
|
||||||
|
28*16, /* not sure how to get them here or if they're even correct */
|
||||||
|
state->m_eyecoordBuffer,
|
||||||
|
result);
|
||||||
|
|
||||||
|
return result[1];
|
||||||
|
}
|
||||||
|
|
||||||
VIDEO_START( taitoair )
|
VIDEO_START( taitoair )
|
||||||
{
|
{
|
||||||
@ -550,7 +586,7 @@ VIDEO_START( taitoair )
|
|||||||
height = machine.primary_screen->height();
|
height = machine.primary_screen->height();
|
||||||
state->m_framebuffer[0] = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
|
state->m_framebuffer[0] = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
|
||||||
state->m_framebuffer[1] = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
|
state->m_framebuffer[1] = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
|
||||||
state->m_buffer3d = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
|
//state->m_buffer3d = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
|
||||||
}
|
}
|
||||||
|
|
||||||
SCREEN_UPDATE( taitoair )
|
SCREEN_UPDATE( taitoair )
|
||||||
@ -603,8 +639,8 @@ SCREEN_UPDATE( taitoair )
|
|||||||
tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 2, 0, 0);
|
tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 2, 0, 0);
|
||||||
|
|
||||||
/* Hacky 3d bitmap */
|
/* Hacky 3d bitmap */
|
||||||
copybitmap_trans(bitmap, state->m_buffer3d, 0, 0, 0, 0, cliprect, 0);
|
//copybitmap_trans(bitmap, state->m_buffer3d, 0, 0, 0, 0, cliprect, 0);
|
||||||
bitmap_fill(state->m_buffer3d, cliprect, 0);
|
//bitmap_fill(state->m_buffer3d, cliprect, 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user