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 ... 56 57 [58] 59 60 ... 135
856
Axe / Re: Axe 8-bit math ideas
« on: September 08, 2010, 09:42:54 pm »
If native registers were supported, it would only be the most basic use of the registers: loading, adding, subtracting, and shifting, plus maybe a few simple things I'm not thinking about.  It would only allow things that are legal in asm so you wouldn't be able to add b and c and store the result in d.  Don't forget that part of implementing the 8 bit mode is moving the variables close enough to relative reference with IY so there are more optimizations possible.

By the way, I'm taking an assembly class using MIPS architecture (very similar to ARM) which feels like such a higher level language compared to z80.  Those instructions are specifically designed to translate from C compilers and only now do I realize why there haven't been many good assemblers for z80 so far :P.

857
Axe / Re: Axe 8-bit math ideas
« on: September 08, 2010, 04:47:57 pm »
Hmm, interesting to use 'inverted' brackets. That has got to go against all the language theories but that actually would work which is the interesting part :P

The problem with that though is that I think it would be beneficial to keep the 8-bit mode from line to line so you don't need to keep using the brackets.

Code: [Select]
]A+1->A[
]B+1->B[

<8bit>
A+1->A
B+1->B
<16bit>

Where <8bit> and <16bit> are some undecided token that indicates a switching of the modes.  They can be used inline as well.

This is something that you won't see soon though, probably not until 2.0 (Axe++) because it basically requires me to rewrite an entirely new copy of the math library including new optimizations, conversions, and other technical issues I would have to deal with.  I was also thinking of allowing the use of some lowercase letters to correspond to their registers for the lowest possible level of optimization.

858
The Axe Parser Project / Re: Axe Parser
« on: September 08, 2010, 12:44:47 am »
Runer112, I don't know how tempSwapArea is actually used.  The TI Developer's guide claims its only used when archiving, but they have been wrong before.  My gut tells me its probably a bug in your program, but its certainly possible that some other bcall or interrupt could be screwing it up.  Maybe ask another asm programmer exactly what its used for if you're still not convinced.

859
The Axe Parser Project / Re: Features Wishlist
« on: September 08, 2010, 12:34:33 am »
@Runner, yes, I fixed that now.  I decided to keep the grayscale routine unchanged since that is most critical and just change the interrupt routine to push and pop the af register pair instead of saving it to a shadow register.  Its exactly the same size as before now and unnoticeably slower.

Just an fyi to all you asm programmers, I was able to save one byte from each call to Copy(), Fill() and Exch() using an optimization I hadn't considered before.
Code: [Select]
this:
  ld   b,h
  ld   c,l
  pop  hl

can become:
  ex   (sp),hl
  pop  bc

Its slightly slower, but its one byte less.

Oh, and I finally took care of another request: dereferencing.  The routine actually already existed so I only had to add about 6 lines of code.  The new syntax for that is the degree sign followed by the variable and it will return the variable's address.  For those familiar with C, its identical to the &.

A        Returns the variable A
{A}r     Returns what A points to
oA       Returns the address of A
{oA}r    Identical to the first example

So I don't want to see anymore of that {L1-52} nonsense and no one has any excuse for being mad if I change where the variables are in the future.  This works with all variable types including files and the subroutine variables.  Also, don't forget that any dereferenced variable is a constant address just like the L1-L6 addresses so any math you do to it is done during compile time for extra optimization.

860
The Axe Parser Project / Re: Features Wishlist
« on: September 07, 2010, 08:48:29 pm »
What about an alternative half byte referencing command?  I imagine that's what it would generally be used for anyway, so just take out the middle man.

Say I call this command nib{} which uses angle brackets like int{} since it's a referencing command.

[C0FFEE123456]->Str1
nib{Str1*2}   .returns C (12 in decimal)
nib{Str1*2+1} .returns 0
nib{Str1*2+2} .returns F (15 in decimal)
nib{Str1*2+N} .returns the Nth nibble in memory


The only strange thing you might notice about this is that the pointer has to be multiplied by 2.  That's because wherever it points to is in bytes so if the pointer is at the 100th byte, it is actually at the 200th nibble.  That's done during compile time in this case so its not going to increase program size or anything.  But now there are 131,072 (2^17) possible addresses, and so that means you can only use this command for half of the memory.  Ram is in $8000-$FFFF which is exactly the range needed.  However that would suck for apps because they need the other half from $0000-$7FFF.  To remedy this, there would be 2 commands, one for programs/ram/archive and one for apps.  So nib{} and nib{}r would work.

Would this be suitable?

EDIT: Oh, there could also be a store-to version for ram, like 5->nib{Str1*2+2} for instance.

861
You press [prgm] after getting an error.  It's had it since 0.3.0 I think but it was initially a little buggy.  I fixed most of it now, but it still has that large program bug, so I don't really trust it too much.  I can't seem to find the error in the code I'm using, but I haven't looked at it for a while so I'll check through it again before 1.0.

862
Axe / Re: Combining 2 AppVars into 1
« on: September 07, 2010, 08:13:33 pm »
Well, I'm not sure about the name checking, but to combine 2 ram appvars A and B into C, you can do this:

Code: [Select]
Return!If GetCalc("appvA")->A
Return!If GetCalc("appvB")->B
{A-2}r->X   .Size of A
{B-2}r->Y   .Size of B
Return!If GetCalc("appvC",X+Y)->C
Copy(A,C,X)
Copy(B,C+X,Y)
Delvar "appvA"
Delvar "appvB"

863
The Axe Parser Project / Re: Axe Parser
« on: September 07, 2010, 08:01:10 pm »
Axe does not use short circuit logic.  It's not on purpose, its just that its more difficult to parse and requires it to read it as a bunch of nested blocks instead of a single statement.  I certainly would want to add it, but at this point it would break too much compatibility with previous versions.  Its something I plan to change in Axe++ which would have a slightly different syntax since it doesn't need to be completely compatible with 1.0.

864
Axe / Re: How to use interrupts
« on: September 07, 2010, 12:20:36 am »
You can't have more than one interrupt running at once independently meaning an interrupt that interrupts the main code and the other interrupt.  But you can have multiple interrupt routines at once for different frequencies. Lets say you want one interrupt at 110Hz and one at 22Hz.  What you can do is setup a single interrupt at 110Hz (number 6) that increments a timer and when the counter gets to 5, then you call the 22Hz routine which also resets the timer.

865
TI Z80 / Re: Axe Platformer (Contest Entry)
« on: September 06, 2010, 10:33:55 pm »
Whoa, this is awesome.  Very nice sprites and animation.  That transition going through the door looks great as well.

866
Axe / Re: How to use interrupts
« on: September 06, 2010, 10:04:39 pm »
Yeah, the OS interrupt needs to be on in order to use the BASIC getkey because it has to detect when keys are pressed in the background.  You could tack on your own getkey routine for a few keys to the end of your interrupt if you really need a feature like that.

867
If its super creative and unlike anything else out there now, and in addition very polished and fun/addicting, then yes definitely its possible.  I would say that even if its simple it can win, but we won't know until we see all the entries.  They are not really judged on how complex or how large they are, but more along the lines of creativity, enjoyability, and quality.

868
The Axe Parser Project / Re: Axe Parser
« on: September 06, 2010, 03:16:50 am »
I was just asking Iambian how he gets grayscale to work in his project Escheron: Shadow over Ragnoth because I was wondering why it seems that every ASM game does grayscale in interrupts. Why exactly do the grayscale routines for Axe have problems with interrupts?

There is only one unfixable bug right now which is that after DispGraph commands, you need to turn interrupts back on again because they sometimes get turned off after a while.  Other than that, there is no problem with using interrupts for grayscale.  You have to use them the correct way though like the assembly programmers do.  That means your interrupt just increments a counter and your main program draws the grayscale once the counter gets to a certain point.  You can't have the 4 level routine inside of the interrupt routine itself because it uses the shadow registers for a speed optimization. But like I said, you should never be putting huge routines like that in interrupts anyway so its not a problem.

Personally though, I don't recommend them because they make the code larger and slower.  You should only use them when you are actually using them for their timing.  Games generally update the display pretty regularly anyway.  Even when there is a big variation in the amount of objects in a room, its not too hard to make the grayscale automatically adapt for that by doubling frames.

To answer the other question, this:
{L1-54}r->B

Parses identically to this:
A->B

There is no difference in the executable since this is an auto optimization.  The subtraction is during compile time.

(1)  {L1-54}
(2)  A^256
(3)  {L1-53}
(4)  A/256

In these examples, (1) and (2) do the same thing and both take 5 bytes.  No optimization there.  (3) and (4) also do the same thing, but in this case, (3) takes 5 bytes and (4) takes 6 bytes so there actually is a slight optimization.  Just for reference, r1-r6 as well as the Y0-Y9 files can also be accessed this way, but you would need the exact hex address becasue they aren't simple offsets with any of the L1-L6 buffers.

869
ASM / Re: Memory Juggling?
« on: September 04, 2010, 11:04:34 pm »
Its actually not that difficult.  But you need somewhere to store the ~7k bytes.  If you use the extra ram page, then that would work very well and you could execute programs as large as half the free ram ~12k bytes.  If you have your program in 2 parts, an archived executable and another program that runs it, then you can use the entire 16k bytes.  But unfortunately, the regular 83+ doesn't have the extra page.

870
ASM / Re: Memory Juggling?
« on: September 04, 2010, 10:51:23 pm »
That's fine if your program disables the OS interrupt and doesn't use a single bcall.  But if it does, it's going to be reading and writing over your program memory where it expects all the OS variables to be causing the bcall to not work properly either so it will surely cause a ram clear.

Pages: 1 ... 56 57 [58] 59 60 ... 135