Show Posts

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 - Quigibo

Pages: 1 ... 104 105 [106] 107 108 ... 135
1576
The Axe Parser Project / Re: Bug Reports
« on: May 04, 2010, 12:40:14 pm »
I just noticed a really stupid mistake on my part.  I accidentally was checking for a right bracket "]" instead of a brace "}" for the pointers.  I just updated with the fixed file, so if you downloaded 0.2.2 before this post, you'll want to re-download it.

1577
The Axe Parser Project / Re: Features Wishlist
« on: May 04, 2010, 12:30:20 pm »
Yes, definitely.

1578
It Axe, you can do this:

:"prgmMYPROG"->Str1
:getcalc(Str1)->C
:{C-2}r->S

Puts the size of the program in S.  Basically, the size bytes come right before the data.

EDIT: by the way, you cannot change the size of the program without some pretty advanced assembly.  You either have to append data to the end ,which might cause the program to shift around in ram and you'll need to get a new pointer right after, OR you can put the entire calculator in edit mode and add as much data as you want, but you have to keep track of a bunch of pointers.  Either way you need to make sure you update the new size manually after changing it.

1579
The Axe Parser Project / Re: Features Wishlist
« on: May 04, 2010, 12:21:14 pm »
Hmmm... that might be useful calc84, I think I will add conj()r to copy data from one place to another backwards where the bytes at the end get copied first and bytes at the beginning get copied last.

Not sure if I will add 8 pixel scrolling.  You can do it with other commands like calc84 mentioned, and usually when you have 8x8 tiles without smooth scrolling, you redraw them on the screen every frame anyway.

Scroll right by 8:
conj(L6+1,L6,767)
Scroll left by 8:
conj(L6+766,L6+767,767)r (not in 0.2.2)
Scroll up by 8:
conj(L6+96,L6,672)
Scroll down by 8:
conj(L6+672,L6+767,672)r (not in 0.2.2)

Not 100% sure if these are correct, but this is the strategy.

1580
The Axe Parser Project / Re: Axe Parser
« on: May 04, 2010, 12:08:23 pm »
The "Fix CODE" commands are Asm flags.  I only have 3 controllable flags right now, but I can always add more.  bcalls are way too low level since they often require registers for input, so you will have to do those with Asm(EFxxxx) where xxxx is the hex code (little endian).

EDIT:
MAJOR MINOR REVISION COMING SOON

I'm announcing this before the next version becasue there is going to be a very big change to how a lot of the commands work and I want to let everyone know if they need to modify their code to accommodate the change.  Let me first explain my reasoning:

Lets say you wrote "If A=5" (assume that A is 5 at this point).  What happens, is first, A is compared to 5.  If they are equal, it returns 1.  Then, it checks to see if the expressions is true, that is to say, that it is not zero.  So it checks if 1 = 0 which it is not, so it will execute the If block.  Now you might see a redundancy here.  A has to be compared to 5 and then the result has to be compared to 0.

EDIT:
I found out that I can not do this, its already pretty efficient here.  However, I do realize that 99% of the time, the logical "and" "or" and "xor" commands are used as Boolean "xor" "or" and "and".  Therefore, I will change them to this (3 bytes less).

Commands this will affect:
If
ReturnIf
While
Repeat

or
and
xor

What you have to change:

EDIT:
Nothing.  The only time you would ever have to modify your code is if you were using the "and" "or" or "xor" commands as low level byte operations instead of logical operations.  If you still need to do bit logic, I will be adding new commands for that.

1581
The Axe Parser Project / Re: Axe Parser
« on: May 04, 2010, 03:44:13 am »
Yup, 0.2.2 is here.

Want to clarify some details.  Although there weren't that many new features, I spent a lot of time on other things instead like bugs, optimizations, and more templated parsing.  Also, as far as the tile map absorber, the 8x8 tiles are added from left to right, then top to bottom.

1582
Axe Parser
Beta 0.2.2



New Features:
  • Min and Max operations
  • Display numbers and ASCII characters anywhere
  • Binary Numbers
  • Import Pics as tile maps
  • Huge update to auto-opts list

Changed:
  • Fixed A LOT of bugs.
  • Programs should be smaller due to auto-opts.

Edit: Fixed some more bugs

1583
Never use NOP.  You might as well try to make the timing code as small as possible.  If you need medium pauses, use a bunch of HALTs.  For precise and very fast pauses, use a few DJNZ $+0 or something like that.  Don't worry about this now, focus on the main code first and run some tests, then add in some pause time if the game runs too fast.

