Omnimaga
Calculator Community => Major Community Projects => The Axe Parser Project => Topic started by: Quigibo on April 19, 2010, 10:40:01 pm
-
I've decided to release the source code for all templated commands the compiler uses when parsing. I challenge anyone to improve the code :)
You'll have to ignore the cryptic scripts that surround the routines and it probably won't be very obvious what is being done in each one of them. If you see any routine you think you can get from the start to the finish more efficiently with equal or lesser size, alert me! If you have any specific question just ask.
Some of the inefficiencies I can't do anything about by the nature of the way the parser currently works, but I plan to correct this eventually (like the jr's at the beginning of the subroutines)
This might also benefit anyone who is trying to transition from Axe to assembly since Axe is for the most part just cookie-cut out of this template.
-
oooh nice to see you are releasing the source for the routines. It might come handy for some people. :)
-
This could be a great way to improve the speed and efficiency of Axe :) it's so cool how you could just recompile a game and make it faster automaticaly ifyou did it with a new version ^^
-
I will have a look at the routines. ;)
-
Question:
If you have fastCopy impemented, then why does CopyBuffer use GrBufCpy?
-
Question:
If you have fastCopy impemented, then why does CopyBuffer use GrBufCpy?
What is called "Fastcopy" in the routines is actually safe copy. Copybuffer was what I used to use but I don't use it anymore. I'm just keeping it there becasue in the future there will be more settings on how to optimize the code for efficiency on the size-speed spectrum. Not all the routines in the list are actually used.
-
Oh, I understand more now. Thanks for the clarification.
-
These routines might actually need some optimizing. I couldn't find an algorithm for signed division anywhere on the internet, so I had to do it the really bulky/lazy way with taking the absolute value and then adding the sign at the end. The line drawing I just translated the pseudo-code from Wikipedia directly into assembly, but there might be a better way for that as well.
-
Quigibo, could you help me understand your "getkey(x)" command. I found it in the routines, and skipped the "jp" and ".db" parts, but I don't understand what H and L mean in the routine. Could you help?
-
That one is actually really complicated, the Parser itself uses an algorithm to determine what to make H and L. That's why I require the number for direct keys to be constant instead of variable becasue it would be way too slow to have to convert it each time its trying to detect a key.
Anyway, H is the key group and L is the bit inverse of the key code I think. There's a chart on day 22 of the learn z80 in 28 days tutorial you can use for reference.
By the way, I haven't updated the list with new commands since the last few versions. If anyone wants any just ask and I'll post them up here.
-
This looks like it would be very neat to look at/learn from, so if you don't mind, I'd appreciate it if you attached an updated list. Thanks! :D
-
Sure thing! I also included a list of some of my macros since I think I use a few of them in my routines.
-
I also included a list of some of my macros since I think I use a few of them in my routines.
I especially liked the min and max macros. Mind if I release some of the macros and routines in a z80 library? (I put credit in the source code and readme, it is my habit)
The adding and multiplying hl by constants can help out some beginners (drawback of some not understanding exactly what are doing) or copy/paste to spare time.
-
Sure, use as many as you want.