Pages

Monday, 8 February 2016

Const-ant issues

After much head-scratching and reading notes on the devkit I've managed to fix the display issues. There are still problems that I'm not going to be able to solve without making allowances in the core Knight Lore code.

Sprites are now rendered at the correct coordinates
As explained in the devkit notes (which I found at the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying beware of the leopard) the .data section is discarded on cartridge systems. Fair enough - I simply need to declare constant auto-initialised data as const. Only that doesn't always work. So I had to resort to using gcc's attribute property to specify the segment. Thankfully that was sufficient.

There are still a few data arrays that need initialising, but are also modified by the code. I'll need to define them as const and then makes copies in RAM before the main code runs.

I've hooked up the joystick input and can actually play the game. I need to get Z-order sorted next.

UPDATE: I've added the font to the FIX layer and display the menu and some panel information.


Showing elements from the FIX layer
The last sections to display are the scrolls that delineate the panel and the frame around the sun/moon. For this I'll define a special bank in the FIX layer.

No comments:

Post a Comment