Search results

  1. G

    C Vs. C++

    Interesting thought. I found it kind of hard to test distant static jumps. Using a big fat asm(".zero 10000000") statement to stretch some function calls, gcc 4.0.2 still uses a simple bl instruction to perform a static function call, with a 10Mb gap. Upping the gap to 100Mb caused a slew of...
  2. G

    Getting Started With Asm?

    I wrote a routine to downsample from 32bpp to 16bpp a while ago, which I think is pretty fast. http://www.glost.eclipse.co.uk/gfoot/gp2x/ - third link down. There are some other assembly thingls there if you're interested in that kind of thing - mostly trying to write things in as little space...
  3. G

    Should I Use Free() In This Case?

    You should only free things you allocate yourself, usually with malloc, but sometimes other functions which internally call malloc for you. A simple pointer assignment is no reason to free additional memory. In your first case, dataIndex isn't even a pointer, it's an array, so you shouldn't...
  4. G

    GP2X Allegro Problem

    It's always worked fine for me, so I haven't really been able to fix it. :( I did make some fixes for firmware 2.0 though, which I never released, too much hassle. I was going to add Allegro to the Open2x svn repository, but I didn't get round to that either, sorry! I ought to upload new...
  5. G

    Interrupt To Check Keys And Joystick

    Yes, it's no good if there's no hardware interrupt there in the first place :) I got the impression from the MMSP2 databook that you can enable interrupts on any GPIO changes, but maybe that's dependent on the actual hardware configuration, not just under software control. I don't know much...
  6. G

    Interrupt To Check Keys And Joystick

    The traditional way to implement this kind of thing under Linux is using a device to communicate with the kernel. The app can wait on the device using select or poll (which has a nicer interface IMHO), and the thread will wake up when data arrives. You can run all this on a separate thread...
  7. G

    GP2X Eclipse Ide

    Eclipse's remote target management is based around using ftp, ssh, or a custom daemon to copy files to the target, launch programs, etc. As I said, it's rather immature at the moment, and the custom daemon is not trivial to get running (I crosscompiled an SSH server instead...). Overall I gave...
  8. G

    Passing A Large Sdl_surface* Between Functions

    The actual speed of the blit hasn't got much to do with whether your pointer is a global or a function argument though - except for really small blits, the cost of copying the image data is going to far outweigh the cost of passing an additional parameter (and note that SDL's blit function will...
  9. G

    GP2X Eclipse Ide

    I set Eclipse up to target the GP2X by manually editing the managed makefile project settings, but it'd be a pain to do that for every project. I posted here a month or two ago pointing to some QNX plugins that adapt the managed makefile support to handle cross-compiling, but they're commercial...
  10. G

    GP2X Programming New Gp2x Bootloader

    I think a better option is to figure out why the system halts, and stop it doing that. If you really wanted to, you could probably make your entire game run as a kernel module anyway. :) Personally I accept that Linux is blocking your access to some things (interrupts in particular) but it's...
  11. G

    GP2X Setting A Standard..

    I'm in favour of general guidelines (B for primary select, X for cancel, etc) and generally I'd be in favour of games having an easily accessible menu with consistent options, including a clear "quit game" to return to the game's front end menu system. I'd want this to be easier to access...
  12. G

    GP2X Mmsp2 Documentation

    You want the MMSP2 databook. It's not good for quick reference, but it is a detail listing of registers on the MMSP2. Some doubts have been raised about its accuracy - Squidge found more up-to-date docs somewhere, but he can't post them. Back in January, it was db.pdf, which is linked on the...
  13. G

    Weird Fwrite Problems

    It seems odd that fwrite would fail. What SDK are you using - official / open2x / devkitGP2X? Something I did wonder was whether using kernel 2.6 headers could cause issues, since the actual device only has kernel 2.4. Still, I've built rsync for the GP2X, and it seems to work fine - I never...
  14. G

    Need Help With Setting Up Development Environment

    It's well worth setting up the USB networking, and logging into the GP2X to run your programs - that way you get to see any errors they generate, and you can see if they exit or hang. Search for "Tcp/ip" on the wiki. You can also run them through gdbserver and debug them. Search for "Gdb" on...
  15. G

    GP2X Thumb Life

    Yes, that sounds better, and it'll work a lot better with C code than my method. The reason absolute addresses don't work with elfpatch is that removing the program header for the data and/or bss sections offsets the start of the text section relative to the beginning of the file. Does the...
  16. G

    Reading Text Files

    Sorry, I might have been wrong about fgets's behaviour when it truncates a line - from the documentation it looks like it does terminate the buffer properly. I don't know where I got the idea that it didn't from! Your fgets line looks fine - I tend to use sizeof() rather than passing 46 for...
  17. G

    GP2X Thumb Life

    Dzz wrote some tutorials in the "Gp2x Demo Development" thread - it's a sticky in this forum. Bypassing SDL isn't a problem - just don't link it - but even linking the standard C library costs quite a few kilobytes, so wouldn't be suitable in a 4k contest. You can still use C so long as you...
  18. G

    GP2X Thumb Life

    I don't know if anyone here is interested in using the Thumb instruction set... but I've packed my tinylife down to 412 bytes by converting most of it. http://www.glost.eclipse.co.uk/gfoot/gp2x/thumblife.zip The functionality is the same, and some of the optimizations would probably have...
  19. G

    Error Compiling Sterm

    canavar, firstly I'm not sure that there is an "official" toolchain. I did have the unofficial gcc 2.95-based toolchain but I nuked it recently so I can't check what the headers are like on that. With the toolchain I do use, forkpty is declared in pty.h...
  20. G

    Error Compiling Sterm

    What toolchain are you using? Note that sterm is not so useful for general development any more - with the latest firmware you can set up networking over the USB cable, and log into your GP2X remotely from your dev PC.
Back
Top