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 ... 158 159 [160] 161 162 ... 197
2386
TI-Nspire / Re: TI-Nspire GB Emulator
« on: February 12, 2010, 09:32:46 pm »
I'm currently working on adding some OS interfacing, like using malloc to request RAM and hopefully saving/loading save games using actual Nspire files

2387
The Axe Parser Project / Re: Features Wishlist
« on: February 09, 2010, 11:38:20 pm »
The next version has already taken care of getting 'illegal' characters into strings using standard tokens.

Let me just explain signed vs unsigned so it doesn't confuse anyone.  All the numbers are unsigned meaning they represent a number between 0 and 65535.  Negative numbers act just like the regular numbers counted backwards instead of forwards, that is -1 is really 65535, -2 is really 65534, etc.  This allows normal subtraction and addition with negative numbers that everyone is used to.

That's all well and good until you have a statement like -1<1.  That would actually be false since 65535 is not less than 1.  You can get around this by doing a 'signed comparison' which is what calc84maniac is talking about.  The limitations with signed comparison is that your numbers can only be half the size, that is -32768 to 32767.  So you would not be able to use the signed comparison (and get the correct answer) if the number is too large or too small.

This is an good idea to implement, but I think I would want it more intuitive than a question mark.  Maybe something like -1<<1 would be better?  Repeating any operation twice will do the signed version of the operation.  So -4<<2 equals 1 and -2**8 would equal -16.

Oh and by the way, bitwise and Boolean or are identical, there is no reason to separate the 2.
But shouldn't << be shift left or something?

Also, bitwise and boolean OR are different.
5 | 2 = 7
5 || 2 = 1 (and the "2" expression isn't evaluated because 5 is non-zero)

2388
The Axe Parser Project / Re: Features Wishlist
« on: February 09, 2010, 07:25:56 pm »
Great idea!  I assume you mean strings would look like this: "Part 1"+?41+"Next Part"+Str1  If Str1 was "Hi" then it would result as "Part 1ANext PartHi".  Sounds cool. :D
Actually, I was thinking "Part1?X41Next Part"+Str1. The X might not be necessary I guess, but it might simplify parsing. To put a question mark in a string, you would use "??"

2389
The Axe Parser Project / Re: Features Wishlist
« on: February 09, 2010, 06:45:40 pm »
I have a suggestion for the parser. You should have a character (I'm thinking "?") that acts as an operation modifier, for things that can possibly have more than one use. For example, "?>" could be used as signed compare, and "? or " would be bit-wise or, while " or " would be boolean or. It could also be used in strings as an escape character, for example ?" would put a quotation mark in the string and ?X41 would put the character 0x41 (or "A")

2390
News / Re: A new 84+ OS ???
« on: February 08, 2010, 12:22:19 pm »
Well the bugs that have been shown all seem to happen because inverted text doesn't act quite like it used to. I think pure Basic things could be fine.

2391
Pokémon Purple / Re: [PP] Progress '10
« on: February 07, 2010, 10:50:56 pm »
I just noticed, when Ash is auto-moved up when he tries to leave, he's still facing down. (unless down/up look the same and I'm crazy)

2392
News / Re: A new 84+ OS ???
« on: February 07, 2010, 10:42:19 pm »

Are those pixels on row 63 in Basic? D:

2393
General Calculator Help / Re: Kirk Meyer's Graph3--Easter Eggs
« on: February 06, 2010, 08:17:39 pm »
I thought about putting an easter egg in Chip's Challenge but I never got around to it.

2394
General Calculator Help / Re: Kirk Meyer's Graph3--Easter Eggs
« on: February 05, 2010, 10:12:01 pm »
I think you have to press ZOOM twice while viewing a graph

2395
The Axe Parser Project / Re: Axe Parser
« on: February 05, 2010, 08:01:00 am »
I think the only way to speed up anything related to text display is to have a custom font routine, though. I am not sure how easy it would be to implement such thing for Axe parser, especially for home screen stuff, where it might be impossible.
I think the problem here is that the output ASM program has to work on its own, so all the font data and routines would be unnecessary overhead

2396
The Axe Parser Project / Re: Axe Parser
« on: February 04, 2010, 06:54:17 pm »
I am confused by what this means. Does it means it would be only possible to mutiply by 2, 4 and the like? It might become an issue for example if I did a small RPG where your max HP and attack power was like 101 x character LV
He's just saying that it would be slower to multiply by anything else because it would call a general routine instead of adding manually

Edit: Ninjaaaaa

2397
The Axe Parser Project / Re: Features Wishlist
« on: February 04, 2010, 12:02:28 am »
Sorry to double post, but I've just started to add the "Output()" feature and I'd like to get some feedback on it.

I know that native BASIC uses Output(y,x) but I much prefer the form of Ouput(x,y).  Should I keep it the old way to less confuse people transitioning from BASIC to Axe, or should I change it to (x,y) so that its more consistent with "Text(" "Pt-On(" and the other drawing commands?
I think you should keep the old way, but start counting at 0 instead of 1.

2398
The Axe Parser Project / Re: Axe Parser
« on: February 03, 2010, 11:45:58 pm »
Thanks for that division routine, but I found this one and its a lot smaller.

Code: [Select]
HL_div_DE:
ld a,h
ld c,l
ld hl,0
ld b,16
__DivLoop:
sll c
rla
adc hl,hl
sbc hl,de
jr nc,__DivSkip
add hl,de
dec c
__DivSkip:
djnz __DivLoop
ld h,a
ld l,c
ret

I'm just a little bit worried about the use of the sll command, will that sacrifice compatibility with the Nspire?
You are correct. You can replace it with "scf \ rl c" though

Edit:
Also, if you haven't done this already, I'd like to suggest that you auto-generate multiplication algorithms when multiplying by constants. Like A*9 would become:
Code: [Select]
ld hl,(var_a)
ld d,h
ld e,l
add hl,hl
add hl,hl
add hl,hl
add hl,de

2399
The Axe Parser Project / Re: Features Wishlist
« on: February 03, 2010, 05:54:26 pm »
Apparently you can't break at all, so it doesn't matter. But Quigibo, if you save the stack pointer somewhere at the beginning of execution, it should be no problem (this method is used quite a bit in asm programs iirc)

2400
The Axe Parser Project / Re: Axe Parser
« on: February 03, 2010, 05:51:25 pm »
Hold up, found a more efficient method (and I put it into loops just for you ;D)

Code: [Select]
div_hl_de:
; BC = HL/DE, HL = remainder

xor a
sub e
ld e,a
sbc a,a
sub d
ld d,a

ld a,h
ld b,l
ld hl,0
ld c,8

div_loop_1:
rla
adc hl,hl
add hl,de
jr c,$+4
sbc hl,de
dec c
jr nz,div_loop_1
rla

ld c,a
ld a,b
ld b,8

div_loop_2:
rla
adc hl,hl
add hl,de
jr c,$+4
sbc hl,de
djnz div_loop_2
rla

ld b,a
ret

Pages: 1 ... 158 159 [160] 161 162 ... 197