Phibrizzo wrote: ↑19 Mar 2024, 17:04
I disasembled Your program.
You and at67 used very smart trick: if color is biger that 63 then is black.
Congratulations!
What I did was pretty simple and somewhat sneaky:
1) Only one loop with no comparisons.
2) You can treat screen memory as one complete non-fragmented segment, i.e. write pixels to the 96 byte offscreen/hidden segments.
3) Toggle the pixel colour using a combination of the low byte and high byte of the incrementing address, this gives us the alternate colour pixels in x and y.
4) Alternate between 0x00/black and 0x3F/white for the pixel colour without branching.
5) Let the code run rampant once it's finished all pixels, i.e. no sanity/safety checks.
6) Use static initialisation of variables, (which my assembler supports), rather than wasting LDI/LDWI instructions in code.
For these kinds of competitions you really need to be more explicit in your rules, or people will have a field day, i.e. I wrote a native version that satisfies the current rules and produces a gt1 file of 0 bytes...
A set of potentially less exploitive rules could go as follows:
- Must produce a physical gt1 file.
- Must run 100% vCPU code, (assembled, compiled or interpreted).
- Must not call SYS functions.
- Must run on <= ROMv5a and 32KByte RAM hardware.
- Must visit all 160x120 pixels.
- Must not write to any offscreen memory.
- Must not mess with the video indirection table to make the onscreen video size smaller or allow for pixel duplication.
- Must produce a stable image and not crash.
- Winner is decided by smallest vCPU code size AND smallest .GT1 file size, with priority going to vCPU code size.
Even with these rules I would hope someone would find a loophole, as that's where the fun really is!