diff --git a/src/mame/drivers/taitoair.c b/src/mame/drivers/taitoair.c index 0b6df18ffe6..0773dc2c1c6 100644 --- a/src/mame/drivers/taitoair.c +++ b/src/mame/drivers/taitoair.c @@ -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(0x3405, 0x3405) AM_WRITE(dsp_x_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(0x3409, 0x3409) AM_WRITE(dsp_y_eyecoord_w) 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(0x341b, 0x341b) AM_WRITE(dsp_sqrt_r) // AM_RANGE(0x341c, 0x341c) AM_READ(dsp_sqrt_flags1_r) diff --git a/src/mame/includes/taitoair.h b/src/mame/includes/taitoair.h index bc80ec503a0..2e40e7548f8 100644 --- a/src/mame/includes/taitoair.h +++ b/src/mame/includes/taitoair.h @@ -51,7 +51,7 @@ public: INT16 m_frustumBottom; 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_frustum_left_w ); WRITE16_HANDLER( dsp_frustum_bottom_w ); +READ16_HANDLER( dsp_x_return_r ); +READ16_HANDLER( dsp_y_return_r ); + diff --git a/src/mame/video/taitoair.c b/src/mame/video/taitoair.c index c206d822a4e..09c0b6072da 100644 --- a/src/mame/video/taitoair.c +++ b/src/mame/video/taitoair.c @@ -518,6 +518,31 @@ WRITE16_HANDLER( dsp_rasterize_w ) { /* Does the pixel projection */ /* 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(); + + /* 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(); /* 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, result); - /* 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; + return result[0]; } +READ16_HANDLER( dsp_y_return_r ) +{ + taitoair_state *state = space->machine().driver_data(); + /* 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 ) { @@ -550,7 +586,7 @@ VIDEO_START( taitoair ) height = machine.primary_screen->height(); 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_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 ) @@ -603,8 +639,8 @@ SCREEN_UPDATE( taitoair ) tc0080vco_tilemap_draw(state->m_tc0080vco, bitmap, cliprect, 2, 0, 0); /* Hacky 3d bitmap */ - copybitmap_trans(bitmap, state->m_buffer3d, 0, 0, 0, 0, cliprect, 0); - bitmap_fill(state->m_buffer3d, cliprect, 0); + //copybitmap_trans(bitmap, state->m_buffer3d, 0, 0, 0, 0, cliprect, 0); + //bitmap_fill(state->m_buffer3d, cliprect, 0); return 0; }