Squidge posted on Jul 11 2006 at 11:28 AM said:
Don't forget that the 940 has an offset applied to all addresses, so the frame buffer address (and all io registers/etc) will be at a different address on the 940 to what they are on the 920.
That being said, something simple like...
Code:
volatile unsigned short *fbaddr = (unsigned short *)0x00101000;
while (1)
{
for (c = 0; c < 153600; c ++)
{
fbaddr[c] ^= 0xFFFF;
}
}
Should work as a simple frame buffer manipulator when the code is placed at 0x03000000. If placed at any other address, modify the address of the frame buffer appropriately.
That is what I tried, or thought I tried, I will try again. Basically the backlight goes on. The 0x4 bit in GPIOH (H2) does not turn it back on. not sure what turned it off in the first place. Basically I am using rlyeh's code to load the 940 and start it. With the exception that I removed the shared memory code (well then later I changed it to use file i/o (different than what he had www.dwelch.com/gp2x).
Basically if I did everything right, or rlyeh did everything right. shutting down the 940, disabling interrupts on the shared registers. Setting the base address of the 940 to 0x03, copying the 940 code to 0x03000000. and brining the 940 back up. both rlyeh's and demo6b did this pretty much the same way. Anyway, I print Hello World! on the display before loading and starting the 940, shouldnt that stay on the display after I start the 940?
This isnt brain surgery, I must have some subtle dumb thing going on here...Even just blinking the led, you would think that the 0x0a00 register, that had just worked on the 920 before would work on the 940, but I had to re-write/initialize a couple of registers. The last two items in the sdk2x timer init. I re-installed linux just in case I had hosed it.
It seems as if when I start the 940 I am doing something to the 920, perhaps causing an interrupt or fault perhaps. I am trying to avoid setting up the MPU or anything on the 940, as, again, the system should already be operating and setup with the exception of 940 specific stuff like the MPU, and even there the 940 should run without the MPU being setup, its just slow right?
Sorry, rambling. Thanks for the help, will try all of this again from scratch, assembler only test program on the 940 to avoid any issues there...
David