#86558 - The_Perfection - Wed Jun 07, 2006 8:56 pm
I'm wondering if there is a program that will translate any image into it's closest possible 15 bit relative, such as the ones used in modes 3 and 5.
I'm sorry if there is an obvious answer to my question, and thanks in advance for any helpful info.
#86590 - tepples - Thu Jun 08, 2006 3:04 am
I think gfx2gba has a mode to do this. Or do you need something that comes packaged with its own GUI?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#86769 - The_Perfection - Fri Jun 09, 2006 3:25 am
Thanks, I'll be sure to take a look at it, but seeing as I don't really know what in the world I'm doing as in manipulating everything with the compiler and what-such, a GUI would be great. Its kinda sad, even though I've been programming for at least a year now, I still don't know how to work these things.
Side Note: I guess updating to dkARM might help with some of my work too, since DKA is so outdated.
Back on track, I just read the bitmap mode intro at TONC, and saw the proper use of header files, along with the use of separate source files. (Yeah, why couldn't it have been put together in its own section? I'd've found it immediately and read it first off; but no, I skipped over the bitmap intro because I knew how to write to the 4th mode front buffer. Anywho,) I'd use them now, but I don't know how to manipulate the compiler and linker to do what I want. If you could help with that, that would be great too.
#86775 - tepples - Fri Jun 09, 2006 5:42 am
Once you learn makefiles, the advantage of a command-line tool is that you can have the converted image automatically be updated every time you change the .bmp or .pcx or .gif or .png image.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#87182 - The_Perfection - Mon Jun 12, 2006 4:07 pm
Okay then, I'm ready to learn, so, where do I start?
I know there's a makefile tutorial or something of the like on the site, but for some reason, I can't get to it right now.
I do know this much, I am using a batch file that looks like this:
Code: |
path=C:\devkitadv\bin
gcc -o MAIN.elf MAIN.c -lm
objcopy -O binary MAIN.elf MAIN.bin
pause
|
How do I make my other code into object files and link them into the project? I imagine the line
Code: |
gcc -o MAIN.elf MAIN.c -lm
|
has something to do with it, but I'm not sure.
#87250 - Cearn - Mon Jun 12, 2006 9:12 pm
The_Perfection wrote: |
... (Yeah, why couldn't it have been put together in its own section? I'd've found it immediately and read it first off; but no, I skipped over the bitmap intro because I knew how to write to the 4th mode front buffer. |
While it would make for good appendix material, I'm fairly certain that if I did put it in the back people would skip it anyway: appendices often are, and if they didn't, they might skip a section covering how to use data properly because it's not exactly exciting reading material. The reason it's in the front in the bitmap section is because that's where the subject first comes up ... although I expected people might skip the bitmap-mode section as well (because they think they know it already), I still think that the group that don't even glance at an early section is smaller than the one skipping appendices. So you see, there is a method behind the madness.
I do agree that it's a little hard to find though. An index of keywords would be nice to have, but unfortunately I'm not quite sure how to make one that's easy to maintain.
Anyway ...
The_Perfection wrote: |
I'm wondering if there is a program that will translate any image into it's closest possible 15 bit relative, such as the ones used in modes 3 and 5. |
AFAIK, gfx2gba requires 4bpp or 8bpp input, but it can convert those to 16bit data. If you need something that can take any bitdepth (and most image types) and convert to any bitdepth, try git.
The_Perfection wrote: |
I know there's a makefile tutorial or something of the like on the site, but for some reason, I can't get to it right now. |
Not exactly a full tutorial on the things, but Tonc gives a few pointers on how to use/makefiles in the setup, first demo, bitmap and makefile chapters. Surely there should be something of use there. Additionally, there are 3 layers of complexity in tonc's makefiles, so you can learn how they work as you go along. Or you can use the libgba makefile templates which will make no sense to the uninitiated, but have the benefit of awesomeness and aren't as much of a b***h to maintain as separate makefiles.
The_Perfection wrote: |
I do know this much, I am using a batch file that looks like this: Code: |
path=C:\devkitadv\bin
gcc -o MAIN.elf MAIN.c -lm
objcopy -O binary MAIN.elf MAIN.bin
pause
|
How do I make my other code into object files and link them into the project? I imagine the line
Code: | gcc -o MAIN.elf MAIN.c -lm |
has something to do with it, but I'm not sure. |
Good guess. This line compiles and links the C code. In principle, all you have to do for multiple files is add the rest of the filenames after 'main.c'. However, that's not what's meant with separate compilation. For that you'd have to invoke gcc on each file, preferably only if its changed since the last time, then link all of them together in the end:
Code: |
REM for files foo.c, bar.c and baz.c, with useful compilation flags
REM compiling steps
gcc -mthumb-interwork -mthumb -O2 -c foo.c -o foo.o
gcc -mthumb-interwork -mthumb -O2 -c bar.c -o bar.o
gcc -mthumb-interwork -mthumb -O2 -c baz.c -o baz.o
REM link
gcc -mthumb-interwork -mthumb foo.o bar.o baz.o -o output.elf
|
Of course, with batchfiles you'd have to manually manage what does and does not need compiling, and add all the commands for each file. Makefiles allow you to do this (almost) automatically, which is why they are preferred.
For devkitARM, the rules would be a little different, but not too much.
#87287 - The_Perfection - Tue Jun 13, 2006 2:53 am
Okay, I've looked through the first three on your makefile list and I plan on looking through the actual makefile section tomorrow. I've also downloaded git and the Programmers Notepad 2, (Haha, you'll hate me for this, but since I don't have Microsoft Visual C++.NET anymore, I've been using Notepad. ( Really, really annoying little bugger.)) And since I've gotten PN, that means that I'm trying to switch to makefiles. (Woo! Auto image recompile!)
Yeah, BTW Cearn, I've found an error in TONC, it's in the "Regular tiled background" section, under the register description. Its in the layout -- CM and Mos are in the wrong locations.
Thanks for the help, but please stick around, chances are I'm going to need some more help with all this.
#87314 - Cearn - Tue Jun 13, 2006 8:14 am
The_Perfection wrote: |
Yeah, BTW Cearn, I've found an error in TONC, it's in the "Regular tiled background" section, under the register description. Its in the layout -- CM and Mos are in the wrong locations.
|
Fixed (at least in the html version). Good call. If you find more let me know.
#87866 - thegamefreak0134 - Fri Jun 16, 2006 2:25 am
I know this is off topic, but perfection it's about time you told him about that one. Didn't you find it like a month ago?
_________________
What if the hokey-pokey really is what it's all about?
[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]
#93372 - The_Perfection - Tue Jul 18, 2006 8:57 pm
Now I'm having a few problems...
I used my first makefile th other day... and it didn't work. This is the basic code: (for now)
Code: |
#
# New (test) Makefile
#
# === Project Details ===
PROJ := # Project name
EXT := gba
CFILES := MAIN.c
COBJS := $(CFILES:.c=.o)
# === Tool Settings ===
CROSS := arm-agb-elf-
AS := $(CROSS)as
CC := $(CROSS)gcc
LD := $(CROSS)gcc
OBJCOPY := $(CROSS)objcopy
MODEL := -mthumb-interwork -mthumb
#SPECS := -specs=gba_mb.specs
ASFLAGS := -mthumb-interwork
LDFLAGS := $(MODEL)
# === Build Steps ===
build : $(PROJ).$(EXT)
$(PROJ).$(EXT) : $(PROJ).elf
@$(OBJCOPY) -v -O binary $< #@
-@gbafix $@
$(PROJ).elf : $(OBJS)
@$(LD) $^ $(LDFLAGS) -o $@
# === Clean Steps ===
.PHONY : clean
clean :
@rm -fv $(COBJS)
@rm -fv $(PROJ).$(EXT)
@rm -fv $(PROJ).elf
|
The thing is, it keeps complaining about not being able to find the gcc. A little help, please? (Oh, I'm running it in PN, if that makes a difference.)
#93390 - Cearn - Tue Jul 18, 2006 10:37 pm
Check your paths, chances are the bin directory of the toolchain (which in this case seems to be DevKitAdv) isn't in there. If you have an installation of devkitPro, change the makefile back to its original settings and add "include $(DEVKITARM)/gba_rules" at the top of the makefile, that should also do it.
You should also enter a project name in PROJ, which is empty right now.
#94183 - The_Perfection - Sun Jul 23, 2006 6:40 pm
Okay, a little help with that, please, because I have no idea how to work this stuff, and I don't have an installation of devkitPro, so the second option doesn't work.
I've also filled PROJ, but that is my basic (unaltered) makefile for the moment.
Found another error in TONC, in the graphic effects area. The mosaic register definitions are either misplaced or miscolored or misnamed, I can't tell you which because I have yet to use that effect.
#94195 - tepples - Sun Jul 23, 2006 7:32 pm
First off, install devkitARM R18. (You may have to look harder to find R18 because it is not the latest version. The latest version has known bugs in the standard library that spring from what is thought to be a defect in how Binutils handles the linker script.) Use it instead of DevKit Advance.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#94213 - Cearn - Sun Jul 23, 2006 8:29 pm
- Get the latest devkitPro downloader and let it run. The default options should suffice, but feel free to add anything that catches your fancy. This page may help in the setup process. The installer should create the required system paths for you.
- Locate the gba_examples in the DKP directories and build one. The easiest way to do that is to open the .pnproj file with Programmer's Notepad (should come with DKP) and hit Alt+1 to build it. If it doesn't, come back here.
- At this point you can choose to run with this, or step back to r18 like tepples said by getting an older version here. But because of the major changes between r18 and r19, the gba_examples wouldn't work anymore if you do.
- Now add the gba_rules thing to the makefile, rename the tool prefixes to either arm-eabi or arm-elf depending on what your current DKP is, and uncomment the SPECS line. Build it and see what happens.
Now that I look at your makefile, there aren't any compilation and assembling steps. Where'd they go? (Not that that'd matter much in this case, as the most important ones will be defined by including gba_rules.)
The_Perfection wrote: |
Found another error in TONC, in the graphic effects area. The mosaic register definitions are either misplaced or miscolored or misnamed |
Both actually :P. I standardized the reg-tables a while back and as you've noticed I made a few copypasta mistakes. I'll run through the whole list again to see if there are any more.
#97588 - The_Perfection - Thu Aug 10, 2006 5:34 pm
Okay, working on getting devkitPro now, i hate our slow internet connection...
According to TONC:
Code: |
#COBJS compiled automatically via implicit rules
#$(COBJS) : %.o : %.c
# $(CC) -c $< $(CFLAGS) -o $@
|
But since I'm special like that, I guess it doesn't apply to me?
Quote: |
The_Perfection wrote:
Quote: | Found another error in TONC, in the graphic effects area. The mosaic register definitions are either misplaced or miscolored or misnamed |
Both actually :P. I standardized the reg-tables a while back and as you've noticed I made a few copypasta mistakes. I'll run through the whole list again to see if there are any more. |
Both? Out of three things? I'm confused...
I don't mean to be rude, (I know its a typo,) but its too much to resist... copypasta? I've never had that before.