Page 2 of 4

Re: Funk Library

PostPosted: 07 September 2013, 00:03
by Madskillz
Cool Nano, I like the look of everything. Seems really clean source wise.

Re: Funk Library

PostPosted: 10 September 2013, 21:25
by NanoWar
Thanks. Still, I am the only one who's using it... Maybe I should add DoorsCS support? :D

Re: Funk Library

PostPosted: 10 September 2013, 22:03
by chickendude
I've looked into it/played around with it a bit and there's some things i really like, especially being able to enum variables. I'd like to do that in my normal programs, too, but i can't figure out how you did that :P

Re: Funk Library

PostPosted: 13 September 2013, 23:00
by NanoWar
It's all in funk/macros/funk_macros_enum.z80 and the parse macro simply writes code in spasm's internal temp buffer with wr() and later simply includes that with run(). Compile-time SMC!

Re: Funk Library

PostPosted: 11 December 2014, 20:24
by NanoWar
Image

Does anybody use SublimeText for coding z80 asm? No? But you should. It looks so pretty :D (see following attachment). If you want it just copy the z80asm-ti package in the SublimeText packages folder, hope it works.

On Windows you can now use the build batch file "build.bat" to quickly compile with spasm (also included in FunkLibrary now):
  • CD in the directory with the z80 or asm file
  • run path/to/funk/build.bat source_file_name program_type calculator_model target_file_name
  • or just run path/to/funk/build.bat if everything is default and only one z80 file is in the directory
In the source file nothing needs to be included, the build.bat compile script is quite intelligent. Just put ret in a file, name it test.z80 and run path/to/funk/build.bat test.z80 ion ti83p TEST in a shell. VoilĂ , out comes an ION program named TEST.8xp with all necessary includes and funk macro powers.

I will add more shell magic like auto include images to it later. For now you can put more scripts that are executed on build in a folder called "funk_execute" in the source folder and files like header definitions in a folder called "funk_include" also in the source folder with the z80 file.

Re: Funk Library

PostPosted: 12 December 2014, 13:44
by chickendude
I've never heard of SublimeText, i just use gedit. I just looked it up and it's a bit expensive for a text editor, no? Anyway, i'll look through the new Funk Library now :D

EDIT: Also, now that i'm working on a couple multi-page app projects it might be time to check out Funk's app macros.

Re: Funk Library

PostPosted: 15 December 2014, 11:36
by NanoWar
Let me know if you need something specific that should be included in Funk.

Sublime Text is free! There is only a smal "Please license" window every 10 saves or so.

If you want to call a routine on page 2 (I never made a 3 page app before) you should check out the "pcal" macro and function in the files "funk_functions_app.z80" and "funk_macros_app.z80"

Re: Funk Library

PostPosted: 16 December 2014, 10:08
by chickendude
Thanks, i'll try it out as soon as i can and let you know how it goes.

Re: Funk Library

PostPosted: 17 December 2014, 02:16
by NanoWar
NEW VERSION ATTACHED

Are you on Windows, chickendude? Because the build script only works there...

I have now included a "compile anywhere" script into the sublime plugin. Oh and the Funk library with SPASM is also included. All in one package! Just copy it in the packages folder (C:\Users\XXXX\AppData\Roaming\Sublime Text 3\Packages) and have fun.

Now you can put a "funk.config" file in a folder and run the build script with no arguments and everything is compiled and included automagically.

example.z80:
Code: Select all
start:
      clear
      pcal    hello_from_page2
      update
      anykey
      quit

.nextpage

hello_from_page2
      textonbuf.on
      text  24, 30, "Hello Funk,"
      text  30, 33, "you rock!"
      textonbuf.off
      ret
 


funk.config:
Code: Select all
Source  = example.z80
Target  = ExampleApp
Name    = EXAMPLE
Calc    = ti83p
Type    = app
Options = -T

Re: Funk Library

PostPosted: 17 December 2014, 10:20
by chickendude
I'm on Linux (Fedora 20), but i don't really need the build script (i've got my own anyway that launches tilem2). But i would like to look into a couple things like the variable declaring stuff and the app stuff.

Re: Funk Library

PostPosted: 18 December 2014, 16:20
by NanoWar
I am very interested in your build script, would you share it?

Btw. do you know how to auto load a file into wabbitemu via command line?

Re: Funk Library

PostPosted: 18 December 2014, 22:53
by NanoWar
Added build scripts for linux!

Have a look at funk/examples/. That's all the code you need! And the graphic gets auto included, too.

Re: Funk Library

PostPosted: 19 December 2014, 11:00
by chickendude
Cool, i'll check it out tonight!

My build script is really simple:
Code: Select all
#!/bin/bash
spasm -DFR pokemon.z80 pokemon.8xk -T -A
.sleep 1
tilem2 pokemon.8xk
(i like having case sensitive labels)

For WabbitEmu, i imagine you just call it with the name of the file:
Code: Select all
wabbitemu.exe file.8xp
You can probably also choose which ROM file to load if you want.

Re: Funk Library

PostPosted: 22 December 2014, 19:16
by NanoWar
Ok cool, maybe I add wabbitemu and some scripts to it.

Here is a new version with fixed Sublime Text menues. To build, hit Ctrl+B :)

