FunkLibrary

Z80 Software Tools
  • Author
  • Message
Offline
User avatar

Madskillz

Site Admin

Re: Funk Library

Post07 September 2013, 00:03

Cool Nano, I like the look of everything. Seems really clean source wise.
Offline
User avatar

NanoWar

Site Admin

Topic Starter

Re: Funk Library

Post10 September 2013, 21:25

Thanks. Still, I am the only one who's using it... Maybe I should add DoorsCS support? :D
Offline
User avatar

chickendude

Staff Member

Re: Funk Library

Post10 September 2013, 22:03

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
Offline
User avatar

NanoWar

Site Admin

Topic Starter

Re: Funk Library

Post13 September 2013, 23:00

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!
Offline
User avatar

NanoWar

Site Admin

Topic Starter

Re: Funk Library

Post11 December 2014, 20:24

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.
Attachments
wizards-highlight.PNG
z80 syntax highlighting in Sublime Text 3
(47.31 KiB) Not downloaded yet
z80asm-ti.zip
Sublime Text 3 + FunkLibrary package (alpha)
(28.83 KiB) Downloaded 128 times
FunkLibrary-0.4.zip
FunkLibrary release 0.4
(580.02 KiB) Downloaded 120 times
Offline
User avatar

chickendude

Staff Member

Re: Funk Library

Post12 December 2014, 13:44

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.
Offline
User avatar

NanoWar

Site Admin

Topic Starter

Re: Funk Library

Post15 December 2014, 11:36

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"
Offline
User avatar

chickendude

Staff Member

Re: Funk Library

Post16 December 2014, 10:08

Thanks, i'll try it out as soon as i can and let you know how it goes.
Offline
User avatar

NanoWar

Site Admin

Topic Starter

Re: Funk Library

Post17 December 2014, 02:16

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
Attachments
funk_example.PNG
windows cmd, start compile script
funk_example.PNG (82.14 KiB) Viewed 27111 times
z80asm-ti.zip
Release 2; Includes FunkLibrary and SPASM
(616.55 KiB) Downloaded 122 times
Offline
User avatar

chickendude

Staff Member

Re: Funk Library

Post17 December 2014, 10:20

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.
Offline
User avatar

NanoWar

Site Admin

Topic Starter

Re: Funk Library

Post18 December 2014, 16:20

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?
Offline
User avatar

NanoWar

Site Admin

Topic Starter

Re: Funk Library

Post18 December 2014, 22:53

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.
Attachments
z80asm-ti.zip
(619.82 KiB) Downloaded 127 times
Offline
User avatar

chickendude

Staff Member

Re: Funk Library

Post19 December 2014, 11:00

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.
Offline
User avatar

NanoWar

Site Admin

Topic Starter

Re: Funk Library

Post22 December 2014, 19:16

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 :)
Attachments
sublime-funk-setup.png
My setup
(373.99 KiB) Not downloaded yet
z80asm-ti.zip
(632.8 KiB) Downloaded 233 times
Offline
User avatar

chickendude

Staff Member

Re: Funk Library

Post10 January 2015, 16:26

Just saw this got featured on Cemetech's Projects of the Month for December :)
http://www.cemetech.net/news.php?id=712
Offline
User avatar

NanoWar

Site Admin

Topic Starter

Re: Funk Library

Post10 January 2015, 18:32

Yeah, because I posted a topic there and tifreak8x is very attentive ;-) .
Offline
User avatar

chickendude

Staff Member

Re: Funk Library

Post14 January 2015, 11:10

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.
Offline
User avatar

NanoWar

Site Admin

Topic Starter

Re: Funk Library

Post14 January 2015, 17:31

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/
Offline
User avatar

chickendude

Staff Member

Re: Funk Library

Post15 January 2015, 00:44

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!
Offline
User avatar

add

Re: Funk Library

Post21 January 2015, 22:58

Cool, I will be watching this project. :-)
Good job NanoWar!
Offline
User avatar

NanoWar

Site Admin

Topic Starter

Re: Funk Library

Post21 January 2015, 23:53

I'd rather like you to try it out! :green:
Offline
User avatar

add

Re: Funk Library

Post22 January 2015, 00:16

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..
Offline
User avatar

NanoWar

Site Admin

Topic Starter

Re: Funk Library

Post22 January 2015, 14:01

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.
Offline
User avatar

add

Re: Funk Library

Post22 January 2015, 14:24

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.
Offline
User avatar

chickendude

Staff Member

Re: Funk Library

Post23 January 2015, 09:38

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.
Attachments
z80.lang.7z
(1022 Bytes) Downloaded 117 times
Captura de pantalla sublime.png
SublimeText3
(159.66 KiB) Not downloaded yet
Captura de pantalla gedit.png
gEdit
(124.24 KiB) Not downloaded yet
PreviousNext

Return to WabbitStudio

Who is online

Users browsing this forum: No registered users and 1 guest

cron