PDA

View Full Version : Can you port flash games to the DS..??



spannernick
February 20th, 2008, 21:06
I have a flash game I want to use on my DS, its a.swf file..??

DanTheManMS
February 21st, 2008, 03:20
If you have the sourcecode, DS coding knowledge, and a lot of time and energy to put into it, you could probably port over a Flash game.

If you're looking for something to play the *.swf file you already have, there's nothing that can do that. There is a port of GPLFlash that can a few very old Flash animation files with no sound or user input, but it's not really worth it, and you have to recompile it to add your own flash file.

spannernick
February 22nd, 2008, 00:11
How do you compile GPLFlash..?

DanTheManMS
February 22nd, 2008, 02:40
http://natrium42.com/blog/?p=36

spannernick
February 22nd, 2008, 19:14
http://natrium42.com/blog/?p=36

I have got the files from there so now what do i do now,I have VC++,devkitpro, appwizard and palib,do i copy it to the devkitpro folder or something..?

I need step by step please..?

Getting error..?


C:\devkitpro\DSflash>make clean
make -C arm9 clean
make[1]: Entering directory `/c/devkitpro/DSflash/arm9'
clean ...
make[1]: Leaving directory `/c/devkitpro/DSflash/arm9'
make -C arm7 clean
make[1]: Entering directory `/c/devkitpro/DSflash/arm7'
clean ...
make[1]: Leaving directory `/c/devkitpro/DSflash/arm7'
rm -f DSflash.ds.gba DSflash.nds DSflash.arm7 DSflash.arm9

C:\devkitpro\DSflash>make
make -C arm7
make[1]: Entering directory `/c/devkitpro/DSflash/arm7'
template.c
arm-eabi-gcc -MMD -MP -MF /c/devkitpro/DSflash/arm7/build/template.d -g -Wall -O
2 -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer -ffast-math -mthumb-interw
ork -I/c/devkitpro/DSflash/arm7/include -I/c/devkitpro/DSflash/arm7/build -I/c/d
evkitPro/libnds/include -I/c/devkitpro/DSflash/arm7/build -DARM7 -c /c/devkitpro
/DSflash/arm7/source/template.c -o template.o
c:/devkitpro/DSflash/arm7/source/template.c: In function 'VblankHandler':
c:/devkitpro/DSflash/arm7/source/template.c:49: error: 'TransferRegion' has no m
ember named 'curtime'
c:/devkitpro/DSflash/arm7/source/template.c:84: error: 'TransferRegion' has no m
ember named 'heartbeat'
c:/devkitpro/DSflash/arm7/source/template.c:96: error: 'TransferRegion' has no m
ember named 'curtime'
c:/devkitpro/DSflash/arm7/source/template.c:49: warning: unused variable 'ct'
make[2]: *** [template.o] Error 1
make[1]: *** [build] Error 2
make[1]: Leaving directory `/c/devkitpro/DSflash/arm7'
make: *** [arm7/DSflash.elf] Error 2

C:\devkitpro\DSflash>pause
Press any key to continue . . .

spannernick
February 22nd, 2008, 22:02
I figured out the problems on line 49 and 96. libnds was modified so that ‘curtime’ was inside of a union called ‘time’. This allows a user to either access the ‘curtime’ variable in its entirety with ‘IPC->time.curtime’, or access individual fields like ‘day’ or ’seconds’ with ‘IPC->time.rtc.day’. (’rtc’ is the structure that contains day, hour, minute, seconds, etc.) The exact details of the IPC object are in ‘libnds/include/nds/ipc.h’ under ‘TransferRegion’. (IPC is of type TransferRegion.) I modified those two lines appropriately so they refer to ‘IPC->time.curtime’ instead of ‘IPC->curtime’.

So that got rid of those two problems, so I am only left with the problem on line 84 - the missing heartbeat variable. There is no reference to heartbeat in the version of ‘ipc.h’ that I am looking at. I also looked in the current template files that came with the most recent nds-examples package of devkitPro, and they have no reference to ‘heartbeat’. It looks like it was simply incremented every time the VblankHandler was called, but it has evidently been removed. (I noticed that I had the nds-examples package from January 27, 2007, but there is a new one as of March 27, 2007. Neither contain references to ‘heartbeat’. Additionally, they don’t contain any dswifi examples. When I get the examples to compile I need to see if I can get them included as part of nds-examples. It would have saved me a lot of time had they been there in the first place…)

Okay, so heartbeat is deprecated.I look up what it means - effectively it means “don’t use this because it won’t be supported in the future, but we are keeping it to keep legacy code happy.” In this case, heartbeat wasn’t deprecated, it was simply removed.So I removed it and now have another error I have to look up...dam...:(

Error..

> "make"
"make" -C arm7
make[1]: Entering directory `/c/devkitpro/DSflash/arm7'
make[2]: `/c/devkitpro/DSflash/DSflash.arm7' is up to date.
make[1]: Leaving directory `/c/devkitpro/DSflash/arm7'
"make" -C arm9
make[1]: Entering directory `/c/devkitpro/DSflash/arm9'
dsflash.cpp
arm-eabi-g++ -MMD -MP -MF /c/devkitpro/DSflash/arm9/build/dsflash.d -g -Wall -O2 -mcpu=arm9tdmi -mtune=arm9tdmi -fomit-frame-pointer -ffast-math -mthumb -mthumb-interwork -I/c/devkitpro/DSflash/arm9/include -I/c/devkitpro/DSflash/arm9/../libflash -I/c/devkitPro/libnds/include -I../../libflash/include -I../../libjpeg/include -I../../libzlib/include -I/c/devkitPro/libnds/include -I../../libflash/include -I../../libjpeg/include -I../../libzlib/include -I/c/devkitpro/DSflash/arm9/build -DARM9 -c /c/devkitpro/DSflash/arm9/source/dsflash.cpp -o dsflash.o
c:/devkitpro/DSflash/arm9/source/dsflash.cpp: In function 'int main()':
c:/devkitpro/DSflash/arm9/source/dsflash.cpp:66: error: 'POWER_CR' was not declared in this scope
make[2]: *** [dsflash.o] Error 1
make[1]: *** [build] Error 2
make[1]: Leaving directory `/c/devkitpro/DSflash/arm9'
"make": *** [arm9/DSflash.elf] Error 2

> Process Exit Code: 2
> Time Taken: 00:00

I know that "'POWER_CR' " is to turn on the screens..

This is line 66 "POWER_CR = POWER_ALL_2D;"