Search results

  1. R

    GP2X Getting Proper Tv-out Resolution With No Scaling At All

    I'm using a Dell 2001FP LCD display, so not quite a TV, but it does have direct s-video input and can sync to either NTSC or PAL. I also don't have a camera handy so I'll try to describe thoroughly... For NTSC: The left 3 columns are duplicated on the right side and there is extra black space...
  2. R

    GP2X Can't Compile .c File (uses Sdl) To .o (using Devkitgp2x)

    Your makefile is set up to build C++ source, not C. You need to set CC and CFLAGS instead of or as well as CXX and CXXFLAGS. (if you still want to use the makefile) One of the conveniences I don't like so much with make... There's implicit rules that hide what's going on...
  3. R

    GP2X Checking Whether A Sprite Is On-screen Before Drawing It

    Sorry, I'm a little confused by your message -- are you replying to me? What I'm saying is, the blitter has to clip to the drawing surface, because if it didn't it would write to bad places in memory. (unless it's a lower-level blitter, in which case you have to clip yourself before calling...
  4. R

    GP2X Checking Whether A Sprite Is On-screen Before Drawing It

    Where? Is your buffer larger than the screen? If you have a buffer the same size as the screen and your blitter already clips to the buffer then you'd have to be drawing a LOT of sprites to see any benefit. And if you've got enough sprites for that to matter, you probably need to group them...
  5. R

    Semi-transparency

    There has to be a faster way to do this than with alpha, though perhaps it might take directly fiddling with hardware registers. :/ Maybe something with the gamma tables?
  6. R

    Speed Optimization

    If you're only drawing surfaces parallel to a screen edge, you can use Bresenham's algorithm to interpolate between screen and texture space using entirely integer math. As I understand it, this was used in Doom to make it run fast enough on the pitiful machines of the time. I'm not completely...
  7. R

    Sprite Movement Angle Or Move To Specific Pixel

    They add the distance to x and y for the specified angle... Is this overly complicated? Any way to optimize these functions? Don't use angles in degrees. Use angles in 256ths/512ths/1024ths of a revolution. Then use table-based sin/cos that returns a fixed-point value. You only need one...
  8. R

    Question On Malloc And Free.

    You might consider using a struct, eg: CODE struct Pair { int firstPart; char secondPart; }; struct Pair *pair = malloc(sizeof(struct Pair)); pair->firstPart = 4; pair->secondPart = 'L'; free(pair); To be more precise, you need to pass the pointer that you got from malloc to free. You...
  9. R

    Any Ideas How To Read Simple Text Files.

    If you want to read line-by-line, there's std::getline (the one that's not a class member) for iostreams/std::strings and fgets for FILEs/char*s.
  10. R

    Oldest Mk2, Newest Mk1

    2006.05.19 - GP2XV127 - 00004899 Mk2 I didn't preorder, so I'd expect there must be Mk2's at least a little older than this.
  11. R

    GP2X What Rgba Format Do You Use (non-sdl)?

    If you want hardware layer composition, you have to use YUV for the lower layers. If we had documentation for the hardware JPEG/MPEG decoding stuff, that may even be useful (since they're natively in YUV). As it is, the cost is too high and the benefit too low.
  12. R

    Pointer Reassignment

    You are passing in the value of the pointer, but you can't change the pointer knowing only its value. You could just as easily pass in a pointer that doesn't have any address: CODE int i = 4; repoint_existing_pointer(&i); What you need to do is pass in the address of the pointer so the...
  13. R

    Pointer Casting: Bug In Arm-gcc?

    There's a way to get GCC to insert the fixups for you, but I don't remember exactly what the incantation is. It's the same as doing temp = (*(source+1)<<8)+(*source); anyway, just automated. It's generally bad form to read multibyte values directly out of a file by casting, since it's not...
  14. R

    Hw Sdl Blitter Question

    Only if you need 100% accurate alpha, which you don't. Fast alpha is usually done with a range of 0 - 255/256 or similar. It's still not going to be blazing fast, you have to do two reads and one write for every pixel, plus you have to unpack the color components to do the actual processing...
  15. R

    GP2X Performance Cost Of Ood On Gp2x

    You should understand the complexity of the constructors/destructors that will be called. Allocating and freeing stuff on the heap isn't fast, but on the stack it is. The cost of putting the extra parameters on the stack isn't all that much. Besides, most of the time you need a way to get at...
  16. R

    Which Filesystem On Sd Card Do You Use?

    FAT32 allows smaller clusters on disks larger than 32MB (2^16 * 512). This allows small files to be stored more efficiently because a cluster is the smallest allocatable unit on FAT. OTOH, each FAT table is twice the size it would be with FAT16 (and then bigger again because you have more...
  17. R

    Mixing Two 16 Bits Colors

    In C and C++, a[b] is exactly the same as *(a+B). Also, I believe the indirect load/store operations on ARM can automatically adjust the pointer at the same time. Together, this means that you can entirely eliminate one add per array reference here. It's not huge, but it is slightly faster...
  18. R

    Mixing Two 16 Bits Colors

    Ok, if I've done the math right, and assuming koukyTiles16 is properly aligned and screenWH is even: const unsigned int mask = 0xF81F07E0 >> 1; const unsigned int carry1 = 0x08010020; const unsigned int carry2 = 0x80100400; unsigned int *src = (unsigned int *)koukyTiles16; unsigned int *dst =...
Back
Top