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

Pages: 1 ... 76 77 [78] 79 80 ... 153
1156
The Axe Parser Project / Re: Features Wishlist
« on: June 23, 2011, 08:59:18 pm »
Remove the scope restrictions on commands? I was just working on a pretty beastly optimization using the value returned by Copy() in the middle of a line, but Axe won't let me. :(

Also, do you think the /10 "optimization" should be removed? It results in smaller code, but also much slower code.

1157
Axe / Re: Routines
« on: June 21, 2011, 05:23:37 pm »
I found an error and fixed it, try it again? Hopefully it was the last error.

1158
Axe / Re: Routines
« on: June 20, 2011, 11:45:12 pm »
I think this is about as fast as it gets for drawing a white square to both buffers. It is not clipped. The code given is for drawing a 6x6 square, but it can be modified to draw a rectangle of any width from 1-9 and any height.

I haven't actually tested this, but hopefully it works. If it does work, it will be very fast. It is faster than drawing a single unaligned sprite to only one buffer.


Code: (79 bytes, 1164 cycles) [Select]
Lbl CLR
.Clear a 6*6 spot on both buffers
.r₁ is the X coordinate and r₂ is the Y coordinate
Asm(447D85856F29293AA5834FCB39CB39CB390911409319E5E607874F)
([03FF81FFC0FFE07FF03FF81FFC0FFE07])
Asm(095E2356E10606C57EA377237EA277013105097EA377237EA27701D9FA09C110E6)
Return


Code: (Source code) [Select]
  ld b,h
  ld a,l
  add a,l
  add a,l
  ld l,a
  add hl,hl
  add hl,hl
  ld a,(axv_r1)
  ld c,a
  srl c
  srl c
  srl c
  add hl,bc
  ld de,plotSScreen
  add hl,de
  push hl
  and %00000111
  add a,a
  ld c,a
  ld hl,$0000        ;Replace with mask LUT
  add hl,bc
  ld e,(hl)
  inc hl
  ld d,(hl)
  pop hl
  ld b,6
DrawLoop:
  push bc
  ld a,(hl)
  and e
  ld (hl),a
  inc hl
  ld a,(hl)
  and d
  ld (hl),a
  ld bc,appBackUpScreen-plotSScreen-1
  add hl,bc
  ld a,(hl)
  and e
  ld (hl),a
  inc hl
  ld a,(hl)
  and d
  ld (hl),a
  ld bc,plotSScreen-appBackUpScreen-1+12
  add hl,bc
  pop bc
  djnz DrawLoop

1159
Axe / Re: Routines
« on: June 19, 2011, 01:52:20 pm »
For copying data from archive to RAM, you want to use Axe's built-in Copy() command. It's smaller, easier to use, and handles page boundaries better. They both handle boundary crossing during copying correctly, but only Axe's built-in command handles boundary crossing before copying correctly. Like:

Copy(Y₁+16384,L₁,256)

1160
decimal dot doesn't mean a comment if it's not the first token on the line.

Actually the comment indicator works anywhere in a line. I don't think Quigibo intended for this originally, but I think having the side affect of inline comments is actually pretty nice.

1161
Since it's fixed point division, how do you think /. looks? I think that operator is actually sort of logical with the decimal point. And although I don't know if you would want to change the fixed point multiplication operator and break compatibility with old programs, I think *. would make a great complement.


Ninja response to Scout: I think the division/multiplication operator first would be a good idea so the parser doesn't see the decimal first and have to worry about what follows being either a comment or a math operator.

1162
Axe / Re: Converting this in Axe-Language
« on: June 17, 2011, 09:27:59 am »
Here's the closest conversion I could come up with. It's not optimized much, as I tried to make the conversion appear 1:1 as much as possible. It runs a lot smoother than the screenshot would suggest, I just recorded it at a low framerate to ensure that most browsers could view it at the correct speed.


EDIT: Also, it's entirely possible that this is not the effect you wanted, because I'm not sure if the code you posted originally is a fully correct copy of your program. Certain parts seemed strange, like:
Code: [Select]
:If X>B:1→Z
:If X>B:-1→Z
:If Y>A:1→V
:If Y>A:-1→V

1163
The Axe Parser Project / Re: Bug Reports
« on: June 16, 2011, 08:44:29 am »
Actually, that's something I can fix.  I haven't updated the token replacement chart for ages since no one's requested any new ones.  I'll see what I can do for the next update.

Why do you need your own chart? When parsing strings, couldn't you use [wikiti]83Plus:BCALLs:4594[/wikiti], which converts a token into its equivalent ASCII string? You may want to use your own chart for the common, short tokens like all the letters, numbers, and some punctuation for speed purposes, though.

1164
The Axe Parser Project / Re: Bug Reports
« on: June 15, 2011, 08:05:41 pm »
I'm not sure how he triggered the empty compile list bug, but here's how I triggered it:

  • Make sure you have at least one Axe backup
  • Using OS memory management, delete all Axe source programs
  • Open the Axe application to the compile menu
  • Delete every backup
  • ???
  • Profit! Although you're not really profiting, you're crashing Axe and losing the contents of RAM.

1165
Axe / Re: Axe Q&A
« on: June 15, 2011, 03:37:59 pm »
You don't need a r, the contrast is a 1-byte value. I think it's not appearing to work correctly because the value stored at 0x8447 isn't the value actually sent to the LCD driver. When adjusting the contrast, the value the OS sends to the LCD driver is the byte stored at this address plus 24. So to set a contrast one higher than the current OS contrast, you would do:

