Author Topic: [Axiom] Floating Point Math (and other stuff)  (Read 23035 times)

0 Members and 1 Guest are viewing this topic.

Offline FinaleTI

  • Believe in the pony that believes in you!
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1830
  • Rating: +121/-2
  • Believe in the pony that believes in you!
    • View Profile
    • dmuckerman.tumblr.com
Re: [Axiom] Floating Point Math (and other stuff)
« Reply #15 on: October 26, 2011, 02:37:00 pm »
Before a CAS could be made, the following needs to occur:
1) String -> FP number
2) FP number -> String
3) Display FP number on arbitrary display buffer at certain position (pref. #2)
4) ???
I have some WIP Axe code to create FP numbers from supplied ASCII strings and store them to OS vars. Currently, scientific notation support is non-existent and it only works for real numbers. I also have a WIP routine for converting FP numbers to ASCII strings for displaying, but only real numbers are supported and scientific notation support is currently iffy at best.


Spoiler For Projects:

My projects haven't been worked on in a while, so they're all on hiatus for the time being. I do hope to eventually return to them in some form or another...

Spoiler For Pokemon TI:
Axe port of Pokemon Red/Blue to the 83+/84+ family. On hold.

Spoiler For Nostalgia:
My big personal project, an original RPG about dimensional travel and a few heroes tasked with saving the world.
Coding-wise, on hold, but I am re-working the story.

Spoiler For Finale's Super Insane Tunnel Pack of Doom:
I will be combining Blur and Collision Course into a single gamepack. On hold.

Spoiler For Nostalgia Origins: Sky's Story:
Prequel to Nostalgia. On hold, especially while the story is re-worked.

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: [Axiom] Floating Point Math (and other stuff)
« Reply #16 on: October 26, 2011, 05:08:01 pm »
I have seen some AXE programmes using strings to export images or tilemaps. How is that possible?
You just have to manipulate the data correctly.  Here's the basic premise:
Set up the string.  This is done in a similar method to setting up a Picture, which I detailed here.
Then loop through the data for the sprite and convert this.  Each nibble (generally) contains one hex character (each byte contains two), so this must be converted to 0-9 or A-F.  Switch the number to its ASCII equivalent, which is shown in this chart:
Code: [Select]
L0 equ 030h
L1 equ 031h
L2 equ 032h
L3 equ 033h
L4 equ 034h
L5 equ 035h
L6 equ 036h
L7 equ 037h
L8 equ 038h
L9 equ 039h
LcapA equ 041h
LcapB equ 042h
LcapC equ 043h
LcapD equ 044h
LcapE equ 045h
LcapF equ 046h

So yeah, that's the basic premise.  I hope it helps. :)

Offline jacobly

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 205
  • Rating: +161/-1
    • View Profile
Re: [Axiom] Floating Point Math (and other stuff)
« Reply #17 on: October 27, 2011, 12:18:53 am »
Bug fix! (See first post)
Also, I started creating a tutorial, so I included that too.

Offline jacobly

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 205
  • Rating: +161/-1
    • View Profile
Re: [Axiom] Floating Point Math (and other stuff)
« Reply #18 on: November 27, 2011, 10:17:04 pm »
Update. Changes:
solve() becomes solve()ʳ
solve(x) returns a pointer to the floating-point number represented by x.
Examples:
float{solve(Select("varA"))}➔A
float{solve(solve(ᵀ+,Select("varA"),Select("varB")))}➔C

Offline Taranok

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 11
  • Rating: +0/-0
    • View Profile
Re: [Axiom] Floating Point Math (and other stuff)
« Reply #19 on: January 30, 2012, 04:11:04 am »
Is it just me or do the code boxes only say "array"?

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: [Axiom] Floating Point Math (and other stuff)
« Reply #20 on: January 30, 2012, 07:45:09 am »
I think it depends on the browser. I am using Chrome and it works fine for me :/

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: [Axiom] Floating Point Math (and other stuff)
« Reply #21 on: February 06, 2012, 08:43:37 am »
@Taranok: Welcome here. And yea, I think it's a browser issue. Works fine in Firefox too.

