• Axe Q&A 5 5
Currently:  

Author Topic: Axe Q&A  (Read 580646 times)

0 Members and 1 Guest are viewing this topic.

Offline Stefan Bauwens

  • Creator of Myst 89 - סטיבן
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1799
  • Rating: +162/-24
  • 68k programmer
    • View Profile
    • Portfolio
Re: Axe Q&A
« Reply #1515 on: June 21, 2012, 05:13:00 am »
If I'm using 4-level greyscale, can I copy the screen and recall it in my main loop. For example:
:Line(0,0,95,0)
:Line(0,0,95,0)r
(^black line)
:rect(1,1,94,63)r
(^light grey rectangle)
:some other sprites
:StorePic
:repeat getkey(15)
:clrdrawrr
:recallpic
dispgraphrr
:end

I've seen storepic and recallpic in the Axe documentation but they seem to copy to the backbuffer, which I guess would ruin the greyscale.
I also saw StoreGdB but I'm not sure what it does.

So, does anyone know if this is even possible? Thanks a lot in advance :)

EDIT:Jacobly already helped me(in chat). Im using Buff( command to store the screen in GDB and with the Copy( command I copy it to the buffers. So thanks jacobly :)
« Last Edit: June 21, 2012, 08:27:49 am by Stefan Bauwens »


Very proud Ticalc.org POTY winner (2011 68k) with Myst 89!
Very proud TI-Planet.org DBZ winner(2013)

Interview with me

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Axe Q&A
« Reply #1516 on: June 21, 2012, 08:47:53 pm »
What are the dangers of exiting a program without restoring the fonts or interrupts?

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Axe Q&A
« Reply #1517 on: June 21, 2012, 08:52:02 pm »
if you don't change the fonts, the danger is that the fonts won't be changed, until something else changes them. nothing bad should happen of it. as for interrupts, the OS's interrupts won't be reinstated, or something like that, and you can expect crashes, i believe.

Offline MGOS

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 336
  • Rating: +95/-0
    • View Profile
Re: Axe Q&A
« Reply #1518 on: June 22, 2012, 12:21:57 am »
The fonts won't affect the Calc that much, it only looks weird at first, until it is restored. Interrupts will always lead to a crash if not reinstalled.

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Axe Q&A
« Reply #1519 on: June 23, 2012, 08:09:35 pm »
is there some way to access the f register directly from axe to get the value of a flag?
* shmibs wants to use bcall(_EnoughMem) as inline hex

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Q&A
« Reply #1520 on: June 23, 2012, 08:45:49 pm »
There are ways to get the contents of the F register, but almost no one ever has to do it.

Instead, try this: Asm(EFFD42ED62) will return zero if there's enough RAM and a non-zero value if there isn't. (Specifically, it returns $FFFF, but the point is that it's not zero.)
Quote from: Axe
768
Asm(EFFD42ED62)
If
Disp "Not enough RAM!"
Else
Disp "768 bytes available!"
End
Spoiler For Explanation:
Quote from: Z80 Assembly
    bcall(_EnoughMem)
    sbc HL, HL
EDIT: Just realized how much I overthought this. Cut out four bytes, but note that the order is reversed (zero means enough RAM, negative one means there isn't).
« Last Edit: June 23, 2012, 11:02:37 pm by Deep Thought »




Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Axe Q&A
« Reply #1521 on: June 23, 2012, 10:14:25 pm »
thanks =D
EDIT:
i was trying to use this, along with _InsertMem, to increase the size of an appvar, but what i have keeps crashing. the size check isn't working, and it just plows on past a safe length. what am i doing wrong here?

Code: [Select]
GetCalc("appvA")->theta
0
Repeat
1
Asm(EFFD42ED62) ;check if there is one at least one byte of free ram
If ; if there is not
1 ;1 is stored to hl
Else
theta
Asm(545D) ;ld d,h : ld e,l
Asm(210100) ;ld hl,1
Asm(EF42F7) ;bcall(_InsertMem)
{theta-2}r++ ;increase size bytes
0:End
End
« Last Edit: June 24, 2012, 12:11:37 am by shmibs »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Q&A
« Reply #1522 on: June 24, 2012, 12:21:51 am »
I haven't figured out your bug, but why are you adding a single byte at a time? _MemChk returns the amount of free RAM you have remaining.




Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Axe Q&A
« Reply #1523 on: June 24, 2012, 12:45:49 am »
i figured it out.
* shmibs was typing in the address for _InsertMem backwards
it's Asm(EFF742)

Offline danny90444

  • LV3 Member (Next: 100)
  • ***
  • Posts: 41
  • Rating: +0/-0
  • Physics :)
    • View Profile
    • facebook
Re: Axe Q&A
« Reply #1524 on: June 26, 2012, 03:27:52 pm »
Could someone explain what axioms are and how to make/use them ?(in axe parser) Also , could someone explain how to make icons?

And also what "IRC" and "ASCII" mean or stand for ?
« Last Edit: June 26, 2012, 03:44:26 pm by danny90444 »
Schrodinger's cat walks into a bar... and doesn't.

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Axe Q&A
« Reply #1525 on: June 26, 2012, 04:22:58 pm »
For Icons, use #Icon. (key: identity) It is 64 hex characters long, for a 16*16 image.

IRC is Internet Relay Chat
ASCII is the American Standard Code for Information Interchange, a character encoding type thing. en.wikipedia.org/wiki/ASCII
« Last Edit: June 26, 2012, 04:23:21 pm by parserp »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Axe Q&A
« Reply #1526 on: June 26, 2012, 04:23:30 pm »
Axioms are libraries, basically extensions to the Axe language to create new commands. For example, if you were using thepenguin77's Fullrene Axiom, Fcdf( would be a valid command in your program. Axioms are written in assembly, because the idea is to create more native commands for Axe.

Set an icon for your program with the #Icon( directive (it's the identity( token, found under the MATRX MATH menu). It takes 64 characters of hexadecimal characters representing the icon. (The documentation has a nice description of images as hex data.)

IRC is just Internet Relay Chat, a really common instant-messaging protocol (like AIM, but with a much longer history and much more versatile). It's nothing specific to Axe or Omnimaga—just google it and you'll find a ton of info.

ASCII usually refers to the character set (the set of all characters ... not sure how to put it beyond that). Technically it's a specific set of 256 characters, the American Standard character set (just google ASCII), but we often use it to refer to "ASCII graphics," like games made entirely on the home screen.




Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Axe Q&A
« Reply #1527 on: June 26, 2012, 04:45:44 pm »
You got ninja'd on the last 2 ones.
I'm not a nerd but I pretend:

Offline parserp

  • Hero Extraordinaire
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1455
  • Rating: +88/-7
  • The King Has Returned
    • View Profile
Re: Axe Q&A
« Reply #1528 on: June 27, 2012, 02:32:43 pm »
(This question is directed toward Deep Thought, but if anybody could answer it, that would be great)

I was trying to figure out how to save a highscore within the program, rather than in an appvar, so I looked at the snakecaster source to try to figure it out.
I'm pretty sure that I got everything else working, except for this one line of code.
Code: [Select]
:GetCalc(E8478)+GDB3-E9D93->Q     //Where E is the little E on calc (2ND + , )
This is what 'gets' the highscore at the beginning of the program, but I'm unsure of exactly what all the stuff is for. (and why it's not working for me)
« Last Edit: June 27, 2012, 02:35:25 pm by parserp »

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Axe Q&A
« Reply #1529 on: June 27, 2012, 02:44:07 pm »
Well, what I would do is creating a str/gdb/pic (w/e) and store the highscore in that since when you write to a string/ w/e ya chose (basically it's the same) you use writeback. I have never really used it, tho.
I'm not a nerd but I pretend: