Cleanup, accuracy, and a fix

This commit is contained in:
Clownacy 2019-02-01 13:49:45 +00:00
parent d52a69b0e6
commit 77fc01311f
3 changed files with 12 additions and 6 deletions

View file

@ -1,12 +1,15 @@
#include "Escape.h"
#include "WindowsWrapper.h"
#include "Draw.h"
#include "KeyControl.h"
#include "Main.h"
int Call_Escape()
{
RECT rc = {0, 128, 208, 144};
while (Flip_SystemTask())
do
{
//Get pressed keys
GetTrg();
@ -30,8 +33,9 @@ int Call_Escape()
//Draw screen
CortBox(&grcFull, 0x000000);
PutBitmap3(&grcFull, 56, 112, &rc, 26);
//PutFramePerSecound();
PutFramePerSecound();
}
while (Flip_SystemTask());
//Quit if window is closed
gKeyTrg = 0;

View file

@ -1,3 +1,5 @@
#include "Flags.h"
#include <cstring>
#include <stdint.h>

View file

@ -9,17 +9,17 @@ void InitTriangleTable()
//Sine
for (int i = 0; i < 0x100; ++i )
{
float v0 = (float)i * 6.2831998 / 256.0;
float v0 = i * 6.2831998 / 256.0;
gSin[i] = (int)(sinf(v0) * 512.0);
}
//Tangent
for (int ia = 0; ia < 0x21; ++ia )
for (int i = 0; i < 0x21; ++i )
{
float a = (float)ia * 6.2831855 / 256.0;
float a = i * 6.2831855 / 256.0;
float v2 = sinf(a);
float b = v2 / cosf(a);
gTan[ia] = (int16_t)(b * 8192.0);
gTan[i] = (int16_t)(b * 8192.0);
}
}