Offline Taranok

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 11
  • Rating: +0/-0
    • View Profile
Re: [Axiom] Floating Point Math (and other stuff)
« Reply #22 on: February 27, 2012, 01:10:35 am »
I'm using firefox also...  10.0.2.

The boxes still say array.

Offline kindermoumoute

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 836
  • Rating: +54/-3
    • View Profile
Re: [Axiom] Floating Point Math (and other stuff)
« Reply #23 on: February 27, 2012, 02:56:05 pm »
I notice your aciom use Select() command, but it's the same tokens than Axe parser command, is there no conflict? ???
Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%

Offline JWinslow23

  • Coder Of Tomorrow
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 556
  • Rating: +43/-6
  • I make quality calculator games...when I have time
    • View Profile
Re: [Axiom] Floating Point Math (and other stuff)
« Reply #24 on: February 28, 2014, 12:47:29 pm »
My savior! ;D

However...I don't see a way to display the numbers in FP format (complex or not), and I need that before I use this. :P
Did you know that "Ammonia Gas" rearranged is "As Omnimaga"?
Click here for the only set of games you'll ever need
= ?

Offline ben_g

  • Hey cool I can set a custom title now :)
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +125/-4
  • Asm noob
    • View Profile
    • Our programmer's team: GameCommandoSquad
Re: [Axiom] Floating Point Math (and other stuff)
« Reply #25 on: February 28, 2014, 03:48:11 pm »
WARNING: untested code

I think the following code should do the trick:
Code: [Select]
:Text(X,Y)
:Asm(7DEFF74B)
« Last Edit: February 28, 2014, 03:48:24 pm by ben_g »
My projects
 - The Lost Survivors (Unreal Engine) ACTIVE [GameCommandoSquad main project]
 - Oxo, with single-calc multiplayer and AI (axe) RELEASED (screenshot) (topic)
 - An android version of oxo (java)  ACTIVE
 - A 3D collision detection library (axe) RELEASED! (topic)(screenshot)(more recent screenshot)(screenshot of it being used in a tilemapper)
Spoiler For inactive:
- A first person shooter with a polygon-based 3d engine. (z80, will probably be recoded in axe using GLib) ON HOLD (screenshot)
 - A java MORPG. (pc) DEEP COMA(read more)(screenshot)
 - a minecraft game in axe DEAD (source code available)
 - a 3D racing game (axe) ON HOLD (outdated screenshot of asm version)

This signature was last updated on 20/04/2015 and may be outdated

Offline JWinslow23

  • Coder Of Tomorrow
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 556
  • Rating: +43/-6
  • I make quality calculator games...when I have time
    • View Profile
Re: [Axiom] Floating Point Math (and other stuff)
« Reply #26 on: February 28, 2014, 04:17:53 pm »
WARNING: untested code
Test it, and I'll get back to you, thanks. I don't want a RAM clear again. :P
« Last Edit: February 28, 2014, 04:18:02 pm by JWinslow23 »
Did you know that "Ammonia Gas" rearranged is "As Omnimaga"?
Click here for the only set of games you'll ever need
= ?

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [Axiom] Floating Point Math (and other stuff)
« Reply #27 on: March 02, 2014, 02:51:33 am »
RAM clears are fun. :D
* Streetwalrus uses zStart

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: [Axiom] Floating Point Math (and other stuff)
« Reply #28 on: March 02, 2014, 03:20:43 am »
Well, I wouldn't say "fun", but indeed, I use zStart and RAM Clears don't annoy me at all ;)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [Axiom] Floating Point Math (and other stuff)
« Reply #29 on: March 02, 2014, 03:41:33 am »
I often clear RAM myself since I use it actually.