Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Converting to sprites
2009-07-02 04:33
SIDWAVE
Account closed

Registered: Apr 2002
Posts: 2238
Converting to sprites

Ok, so i have run into a problem.. hehe

I have 52 bmp pics, which are each the size of 2x2 C64 sprites.

So there's room for them all in 1 VIC bank..
Now problem is to convert them..

I tried Gang-Ed, but it only imports bmp as hires/mcol bitmap/char, and blows up the small image to fullscreen!

So i saved all the frames as a koala pr pic.. hahaha

Now i am stuck with 52 koala pics, that need to be transformed into 4 sprites each, bwahaha..

This is really silly..

What i really need is:

1) convert the 48x48 pixel bmp to 4 colors
2) convert this to 4 sprites

Is there an editor, where i can load bmp/gif into a sprite editor ? they have correct size, just need to be fixed to 4 cols.. which i can do with a batchconvert in thumbs plus (reduce nr of colors)

??

Thanks for any help!
 
... 56 posts hidden. Click here to view all posts....
 
2013-01-23 18:28
MagerValp

Registered: Dec 2001
Posts: 1078
ChristopherJam: there's a pure python png reader class out there so you don't have any external dependencies. I've then added a class to handle layers of tiled graphics with color restrictions, that spits out bitmap data. Works like a charm.
2013-01-23 18:48
Cruzer

Registered: Dec 2001
Posts: 1048
@Burglar: Yes please, maybe I can finally be 1337 then :)
2013-01-23 19:30
Slammer

Registered: Feb 2004
Posts: 416
An alternative to makefiles is ANT, which is kind of advanced makefiles. It is good for platform independent development and can do advanced stuff like zip and ftp. The drawback is the xml-syntax.

If you are new to, or unsure of, the concept of making the execution of a program dependant on the change in another file, then start with makefiles (Simpler and easier to learn). If you need to make bigger and more advanced or platform independent build tools, then ANT is the way to go.

Traditionally makefiles is a C/C++ tool, while ANT is a Java tool, so if you use one of these languages, you might want to chose the matching 'build-language' since your standard tools probably already supports it.
2013-01-23 20:00
Burglar

Registered: Dec 2004
Posts: 1101
I added the final version of the source to codebase64. Feel free to improve ;)

2013-01-24 07:57
Frantic

Registered: Mar 2003
Posts: 1648
Quoting Burglar
I was thinking about writing a Makefile howto for codebase... Seems its needed for some people ;)


@Burglar: Please do! I certainly agree that some people would benefit from getting over that threshold, which is really quite low, considering that makefiles don't have to be complicated at all to be useful.

I've used makefiles for my C64 coding for quite a number of years now and using .bat/shell-scripts would of course be unthinkable. :)

Here is a quite generic little makefile that I found lying around on my harddrive. Maybe it can serve as inspiration or something... Of course it could be put in a simpler and more pedagogical way for someone who never used makefiles before, and it is not the optimal way of doing stuff in all cases there.. may even be some obsolete/erroneous lines in there.. but still.. just throwing it out here.. Maybe it helps someone.

"make" will result in the creation of a .d64 file with the assembled and crunched prg on it.

"make vice" will do the same thing, but also load the d64 with vice.

# Generic 6510 assembler makefile -- FTC/HT
#
# Assumes that all files named .a, .s, i., .inc., .asm are to be considered source files

#Project specific settings
NAME = template
STARTADRESS = 0800
STARTFILE	= start.inc
POSTFIX		= #.exe

# Names of main files and directories
TARGETDIR = bin
SRCNAME = code.a
PRGNAME = $(NAME).prg
D64NAME = $(NAME).d64
LABFILE = _vicelabels.txt
VICEOUT = _viceoutput.txt

# Generate a comprehensive source file list
SOURCEFILES =
SOURCEFILES += $(wildcard *.a)
SOURCEFILES += $(wildcard *.asm)
SOURCEFILES += $(wildcard *.i)
SOURCEFILES += $(wildcard *.inc)
SOURCEFILES += $(wildcard *.s)
SOURCEFILES += $(wildcard *.src)

# Tool locations
TOOLDIR = ~/sys/c64/devtools_mac
#TOOLDIR = ../_win32tools
#TOOLDIR = ../amigatools

# Specific tool locations
ACME		= $(TOOLDIR)/acme/acme$(POSTFIX)
	
PUCRUNCH	= $(TOOLDIR)/pucrunch/pucrunch$(POSTFIX)
EXOMIZER	= $(TOOLDIR)/exomizer/exomizer$(POSTFIX)

C1541		= $(TOOLDIR)/vice/tools/c1541$(POSTFIX)
VICE		= $(TOOLDIR)/vice/tools/x64$(POSTFIX)

