Author Topic: Axe Sprite Editor  (Read 3550 times)

0 Members and 1 Guest are viewing this topic.

Offline adrusi

  • LV2 Member (Next: 40)
  • **
  • Posts: 25
  • Rating: +4/-0
    • View Profile
    • Adrusi
Axe Sprite Editor
« on: May 21, 2013, 10:44:47 pm »
I saw this topic from a while back:

Ok, I have been trying out runer's sprite editor recently, which stored all sprites into an appvar which I couldn't decode (even with runer's help).
Even though I heard runer has been working on a new sprite editor, I decided to write my own.
This sprite editor stored the sprites directly into Pic5/Pic6 (frontbuffer/backbuffer respectively).
(It is your task to copy them to other pics/datafiles if you want)
It only supports 4lv grayscale.
I am not planning to support 3lv grayscale, nor any other features as this program is mainly meant for helping me completing zelda, I just decided to share it.
Controls:
Arrows - Move the cursor
F1 - Black
F2 - Darkgray
F3 - Lightgray
F4 - White
- - Go to the last sprite
+ - Go to the next sprite
Clear - Leave the program

Do not compile this program as an app, as it uses SMC.

Credits:
Me - Programming this app
Runer112 for the idea in the first place and help on how the Pic files are structured.

Bugs:
-It responds too fast
-You need to have Pic5 and Pic6 in the ram.

*I do not take any responsibility for any crashes/data losses caused by this program*
Don't let that spoil it tho, its a simple program allowing you to create 4lv grayscale sprites.

I thought the tool could be useful, but I found it almost unusable because it responded to key input too quickly.

I hacked together a solution to that problem for my own use, but I figured there's no reason I shouldn't share it with you guys.

As a bonus, I also increased to quality of the grayscale, retrofitting interrupts onto the old code (kind of ugly in one place, but it works).

All credit to Ikkerens, who wrote the actual program.

https://mega.co.nz/#!0wwXWbbY!fWFCr37nytZlUhKFimtGWA8obbdcbr-dEetMzZQGpyM


PS: I'm mostly a lurker on omnimaga and I can't figure out how to add attachments. Do I need a certain number of posts before I earn the right or what?
« Last Edit: May 21, 2013, 10:54:19 pm by Juju »

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Axe Sprite Editor
« Reply #1 on: May 21, 2013, 10:51:18 pm »
yeah, we have a post limit to avoid people spamming things. you need to have at least 20 posts before you can add an attachment. i can't access mega with flash from my current location, but hopefully someone else can come along and attach it for you =)

also, it's nice to see people picking up and improving old things.
« Last Edit: May 21, 2013, 10:52:32 pm by shmibs »

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: Axe Sprite Editor
« Reply #2 on: May 21, 2013, 10:54:47 pm »
but hopefully someone else can come along and attach it for you =)
There we go ^_^

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline adrusi

  • LV2 Member (Next: 40)
  • **
  • Posts: 25
  • Rating: +4/-0
    • View Profile
    • Adrusi
Re: Axe Sprite Editor
« Reply #3 on: May 25, 2013, 08:06:48 pm »
Quick update which adds support for archived pictures.

Offline adrusi

  • LV2 Member (Next: 40)
  • **
  • Posts: 25
  • Rating: +4/-0
    • View Profile
    • Adrusi
Re: Axe Sprite Editor
« Reply #4 on: June 04, 2013, 03:08:09 pm »
Update:
  • Added support for masks.
  • The OS var "Pic7" must exist either in RAM or archive just like "Pic5" and "Pic6" or else it won't run.
  • Press F5 to toggle the selected pixel in the mask, it will be marked with a + in the editing area and the actual mask sprite will be displayed above the grayscale sprite.

    Using masks in Axe:
    First you have to load all the sprites into your executable, so:
    Code: [Select]
    [Pic5ʳ]→Pic0
    [Pic6ʳ]→Pic1
    [Pic7ʳ]→Pic2
    Then I find it convenient to have a subroutine abstract the sprite drawing (and you can manually inline during profiling):
    Code: [Select]
    Lbl PTON
    r3*8→r3
    Pt-And(r1, r2, r3+Pic2)
    Pt-And(r1, r2, r3+Pic2)ʳ
    Pt-On(r1, r2, r3+Pic0)
    Pt-On(r1, r2, r3+Pic0)ʳ
    Return

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Axe Sprite Editor
« Reply #5 on: June 04, 2013, 03:11:03 pm »
suggestion: make it auto-create the os pic vars on starting if they don't exist

other than that, nice update :D

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline adrusi

  • LV2 Member (Next: 40)
  • **
  • Posts: 25
  • Rating: +4/-0
    • View Profile
    • Adrusi
Re: Axe Sprite Editor
« Reply #6 on: June 04, 2013, 06:32:32 pm »
suggestion: make it auto-create the os pic vars on starting if they don't exist

other than that, nice update :D

Fixed. Just for the hell of it, I also included a executable compiled for no shell.

I also made it a bit safer at the cost of long startup and exit times. It used to keep the OS picvars in RAM while the program was running, this of course makes ram clears during the program's execution a problem. Now it operates on a temporary buffer which is copied to and from archived picvars on startup and exit. Even with fast mem timings enabled, it can take upwards of 10 seconds (since if has to write to the archive).

Personally I think it's worth it. The primary intention for the tool is making sprites for games, and if you loose your game's sprites, it might just ruin your day.

Edit: the program prefixed with a theta is the Axe source, and the other one is the executable.
« Last Edit: June 04, 2013, 06:33:35 pm by adrusi »