Yes. It's used by the last tool in the compilation process, mkg3a, to produce the g3a file.

If you want to get rid of all the unnecessary files generated during compilation, just open a command line, cd to the folder where the project is, and type the command "make clean".
How do I do a different picture? Do I use the same .bin file? If not, how do I make a new one?
Spenceboy98 wrote:
How do I do a different picture? Do I use the same .bin file? If not, how do I make a new one?


You change the picture data in the main.c file... and then you double click on the batch file, like you did before...
It says that it needs Spencer.bin to make main.o. Help please.
My friend is trying to convert a pic, but it keeps giving him this error:


Code:
../..//bin/sh3eb-elf-gcc.exe -c -m3 -mb -O3 -mhitachi -Wall -nostdlib  -I../..//
include -lfxcg -lgcc -L../..//lib -std=c99 main.c -o main.o
main.c: In function 'CopySprite':
main.c:4:4: error: unknown type name 'color_t'
main.c:4:20: error: 'color_t' undeclared (first use in this function)
main.c:4:20: note: each undeclared identifier is reported only once for each fun
ction it appears in
main.c:4:28: error: expected expression before ')' token
main.c:5:13: error: 'VRAM' undeclared (first use in this function)
main.c:5:29: error: expected expression before ')' token
main.c:6:12: error: 'LCD_WIDTH_PX' undeclared (first use in this function)
main.c: In function 'PRGM_GetKey':
main.c:16:3: warning: implicit declaration of function 'PRGM_GetKey_OS' [-Wimpli
cit-function-declaration]
main.c: In function 'main':
main.c:242:5: warning: implicit declaration of function 'GetKey' [-Wimplicit-fun
ction-declaration]
main.c:244:5: warning: implicit declaration of function 'Bdisp_PutDisp_DD' [-Wim
plicit-function-declaration]
make: *** [main.o] Error 1


Help please.
Does he have the SDK set up? What does his code look like? I can't help simply by a stream of error messages....
Code for main.c is:


Code:
#include "keyboard.hpp"

void CopySprite(const void* datar, int x, int y, int width, int height) { 
   color_t*data = (color_t*) datar; 
   color_t* VRAM = (color_t*)0xA8000000; 
   VRAM += LCD_WIDTH_PX*y + x; 
   for(int j=y; j<y+height; j++) { 
      for(int i=x; i<x+width; i++) { 
         *(VRAM++) = *(data++); 
     } 
     VRAM += LCD_WIDTH_PX-width; 
   } 
}
int PRGM_GetKey(){ 
  unsigned char buffer[12]; 
  PRGM_GetKey_OS( buffer ); 
  return ( buffer[1] & 0x0F ) * 10 + ( ( buffer[2] & 0xF0 ) >> 4 ); 
}

<SourceCoder Code>

int main() {
  while(1) {
    int key = PRGM_GetKey();
    if(key == KEY_PRGM_MENU) {  GetKey(&key); }
    CopySprite(ponyWithBackground, 0, 0, 275, 216);
    Bdisp_PutDisp_DD();
  }
  return 0;
}


Makefile is:


Code:
PREFIX=../../
CC=$(PREFIX)/bin/sh3eb-elf-gcc.exe
MKG3A=$(PREFIX)/bin/mkg3a.exe
RM=del
CFLAGS=-m3 -mb -O3 -mhitachi -Wall -nostdlib  -I$(PREFIX)/include -lfxcg -lgcc -L$(PREFIX)/lib -std=c99
MKG3AFLAGS=-i uns:Icon_U.bmp -i sel:Icon_S.bmp -n en:MyPony
LDFLAGS=$(CFLAGS) -T../common/prizm.ld -Wl,-static
CSOURCES=main.c
OBJECTS=$(CRT0:.s=.o) $(CSOURCES:.c=.o)
BIN=MyPony.bin
ADDIN=$(BIN:.bin=.g3a)

all: $(ADDIN)
   
$(BIN): $(OBJECTS)
   $(CC) $(OBJECTS) $(LDFLAGS) -o $@
   
$(ADDIN): $(BIN)
   $(MKG3A) $(MKG3AFLAGS) $< $@

.s.o:
   $(CC) -c $(CFLAGS) $< -o $@
   
.c.o:
   $(CC) -c $(CFLAGS) $< -o $@

clean:
   $(RM) $(OBJECTS) $(BIN) $(ADDIN)
   
   
Try also adding:

Code:
#include <display_syscalls.h>
#include <display.h>
#include <color.h>
It looked like it was missing some code at the beginning. Thanks!
Spenceboy98 wrote:
It looked like it was missing some code at the beginning. Thanks!
No problem. You can generally figure out these sort of things by seeing what functions it's complaining about and checking which header files in the include/ directory define those system calls.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 4 of 4
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement