Author Topic: [68k] Incorrect Cursor Drawing  (Read 3051 times)

0 Members and 1 Guest are viewing this topic.

Offline blue_bear_94

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 801
  • Rating: +25/-35
  • Touhou Enthusiast / Former Troll / 68k Programmer
    • View Profile
[68k] Incorrect Cursor Drawing
« on: November 30, 2012, 04:13:53 pm »
I decided to start using the latest GCC4TI release, but my graphic editing program now has a cursor glitch! (screenshot attached, along with how it's supposed to look)
My source code is also attached.
My code to draw the cursor is as follows:
Code: [Select]
void drawCursor(unsigned int x,unsigned int y) //Draws the cursor
{
unsigned char cursorl[8] = {
~0x80,~0xC0,~0xA0,~0x90,~0xB8,~0xE0,~0x90,~0x08
};
unsigned char cursord[8] = {
~0x80,~0xC0,~0xE0,~0xF0,~0xF8,~0xE0,~0x90,~0x08
};
unsigned char cursorm[8] = {
~0x7F,~0x3F,~0x1F,~0x0F,~0x07,~0x1F,~0x6F,~0xF7
};

Sprite8(x,y,8,cursorm,GrayGetPlane(LIGHT_PLANE),SPRT_AND);
Sprite8(x,y,8,cursorm,GrayGetPlane(DARK_PLANE),SPRT_AND);
Sprite8(x,y,8,cursorl,GrayGetPlane(LIGHT_PLANE),SPRT_OR);
Sprite8(x,y,8,cursord,GrayGetPlane(DARK_PLANE),SPRT_OR);
}

This code worked as intended on TIGCC 0.96 Beta 8, but shows the wrong cursor on GCC4TI 0.96 Beta 10. Any help would be appreciated!
Due to dissatisfaction, I will be inactive on Omnimaga until further notice. (?? THP hasn't been much success and there's also the CE. I might possibly be here for a while.)
If you want to implore me to come back, or otherwise contact me, I can be found on GitHub (bluebear94), Twitter (@melranosF_), Reddit (/u/Fluffy8x), or e-mail (if you know my address). As a last resort, send me a PM on Cemetech (bluebear94) or join Touhou Prono (don't be fooled by the name). I've also enabled notifications for PMs on Omnimaga, but I don't advise using that since I might be banned.
Elvyna (Sunrise) 4 5%
TI-84+SE User (2.30 2.55 MP 2.43)
TI-89 Titanium User (3.10)
Casio Prizm User? (1.02)
Bag  東方ぷろの

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: [68k] Incorrect Cursor Drawing
« Reply #1 on: November 30, 2012, 04:19:32 pm »
After installing GCC4TI 0.96 Beta 10, have applied the hotfixes which are duly mentioned on the official download pages ? ;)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline blue_bear_94

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 801
  • Rating: +25/-35
  • Touhou Enthusiast / Former Troll / 68k Programmer
    • View Profile
Re: [68k] Incorrect Cursor Drawing
« Reply #2 on: November 30, 2012, 04:31:43 pm »
I now did, and when I try to build the program, a lot of errors appear.
"Storage class specified for parameter '...'."
EDIT: Never mind, I compiled it successfully!
« Last Edit: November 30, 2012, 04:34:29 pm by blue_bear_94 »
Due to dissatisfaction, I will be inactive on Omnimaga until further notice. (?? THP hasn't been much success and there's also the CE. I might possibly be here for a while.)
If you want to implore me to come back, or otherwise contact me, I can be found on GitHub (bluebear94), Twitter (@melranosF_), Reddit (/u/Fluffy8x), or e-mail (if you know my address). As a last resort, send me a PM on Cemetech (bluebear94) or join Touhou Prono (don't be fooled by the name). I've also enabled notifications for PMs on Omnimaga, but I don't advise using that since I might be banned.
Elvyna (Sunrise) 4 5%
TI-84+SE User (2.30 2.55 MP 2.43)
TI-89 Titanium User (3.10)
Casio Prizm User? (1.02)
Bag  東方ぷろの

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: [68k] Incorrect Cursor Drawing
« Reply #3 on: December 01, 2012, 02:14:29 am »
BTW, you should mark the sprite definitions "const", and either move them out of the function, or let them in the function but mark them "static" :)
As the code snippet above stands, it needlessly creates the variables on the stack, which takes significantly more space than having a const copy statically stored in the program.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.