Re: Funk Library

PostPosted: 10 January 2015, 16:26
by chickendude
Just saw this got featured on Cemetech's Projects of the Month for December :)
http://www.cemetech.net/news.php?id=712

Re: Funk Library

PostPosted: 10 January 2015, 18:32
by NanoWar
Yeah, because I posted a topic there and tifreak8x is very attentive ;-) .

Re: Funk Library

PostPosted: 14 January 2015, 11:10
by chickendude
Btw, i was wondering if Funk had a "relocate" feature (essentially something like .org $8000 \ .endorg to change the addresses within a certain range of code). I saw that Brass has a .relocate \ .endrelocate feature, but i don't think spasm has anything similar.

Re: Funk Library

PostPosted: 14 January 2015, 17:31
by NanoWar
SPASM has it here: https://wabbit.codeplex.com/wikipage?ti ... s#relocate

I will add it to funk.

Code: Select all
;============================================
;     > relocate
;============================================

#macro _funk_relocate(_relocate_location)
      #ifndef funk_relocate_oldLocation
            #define funk_relocate_oldLocation eval($)
            #define funk_relocate_location eval(_relocate_location)
            .org funk_relocate_location
      #else
            .err "You cannot nest relocate blocks."
      #endif
#endmacro
#define .relocate _funk_relocate(

#macro _funk_endrelocate()
      #ifdef funk_relocate_location
            .org $ - funk_relocate_location + funk_relocate_oldLocation
            #undefine funk_relocate_location
            #undefine funk_relocate_oldLocation
      #else
            .err "No relocate statements corresponds to this endrelocate."
      #endif
#endmacro
#define .endrelocate _funk_endrelocate(
 


Edit: Ok, I pushed it on github: https://github.com/NanoWar/FunkLibrary/

Re: Funk Library

PostPosted: 15 January 2015, 00:44
by chickendude
Cool, it's not something you use all the time but when you've got to use it it's a huge pain not having it :D Thanks!

Re: Funk Library

PostPosted: 21 January 2015, 22:58
by add
Cool, I will be watching this project. :-)
Good job NanoWar!

Re: Funk Library

PostPosted: 21 January 2015, 23:53
by NanoWar
I'd rather like you to try it out! :green:

Re: Funk Library

PostPosted: 22 January 2015, 00:16
by add
Well, watching it on github I mean.
But of course I will try it out. :-)

EDIT:
I'm trying it out right now (Currently in Windows 7), and I had to remove the "FUNK_PATH," part from line 23 in the test file named "funk.z80".
Then it compiled just fine. The reason for this problem was that for some reason Windows kept expecting the file to be in a previous (?) directory and not in the one that the file is in. So it was trying to find funk\... instead of just the ... .
So, I guess it's just something that went wrong with the test, but I don't seem to have the same problem with the .bat file so I might be the one missing something here..
Anyway, gonna keep on testing, and am also trying to work out how to get Atom to have better syntax-highlighting. :-)

EDIT 2:
Trying it out on my Ubuntu installation now, and I have the same problem when I don't run it with your build script.
I do find that somewhat strange..

Re: Funk Library

PostPosted: 22 January 2015, 14:01
by NanoWar
You should put funk in a subfolder

project/source.z80
project/funk/...


BTW: no need to edit your post, feel free to double post/bump and then I see your news :)

And IF you use SublimeText3 instead of Atom, there is a package a few posts above called z80-ti that you might want to check out, it has everything build in.

Re: Funk Library

PostPosted: 22 January 2015, 14:24
by add
Ah, ok that kinda makes sense.

Trying out SublimeText3, it looks very much like Atom to be honest. I guess this is where the Atom projects gets a lot of its inspiration.

Re: Funk Library

PostPosted: 23 January 2015, 09:38
by chickendude
Ok, i just tried out SublimeText and while i think it's nice, the interface just isn't as pretty/integrate as well and takes up much more screen space than gedit. I'll show a screenshot to show what i mean.

Anyway, i made a simple syntax highlighting file for gEdit. I made one before for ARM assembly. Deep_thought made one that's available on ticalc, but it didn't have syntax highlighting for instructions and some other things. For me, i just put the file in "/usr/share/gtksourceview-3.0/language-specs/" and it shows up in the syntax highlighting list.

I'm downloading Atom now to check that out.

EDIT: Full screen mode is nice, i just wish you could press Alt to bring back the menu if you've hidden it. Most programs seem to work that way nowadays (Atom also works that way). Otherwise, it's a pain to get to the menu after you've hidden it.
EDIT2: Just played around with it a bit more and the full screen mode is pretty nice. I couldn't get Funk to work so i just loaded my own script and it's really nice, ctrl+b to assemble and send to the calc.