aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index 9a22000..4b2b2d6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -25,8 +25,10 @@ WITH REGARD TO THIS SOFTWARE.
25// Config parameters. 25// Config parameters.
26// 26//
27 27
28#ifndef TEXT_LAYER 28#if !defined(TEXT_MODE) || TEXT_MODE == 0
29#define TEXT_LAYER ppu.fg 29#define TEXT_LAYER ppu.fg
30#else
31#define TEXT_LAYER ppu.bg
30#endif 32#endif
31 33
32#ifndef CONTROL_METHODS 34#ifndef CONTROL_METHODS
@@ -39,15 +41,21 @@ WITH REGARD TO THIS SOFTWARE.
39#elif PROF_ENABLE == 1 41#elif PROF_ENABLE == 1
40#define PROF(F,VAR) (profile_start(),(F),(VAR) = MAX(profile_stop(), (VAR))) 42#define PROF(F,VAR) (profile_start(),(F),(VAR) = MAX(profile_stop(), (VAR)))
41#endif 43#endif
42#define PROF_SHOW(X,Y) \ 44#ifndef PROF_SHOW_X
45#define PROF_SHOW_X 0
46#endif
47#ifndef PROF_SHOW_Y
48#define PROF_SHOW_Y 0
49#endif
50#define PROF_SHOW() \
43 do { \ 51 do { \
44 txt_position((X), (Y));\ 52 txt_position((PROF_SHOW_X), (PROF_SHOW_Y));\
45 txt_printf("INPUT: %lu ", input_cycles);\ 53 txt_printf("INPUT: %lu ", input_cycles);\
46 txt_position((X), (Y)+1);\ 54 txt_position((PROF_SHOW_X), (PROF_SHOW_Y)+1);\
47 txt_printf("EVAL: %lu ", eval_cycles);\ 55 txt_printf("EVAL: %lu ", eval_cycles);\
48 txt_position((X), (Y)+2);\ 56 txt_position((PROF_SHOW_X), (PROF_SHOW_Y)+2);\
49 txt_printf("FLIP: %lu ", flip_cycles);\ 57 txt_printf("FLIP: %lu ", flip_cycles);\
50 txt_position((X), (Y)+3);\ 58 txt_position((PROF_SHOW_X), (PROF_SHOW_Y)+3);\
51 txt_printf("MIX: %lu ", mix_cycles);\ 59 txt_printf("MIX: %lu ", mix_cycles);\
52 } while (0) 60 } while (0)
53#define PROF_INIT() \ 61#define PROF_INIT() \
@@ -57,7 +65,7 @@ WITH REGARD TO THIS SOFTWARE.
57 u32 mix_cycles = 0; 65 u32 mix_cycles = 0;
58#else 66#else
59#define PROF(F,VAR) (F) 67#define PROF(F,VAR) (F)
60#define PROF_SHOW(X,Y) 68#define PROF_SHOW()
61#define PROF_INIT() 69#define PROF_INIT()
62#endif 70#endif
63 71
@@ -405,7 +413,6 @@ int main(void) {
405 // Register interrupts. 413 // Register interrupts.
406 irq_init(); 414 irq_init();
407 irs_set(IRQ_VBLANK, sound_vsync); 415 irs_set(IRQ_VBLANK, sound_vsync);
408 // irs_set(IRQ_TIMER_1, irs_stop_sample);
409 416
410 // Initialize VM. 417 // Initialize VM.
411 dma_fill(&u, 0, sizeof(u), 3); 418 dma_fill(&u, 0, sizeof(u), 3);
@@ -427,7 +434,7 @@ int main(void) {
427 PROF(handle_input(&u), input_cycles); 434 PROF(handle_input(&u), input_cycles);
428 PROF(evaluxn(&u, mempeek16(devscreen->dat, 0)), eval_cycles); 435 PROF(evaluxn(&u, mempeek16(devscreen->dat, 0)), eval_cycles);
429 PROF(sound_mix(), mix_cycles); 436 PROF(sound_mix(), mix_cycles);
430 PROF_SHOW(9, 8); 437 PROF_SHOW();
431 PROF(flipbuf(&ppu), flip_cycles); 438 PROF(flipbuf(&ppu), flip_cycles);
432 } 439 }
433 440