#170094 - wallacoloo - Sun Aug 30, 2009 12:42 am
I'm trying to get libfat to work on my GBA.
I am following this tutorial.
I made a quick program that tries to initialize libFat and create a new file. I added some tests that check to make sure that libfat initialized correctly:
When I get to step 3 in the tutorial, I get the following error while attempting to apply the DLDI patch to the resulting rom:
"(file) does not have a DLDI section"
I tried testing the program anyways, the screen turned red (indicates that libfat didn't initialize correctly).
Any ideas on what I'm doing wrong?
(And yes, I remembered to add -lfat to the LIBS section of my makefile)
Last edited by wallacoloo on Tue Sep 01, 2009 12:14 am; edited 1 time in total
I am following this tutorial.
I made a quick program that tries to initialize libFat and create a new file. I added some tests that check to make sure that libfat initialized correctly:
Code: |
#include <stdio.h>
#include <fat.h> unsigned short* Screen = (unsigned short*)0x6000000; void setRed() { int i = 0; while(i < 38400) { Screen[i] = 31; i++; } } void setWhite() { int i = 0; while(i < 38400) { Screen[i] = 32767; i++; } } int main() { *(unsigned long*)0x4000000 = 0x403; // mode3, bg2 on int res = fatInitDefault(); if (res) { //Success setWhite(); } else { //Failure setRed(); } FILE* pFile; char buffer[] = "test"; pFile = fopen ( "myfile.bin" , "wb" ); fwrite (buffer, 1, sizeof(buffer), pFile); fclose (pFile); while(1){} } |
When I get to step 3 in the tutorial, I get the following error while attempting to apply the DLDI patch to the resulting rom:
"(file) does not have a DLDI section"
I tried testing the program anyways, the screen turned red (indicates that libfat didn't initialize correctly).
Any ideas on what I'm doing wrong?
(And yes, I remembered to add -lfat to the LIBS section of my makefile)
Last edited by wallacoloo on Tue Sep 01, 2009 12:14 am; edited 1 time in total