π
<-
Chat plein-écran
[^]

fonctions de sprite gcc4ti

Programmation et implémentation d'algorithmes.

Re: fonctions de sprite gcc4ti

Message non lude Michael0x18 » 24 Fév 2021, 01:40

Interesting. I tried the second one, and it works. A bit earlier, I figured out that since the 68K uses big endian, we can't do 1<<offset; it needs to be 1<<(size-offset).

Thank you yet again! I think I'm going to use the new one because it seems to be a little faster.
Avatar de l’utilisateur
Michael0x18
Niveau 3: MH (Membre Habitué)
Niveau 3: MH (Membre Habitué)
Prochain niv.: 36%
 
Messages: 12
Inscription: 07 Oct 2020, 17:10
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: fonctions de sprite gcc4ti

Message non lude Lionel Debroux » 24 Fév 2021, 08:30

A bit earlier, I figured out that since the 68K uses big endian, we can't do 1<<offset; it needs to be 1<<(size-offset).

Oh yeah, I missed that too. You could also shift right a 0x8000 value for a short, 0x80 for a byte.

I think I'm going to use the new one because it seems to be a little faster.

The byte-sized version should indeed be marginally faster if the compiler produces a btst instruction, but not that much.
If the pixel test function is used at few call sites (say, less than 5), you should consider declaring it "inline", so as to avoid the overhead of passing arguments into the appropriate registers (or worse, on the stack, if you didn't use the -mregparm=5 compiler flag), calling into a subroutine, returning from that subroutine, and possibly adjusting the stack pointer at some point if the default stack-based calling convention is being used.

In ExtGraph, pixel operations are macros because it yields much, much better speed optimization, and sometimes size optimization as well.
Membre de la TI-Chess Team.
Co-mainteneur de GCC4TI (documentation en ligne de GCC4TI), TIEmu et TILP.
Avatar de l’utilisateur
Lionel DebrouxSuper Modo
Niveau 14: CI (Calculateur de l'Infini)
Niveau 14: CI (Calculateur de l'Infini)
Prochain niv.: 11.2%
 
Messages: 6858
Inscription: 23 Déc 2009, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: -
GitHub: debrouxl

Re: fonctions de sprite gcc4ti

Message non lude Michael0x18 » 24 Fév 2021, 17:01

True. It's called eight times within the same function. I'll declare it inline/convert it to a macro and see.
Avatar de l’utilisateur
Michael0x18
Niveau 3: MH (Membre Habitué)
Niveau 3: MH (Membre Habitué)
Prochain niv.: 36%
 
Messages: 12
Inscription: 07 Oct 2020, 17:10
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Re: fonctions de sprite gcc4ti

Message non lude Lionel Debroux » 24 Fév 2021, 17:55

An inline function buys you type checking and other niceties that macros can't bring, so you should keep using a function :)
Membre de la TI-Chess Team.
Co-mainteneur de GCC4TI (documentation en ligne de GCC4TI), TIEmu et TILP.
Avatar de l’utilisateur
Lionel DebrouxSuper Modo
Niveau 14: CI (Calculateur de l'Infini)
Niveau 14: CI (Calculateur de l'Infini)
Prochain niv.: 11.2%
 
Messages: 6858
Inscription: 23 Déc 2009, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Classe: -
GitHub: debrouxl

Re: fonctions de sprite gcc4ti

Message non lude Michael0x18 » 24 Fév 2021, 18:07

Okay. Got it. (And thank you yet again!)
Avatar de l’utilisateur
Michael0x18
Niveau 3: MH (Membre Habitué)
Niveau 3: MH (Membre Habitué)
Prochain niv.: 36%
 
Messages: 12
Inscription: 07 Oct 2020, 17:10
Genre: Non spécifié
Calculatrice(s):
MyCalcs profile

Précédente

Retourner vers Programmation

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 6 invités

-
Rechercher
-
Social TI-Planet
-
Sujets à la une
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
Phi NumWorks jailbreak
123
-
Faire un don / Premium
Pour plus de concours, de lots, de tests, nous aider à payer le serveur et les domaines...
Faire un don
Découvrez les avantages d'un compte donateur !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partenaires et pub
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
800 utilisateurs:
>770 invités
>26 membres
>4 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Autres sites intéressants
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)