This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - Runer112
Pages: 1 ... 101 102 [103] 104 105 ... 153
1531
« on: January 10, 2011, 11:19:37 am »
En regardant le code généré, j'ai même constaté que :
:20->A+2-B est moins optimisé que :
:20->A :22->B Pourquoi le premier exemple contient -B au lieu de →B? Il est possible que ça l'affecte. En revanche :
:12->A->B est bel et bien plus optimisé que :
:12->A :12->B Vous avez raison. Le deuxième exemple répète la constante, qui prend 3 octets.
1532
« on: January 09, 2011, 08:39:18 pm »
Oh lol. Nevermind then! But why is DispGraphrr listed as incompatible with interrupts in the Commands.htm file?
1533
« on: January 09, 2011, 05:54:37 pm »
Before I begin, let me clarify something about shadow registers, because I was a bit confused about this myself for a while. When exchanging registers with shadow registers, the processor doesn't move values from the active registers into the shadow registers and vice versa. There is not one specified set of "active" registers and one specified set of "shadow" registers. Instead, the processor uses a mux to simply flip its definition of which set is the active set and which set is the shadow set. So when an interrupt activates, the processor simply designates the set of registers it wasn't previously using as the set that the interrupt will use.
Anyways, the reason the grayscale routines cause problems is because they require both sets of the af register pair. When not inside an interrupt this is fine, because nothing else was using the second af register pair. But during an interrupt, the af register pair that was being used before the interrupt probably has data in it that we don't want to destroy. However, because the grayscale routine uses both of the af register pairs, this saved value for af will be destroyed. My solution was to back up the saved af register which we don't want destroyed by putting it onto the stack at the start of the routine. At the end of the routine, it is then taken off the stack and put it back into the inactive af register to live to see another day.
1534
« on: January 09, 2011, 05:31:59 pm »
Sorry for posting in English, but I don't want to cause any confusion due to bad translation. It all looks quite good! I'm looking forward to new sections about more advanced Axe topics. But until then, here are the problems that I noticed with the existing sections. - Output() is not capitalized in some examples
- Pause 1000 is not a second, a second is closer to Pause 1800
- Pause and Pause 0 work, they just can take up to 40 seconds to process
- Adding or subtracting any value besides 1, 2, 255, 256, 257, or 512 is not more optimized than just stating a whole new value
- abs() works regardless of where the calculation occurred that made the value negative
- In one place you use ≥0, which is always true, so it seems somewhat pointless
- The guy who commented about your xor diagram is right
- In the variables and calculations exercise, the text would be centered better if outputted at (6,3) and (6,4)
- Also in that exercise, one line says A≤0→1, which I assume should be A≤0→A
- "10²→B-66→C :√(B+C)→A" :: In this, -66→C should be -56→C. Also, if you want to use it, a more optimized way would be :44→C
- "Et si A est négatif, il n'y a pas un moyen plus simple que If A≠0" :: Negatives do not require special treatment in this case
- DS<() decreases the variable before checking if it equals 0
- "Une boucle consiste à répéter un code tant qu'une expression n'est pas VRAIE." :: Depending upon the loop type, this is not true. It would be better to say: "Une boucle consiste à répéter un code tant qu'une condition est vrai." (Isn't it spelled "vrai" and not "vraie"?)
- In your For() loop made with a Repeat loop, "Repeat Variable=ValeurDeFinDeBoucle" should be "Repeat Variable>ValeurDeFinDeBoucle"
- The code for the last question about loops would only freeze the calculator if A=0.
1535
« on: January 09, 2011, 05:10:07 pm »
For that matter it might be better to make class and power whole bytes, as that would make each entry size 24 and probably make the retrieval of those two values a lot easier/smaller/faster.
1536
« on: January 09, 2011, 05:04:28 pm »
Even better: A*12*2-A And why are you multiplying by 23 so much anyways? Just wondering if it could be avoided altogether.
1537
« on: January 09, 2011, 03:38:05 pm »
Quigibo, would you go for grayscale routines that are 5 bytes and about 33 cycles larger, but work with interrupts? I may be wrong, but I believe this could be done by changing the start and end of the routines like so: Start: ld a,i push af di
End: pop af ret po ei ret
| | Start: ex af,af' push af ld a,i push af di
End: pop af ex af,af' pop af ex af,af' ret po ei ret
|
1538
« on: January 09, 2011, 02:52:58 pm »
You can use both DispGraphr and DispGraphrr in an interrupt, and both will work just fine. However, the code that was executing before the interrupt activated probably will not work fine. It is very likely that this would cause corruption, and possibly a crash.
At least for now. I'm looking at the grayscale routines and seeing if it's possible to make them work with interrupts.
1539
« on: January 09, 2011, 01:40:14 pm »
kindermoumoute, serait-il d'accord si je lis le tutoriel et souligné les erreurs que j'ai trouvé?
1540
« on: January 09, 2011, 01:00:51 pm »
Oh damn, you know what? Now I remember why I had the conditional return in the middle of the sprite rotating routines, Quigibo. Without it, the routines would return vx_SptBuff+8 in hl. Oops... But instead of re-implementing the conditional return, here's the better fix:
p_RotC: .db __RotCEnd-1-$ ex de,hl ld c,8 __RotCLoop1: ld hl,vx_SptBuff+8 ld b,8 ld a,(de) __RotCLoop2: dec l rra rr (hl) djnz __RotCLoop2 inc de dec c jr nz,__RotCLoop1 ret __RotCEnd:
p_RotCC: .db __RotCCEnd-1-$ ex de,hl ld c,8 __RotCCLoop1: ld hl,vx_SptBuff+8 ld b,8 ld a,(de) __RotCCLoop2: dec l rla rl (hl) djnz __RotCCLoop2 inc de dec c jr nz,__RotCCLoop1 ret __RotCCEnd:
EDIT: And as a side note, would it be possible to reformat DS<() so that the variable is reinitialized to its maximum value at the End? That way, 3 bytes could be saved by having both the zero and not zero conditions using the same store command. For example:
ld hl,(var) dec hl ld a,h or l jp nz,DS_End ;Code inside statement goes here ld hl,max DS_End: ld (var),hl
1541
« on: January 08, 2011, 10:34:38 pm »
If you have 150 labels, your compiled code probably shouldn't fit in RAM anyways.
1542
« on: January 08, 2011, 06:17:57 pm »
Axe has a maximum allowance of 150 labels and static pointers by the way.
1543
« on: January 08, 2011, 02:56:59 pm »
The two bytes that specify the size of the variable should be the 2 bytes immediately preceding the pointer returned from GetCalc(), whether using the normal or archive method. This is easy for variables in RAM, because the variable's data starts with two bytes for its size, and the VAT pointer for the variable always points right to it. However, when variables with variable names (programs, lists, appvars, and groups) are archived, the variable's name (and possibly other data, I'm not sure) is appended to the file in front of the two bytes indicating size. To correct this, Quigibo's archive variable locating routine determines the length of the variable's name from the VAT and adds that to the pointer to skip this unwanted data and to be consistent with unarchived variables. However, he forgot to check if the variable's type is a protected program, so it thinks that any protected program doesn't have this and doesn't correct for the name length.
1544
« on: January 08, 2011, 02:42:18 pm »
I remember encountering a problem a long time ago, but this is before my Axe and assembly skills were too adept and I figured I was just doing something wrong. However, just a few moments ago, SirCmpwn was having trouble getting the size of archived programs, so I looked into it to help out. In the process of testing the reading of archived programs with a randomly chosen program target (which happened to be a protected assembly program) and looking at Commands.inc, I realized that p_GetArc doesn't check for protected programs!
1545
« on: January 07, 2011, 11:47:05 pm »
Could buffer operations be extended to support buffer arguments? I don't think I urgently need it, but I'm sure others would like it. And since all the commands already exist, it would be best not to have to make whole new copies of all the commands with Axioms. Most of the current routines would handle it with no problem. I guess the question is how hard/time-consuming it would be for you to implement it? Variable buffers would play nice with all of the following commands. - ClrDraw
- DispGraphClrDraw
- StoreGDB
- StorePic (the destination buffer would have to come first and in hl, so an ex de,hl would need to be added)
- RecallPic
- DrawInv
- All of the screen shifting commands
- All of the pixel commands
- Line()
- Rect()
- RectI()
EDIT: Completely unrelated, but how did you come up with 1900 and 4700 cycles as arguments to pause for approximately one second? I calculated more like 1800 and 4500 for 6.0MHz and 15.0MHz, or about 1850 and 4600 for 6.15MHz and 15.4MHz (which is about how fast my TI-84+SE runs I believe).
Pages: 1 ... 101 102 [103] 104 105 ... 153
|