#---------------------------------------------------------
# Create a .d64 with the prg on it
$(TARGETDIR)/$(D64NAME) : $(TARGETDIR) $(TARGETDIR)/$(PRGNAME)
	@echo "*************************"
	@echo "* Creating .d64...      *"
	@echo " "
	@$(C1541) -format $(NAME),ht d64 $(TARGETDIR)/$(D64NAME) -attach $(TARGETDIR)/$(D64NAME) -write $(TARGETDIR)/$(PRGNAME) $(NAME)
	@echo " "

#---------------------------------------------------------
# Assemble and crunch .prg file
$(TARGETDIR)/$(PRGNAME) : $(TARGETDIR) $(SRCNAME) $(SOURCEFILES) Makefile
	@echo " "
	@echo "*************************"
	@echo "* Assembling program... *"
	@echo " "	
	@echo "	* = $$""$(STARTADRESS)" > $(STARTFILE)		#Generate start adress file, included first in the sourcefiles
	@echo " "
	@$(ACME) -v2 --cpu 6510 -f CBM --vicelabeldump $(LABFILE) -o $(TARGETDIR)/$(PRGNAME) $(SRCNAME)
	@echo " "

	@echo "*************************"
	@echo "* Crunching program...  *"
	@echo " "
	@$(EXOMIZER) sfx 0x$(STARTADRESS) -m500 -p1 -x1 -p1 -t64 -o $(TARGETDIR)/$(PRGNAME) $(TARGETDIR)/$(PRGNAME) # > /dev/null
#	@$(PUCRUNCH) -c64 -x0x$(STARTADRESS) -i0 -g0x35 -ffast $(TARGETDIR)/$(PRGNAME) $(TARGETDIR)/$(PRGNAME) > /dev/null
	@echo " "


#---------------------------------------------------------
# Create TARGETDIR directory if it doesn't exist
$(TARGETDIR) :
	@test -d "$(TARGETDIR)" || mkdir -p "$(TARGETDIR)" 
	
	
#---------------------------------------------------------
# Open .prg file in VICE
vice : $(TARGETDIR)/$(D64NAME)
	@echo "*************************"
	@echo "* Open .d64 in vice...  *"
	@echo " "
	@$(VICE) -truedrive +cart -autostart-handle-tde -moncommands $(LABFILE) $(TARGETDIR)/$(D64NAME) >>$(VICEOUT) 2>&1 &&
	@echo " "

#---------------------------------------------------------
clean : 
	@echo "*************************"
	@echo "* Cleaning...           *"
	@echo " "
	$(RM) -f $(STARTFILE)
	$(RM) -f $(TARGETDIR)/$(PRGNAME)
	$(RM) -f $(TARGETDIR)/$(D64NAME)
	$(RM) -f _*.txt
	rmdir $(TARGETDIR)
	@echo " "
	
2013-01-24 10:15
HCL

Registered: Feb 2003
Posts: 728
@Frantic: So that was supposed to be "not complicated at all"!?!? Any makefile larger than 10 lines is complicated :P.
2013-01-24 12:08
Oswald

Registered: Apr 2002
Posts: 5094
Quote: @Frantic: So that was supposed to be "not complicated at all"!?!? Any makefile larger than 10 lines is complicated :P.

+1

Make is scary. I have only used it once so far: While it adds flexiblity and saves compile time on the other hand it adds an extra level of frustration. Fighting with it is not fun, so it will do what you want. If you're not familiar with it, and you only started to use it for your c64 project you will have trouble.
2013-01-24 13:11
enthusi

Registered: May 2004
Posts: 677
Nah. You can make super plain Makefiles that look and act like a mere bash script.
THEN you can add ONE layer of complexity by adding dependencies, etc.
super-easy to learn, hard to master though. But for big gain in c64 projects you'd hardly have to master it.
it breaks down to:
game.prg: game.asm leveldata.bin
   xa game.asm -o game.prg

leveldata.bin: level.asm charset.bin
   xa level.asm -o leveldata.bin

charset.bin: charset.koala
   convert charset.koala charset,bin

this has 3 'layers' already. Yet leveldata.bin will only be reassembled when level.asm or charset changed. It will automatically recognize if charset.koala changed even though level.asm might still be the same etc.
You can hardly call this complex.
2013-01-24 13:41
chatGPZ

Registered: Dec 2001
Posts: 11386
"Make is scary."
you know what is _really_ scary? - supposedly decent coders proposing .bat files. /o\

not using make because it is "scary" or "hard" is pretty much like using basic over assembly because asm is "scary" and "hard". it boils down to "i am to lazy to learn it so i will pretend i dont need it".
2013-01-24 13:59
Cruzer

Registered: Dec 2001
Posts: 1048
Agree with Oswald. I'm using Ant and Maven enough at work to get my need for boring configuration crap covered. When coding c64 I just want it to be fun and about hacking the c64. Will probably try out make someday though.
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
csabanw
Fulgore/Excess/TREX
Krill/Plush
ΛΛdZ
zscs
rexbeng
FunFun/Triangle
Guests online: 114
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 Fungus  (9.8)
5 S!R  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.05 sec.