I was just like you when I started out.  I dove right in and then ran into a bunch of weird problems I could never figure out until I finally learned the inner-workings.   For instance, I remember when the same stack being used for both pushing/popping AND for calls really threw me off when I was trying to pass arguments using push and pop.

If you want some useful routines, check out the Axe Parser commands source code.  It has all the stuff you were asking about like detecting keys directly, drawing sprites, screen scrolling, and even sound/music out of the linkport (since this is a guitar hero clone).  You might even consider using Axe if your goal is just trying to make the game, its a lot easier than assembly, and just as fast.  But if the goal is to learn assembly, then try the "Learn Z80 In 28 Days" tutorial, that helped me the most.

1584
Other Calculators / Re: Sprite Sizes
« on: May 04, 2010, 01:13:15 am »
I've used 12*12 before, even though it was really a 16*16 with transparent edges.  8*16 and 16*8 are common as well.

1585
Axe / Re: Signed Comparison Broked
« on: May 03, 2010, 11:53:56 pm »
Thanks for pointing that out!  Actually, I've already fixed that in the next version.  I've been spending most of this entire week just going through all the math routines and making them more efficent both on the parser side and the code generation.  Also, there were a lot more bugs than I thought (like this one).  I've fixed at least 5 different bugs already, mostly on the parsing side, and it seems to be running much smoother.  I'll be updating in a few hours probobly.

That's a good idea to do seperate high and low comparisons, I'll see if it reduces the size.

1586
Jerros, I don't think you have a clear understanding of how that assembly routine works.  First of all, drawing an 8x8 sprite fully clipped onto the buffer literally takes less than a millisecond.  You don't actually have to refresh the screen until you have finished drawing all the sprites.  Your layout should be something like this:

Loop:
<Draw Sprites>
<Refresh Screen>
<Pause For Timing>
<Handle Key Presses>
<Sprite Movement>
jp Loop

It sounds like you're pretty new to assembly.  You might want to start a little slower becasue you're trying to do some complicated things that are going to be very confusing without a lot of experience.

1587
Axe / Re: Smooth scrolling in Axe
« on: May 03, 2010, 12:16:21 am »
You basically have to draw a few tiles partially off the screen as you scroll.

ztrumpet made a smooth scrolling engine with 16x16 sprites, you can adapt it to 8x8 easily though.
http://ourl.ca/4161/79940

I think I recall seeing some other people making them too, but I can't seem to find any.

1588
TI-BASIC / Re: Hex with Sprites
« on: May 02, 2010, 09:09:26 pm »
I use this one.  Its really basic, but its great for monochrome images and supports any size you want.

http://www.ticalc.org/archives/files/fileinfo/134/13415.html

1589
The Axe Parser Project / Re: Axe Parser
« on: May 02, 2010, 09:04:03 pm »
He means the native binary/bit support.  I'll see if I have time.  Probably not though, or it might only be partially ready.

The optimizations list has a list of how many bytes each math operation takes up.  Doing A+5 for instance, the plus 5 is not on the list, so it takes the +CONST default size which is 4 bytes.  If you did A+1 instead, the operation would actually be only 1 byte since  adding 1 to a number is very efficient in assembly.  Other things like testing if a number equals 2 used to be a 10 byte command, but its now only a 9 byte command in the new version.

If you ever have the option, always try to use the auto-opt commands.  Like if you're calculating a score or something and you are using X*30 as part of the equation, you might want to consider X*32 instead just becasue it will be smaller if it makes no difference otherwise.

1590
The Axe Parser Project / Re: Axe Parser
« on: May 02, 2010, 07:24:32 pm »
I finally finished rewriting the entire math engine.  The code was getting way too messy and especially with the addition of signed and unsigned versions of math operations.  It was making it way too complicated to optimize the code.  The parser code is now a lot more organized, smaller, faster, and uses fewer variables.  In addition, nearly all of my example programs became a few bytes smaller from my increased auto-opt list.  In my game of life example, it actually shrunk by 9 bytes (1.3% reduction) without changing any code, simply by compiling with the newer version!  Everyone will most likely see small drops in the executable sizes.  These aren't the big optimizations though.  Those will eventually come when I get to look-ahead parsing.

I'm going to focus on some new commands now.  I might have it ready by late tonight, but I'm not sure.  Don't expect too many new things, I spent most of my time swatting bugs and cleaning the code so that future versions will be easier to write.

Pages: 1 ... 104 105 [106] 107 108 ... 135