Author Topic: Axe Q&A  (Read 587209 times)

0 Members and 4 Guests are viewing this topic.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Q&A
« Reply #1680 on: January 16, 2014, 09:41:20 pm »
(A) While a full-screen update on the non-color calculators takes about 1/100th of a second and almost everything that uses it relies on it being fast, a full-screen update on the color calcs takes about 1/5th of a second
Yeah but we could cheat with some frameskip and with the double-pixel trick. Moreover, some coders (like matref and I, or Builderboy and others) still have the possibility to trigger the 15MHz mode to get more speed on the CSE without losing any compatibility this time, so our programs of course will have speed issues, but also some speed gains.
Also that depends on the program you are porting because I don't think AudaciTI will have too much issues with refreshing since nothing happens on the screen except menus :P

Unfortunately, these points are not really valid. The ~5Hz screen update rate I cited is with 15MHz mode enabled already. If you tried frameskip, considering most non-color games probably run at 20-60fps, you'd be skipping anywhere from 75% to 90% of frames, which is very poor. And finally, it doesn't really matter how few differences there are between frames, because DispGraph has always been a full-frame resend command and can't really be modified to (efficiently) perform incremental updates.

Offline ClrDraw

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 627
  • Rating: +61/-2
    • View Profile
    • GitHub
Re: Axe Q&A
« Reply #1681 on: January 18, 2014, 09:40:09 pm »
So with an 8 by 8 sprite you use Pt-Change() to draw it inverted. How do you do that with a 16 by 16?
Visit my GitHub for all my TI programs as well as other projects.
Also check out my website.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Axe Q&A
« Reply #1682 on: January 18, 2014, 11:59:53 pm »
So with an 8 by 8 sprite you use Pt-Change() to draw it inverted. How do you do that with a 16 by 16?
Since Axe doesn't have any 16x16 sprite routines (at least as far as I could tell according to the official documentation), you have to do it by drawing four 8x8 sprites. So if Pic1 is the top-left corner of the 16x16 sprite, Pic1+8 is the top-right, +16 the bottom-left, and +24 the bottom-right, then you'd want to do something like this (assuming drawing to X,Y):
Code: [Select]
Pt-Change(X,Y,Pic1)
Pt-Change(X+8,Y,Pic1+8)
Pt-Change(X,Y+8,Pic1+16)
Pt-Change(X+8,Y+8,Pic1+24)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline ClrDraw

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 627
  • Rating: +61/-2
    • View Profile
    • GitHub
Re: Axe Q&A
« Reply #1683 on: January 20, 2014, 10:33:33 am »
Okay, thanks. One more question, how do I name my own variables? not static variables, but stuff I can change like A,B,C, etc (just different names).
Visit my GitHub for all my TI programs as well as other projects.
Also check out my website.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Axe Q&A
« Reply #1684 on: January 20, 2014, 10:42:54 am »
Choose a pointer to a safe RAM area with a length of two bytes or more, for example L1, then do L1→°Lolwat. Now Lolwat is a variable you can use. You can also do L1+2→°Wattouat or [0000]→°Meh. The last solution is not a good idea since it will trigger writeback and won't work in apps, but if you already use all safe RAM areas, you might want to do this.
« Last Edit: January 20, 2014, 10:44:27 am by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Axe Q&A
« Reply #1685 on: February 05, 2014, 01:32:50 am »
Quick question: are min and max signed or unsigned ?
(does min(~1,0) return 0 because 0<65535 or ~1 because ~1<0 ?)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline TheMachine02

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 452
  • Rating: +105/-0
  • me = EF99+F41A
    • View Profile
Re: Axe Q&A
« Reply #1686 on: February 05, 2014, 01:50:46 am »
there is two version of min/max :

one unsigned :

Code: [Select]
min(0,-1) .return 0 (0<65535)
max(-1,0) .return -1

and one signed (with the r modifier):

