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

Pages: 1 ... 151 152 [153] 154 155 ... 197
2281
Axe / Re: Need code help with Sprites
« on: March 16, 2010, 11:38:36 pm »
Hmm well you don't need to do ClrDraw, you can just do "Pt-Off(X,Y,Pic#" before you update it's X or Y location, and then draw the new sprite.
Pt-Off doesn't work that way. What it actually does is similar to the "overwrite" option in xLib. You could do Pt-Off with a blank sprite to erase though, I think

2282
The Axe Parser Project / Re: Assembly Programmers - Help Axe Optimize!
« on: March 16, 2010, 10:13:57 pm »
That's a cleaver trick!  But wouldn't something like this be simpler?

or a
sbc hl,de
add hl,de
jr nc,$+3
ex de,hl


But I'm trying to convert all of my math commands to signed operations anyway, so I would need to tweak it a bit.
Ah, I didn't think of that. :P Here's a good way to do signed comparison by the way:
or a
sbc hl,de
ld a,h
rla
jp po,$+4
ccf

It should give the same flag outputs you would expect from an unsigned compare (note that rla does not modify the Z or P/V flags)

Edit:
Now I came up with one that can restore the original value of HL without destroying the C flag in the process:
or a
sbc hl,de
ld a,h
jp po,$+4
cpl
add hl,de
rla

2283
The Axe Parser Project / Re: Assembly Programmers - Help Axe Optimize!
« on: March 16, 2010, 09:21:55 pm »
I just made optimized min/max routines that you can use :D
Code: [Select]
Min_HLDE:
 xor a
 sbc hl,de
 jr c,$+4
 ld h,a
 ld l,a
 add hl,de

Code: [Select]
Max_HLDE:
 xor a
 sbc hl,de
 jr nc,$+4
 ld h,a
 ld l,a
 add hl,de

2284
The Axe Parser Project / Re: Axe Parser
« on: March 16, 2010, 02:39:28 pm »
This?

Quote
'CHAR'   The expression becomes the ASCII value of the single character between the apostrophes. It can even be another apostrophe.
Yep, that would be it. Like, if you read a byte, B, from a string you can check to see if it is "A" by doing:
Code: [Select]
If B='A'instead of the more cryptic
Code: [Select]
If B=65
This really helped the readability of my BrainF*** compiler

2285
The Axe Parser Project / Re: Axe Parser
« on: March 16, 2010, 02:27:47 pm »
Just search for "ASCII" and you should find it, I think

2286
The Axe Parser Project / Re: Axe Parser
« on: March 16, 2010, 12:57:52 am »
Mhmm ok, because the way it is explained in the doc seems like something totally different. I think it may be best to clarify in the doc that fill does the same thing as the BASIC command, but for pointers instead of lists. Also if I read Builderboy way, I still doN,t get it. To me it seems like he's saying Fill just copy one list element to the next one, not fill the entire list with an element.

About Conj, what if we want to do For(X,9,12:{L1+X}->{L2+X:End?

Also are lists defined the same way as other stuff? Like at the beginning of a program I just do {2,34,5,23,0->L1?
For that example, you would want conj(L1+9,L2+9,4

And remember that L1-L6 are just areas of RAM. So, you will need to initialize data just like for a sprite (you will have to convert the values to hex), and store to a String or Pic or something. Then, you should copy your String/Pic to one of the defined RAM areas. (I suppose technically, you could modify the data while it's in the program, but that only works correctly for no-stub)

Edit: Example code
Code: [Select]
:[0222051700->Pic1
:conj(Pic1,L1,5

Edit2:
Also, remember that Quigibo is planning for real array support later. So it should get easier.

2287
The Axe Parser Project / Re: Axe Parser
« on: March 16, 2010, 12:16:16 am »
I'll give some examples of these commands in use. For example, instead of doing this to fill the 6 bytes at L1 with zeros:
Code: [Select]
:For(X,0,5
:0->{L1+X
:End
You can do this:
Code: [Select]
0->{L1}
Fill(L1,6

The conj( command is just used to copy a number of bytes from one location to another, like if you want to copy 10 bytes from L1 to L2. Here is the old way:
Code: [Select]
:For(X,0,9
:{L1+X}->{L2+X
:End
And here is the new way:
Code: [Select]
:conj(L1,L2,10
expr( does a similar thing, but it exchanges, or swaps, the data at the two locations.

2288
The Axe Parser Project / Re: Assembly Programmers - Help Axe Optimize!
« on: March 15, 2010, 11:59:11 pm »
I tried -1*-1 and I ended up with 1. I dunno, maybe there's something going on with the underscore in the loop label? I've never really used that.

2289
The Axe Parser Project / Re: Assembly Programmers - Help Axe Optimize!
« on: March 15, 2010, 11:41:33 pm »
By the way calcmaniac, your code didn't work.  I tried -1 times 1 and it returned a weird number.  But I was able to create my own routine after looking at some other code.  Its a little slower, but its roughly the same size as the original 8bit routine.
I just typed it in on my calculator and tried $ffff*$0001 and $0001*$ffff and both gave $ffff. Did you make a typo somewhere or something?

2290
The Axe Parser Project / Re: Assembly Programmers - Help Axe Optimize!
« on: March 15, 2010, 11:08:03 pm »
Hmmm it would seem so.  Is it really so much of a hassle to flip the negative bit, multiply/divide, then flip it again?  Seems trivial compared to any other modification, although i'm not an asm guy :P
You can't just flip a bit. You have to subtract from zero.

2291
Other Calculators / Re: Modded Calculator?
« on: March 15, 2010, 09:41:09 pm »
Apparently the 83+SE, 84+, and 84+SE 15MHz mode is already overclocking, just officially by TI.

2292
Project M (Super Mario) / Re: Project M Reboot
« on: March 15, 2010, 04:34:11 pm »
I redraw the whole thing every frame with a dedicated routine (along with the scrolling background). In Axe, you could probably draw some sprites after you scroll, since they are clipped to the edge of the screen now

2293
Project M (Super Mario) / Re: Project M Reboot
« on: March 15, 2010, 04:14:49 pm »
That looks incredible!  I'm glad progress is being made with this!  ;D

I was wondering: How do you just display the parts of the tiles you want when it scrolls?  I was trying to figure out how to do this in Axe, but I couldn't figure out the right method to use.  How does the great calc84 do it? :D  Thanks!
I don't think I understand your question. You mean how do I do smooth-scrolling?

2294
Project M (Super Mario) / Re: Project M Reboot
« on: March 15, 2010, 10:38:47 am »
It means that I have a table of routine, one for each tile. When Mario collides with the tile, the routine is called and it can do stuff :D

And I might try to get the grayscale working properly as well. :P

Edit:
Also, you may have noticed that the bouncing blocks are smoothly animated now, rather than jumping a few pixels. :D This is one of the strengths of my sprite routine.

2295
Project M (Super Mario) / Re: Project M Reboot
« on: March 15, 2010, 12:24:23 am »
I fixed a bunch of collision detection bugs, added support for collision callbacks, and also added a couple new types of (sprite) objects :D


Edit:
Browsers that support playing GIFs with high framerate recommended (such as Firefox)

Pages: 1 ... 151 152 [153] 154 155 ... 197