1#!/usr/bin/perl 2 3$handle = STDOUT; 4 5print $handle <<ENDDOC; 6/*---------------------------------------------------------------------------* 7 Project: TwlSDK - FX - 8 File: fx_sincos.c 9 10 Copyright 2003-2008 Nintendo. All rights reserved. 11 12 These coded instructions, statements, and computer programs contain 13 proprietary information of Nintendo of America Inc. and/or Nintendo 14 Company Ltd., and are protected by Federal copyright law. They may 15 not be disclosed to third parties or copied or duplicated in any form, 16 in whole or in part, without the prior written consent of Nintendo. 17 18 *---------------------------------------------------------------------------*/ 19#include <nitro/fx/fx_trig.h> 20 21const fx16 FX_SinCosTable_[4096 * 2] = { 22ENDDOC 23 24 for ($i = 0; $i < 4096; ++$i) { 25 my $deg = $i * 360 / 4096.0; 26 my $valsin = sprintf("%.0f", sin($i * 6.28318530717958647692 / 4096.0) * 4096.0); 27 my $valcos = sprintf("%.0f", cos($i * 6.28318530717958647692 / 4096.0) * 4096.0); 28 if ($i == 4095) { 29 printf $handle " (fx16)0x%04x, (fx16)0x%04x // %.3f, %.3f ( deg = %f )\n", ($valsin & 0xffff), ($valcos & 0xffff), ($valsin / 4096.0), ($valcos / 4096.0), $deg; 30 } else { 31 printf $handle " (fx16)0x%04x, (fx16)0x%04x, // %.3f, %.3f ( deg = %f )\n", ($valsin & 0xffff), ($valcos & 0xffff), ($valsin / 4096.0), ($valcos / 4096.0), $deg; 32 } 33 } 34 35print $handle "};\n"; 36 37 38 39