Shade({ᴇ8447}+24+1)

1166
Axe / Re: Commands for Axe
« on: June 15, 2011, 03:17:02 pm »
I know I'm a bit late to join the party to help out here, but I have a lot more information to offer. What follows is a list of code conversions for all your examples, each accompanied with an exhaustive list of notes. These notes specify how the Axe code works and help outline how it is different from its BASIC counterpart.

If you have any questions left unanswered by this, please ask!


BASIC   Axe   Notes

randInt(1,5)→X   rand^5+1→X   
  • rand returns a pseudo-random integer from 0 to 65535.
  • ^ is the modulus function, which would then limit this number's range to 0 to 4.
  • Adding one increases the range to 1 to 5.
  • Axe 1.0 may have a built-in random integer function with a specifiable range, making the above obsolete.

{1,2,3,4,5}→L₁   Data(1,2,3,4,5)→GDB1   
  • Instead of storing the list of numbers in an OS list variable accessible outside of the program, the data is stored inside of the program.
  • If this is compiled as an application, you will be unable to change the values in this list. Get around this by copying the list to RAM and instead operating on the copy.
  • Each number is only a 1-byte integer instead of a 9-byte float.
  • Get used to only using 1- or 2-byte integers in Axe!
  • Whereas code to access this list in BASIC would be like L₁(3), the Axe code would be {3-1+GDB1}. The -1 is added because data in Axe is zero-indexed.
  • You could make this a list of 2-byte numbers by adding the ʳ modifier to the end of each number. Elements of the list would then be accessed with code like {3*2-2+GDB1}ʳ

sub("ABCDEF",3X-2,3)→Str1   sub(SUB,"ABCDEF",X*3-2,3)→S

.Later in the code:
Lbl SUB
0→{Copy(r₂+r₁-1,ᴇ8000,r₃)}
Return ᴇ8000
   
  • Axe has very few built-in string manipulation functions, which is why...
  • You supply your own routine! Lbl SUB is a custom routine for the substring operation. It places the substring starting at byte 0x8000 in memory in a 256-byte section of free RAM not used by anything else in Axe.
  • sub(SUB,[arg1,arg2,...]) calls the routine named SUB, with up to 6 arguments optionally specified. These arguments are then placed in order into the variables r₁-r₆
  • Note that implicit multiplication (e.g. 3X) is not supported. X*3 is used instead. 3*X would also work, but it much less optimized.
  • The result of the function is not an actual string object, but a pointer to the object. So the value returned is stored to the integer variable S.
  • Get used to strings, OS variables, and more being referenced as pointers to the objects, not the objects themselves!

iPart(X)+abs(Y)→Z   X+abs(Y)→Z   
  • Since values in Axe are 2-byte numbers, floats and decimals along with functions like iPart() are out.
  • Because certain code can result in more optimized assembly, this would be more optimized as abs(Y)+X→Z

For(X,1,20,1)
End
   For(X,1,20)
End
   
  • Axe does not support an increment argument with For() loops, so it's a good thing your sample code had an increment of one!
  • Axe 1.0 will hopefully support the optional increment argument with For() loops
  • I don't know if you have no code inside of the For() loop because this was just an example, or if you were using it simply to generate a pause. If you are just aiming to generate a pause, Axe's Pause # command should be very helpful. A Pause 1800 approximately correlates to a one-second pause at 6MHz, or approximately a Pause 4500 at 15MHz. (Unless you use the Full command in your program and it is executing on a non-83+BE, your code is running at 6MHz)

dim(L₁)→A   Data(1,2,3,4,5)→GDB1
[]→GDB0
GDB0-GDB1→A
   
  • This code assumes L₁ is the list you defined earlier.
  • GDB1 points to the first byte of the list, and GDB0 points to the first byte after the list. So subtracting the two gives you the distance between them, in this case the size of the data.
  • If this were a list of 2-byte numbers, you would need to make sure to divide the distance calculated by 2.
  • To make a dynamic list with a variable number of elements, you would need to put the list in a section of free RAM somewhere and keep track of the number of elements yourself.


1167
The Axe Parser Project / Re: Bug Reports
« on: June 15, 2011, 03:06:05 pm »
Numbers in Axe are limited to 2-byte values, so 0-65535. Compiling will fail upon reaching a number greater than this.

Also, it's not a bug that people can create malicious code with Axe. You can create malicious code with any language, but because Axe is powerful, you can create powerfully malicious code.

1168
The Axe Parser Project / Re: Bug Reports
« on: June 15, 2011, 02:27:56 pm »
That most certainly is a major bug, and a great find! I always have Axe source code on my calculator so never noticed this before.

1169
TI Z80 / Re: Tag
« on: June 14, 2011, 12:36:14 am »
The title screen is 4-level grayscale, is it not? In which case I suggest you use 4-level grayscale for the pause screen as well, which would save you 66 bytes. :)

1170
ASM / Re: Texture drawing
« on: June 13, 2011, 06:59:02 pm »
Well Gemini was a raycaster, not a "real" 3D engine. Which I believe is what ben_g wants. Applying textures in raycasting is easy because of the vertical scanline rendering method and the restrictions of the camera.

Pages: 1 ... 76 77 [78] 79 80 ... 153