Code: [Select]
min(-1,5)r   .return -1
max(-8,9)r  .return 9
AXE/asm programmer - unleash the power of z80 //C++//C

epic 3D things http://www.ntu.edu.sg/home/ehchua/programming/opengl/CG_BasicsTheory.html

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Axe Q&A
« Reply #1687 on: February 05, 2014, 11:50:31 am »
Ok, thanks for the answer :)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Axe Q&A
« Reply #1688 on: February 16, 2014, 05:35:04 am »
I'm writing an axiom and want to put the address of a function of the axiom in a variable. Currently what I do is :
Code: [Select]
.db REP_ABS
 .org $-1
 ld hl, sub_axiom10
 ld (someVar), hl
But it doesn't seem to work : when in the Axe code I replace somevar by the axiom function itself it works. I have REP_ABS = $49. What am I doing wrong ?

EDIT : solved on IRC, I had to use REP_NEXT ($7F). I thought I tried it already.
« Last Edit: February 16, 2014, 07:19:44 am by Matrefeytontias »

Offline TheMachine02

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 452
  • Rating: +105/-0
  • me = EF99+F41A
    • View Profile
Re: Axe Q&A
« Reply #1689 on: February 19, 2014, 11:52:44 am »
Does using #ExprOn in a program affect axiom too ?
I mean, if an axiom use the axe multiplication and the program calling axiom command have #ExprOn, does the multiplication will be optimize for speed too ?
AXE/asm programmer - unleash the power of z80 //C++//C

epic 3D things http://www.ntu.edu.sg/home/ehchua/programming/opengl/CG_BasicsTheory.html

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Q&A
« Reply #1690 on: February 19, 2014, 08:27:32 pm »
Does using #ExprOn in a program affect axiom too ?
I mean, if an axiom use the axe multiplication and the program calling axiom command have #ExprOn, does the multiplication will be optimize for speed too ?

That's a good question... Honestly, I'm not sure. If I had to guess, I'd say that because of how Axioms are parsed, it would depend on the optimization state at the end of the main source program. Either that, or it simply ignores the optimization state (although if you use multiplication yourself in a speed-optimized block, that should force the Axiom to as well).

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Axe Q&A
« Reply #1691 on: February 21, 2014, 10:18:11 am »
Isn't there a way to,simply call sub_mulFast instead of sub_mul ? Apparently axioms always compile in #ExprOff mode, no matter what the state of optimization is when they are parsed.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Q&A
« Reply #1692 on: February 21, 2014, 06:07:16 pm »
Isn't there a way to,simply call sub_mulFast instead of sub_mul ? Apparently axioms always compile in #ExprOff mode, no matter what the state of optimization is when they are parsed.

No, Axioms can't explicitly call the fast version of the command. And yes, a quick test seems to suggest that subroutines referenced by Axioms will default to the slow version. However, it also seems that my suspicion that using a native Axe command that calls the underlying subroutine in an #ExprOn section somewhere does result in the Axiom referencing the fast version, so I guess having a dummy call in the Axe source to a command that uses the underlying subroutine would be a workaround.

I'm not sure if this is a problem that is reasonably fixable, but I'll look into a more permanent solution.
« Last Edit: February 21, 2014, 06:10:04 pm by Runer112 »

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: Axe Q&A
« Reply #1693 on: February 21, 2014, 07:58:30 pm »
So I would do like a dummy multiplication at the start of the #ExprOn block ? Like :

:#ExprOn
:A*B
:.rest of the code


Is that it ?

Offline ClrDraw

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 627
  • Rating: +61/-2
    • View Profile
    • GitHub
Re: Axe Q&A
« Reply #1694 on: March 08, 2014, 07:21:54 pm »
I'm making a new game and need to make the attached picture into a giant bitmap for my Axe source. Is there any way to do this that won't take me an hour?
Visit my GitHub for all my TI programs as well as other projects.
Also check out my website.