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 - Runer112
Pages: 1 ... 124 125 [126] 127 128 ... 153
1876
« on: October 20, 2010, 08:12:52 am »
Ah ok. Seems kinda good I guess for Axe. One question, though: I never learned Sin/Cos much in hi school and never got into 3D stuff, but with your routine, what kind of game could be possible that wouldn't be with the built-in routine?
Raycaster
1877
« on: October 20, 2010, 08:11:08 am »
with the pt-Mask(x,y,sprite) command, you can take a masked spritee and draw it on the screen so that certain parts are white, certain parts are transparent.
How a masked sprite works: there are two parts; the normal sprite and it's back buffer sprite. the front sprite defines what is black and what is white; then the back buffer decides what is filled white, and what is transparent. a black dot on the front buffer is always black (in monochrome mode, no grayscale) if a dot is blank in the front buffer sprite, then if there s a pixel behind it that is black it will show up filled with the pt-mask() command.
a sprite data like this (in binary -- easier to visualize)
11000000 00001100
if the first byte is front buffer and the second is back buffer, then the first two pixels drawn will be black, the next two transparent, the next two filled white, he last two transparent.
if you still don't understand, look in the axe parser documentation for a better idea.
Actually the Pt-Mask() command (accessible as the Plot1() token) has different logic, as it was designed for 3-level grayscale masked sprites. Each sprite would have 2 8-byte buffers of data. The bits in each byte in the buffers would correspond to a pixel color as follows: Second buffer 1 0 First 1 Black Gray Buffer 0 White Transparent
1878
« on: October 20, 2010, 03:23:38 am »
Well obviously they're not going to be as fast as the built-in sine and cosine routines, as not only are those written in pure, optimized assembly, but they don't have to be nearly as accurate. Timing the routines at 6MHz gave these results: - The built-in sine routine calculates the sines of 1-65535 in about 4.4. seconds (let's call this 100% speed)
- My size-optimized sine routine calculates the sines of 1-65535 in about 23.1 seconds (19% speed)
- My speed-optimized sine routine calculates the sines of 1-65535 in about 17.7 seconds (25% speed)
19% speed may sound a bit slow, but that's still almost 3,000 calculations per second. So these routines are about 4 (speed-optimized routine) or 5 (size optimized routine) times slower than the built-in routines. My routines are also 12 (size-optimized routine) or 22 (speed-optimized routine) times the size of the built-in routines (378 or 695 vs. 31 bytes). But you get 256 times the accuracy, so depending upon what you need, it could be worth it.
1879
« on: October 20, 2010, 02:38:42 am »
Cool, I now have access to the forums again.
Anyways, the routines I had were a pair of deadly accurate sine and cosine routines. And by deadly accurate I mean percent errors in the hundredths or thousandths of a percent. Whereas the built-in routines accept integer inputs and give signed 8-bit integer outputs, these routines accept 8.8 fixed point inputs and give signed 8.8 fixed point outputs. That means it accepts inputs with 256 times the precision, and gives outputs with 256 times the precision as well!
The first file (TRIGLIB.8xp) is the library you probably want to use in most situations, as it's slower than the second library but over 300 bytes smaller. This is because, whereas the first library uses a 128-byte LUT for one quarter of the period and makes use of the symmetry of the sine wave to do extra calculations for values anywhere in the period, the second uses a 512-byte LUT for the full period.
EDIT: Oh right, I forgot to say: use sub(SIN,value) and sub(COS,value) to use them. And to properly insert a library like this into your program, put a line saying prgmTRIGLIB in the subroutine section of your code.
1880
« on: October 19, 2010, 10:45:36 pm »
I think you guys might be overthinking this... I think all he wants is Pt-Off() instead of Pt-On().
1881
« on: October 18, 2010, 06:00:43 pm »
L1. In that area of safe RAM (the 54 bytes before where L1 points) is where the built-in 27 variables reside, too.
EDIT: Mega ninja'd.
1882
« on: October 18, 2010, 11:53:56 am »
OH MY GOD, PROGRESS!!! YAY! I thought this was dead!
1883
« on: October 18, 2010, 09:48:06 am »
1884
« on: October 18, 2010, 09:31:56 am »
Well I wanted to post the source for a routine I had just made, but the option to attach files seems to have vanished...
1885
« on: October 17, 2010, 06:59:03 pm »
.S=Score (or any other number to align right) .T=Temp .X=x position of text .Y=y position of text 91→X S→T While T/10→T X-4→X End Text(Y,X,S▸Dec)
1886
« on: October 17, 2010, 06:49:21 pm »
Pick which sprite you want for what, I rotated them both
1887
« on: October 17, 2010, 06:24:36 pm »
A 12-frame rotation for the captured ship sprite made by SirCmpwn. EDIT: By the way, perhaps these may be of use: Galaga for arcade
| | Galaga for Gameboy Advance
| EDIT 2: I was just watching a video on youtube of Galaga, and I noticed something... The "captured fighter" never rotates, it only rotates when it's being captured or being released, in which case it's colored like the normal fighter. Should I modify my animation to instead rotate SirCmpwn's other ship sprite? Or do you just want to flip his definitions?
1888
« on: October 17, 2010, 05:42:04 pm »
By the way, I just sort of chose 16 rotations arbitrarily. It seemed like enough to smoothly rotate small sprites without going too far overboard. If you want less or more (probably 12 or 24), though, just ask and it'll be no problem for me to remake them.
1889
« on: October 17, 2010, 06:26:27 am »
What about pictures, strings, and lists? Those have a E00-E09 byte built into their name and could incorrectly be read as a valid NL. I'm not saying its impossible to do, I'm saying its impossible to do and have it work correctly in every possible situation. I'm sure someone could have some kind of hacked variable or something that would break your system.
Well I know pictures are stored in the other section of the VAT, and although I'm not sure about strings, I believe they are also stored in the other section. However, lists are in the section we're concerned with, which is the point of the {P+2} check. If the name is a two-byte token for L1- L6 and {P} is detected as the byte in the token less than or equal to 8 (the byte of the name found earlier in RAM), then {P+2} will always be NL, which can never be greater than or equal to 0x40. If {P} is the NL byte, though, then {P+2} will be DAH, which is always greater than or equal to 0x40, so this will be positively identified. And yes, if someone has hacked, invalid VAT entries, that could potentially break my system, but there's really no reason that should ever happen. Unless they were mucking around with the VAT themself, in which case it's their fault anyways if VAT reading code fails. EDIT: Speaking of hacked VAT entries, I just remembered that DCS makes programs called "%FLD n" to handle its folders, where n can be any byte, so could be less than or equal to 8. However, this would be avoided in the initial skip over the first byte, which I originally had only in case it was a formula byte for a list. Now it looks like the skip performs double duty
1890
« on: October 17, 2010, 12:05:12 am »
Like a linked list, it is impossible to transverse the list backwards. You would have to start at the beginning again and then iterate through the list until you get to the N-1th item. Generally this is pretty fast though unless you have over 9000 items on your list. That's how the calculator "scrolls up" on your program list*.
*kind of becasue it also has to sort alphabetically.
Oh really? I beg to differ: .Get Previous Entry .Returns 1 if start of VAT or 0 otherwise Lbl VPV P+1→P While {P+1→P}≥8+({P+2}≤ᴇ40) End P+6→P={ᴇ9830} Return | |
Skip the first byte in case it's the F# byte for a list or a DCS folder # Keep advancing until {P+1→P} is a valid NL and {P+2} is a valid DAH Optimized version of Repeat {P+1→P}≤8 and {P+2}≥ᴇ40 Move forward 6 bytes to start of entry and signal if at start of VAT
|
Unless some cretin (possibly the same one who left the CPU in Mode 2) messed with the VAT so a name besides L 1-L 6 contains a byte with a value of less than or equal to 8 in it, this should work. (Can someone please verify my belief that DAH will always greater than or equal to 0x40?) *Pats self on back for doing something even Quigibo thought was impossible*EDIT: Will also correctly deal with DCS folders!
Pages: 1 ... 124 125 [126] 127 128 ... 153
|