Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

Ads

#1 2015-03-05 05:54:38

Glad
Member
From: France
Registered: 2015-03-04
Posts: 28
Website

[HELP] gb.h error - undocumented I/O error

I've got a problem when I try to compile my c code.

The first a follow the instruction on http://www.loirak.com/gameboy/gbprog.php and it worked.

So I try to write my own program using parts of other source code. My goal is just to display a picture. I ended up with that code :

-------------------------------------------------------------------------------------------------------------------------

#include <gb.h>

#include "nude_t.h"        /*the tiles and palette entries*/
#include "nude_t.c"
#include "nude_m.h"        /*the map (pointers to tiles)*/
#include "nude_m.c"
#include "nude_.h"        /*the map's palette entries (pointers to palette)*/
#include "nude_.c"


UWORD nudePalCGB[] =
{
  nudeTilesCGBPal0c0,nudeTilesCGBPal0c1,nudeTilesCGBPal0c2,nudeTilesCGBPal0c3,
  nudeTilesCGBPal1c0,nudeTilesCGBPal1c1,nudeTilesCGBPal1c2,nudeTilesCGBPal1c3,
  nudeTilesCGBPal2c0,nudeTilesCGBPal2c1,nudeTilesCGBPal2c2,nudeTilesCGBPal2c3,
  nudeTilesCGBPal3c0,nudeTilesCGBPal3c1,nudeTilesCGBPal3c2,nudeTilesCGBPal3c3,
  nudeTilesCGBPal4c0,nudeTilesCGBPal4c1,nudeTilesCGBPal4c2,nudeTilesCGBPal4c3,
  nudeTilesCGBPal5c0,nudeTilesCGBPal5c1,nudeTilesCGBPal5c2,nudeTilesCGBPal5c3,
  nudeTilesCGBPal6c0,nudeTilesCGBPal6c1,nudeTilesCGBPal6c2,nudeTilesCGBPal6c3,
  nudeTilesCGBPal7c0,nudeTilesCGBPal7c1,nudeTilesCGBPal7c2,nudeTilesCGBPal7c3
};

void main()
{

  set_bkg_palette( 7, 1, &nudePalCGB[28] );
  set_bkg_palette( 6, 1, &nudePalCGB[24] );
  set_bkg_palette( 5, 1, &nudePalCGB[20] );
  set_bkg_palette( 4, 1, &nudePalCGB[16] );
  set_bkg_palette( 3, 1, &nudePalCGB[12] );
  set_bkg_palette( 2, 1, &nudePalCGB[8] );
  set_bkg_palette( 1, 1, &nudePalCGB[4] );
  set_bkg_palette( 0, 1, &nudePalCGB[0] );

set_bkg_data(0, 161,nudeTiles);


  VBK_REG = 1;
  set_bkg_tiles(0,0,nudeMapWidth,nudeMapHeight,nudePal);

  VBK_REG = 0;
  set_bkg_tiles(0,0,nudeMapWidth,nudeMapHeight,nudeMap);


}
--------------------------------------------------------------------------------------------------------------------------

I use this make.bat :

C:\gbdk\bin\lcc -c -o main.o main.c

C:\gbdk\bin\lcc -Wl-yp0x143=0xC0 -Wl-yp0x14A=1 -o main.gb main.o

--------------------------------------------------------------------------------------------------------------------------

I don't know if the code really work but everytime I try to compile my code, I've got this message :

"main.c1: error: gb.h: undocumented I/O error"

I reinstall GBDK but the problem is still here...


Another boring artist.

Current software project --> Walking under the rain (GB)
Current hardware project --> GlitchBoy

Offline

 

#2 2015-03-05 06:20:59

Glad
Member
From: France
Registered: 2015-03-04
Posts: 28
Website

Re: [HELP] gb.h error - undocumented I/O error

After some research, I change my compiler to gbz80-bg and I wrote a new make.bat :

C:\SDK\gbz80-gb\2-1-5\bin\lcc -Wa-l -Wl-m -o main.o main.c
C:\SDK\gbz80-gb\2-1-5\bin\lcc -Wa-l -c -o nude_t.o nude_t.c
C:\SDK\gbz80-gb\2-1-5\bin\lcc -Wa-l -c -o nude_m.o nude_m.c
C:\SDK\gbz80-gb\2-1-5\bin\lcc -Wl-m -Wl-yp0x143=0x80 -o main.gb main.o nude_t.o nude_m.o

The error messag change to :

C:\SDK\gbz80-gb\2.1.5\lib\crt0.o : cannot open.
C:\SDK\gbz80-gb\2.1.5\bin\Icc -Wa -l -c -o nude_t.o nude_t.c
C:\SDK\gbz80-gb\2.1.5\bin\Icc -Wa -l -c -o nude_m.o nude_m.c
C:\SDK\gbz80-gb\2.1.5\bin\Icc : can't find "main.o"


Another boring artist.

Current software project --> Walking under the rain (GB)
Current hardware project --> GlitchBoy

Offline

 

#3 2015-03-05 12:20:01

Glad
Member
From: France
Registered: 2015-03-04
Posts: 28
Website

Re: [HELP] gb.h error - undocumented I/O error

I tried again to compile other example programm with gbdk and the error still here :

error: gb.h: undocumented I/O error...

I need help :'(


Another boring artist.

Current software project --> Walking under the rain (GB)
Current hardware project --> GlitchBoy

Offline

 

#4 2015-03-06 19:36:16

a cat
Member
Registered: 2014-07-27
Posts: 98

Re: [HELP] gb.h error - undocumented I/O error

sorry for the inactivity in this fourm i havent been on for a while

this looks like a problem with the compiler and not your program were are you downloading gbdk?


a cat in need of knowledge!!

Offline

 

#5 2015-03-07 09:13:39

Glad
Member
From: France
Registered: 2015-03-04
Posts: 28
Website

Re: [HELP] gb.h error - undocumented I/O error

Thanks for your answer ! I download it from sourceforge !


Another boring artist.

Current software project --> Walking under the rain (GB)
Current hardware project --> GlitchBoy

Offline

 

#6 2015-04-07 16:05:21

NicklausW
Member
Registered: 2014-02-09
Posts: 22

Re: [HELP] gb.h error - undocumented I/O error

Should be <gb\gb.h>, not <gb.h>.

(Looks like I'm late to this party)

Offline

 

#7 2015-04-24 18:23:22

Glad
Member
From: France
Registered: 2015-03-04
Posts: 28
Website

Re: [HELP] gb.h error - undocumented I/O error

I let down C for a moment and tried to do it in assembler but I still want to try in C. So I look a the code one more time and try to add <gb/gb.h> and still got the error messages...


Another boring artist.

Current software project --> Walking under the rain (GB)
Current hardware project --> GlitchBoy

Offline

 

#8 2015-05-04 08:52:42

Glad
Member
From: France
Registered: 2015-03-04
Posts: 28
Website

Re: [HELP] gb.h error - undocumented I/O error

Ok folks ! I solved the godamn problem ! Now I can display picture and I'm happy ! Thanks for the help !


Another boring artist.

Current software project --> Walking under the rain (GB)
Current hardware project --> GlitchBoy

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson