Just tried your graphics demo and it looks nice! Is this designed for a particular board that has a connector for the NES controller? How do I connect one myself? Are any parts required other than the controller itself?
Nothing to do with static declarations or aligments, just a stupid mistake on my side. The initialize_background function was overflowing the tile_map arrays by more than 200 bytes. The effect was visible with static declarations because the memory is organized differently in that case (I see the tile_map arrays are located in the .bss segment, while without static they are located in the .common segment) and the overflow was overwriting other data. The aligments, according to the output of nm, are as expected in both cases.
Thank you all for your help, and sorry for the time you loose on this.
Just tried your graphics demo and it looks nice! Is this designed for a particular board that has a connector for the NES controller? How do I connect one myself? Are any parts required other than the controller itself?
It is not designed for a particular board. The NES controller expects P2=clock, P3=latch and P4=data (also P5=data for second controller but is not used), the pins are defined in nes_gamepad_ctrl.h and can be changed to match the hardware. I don't think other parts are necessary except the controller and related connector (I think Parallax has a NES connector breakout board).
Nothing to do with static declarations or aligments, ...
You'd still have to make sure that the array is long aligned (gcc only guarantees word alignment for the type you used). This is assuming that propeller-elf-gcc acts the same as gcc in that respect.
Comments
Nothing to do with static declarations or aligments, just a stupid mistake on my side. The initialize_background function was overflowing the tile_map arrays by more than 200 bytes. The effect was visible with static declarations because the memory is organized differently in that case (I see the tile_map arrays are located in the .bss segment, while without static they are located in the .common segment) and the overflow was overwriting other data. The aligments, according to the output of nm, are as expected in both cases.
Thank you all for your help, and sorry for the time you loose on this.
It is not designed for a particular board. The NES controller expects P2=clock, P3=latch and P4=data (also P5=data for second controller but is not used), the pins are defined in nes_gamepad_ctrl.h and can be changed to match the hardware. I don't think other parts are necessary except the controller and related connector (I think Parallax has a NES connector breakout board).
I have a site for this project at http://dev.maccasoft.com/propge/ if you want to take a look.
Related discussions are here http://forums.parallax.com/showthread.php/146667 and on the Propellerpowered site here http://propellerpowered.com/forum/index.php?topic=415.0