void global_polygon_textured(ta_parameter_writer& writer,
                             uint32_t list,
                             const mesh_material * material)
{
   uint32_t parameter_control_word = para_control::para_type::polygon_or_modifier_volume
                                   | list
                                   | obj_control::col_type::intensity_mode_1
                                   | obj_control::gouraud
                                   | obj_control::shadow
                                   | obj_control::texture
                                   ;

   uint32_t isp_tsp_instruction_word = isp_tsp_instruction_word::depth_compare_mode::greater
                                     | isp_tsp_instruction_word::culling_mode::no_culling;

   uint32_t tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one
                                 | tsp_instruction_word::dst_alpha_instr::zero
                                 | tsp_instruction_word::texture_shading_instruction::decal
                                 | tsp_instruction_word::fog_control::no_fog
                                 | tsp_instruction_word::texture_u_size::from_int(material->width)
                                 | tsp_instruction_word::texture_v_size::from_int(material->height);
                                 ;

   uint32_t texture_address = texture_memory_alloc.texture.start + material->offset;
   uint32_t texture_control_word = texture_control_word::pixel_format::_565
                                 | texture_control_word::scan_order::twiddled
                                 | texture_control_word::vq_compressed
                                 | texture_control_word::texture_address(texture_address / 8)
                                 ;

   float a = 1.0f;
   float r = 1.0f;
   float g = 1.0f;
   float b = 1.0f;

  writer.append<ta_global_parameter::polygon_type_1>() =
    ta_global_parameter::polygon_type_1(parameter_control_word,
                                        isp_tsp_instruction_word,
                                        tsp_instruction_word,
                                        texture_control_word,
                                        a,
                                        r,
                                        g,
                                        b
                                        );
}

void global_polygon_untextured(ta_parameter_writer& writer,
                               uint32_t list)
{
   uint32_t parameter_control_word = para_control::para_type::polygon_or_modifier_volume
                                   | list
                                   | obj_control::col_type::intensity_mode_1
                                   | obj_control::gouraud
                                   | obj_control::shadow
                                   ;

   uint32_t isp_tsp_instruction_word = isp_tsp_instruction_word::depth_compare_mode::greater
                                     | isp_tsp_instruction_word::culling_mode::no_culling;

   uint32_t tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one
                                 | tsp_instruction_word::dst_alpha_instr::zero
                                 | tsp_instruction_word::texture_shading_instruction::decal
                                 | tsp_instruction_word::fog_control::no_fog
                                 ;

   uint32_t texture_control_word = 0;

   float a = 1.0f;
   float r = 1.0f;
   float g = 1.0f;
   float b = 1.0f;

  writer.append<ta_global_parameter::polygon_type_1>() =
    ta_global_parameter::polygon_type_1(parameter_control_word,
                                        isp_tsp_instruction_word,
                                        tsp_instruction_word,
                                        texture_control_word,
                                        a,
                                        r,
                                        g,
                                        b
                                        );
}
