-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
74 lines (55 loc) · 1.46 KB
/
main.cpp
File metadata and controls
74 lines (55 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/* copyright enumer8 2025 */
/* Aquarius - tiny aquarium scene
programmed for the Dreamcast
using PVR */
#include "matrix.hpp"
#include "dcm.h"
#include <dc/pvr.h>
#include <dc/maple.h>
#include <dc/fmath.h>
#include <dc/maple/controller.h>
#include <dc/biosfont.h>
#include <dc/perfctr.h>
// #include <dc/matrix.h>
// #include <dc/matrix3d.h>
#include <kos.h>
#include <stdio.h>
#include <stdbool.h>
// thanks Falco
//void testing_time(){
//
// uint64 start_time = timer_ns_gettime64();
// int32 i, j;
// for(i = 0; i < 50000; i++){
// for(j = 0; j < 360; j++)
// volatile int32 temp = fast_deg2fsca(j);
//
// }
//
// uint64 end_time = timer_ns_gettime64();
// printf("Took %llu nanoseconds:\n", end_time - start_time);
//}
void testing_time_bit(){
uint64 start_time = timer_ns_gettime64();
int32 i, j;
for(i = 0; i < 75000; i++){
for(j = 0; j < 360; j++)
volatile int32 temp = fast_deg2fsca_bit(j);
}
uint64 end_time = timer_ns_gettime64();
printf("Took %llu nanoseconds:\n", end_time - start_time);
}
// MAIN STARTS HERE!
int main(int argc, char **argv){
vid_set_mode(DM_640x480, PM_RGB565);
pvr_init_defaults();
init_scale_matrix(32.4f, 30.1f, 9.34f);
pvr_set_bg_color(0.9f, 0.0f, 0.4f);
testing_time_bit();
// PVR SCENE SETUP - OPAQUE DRAWING
pvr_scene_begin();
pvr_list_begin(PVR_LIST_OP_POLY);
pvr_list_finish();
pvr_scene_finish();
return 0;
}