Elektroda.pl
Elektroda.pl
X
Please add exception to AdBlock for elektroda.pl.
If you watch the ads, you support portal and users.

Arduino i retro konsola, błąd kompilacji kodu gry.

DipolUKF 10 May 2018 18:02 573 8
  • #1
    DipolUKF
    Pupil
    Witam :!: Ostatnio wpadłem na pomysł żeby zrobić retro konsolę (projekt hackvision). Zabrałem się do pracy, pobrałem biblioteki, i kod gry, ale gdy wszystko uruchomiłem w Arduino IDE to nie chciało się skompilować, próbowałem wszystkiego, ale nic nie działa, jak mam to zrobić żeby działało?
    Do you have a problem with Arduino? Ask question. Visit our forum Arduino.
  • #3
    User removed account
    User removed account  
  • #4
    DipolUKF
    Pupil
    Spoiler:
    title_bitmap.h:6: error: 'prog_uchar' does not name a type

    extern prog_uchar title_bitmap[];

    ^

    In file included from C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde:17:0:

    hackvision_logo_bitmap.h:6: error: 'prog_uchar' does not name a type

    extern prog_uchar hackvision_logo_bitmap[];

    ^

    In file included from C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde:18:0:

    asteroid_bitmaps.h:6: error: 'prog_uchar' does not name a type

    extern prog_uchar asteroid_bitmaps[];

    ^

    In file included from C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde:19:0:

    asteroid_vertices.h:6: error: 'prog_uchar' does not name a type

    extern prog_uchar asteroid_vertices[];

    ^

    In file included from C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde:20:0:

    ship_bitmaps.h:6: error: 'prog_uchar' does not name a type

    extern prog_uchar ship_bitmaps[];

    ^

    In file included from C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde:21:0:

    ship_vertices.h:6: error: 'prog_uchar' does not name a type

    extern prog_uchar ship_vertices[];

    ^

    In file included from C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde:22:0:

    saucer_bitmaps.h:6: error: 'prog_uchar' does not name a type

    extern prog_uchar saucer_bitmaps[];

    ^

    In file included from C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde:23:0:

    saucer_vertices.h:6: error: 'prog_uchar' does not name a type

    extern prog_uchar saucer_vertices[];

    ^

    In file included from C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde:24:0:

    explosion_bitmaps.h:6: error: 'prog_uchar' does not name a type

    extern prog_uchar explosion_bitmaps[];

    ^

    In file included from C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde:25:0:

    ship_explosion_bitmaps.h:6: error: 'prog_uchar' does not name a type

    extern prog_uchar ship_explosion_bitmaps[];

    ^

    In file included from C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde:26:0:

    explosion_frequencies.h:6: error: 'prog_uchar' does not name a type

    extern prog_uchar explosionFreq[];

    ^

    Asteroids:75: error: 'prog_char' does not name a type

    prog_char s0[] PROGMEM = "ASTEROIDS";

    ^

    Asteroids:76: error: 'prog_char' does not name a type

    prog_char s1[] PROGMEM = "HIGH SCORES";

    ^

    Asteroids:77: error: 'prog_char' does not name a type

    prog_char s2[] PROGMEM = "GAME";

    ^

    Asteroids:78: error: 'prog_char' does not name a type

    prog_char s3[] PROGMEM = "OVER";

    ^

    Asteroids:80: error: variable 'strings' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

    PROGMEM const char *strings[] = {s0, s1, s2, s3};

    ^

    Asteroids:80: error: 's0' was not declared in this scope

    PROGMEM const char *strings[] = {s0, s1, s2, s3};

    ^

    Asteroids:80: error: 's1' was not declared in this scope

    PROGMEM const char *strings[] = {s0, s1, s2, s3};

    ^

    Asteroids:80: error: 's2' was not declared in this scope

    PROGMEM const char *strings[] = {s0, s1, s2, s3};

    ^

    Asteroids:80: error: 's3' was not declared in this scope

    PROGMEM const char *strings[] = {s0, s1, s2, s3};

    ^

    C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde: In function 'void drawAsteroid(Asteroid)':

    Asteroids:105: error: 'asteroid_bitmaps' was not declared in this scope

    overlaybitmap(a.x, a.y, asteroid_bitmaps + (((a.info >> 4) & 0x7) * SIZEOF_ASTEROID_BITMAP_RECORD), 0, 0, 0);

    ^

    C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde: In function 'void eraseAsteroid(Asteroid)':

    Asteroids:109: error: 'asteroid_bitmaps' was not declared in this scope

    erasebitmap(a.x, a.y, asteroid_bitmaps + (((a.info >> 4) & 0x7) * SIZEOF_ASTEROID_BITMAP_RECORD), 0, 0, 0);

    ^

    C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde: In function 'void displayScore()':

    Asteroids:581: error: 'ship_bitmaps' was not declared in this scope

    overlaybitmap(i*6, 6, ship_bitmaps, 0, 0, 0);

    ^

    C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde: In function 'void drawExplosions()':

    Asteroids:590: error: 'explosion_bitmaps' was not declared in this scope

    erasebitmap(explosions[i].x, explosions[i].y, explosion_bitmaps + ((explosions[i].index - 1) * SIZEOF_EXPLOSION_BITMAP_RECORD), 0, 0, 0);

    ^

    Asteroids:595: error: 'explosion_bitmaps' was not declared in this scope

    overlaybitmap(explosions[i].x, explosions[i].y, explosion_bitmaps + (explosions[i].index++ * SIZEOF_EXPLOSION_BITMAP_RECORD), 0, 0, 0);

    ^

    Asteroids:603: error: 'ship_explosion_bitmaps' was not declared in this scope

    erasebitmap(shipExplosion.x, shipExplosion.y, ship_explosion_bitmaps + ((shipExplosion.index - 1) * SIZEOF_EXPLOSION_BITMAP_RECORD), 0, 0, 0);

    ^

    Asteroids:608: error: 'ship_explosion_bitmaps' was not declared in this scope

    overlaybitmap(shipExplosion.x, shipExplosion.y, ship_explosion_bitmaps + (shipExplosion.index++ * SIZEOF_EXPLOSION_BITMAP_RECORD), 0, 0, 0);

    ^

    C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde: In function 'void drawSaucer()':

    Asteroids:633: error: 'saucer_bitmaps' was not declared in this scope

    erasebitmap(saucerX, saucerY, saucer_bitmaps, 0, 0, 0);

    ^

    C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde: In function 'void drawShip()':

    Asteroids:786: error: 'ship_bitmaps' was not declared in this scope

    erasebitmap(oldShipX, oldShipY, ship_bitmaps + (oldShipHeading * SIZEOF_SHIP_BITMAP_RECORD), 0, 0, 0);

    ^

    In file included from C:\Users\user\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.2\cores\arduino/Arduino.h:28:0,

    from C:\Users\user\AppData\Local\Temp\arduino_build_373987\sketch\Asteroids.pde.cpp:1:

    C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde: In function 'boolean detectCollisions()':

    Asteroids:849: error: 'asteroid_vertices' was not declared in this scope

    nverts = pgm_read_byte(asteroid_vertices + (type * SIZEOF_ASTEROID_VERTICES_RECORD));

    ^

    Asteroids:850: error: 'asteroid_vertices' was not declared in this scope

    xvert = asteroid_vertices + (type * SIZEOF_ASTEROID_VERTICES_RECORD) + 1;

    ^

    Asteroids:854: error: 'ship_vertices' was not declared in this scope

    shipxvert = ship_vertices + (shipHeading * SIZEOF_SHIP_VERTICES_RECORD);

    ^

    Asteroids:904: error: 'explosion_bitmaps' was not declared in this scope

    erasebitmap(explosions[explosionIndex].x, explosions[explosionIndex].y, explosion_bitmaps + ((explosions[explosionIndex].index - 1) * SIZEOF_EXPLOSION_BITMAP_RECORD), 0, 0, 0);

    ^

    Asteroids:995: error: 'saucer_vertices' was not declared in this scope

    xvert = saucer_vertices;

    ^

    Asteroids:1010: error: 'saucer_bitmaps' was not declared in this scope

    erasebitmap(saucerX, saucerY, saucer_bitmaps, 0, 0, 0);

    ^

    Asteroids:1039: error: 'saucer_bitmaps' was not declared in this scope

    erasebitmap(saucerX, saucerY, saucer_bitmaps, 0, 0, 0);

    ^

    Asteroids:1043: error: 'explosion_bitmaps' was not declared in this scope

    erasebitmap(explosions[explosionIndex].x, explosions[explosionIndex].y, explosion_bitmaps + ((explosions[explosionIndex].index - 1) * SIZEOF_EXPLOSION_BITMAP_RECORD), 0, 0, 0);

    ^

    Asteroids:1058: error: 'ship_vertices' was not declared in this scope

    shipxvert = ship_vertices + (shipHeading * SIZEOF_SHIP_VERTICES_RECORD);

    ^

    C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde: In function 'void die()':

    Asteroids:1085: error: 'ship_bitmaps' was not declared in this scope

    erasebitmap(remainingShips*6, 6, ship_bitmaps, 0, 0, 0);

    ^

    C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde: In function 'boolean titleScreen()':

    Asteroids:1103: error: 'asteroid_bitmaps' was not declared in this scope

    overlaybitmap(0, 10, asteroid_bitmaps + (0 * SIZEOF_ASTEROID_BITMAP_RECORD), 0, 0, 0);

    ^

    Asteroids:1110: error: 'ship_bitmaps' was not declared in this scope

    overlaybitmap(52, 24, ship_bitmaps + (2 * SIZEOF_SHIP_BITMAP_RECORD), 0, 0, 0);

    ^

    Asteroids:1112: error: 'explosion_bitmaps' was not declared in this scope

    overlaybitmap(70, 0, explosion_bitmaps + (0 * SIZEOF_EXPLOSION_BITMAP_RECORD), 0, 0, 0);

    ^

    Asteroids:1115: error: 'title_bitmap' was not declared in this scope

    overlaybitmap(0, 20, title_bitmap, 0, 0, 0);

    ^

    Asteroids:1120: error: 'hackvision_logo_bitmap' was not declared in this scope

    overlaybitmap(70, 66, hackvision_logo_bitmap, 0, 0, 0);

    ^

    C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde: In function 'boolean getInput()':

    Asteroids:1542: error: 'ship_bitmaps' was not declared in this scope

    erasebitmap(oldShipX, oldShipY, ship_bitmaps + (oldShipHeading * SIZEOF_SHIP_BITMAP_RECORD), 0, 0, 0);

    ^

    In file included from C:\Users\user\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.2\cores\arduino/Arduino.h:28:0,

    from C:\Users\user\AppData\Local\Temp\arduino_build_373987\sketch\Asteroids.pde.cpp:1:

    C:\Users\user\Documents\Arduino\libraries\Asteroids\Asteroids.pde: In function 'void soundISR()':

    Asteroids:1697: error: 'explosionFreq' was not declared in this scope

    setPWMFreq(pgm_read_byte(explosionFreq + explosionFreqIndex));

    ^

    Użycie biblioteki arduino-tvout-master w wersji 1.0.1 z folderu: C:\Users\user\Documents\Arduino\libraries\arduino-tvout-master
    Użycie biblioteki EEPROM w wersji 2.0 z folderu: C:\Users\user\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.2\libraries\EEPROM
    Użycie biblioteki Controllers z folderu C:\Users\user\Documents\Arduino\libraries\Controllers (legacy)
    exit status 1
    'prog_uchar' does not name a type

    To opis błędu, a tu źrudło z kturego pobrałem pliki zip

    https://www.instructables.com/id/Making-a-Portable-Retro-Game-Console-Using-Arduino/
  • #5
    ex-or
    Level 27  
    Typy "prog_char" itp. są baaaardzo przestarzałe, nie są już obsługiwane przez nowe wersje avr-libc.
    Chyba najprościej ściągnąć sobie jakąś antyczną wersję IDE Arduino, gdzieś tak sprzed wersji 1.0, i na tym spróbować kompilacji. Inna opcja to dodanie odpowiednich flag dla kompilatora: http://tuxgraphics.org/electronics/201207/prog_char.shtml Ale diabli wiedzą gdzie się to wpisuje w IDE Arduino. Tu coś o tym piszą: https://stackoverflow.com/questions/28037491/arduino-1-0-6-how-to-change-compiler-flag . Opcja nr 3 to przeróbka programu tak by pozbyć się tych prog_charów, ale nad tym nie będę się rozwodził bo mam wrażenie, że ta opcja raczej Cię nie zainteresuje.
  • #6
    DipolUKF
    Pupil
    To chyba spróbuje z tą 3 opcją bo wersje IDE z przed 1.0 już nie są dostępne a ta opcja z flagami jest dla mnie trochę skomplikowana.
  • #8
    DipolUKF
    Pupil
    Im bardziej się zagłębiam w ten projekt tym bardziej mi się odechciewa.
  • #9
    DipolUKF
    Pupil
    Zrezygnowałem z budowy tej konsoli.