Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Xeda112358 on January 21, 2012, 02:36:31 pm
-
Okay, after having some fun with Builderboy's Flame tutorial and Deep Thought's ORG ide, I put together this little program (136 bytes). Pretty much, you send a number in Ans and this program uses that picture as fuel for a fire. If the picture doesn't exist, it just disintegrates the screen. It will keep burning until the user presses a key, too, so you can use this for an intro screen in a game!
Things I am wondering if I should add:
-making white fire instead
-using the current screen as fuel
-seeing if I could add this in as an interrupt to be disabled or enabled
-Adding in 15MHz mode
-
That's pretty cool! The white fire idea would be a good idea because it would look like more of a fire, as fire is usually brighter. Just a question from a beginning programmer, what does the "3:" and "6:" do?
-
they store 3 or 6 into ans before running the program.
-
Oh, well pictures are named by 60xx in memory. When I do 3, my program looks for the picture 6003 (Pic4) and when I do 6, it searches for Pic7 (6006). Pretty much, I do something like this:
bcall(_RclAns)
or a ;tests if A is 0. this is the type and we want 0 (o is a number)
jr nz,PicNotFound
bcall(_ConvOP1) ;we find the number
ld d,e
ld e,60h ;so DE is xx60. in RAM, it is stored in reverse as 60xx
ld (OP1+1),de ;we load the name to OP1
xor a ;optimised way to do ld a,0 (3 cycles faster, 1 byte smaller)
ld (OP1+3),a ;we add a zero after the name
rst rFindSym ;we locate the var
jr c,PicNotFound
inc de
inc de ;de now points tot he picture data :)
Also, it now handles the options using the current graph screen as fuel as well as using white fire (program and screenie coming soon!)
-
You should have white fire, black fire, and maybe even greyscale fire like in FireFall :D
(http://www.omnimaga.org/index.php?action=dlattach;topic=10774.0;attach=9767;image)
But it's looking really cool ^^ Do you think the intensity of the fire should be a possible argument?
-
That is a good idea, too o.o And I think I will keep the fire options simple XD I want it so any BASIC user can use it with ease :) Also, ORG is not working for me at the moment, so bug testing and stuff is not working D:
EDIT: Okay, here is an updated version:
-Use a number >255 to use the graph screen as an image for fuel
-Use - before the number to use white fire instead
-
Heh...It'd be cool to be able to have your screen burning with grayscale fire while using the calc normally.
-
Hmm, well I was thinking of making an interrupt to keep a burning picture...
EDIT: It might go well with zStart...
-
That would be amazing if you could do that. I would totally program with fire... XD
-
/me wonders if something like this would work well as an Axiom
It's not that hard to do yourself but still 0.o
-
As an axiom command, you would only need to execute one frame and let the user put the frame in a loop. The loop that is executed is this:
Fire:
ld hl,934Ch
ld de,9340h
ld bc,2F4h
Random: ;feel free to give me a smaller rand routine that is pretty random x.x
push hl
push de
ld hl,0
ld a,r
ld h,a
add a,(hl)
inc hl
rrca
add a,(hl)
inc hl
rrca
xor (hl)
inc hl
rrca
rrca
ld l,a
ld (Random+3),hl
and 7
ld d,8Bh
ld e,a
ld a,(de)
pop de
pop hl
Method:
or (hl) ;change to AND for t'other method
ld (de),a
inc de
cpi
jp pe,Random
ret
And 8B00h contains the bytes 0102040810204080. Use FEFDFBF7EFDFBF7F for black fire.
After that, you just draw your picture back over it with display the graph to the LCD :)
To lessen the intensity, you can change the and 7 to and 3 and the values at 8B00h to 18244281 or something similar.
To raise the intensity, change to and 15 and put an FF between each byte at 8B00h, so FEFFFDFFFBFFF7FFEFFFDFFFBFFF7FFF
-
Heh...It'd be cool to be able to have your screen burning with grayscale fire while using the calc normally.
Those kind of mods are rather difficult as many OS processes only update the screen and nothing else. That means it would be difficult to keep a memory of what was actually on the screen.
The only solution I see would be to read the entire LCD back before every single grayscale interrupt and compare it to a known copy of what the screen looked like. This however would require two full screen updates and therefore 100% of cpu time at 60hz. It should run at 30hz though.
So, if I get bored... (Or if xeda gets bored (make a getCSC hook that enables your interrupt :D))
-
Xeda, that's an awesome program! ;D
-
Thanks :D I hope it will be useful to some BASIC coder out there some day :)
-
whoa. I just read this. :D
Looks great. XD
-
Heh...It'd be cool to be able to have your screen burning with grayscale fire while using the calc normally.
Those kind of mods are rather difficult as many OS processes only update the screen and nothing else. That means it would be difficult to keep a memory of what was actually on the screen.
That would be epic. Something like ON+GRAPH to set the current screen on fire? :D
-
Or when you clear the screen with [CLEAR], instead of vanishing, the screen burns away ;D
-
THAT is a cool program...
-
Heh...It'd be cool to be able to have your screen burning with grayscale fire while using the calc normally.
Those kind of mods are rather difficult as many OS processes only update the screen and nothing else. That means it would be difficult to keep a memory of what was actually on the screen.
The only solution I see would be to read the entire LCD back before every single grayscale interrupt and compare it to a known copy of what the screen looked like. This however would require two full screen updates and therefore 100% of cpu time at 60hz. It should run at 30hz though.
So, if I get bored... (Or if xeda gets bored (make a getCSC hook that enables your interrupt :D))
Oh yeah, I hadn't thought of the fact that the OS tends to write directly to the LCD :\
-
Wow, I really like the idea of pressing clear an burning away the screen o.o If I get time, I want to work on that!
-
Thanks for this Xeda!
It helps alot :D
-
No problem :3 I am glad it helped!
-
Yeong should use this as part of the new ROL3 magic animations (maybe Omnima which has 4 elements?)
-
Hmm, Grammer can use assembly programs... But I could add it as a fill option as well.
-
Hmm, Grammer can use assembly programs... But I could add it as a fill option as well.
That would be awesome! :D
-
Yeong should use this as part of the new ROL3 magic animations (maybe Omnima which has 4 elements?)
What I was thinking about Omnima is using pyro, quasar, freeze, and blitz animation to elemental attack.