diff options
author | angelosa <salese_corp_ltd@email.it> | 2018-02-10 15:38:12 +0100 |
---|---|---|
committer | angelosa <salese_corp_ltd@email.it> | 2018-02-10 18:00:37 +0100 |
commit | c5cf2f7d97077872db9e51471e00da45e7cfa84e (patch) | |
tree | 574628e531be290f4ebf4fc393f1b8364597f247 | |
parent | 167f5f18b001b03a9fa713370818f8c52a8a8d6e (diff) |
model2.cpp: state-ized frame_start / geo_parse (nw)
-rw-r--r-- | src/mame/includes/model2.h | 2 | ||||
-rw-r--r-- | src/mame/video/model2.cpp | 20 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/mame/includes/model2.h b/src/mame/includes/model2.h index bccb952c115..a61cf4cea5b 100644 --- a/src/mame/includes/model2.h +++ b/src/mame/includes/model2.h @@ -249,6 +249,8 @@ public: uint32_t copro_fifoout_pop(address_space &space, uint32_t offset, uint32_t mem_mask); void copro_fifoout_push(device_t *device, uint32_t data,uint32_t offset,uint32_t mem_mask); + void model2_3d_frame_start( void ); + void geo_parse( void ); void model2_3d_frame_end( bitmap_rgb32 &bitmap, const rectangle &cliprect ); void model2_timers(machine_config &config); diff --git a/src/mame/video/model2.cpp b/src/mame/video/model2.cpp index 6c019f31ddb..e5685f91dfc 100644 --- a/src/mame/video/model2.cpp +++ b/src/mame/video/model2.cpp @@ -884,9 +884,9 @@ static void model2_3d_project( triangle *tri ) } /* 3D Rasterizer frame start: Resets frame variables */ -static void model2_3d_frame_start( model2_state *state ) +void model2_state::model2_3d_frame_start( void ) { - raster_state *raster = state->m_raster; + raster_state *raster = m_raster; /* reset the triangle list index */ raster->tri_list_index = 0; @@ -2550,13 +2550,13 @@ static uint32_t * geo_process_command( geo_state *geo, uint32_t opcode, uint32_t return input; } -static void geo_parse( model2_state *state ) +void model2_state::geo_parse( void ) { - uint32_t address = (state->m_geo_read_start_address/4); - uint32_t *input = &state->m_bufferram[address]; + uint32_t address = (m_geo_read_start_address & 0x7ffff)/4; + uint32_t *input = &m_bufferram[address]; uint32_t opcode; - while( input != nullptr && (input - state->m_bufferram) < 0x20000 ) + while( input != nullptr && (input - m_bufferram) < 0x20000 ) { /* read in the opcode */ opcode = *input++; @@ -2568,14 +2568,14 @@ static void geo_parse( model2_state *state ) address = (opcode & 0x7FFFF) / 4; /* update our pointer */ - input = &state->m_bufferram[address]; + input = &m_bufferram[address]; /* go again */ continue; } /* process it */ - input = geo_process_command( state->m_geo, opcode, input ); + input = geo_process_command( m_geo, opcode, input ); } } @@ -2620,10 +2620,10 @@ uint32_t model2_state::screen_update_model2(screen_device &screen, bitmap_rgb32 copybitmap_trans(bitmap, m_sys24_bitmap, 0, 0, 0, 0, cliprect, 0); /* tell the rasterizer we're starting a frame */ - model2_3d_frame_start(this); + model2_3d_frame_start(); /* let the geometry engine do it's thing */ /* TODO: don't do it here! */ - geo_parse(this); + geo_parse(); /* have the rasterizer output the frame */ model2_3d_frame_end( bitmap, cliprect ); |