Project

General

Profile

Statistics
| Revision:

root / lab5 / lab5.c @ 96

History | View | Annotate | Download (2.3 KB)

1
#include <lcom/lcf.h>
2

    
3
#include <lcom/lab5.h>
4

    
5
#include <stdint.h>
6
#include <stdio.h>
7

    
8
#include "graphics.h"
9
#include "graphics_macros.h"
10

    
11
// Any header files included below this line should have been created by you
12

    
13
int main(int argc, char *argv[]) {
14
  // sets the language of LCF messages (can be either EN-US or PT-PT)
15
  lcf_set_language("EN-US");
16

    
17
  // enables to log function invocations that are being "wrapped" by LCF
18
  // [comment this out if you don't want/need it]
19
  lcf_trace_calls("/home/lcom/labs/lab5/trace.txt");
20

    
21
  // enables to save the output of printf function calls on a file
22
  // [comment this out if you don't want/need it]
23
  lcf_log_output("/home/lcom/labs/lab5/output.txt");
24

    
25
  // handles control over to LCF
26
  // [LCF handles command line arguments and invokes the right function]
27
  if (lcf_start(argc, argv))
28
    return 1;
29

    
30
  // LCF clean up tasks
31
  // [must be the last statement before return]
32
  lcf_cleanup();
33

    
34
  return 0;
35
}
36

    
37
int(video_test_init)(uint16_t mode, uint8_t delay) {
38

    
39
    set_graphics_mode(mode);
40

    
41
    tickdelay(micros_to_ticks(delay*1e6));
42

    
43
    vg_exit();
44
    return 0;
45
}
46

    
47
int(video_test_rectangle)(uint16_t mode, uint16_t x, uint16_t y,
48
                          uint16_t width, uint16_t height, uint32_t color) {
49
  /* To be completed */
50
  printf("%s(0x%03X, %u, %u, %u, %u, 0x%08x): under construction\n",
51
         __func__, mode, x, y, width, height, color);
52

    
53
  return 1;
54
}
55

    
56
int(video_test_pattern)(uint16_t mode, uint8_t no_rectangles, uint32_t first, uint8_t step) {
57
  /* To be completed */
58
  printf("%s(0x%03x, %u, 0x%08x, %d): under construction\n", __func__,
59
         mode, no_rectangles, first, step);
60

    
61
  return 1;
62
}
63

    
64
int(video_test_xpm)(xpm_map_t xpm, uint16_t x, uint16_t y) {
65
  /* To be completed */
66
  printf("%s(%8p, %u, %u): under construction\n", __func__, xpm, x, y);
67

    
68
  return 1;
69
}
70

    
71
int(video_test_move)(xpm_map_t xpm, uint16_t xi, uint16_t yi, uint16_t xf, uint16_t yf,
72
                     int16_t speed, uint8_t fr_rate) {
73
  /* To be completed */
74
  printf("%s(%8p, %u, %u, %u, %u, %d, %u): under construction\n",
75
         __func__, xpm, xi, yi, xf, yf, speed, fr_rate);
76

    
77
  return 1;
78
}
79

    
80
int(video_test_controller)() {
81
  /* To be completed */
82
  printf("%s(): under construction\n", __func__);
83

    
84
  return 1;
85
}