Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27

Thread: nintendo ds / gba

  1. #11

    nintendo ds / gba

    hmm, i just did a try making a gba program using the freepascal arm port, but it seems that direct memory access is not implemented. I have no idea how to write such a thing. e.g assign the address $4000000 to the var (pointer) REG_DISPCNT. Maybe i can use assembly for setting that value, but i feel like cheating that way....
    http://3das.noeska.com - create adventure games without programming

  2. #12
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    nintendo ds / gba

    Don't. The whole concept of programming for a console is to practically access the hardware directly. Doing as you suggest may even take better advantage of the system's resources.

    My only question with that is, does the ARM variation of FPC support inline ASM for ARM? Some of the function calls are a bit diferent and data conventions are different in describtion(for native ARM anyway). See chapter 11 of that book I posted about in reference to what a byte, word and half-word is for the ARM.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  3. #13

    nintendo ds / gba

    found out some more:
    freepascal allows:
    pointername := pointer(memoryaddress);

    Next thing that happened is that the program compiles, but then says the generated assembly sourcecode is not valid.... :x

    Doing a search for crosscompiling bin utils gave the following site: http://users.pandora.be/Jan.Van.hijf...ssCompile.html

    using the as compiler from those binutils i can manualy compile the generated assembly source without complaints.

    Now i have to figure out to do this automaticaly as only my unit part gets compiled to an assembly source file. Freepascal does not want to use the right as compiler. Any ideas here....

    But there is some progress.... slow but....
    http://3das.noeska.com - create adventure games without programming

  4. #14

    nintendo ds / gba

    now i got it to compile my test program. But propably it is not a valid gameboy cartridge as visual boy advance under windows does not load it. Trying a linux gameboy emu it loads, but does nothing.....

    Now on to finding out how to make a cartridge from the elf executable and replacing crt0.o with something gba like instead of linux arm like.

    Ideas on this are welcome....
    http://3das.noeska.com - create adventure games without programming

  5. #15
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    nintendo ds / gba

    Hmm... this might seem like an odd idea... but what about trying to hack around with a simple GBA rom? You could try using it's 'header' or whatever the GBA uses to id a GBA ROM.... maybe the Mappy VM source might give you a hint into this...

    If I didn't have a big exam tomorrow I'd look into it tonight for you. :/ If you are still stuck later in the week and I manage to get a bit of time for it I may have a look.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  6. #16

    nintendo ds / gba

    Quote Originally Posted by noeska
    Ideas on this are welcome....
    If you can create a correct "cartridge" with C compiler, you could try to do a very simple program (hello world), and do the same with pascal.
    Eventually you will get very little code, and you could try to view differencies with headers, code and the like with an hex editor.
    If you have some free time :mrgreen:
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  7. #17

    nintendo ds / gba

    i try to spend an hour evening per day on it. Also i keep an eye on: http://linux.gbadev.org/gcc-gba/ as mentioned before. It seems i have to convert the generated .elf file to something binary. Just have to find the tool in my linux as the tool is supposed to be part of the binutils....

    The hardest part wil be replacing the crt.o of linux arm with the gba one.
    http://3das.noeska.com - create adventure games without programming

  8. #18

    nintendo ds / gba

    WOW!! This is exciting!!! Look forward to reading more about your progress.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  9. #19

    nintendo ds / gba

    Quote Originally Posted by noeska
    It seems i have to convert the generated .elf file to something binary.
    If i remember well this could be done with fpc directly. You can choose the kind of executable i think. Sorry if i can't give more info.
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  10. #20

    nintendo ds / gba

    i now seem to be able to make fake cartridges, but the emulator loads it and does nothing, although i meanth it to draw one pixel. Adding something like writeln('hello') causes the emu to crash.... so at least some code gets executed....

    if the free pascal compiler needs to be modified to implement crt0.o for the gba i am not going on with this project as i do not have enough knowledge for changing the free pascal compiler.
    http://3das.noeska.com - create adventure games without programming

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •