Author Topic: Features Wishlist  (Read 616239 times)

0 Members and 3 Guests are viewing this topic.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Features Wishlist
« Reply #495 on: April 12, 2010, 02:19:52 pm »
Probably the most useful application is when working with bitfields. Say you wanted to have a variable that holds various flag bits, that are 0 or 1. You can use bitwise logic to change individual bits of the value.
A or 4->A would set bit 2 to 1, for example. A and 4 would be used to check whether bit 2 is 0 or 1. It's really a pretty low-level thing, but it can be useful (I sure wish TI-Basic had this)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #496 on: April 12, 2010, 02:31:57 pm »
mhmm ok so if for example

A=0 all 8 bits would be 0,
If A=1 the 8th one would be 1,
If A=2 the 7th one would be 1,
If A=3 both 7th and 8th one would be 1
If A=4 the 6th one would be 1,
If A=5 the 6th and 8th one would be 1

And so on?

I'm a bit confused, still. I don't know if I understadn what you mean.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Features Wishlist
« Reply #497 on: April 12, 2010, 02:33:28 pm »
mhmm ok so if for example

A=0 all 8 bits would be 0,
If A=1 the 8th one would be 1,
If A=2 the 7th one would be 1,
If A=3 both 7th and 8th one would be 1
If A=4 the 6th one would be 1,
If A=5 the 6th and 8th one would be 1

And so on?

I'm a bit confused, still. I don't know if I understadn what you mean.
Yeah, you've got it right (except we refer to the rightmost bit as bit 0, and the leftmost as bit 7)

Edit:
Example, setting pixel (0,0) of the graph buffer manually:
{L6} or 128->{L6}
« Last Edit: April 12, 2010, 02:34:54 pm by calc84maniac »
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #498 on: April 12, 2010, 02:36:05 pm »
oh ok. My worry, though: wouldn,t it be very hard to do If conditions checking if certain bits are = to 1? Maybe it would need a special command to check each indidivual bit

I would love this feature, though, because it would make storing switches/treasure chests/items acquired flags much easier and smaller.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Features Wishlist
« Reply #499 on: April 12, 2010, 02:38:20 pm »
oh ok. My worry, though: wouldn,t it be very hard to do If conditions checking if certain bits are = to 1? Maybe it would need a special command to check each indidivual bit

I would love this feature, though, because it would make storing switches/treasure chests/items acquired flags much easier and smaller.
Hmm, this is true. Maybe there should be a command to return powers of 2 for quick bitwise operations.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Will_W

  • LV3 Member (Next: 100)
  • ***
  • Posts: 54
  • Rating: +1/-1
    • View Profile
Re: Features Wishlist
« Reply #500 on: April 12, 2010, 02:40:27 pm »
To check a bit, you can mask it with And.
ex de,hl
ld (hl),e
inc hl
ld (hl),d
ld a,(hl)

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Features Wishlist
« Reply #501 on: April 12, 2010, 02:43:04 pm »
To check a bit, you can mask it with And.
Yeah, but the issue is with having to write each case of "and 1", "and 2", "and 4", etc. Having something that will check a given bit from 0 to 7 (or 15, since we are using 16-bit values) would be pretty useful to get rid of repetitive code.
« Last Edit: April 12, 2010, 02:43:24 pm by calc84maniac »
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Features Wishlist
« Reply #502 on: April 12, 2010, 02:44:41 pm »
Yeah, but its much more size and speed efficient to use bit checks.  I'll add auto-ops for "and" and "or" operations with powers of 2 sometime in the future so they can be used.  Maybe even a binary prefix, becasue that would really help with this.

EDIT: ninja'd!
« Last Edit: April 12, 2010, 02:45:41 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #503 on: April 12, 2010, 02:44:58 pm »
Yeah this is what I meant (calc84 reply). Else we may end up with like if A=0 or A=2 or A=4 or A=6 or A=8 or A=10 or A=12 x.x

Or smaller stuff but still complicated x.x
« Last Edit: April 12, 2010, 02:45:21 pm by DJ Omnimaga »
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #504 on: April 13, 2010, 11:09:52 am »
Something I've been curious about all of a suddent is: if Axe Parser had Line( support, could it be somewhat fast enough for someone with 3D experience to write a raycasting engine?
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Features Wishlist
« Reply #505 on: April 13, 2010, 01:51:11 pm »
*gasp* :O

The possibilities are endless.
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Features Wishlist
« Reply #506 on: April 13, 2010, 03:22:51 pm »
Raycasting wouldn't use the Line() command unless all the walls are pitch black, and then you can't see anything.  The actual algorithm is very complicated and although it could be made with Axe, it would either be too slow or very minimal.  However, by using Line() Axe is definitely fast enough for some realtime 3D wireframe renderings.

I won't promise anything, but it could be a possibility that I might add automated ray casting and mode 9 support in a very far future version.  I have no idea how it would work though.
« Last Edit: April 13, 2010, 03:23:26 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #507 on: April 13, 2010, 04:33:49 pm »
Aaah ok I see. I was not sure if raycasting used multiple sets of Line(-alike commands. For wireframe 3D I think it could be fast indeed, unless the models had an extreme amount of polygons. Maybe something like Space Dementia 1 for 68K calcs?
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Features Wishlist
« Reply #508 on: April 13, 2010, 07:46:56 pm »
OH MY GOD...

AUTOMATIC RAYCASTING?
MODE 9 SUPPORT?

:D
:D
:D

GOD, I LOVE YOU, QUIGIBO.

nohomo
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #509 on: April 13, 2010, 07:57:41 pm »
Uhm, I missed the Mode 9 part. What would it be? I know about Mode 7 but not 9

I assume it would make both Axe parser and the compiled programs considerably larger, right, tho (if raycasting or the like were added)?
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)