![]() |
![]() |
![]() |
![]() |
![]() |
Make "PS2 Invaders v1.6" by "InPulSe Team" work.
Posted on 2005-10-14 00:00:00 |
Fixed the problem with the main title texture. It had nothing to do with the texture address, but it's a fix I'm really not sure about. The TEX0 register associated with this sprite primitive specifies a texture whose incoming buffer is 320 pixels wide and specifies a texture width of 512. The given width is 512 because it's the nearest power of 2, but the texture is 320 pixels wide in reality. To make the texture upload correctly, I changed the texture upload code so it specifies a texture row size, to OpenGL (using glPixelStore), equal to the given texture buffer width in the TEX0 register.
But this broke sereval demos. One of them use a buffer width of 512 with a texture size of 256. Specifing a pitch of 512 is wrong because the texture present in RAM has a pitch of 256 pixels. So, right now, I'm currently using the minimum value between the buffer width and texture size. Humm, but thinking this over, I think this could be related a problem in the DMA transfers. You can also specify a pitch while transfering pixels... So fixing this DMA transfer problem would probably allow me to revert to the first fix idea (which is more logical). I'll work on that tomorrow... But anyways, here's the result with the current fix. I'm not still sure about the way to implement the user input stuff. Sending keyboard messages to the IOP module seems like the easiest idea, but wouldn't work well if I'd want to support joypads because it would need to translate those into keyboard messages. Maybe I'll opt for a solution where the button configuration is located at the UI level and have button messages sent instead of raw keyboard/joystick messages. |