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 ... 22 23 [24] 25 26 ... 135
346
Axe / Re: PIC MISSING even though Picture is present
« on: June 21, 2011, 03:28:09 am »
That's interesting it happened when the picture was in RAM because I first thought it might be a page boundary issue.  I'll double check the code for tilemap importing.

EDIT: Found it!  Funny bug... the picture tokens are 2 bytes each so it has to call an extra "read byte" routine after the first byte has already been added to the file name buffer.  That's fine, but there's a 1/256 chance that the parser needs to display the current progress (which it checks for during every "read byte").  It just so happens that TI's routine uses the same buffer to display numbers so the filename being built up will get corrupted and you get a "pic missing".  This will be fixed next version, in the mean time, adding/removing a comment before the [Pic] command should get rid of it.

347
Math and Science / Re: Finding out which side of a line a point is on
« on: June 21, 2011, 12:48:06 am »
Its very simple.  If you have a point R with vector RS, you can determine if point P is above or below by taking the dot product of the vectors RS and RP.  If its positive, its above, negative, its below, and zero its on the line.  It requires just 2 multiplications and an addition.

EDIT: Actually wait, that doesn't work.  Let me revise that.

EDIT2: The correct formula was this:
(X2 - X1)*(Py - Y1) - (Y2 - Y1)*(Px - X1)

You can improve it slightly to this:
(X2 - X1)*(Py - Y1) + (Y1 - Y2)*(Px - X1)

That replaces a subtraction with an addition to speed it up.

348
Axe / Re: Routines
« on: June 20, 2011, 10:03:30 pm »
You can always use a single Pt-Mask() to write a white square to both buffers.  Not sure if yours is faster than that or not, but its possible due to the lack of clipping and argument checking.

349
The Axe Parser Project / Re: MIDI To Axe Music Converter
« on: June 20, 2011, 02:26:10 am »
Yeah, there's a bug where it gives an invalid checksum to the file.  You can get around it by transferring it to wabbitemu and then transferring it back.  I fixed this but I haven't finished the new version yet.

350
Axe / Re: Detector colision probleme
« on: June 18, 2011, 07:33:15 pm »
Don't forget order of operations is strictly left to right.  Change O=X+A-2 to X+A-2=O.

351
ASM / Flash Locking
« on: June 17, 2011, 09:26:00 pm »
Quick question.  I use flash unlocking a lot and I was wondering if flash actually gets locked again by the OS once an application quits.  If not, is there a simple way to lock it again?  I don't want the potentially unlikely yet dangerous situation of someone's buggy code accidentally writing to flash and corrupting something.  This flash stuff isn't well documented so I'm hoping someone knows the answer.

352
eh.... as much as I like the dot, I would really like to avoid it so it doesn't look weird next to another new feature I'm adding.

353
Axe / Re: Get first/second byte of r-variable easily
« on: June 17, 2011, 05:05:42 am »
To answer the original question:

Code: [Select]
r1/256
r1^256

The top one gets the high 8 bits and the bottom one gets the low 8 bits.  Although {or1+1} is slightly more efficient than r1/256 currently, but it could eventually auto-optimize in later versions.

354
Cool, thanks!  I was also able to do that same sign flag optimization to the 8.8 multiplication routine.  Any idea what might be a good token for fixed point division?  That's the main thing holding me back from adding it.  /* is the first thing that comes to mind but I think its confusing.  /// could also work but that's a lot to type...

355
Math and Science / Re: The Four travelers
« on: June 16, 2011, 10:12:31 pm »
From a game theory perspective, I'd have to agree that 19 is the minimum amount of time it can take unless there is something fundamental about this problem that I'm not understanding (which I assume there is).

-Each trip across must be a full trip due to the 3 person rule.  Otherwise it could only increase the time.
-Mr. A has to travel with every person or else it could only increase time.
-I'm assuming you can't "toss" the lamp over the bridge, set it on fire, or cut it and swing to the other side.

356
Axe / Re: [Tutorial]Achieving Decent Functional Programming in Axe
« on: June 16, 2011, 09:40:16 pm »
High order functions will be possible in Axe 1.0.0, and will be an interesting paradigm change.  That will probably be THE biggest change from the betas.  However, I'm still not sure if they will be recursively nestable yet, where the parameters can be backed up to the stack, but its still pretty damn useful.

357
The Axe Parser Project / Re: Bug Reports
« on: June 16, 2011, 05:11:26 pm »
Thanks Runer, I completely forgot about that, much easier!

358
The Axe Parser Project / Re: Axe Parser
« on: June 16, 2011, 06:49:51 am »
So far, its the same speed.  However, after the first pass, there is a short but noticeable pause as it writes all the used subroutines to the current end of the program so that data is always after any code during the 2nd pass.  I don't think the peephole ops would cause a significant slowdown either, probably unnoticeable.

359
Axe / Re: Commands for Axe
« on: June 16, 2011, 06:39:25 am »
Pt-On is the sprite drawing command which takes 3 arguments.  You want Pxl-on to draw pixels.  Also, you seem to be under the impression that it is easy to convert a BASIC program into an Axe one.  This is definitely not the case.  Even though they look the same, they function completely differently.  Luckily, Axe comes with some documentation of how it works written for people already familiar with BASIC, just like you.  You should definitely give it a read, its not that long.  Also, be sure to check the commands.htm file before using any command in Axe just to make sure it does what you think it does. :)

Oh and by the way, if you press [prgm] right after an error, it will scroll to the error.

EDIT: And also, you'll want a DispGraph at the end to display the buffer on the LCD.  And starting text with -1 doesn't do what you think either, you'll need the "Fix" commands.

360
The Axe Parser Project / Re: Axe Parser
« on: June 16, 2011, 06:29:46 am »
Yay!  I can finally parse STARSHIP and have it work.  I still need to fix a bunch of miscellaneous things though.

Since I'm rewriting the engine anyway, I figured I might also want to add another feature to the auto-optimizer, something called "Peephole Optimization".  The way it works is basically every time the parser writes an inline instruction, it will scan upwards several bytes and see if the code matches a list of patterns.  If it does, it will replace the code with the more optimized version and then continue writing.  If this works, then its possible Axe programs can get EXTREME :o optimizations approaching that of a moderate z80 coder. It could result in up to a 5-10% decrease in code size plus a small speed boost!

I am going to try to make these open source like I have been doing with the commands so that others can help me with them, hopefully I can find a good system for it.  This is all speculation though, I'm not sure if I'll have time or add it at all if it gets too complex, but I'm hoping it can work.  This could also render a lot of those weird Axe tricks obsolete since they would happen automatically, like 0->A:0->B could automatically optimize to 0->A->B.

Pages: 1 ... 22 23 [24] 25 26 ... 135