Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

embedded system Ive got a problem

Status
Not open for further replies.

RISCIT

Junior Member level 1
Joined
Dec 30, 2011
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,441
Hello guys,

I m working on an embedded system and my job is to design a C programm and to embbed it on a plasma CPU MIPS. I wrote my code and it work correctly on windows and here is the minimum code that you need to see to ask at my questions.

Processor that we use dont understant graphics library #include <graphics.h> and i want to know how im going to make to initialise the screen on which VGA interface will be connected. We cannot use functions that its appears in the main such as initwindow(1018, 736,"Snake 1.0") who is expected to create a window on the screen or readimagefile("im.jpg", 10, 630, 90, 720) who must read an image that we load on the processor

so how can i create these two functions? to make the same work? processor dont understant them therefore it will not work

have you and idea for my problems?

Thanks you


Code C - [expand]
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include <graphics.h>
#include <stdio.h>
 
 
#define LEFT 1
#define RIGHT 2
#define UP 3
#define DOWN 4
 
 
int score; //Affiche le score à l'écran
int gamedelay;// Permet de sélectionner la vitesse du serpent
int Vie;
 
 
struct Snake_Data {
int length;
int head_x;
int head_y;
int bend_x [1000];
int bend_y [1000];
int bend_dir [1000];
 
 
}
Snake;
 
 
 void userinput ()
   {
     static int i = 0;
     if ( i > 1000) i = 0; // Permet de créer la queue du serpent
     static int j = 0;
     if ( j > 1000) j = 0;
     char input;
     if (kbhit ())
       {
         input = getch ();
 
 
 
         if (input == 80) input = DOWN;
 
         if (input == 72) input = UP;
 
         if (input == 75) input = LEFT;
 
         if (input == 77) input = RIGHT
 
 
 
        }
 
 
     if (Snake.tail_x == Snake.bend_x [j] && Snake.tail_y == Snake.bend_y [j])
        {
          Snake.tail_dir = Snake.bend_dir [j];
          j++;
        }
 
 }
 
 
 
 
void initscreen ( ) //Initialise l'écran
 {
   int i;
 
 
   setcolor (4);
   line (10,10,10,610);
   line (1008,10,1008,610);
   line (10,610,1008,610);
   line (10,10,1008,10);
 
 
 
 
   //Dessine le debut du corps du serpent
 
   for (int i = Snake.length; i>0;i--)
      {
        putpixel (Snake.head_x-i,Snake.head_y,15);
      }
 }
 
 
}
 
 
int main ()
{
  initwindow(1018, 736,"Snake 1.0"); // Création fenêtre de 1024 * 768
  readimagefile("im.jpg", 10, 630, 90, 720);
  readimagefile("bar.jpg",555, 700, 90, 704);
  initgamedata ();
  initscreen ();
  gameengine ();
 
  system ("pause");
}

 
Last edited by a moderator:

Hello guys,

I m working on an embedded system and my job is to design a C programm and to embbed it on a plasma CPU MIPS. I wrote my code and it work correctly on windows and here is the minimum code that you need to see to ask at my questions.

Processor that we use dont understant graphics library #include <graphics.h> and i want to know how im going to make to initialise the screen on which VGA interface will be connected.
<SNIP>

It is probably not the case that the processor does not understand: #include <graphics.h>. Processors don't undertand anything but code.

It is probably the case that your embedded compiler / system builder does not have <graphics.h>. And from your post it seems that your plasma panel would probably not be a part of a standard graphics library.
Sounds to me like you need to find or write your own graphics library.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top