Omnimaga

General Discussion => Technology and Development => Computer Projects and Ideas => Topic started by: Halifax on February 19, 2007, 06:54:00 am

Title: Bitmap to Binary Application
Post by: Halifax on February 19, 2007, 06:54:00 am
This was made to help me convert 200 or so tiles for The Massacre. It only works for 16x16 sprites and it outputs them in ".db" form formatted and everything. It has one bug and that is that it puts an unknown character at the end of every line. Oh well I am releasing the program and I am releasing the source so maybe someone else can work on it.

This only converts 8bit bitmaps to binary.

http://www.freewebs.com/omnimaga/bitbin.exe

http://www.freewebs.com/omnimaga/main.cpp

The source is only about 200 lines in the file and its easy to understand. I would like to see someone else work on this.
Title: Bitmap to Binary Application
Post by: bfr on February 19, 2007, 10:47:00 am
Sweet!  200 tiles or so?  o.oblink.gif

Anyway, you could have used ImageStudio, but still, nice work.  :)smile.gif
Title: Bitmap to Binary Application
Post by: Halifax on February 19, 2007, 12:44:00 pm
Image Studio converts standalone bitmaps to binary?

eh.. It only took me like 1 hour to throw this program together
Title: Bitmap to Binary Application
Post by: JincS on February 19, 2007, 07:09:00 pm
I'll mod/tweak the code a bit to optimize it (as soon as I get my compiler working again). Do you want this code in C or C++?

BTW Win32 GUI tuts area coming along slow, but nice. I'll post updates as I finish them...
Title: Bitmap to Binary Application
Post by: Halifax on February 20, 2007, 03:22:00 pm
JincS I want it in C please and thanks
Title: Bitmap to Binary Application
Post by: JincS on February 21, 2007, 07:17:00 am
kk can do

BTW just got my compiler back online today, so I'll work on it tonight (if I have time).
Title: Bitmap to Binary Application
Post by: bfr on February 21, 2007, 01:39:00 pm
w00t!

I have to start programming more in C/C++...
Title: Bitmap to Binary Application
Post by: Halifax on February 21, 2007, 02:31:00 pm
Hey also I am recently working on an Assembler for my code that is based off of the OTBP oncalc assembler. Which if you think about it the OTBP assembler assembles pretty damn fast in basic on calc so in C on computer it would be even mucho faster. I am expecting to include special things in this for Massacre that no other assembler has really suited me with :(sad.gif. TASM is alright but slow. SPASM is fast as crap but doesn't fit me so why not make my own!

@bfr: There really is no need for C++ and if I recall it is harder to make cross-platform applications out of C++ so I would just stick with C it has everything you need and every main commercial/non-commercial things uses it.
Title: Bitmap to Binary Application
Post by: bfr on February 21, 2007, 04:08:00 pm
It is harder to make cross-platform applications out of C++? This may be true, but I thought the main issue was speed (although some people argue that there isn't much of a difference).  Anyway, isn't wxWidgets, a cross-platform GUI toolkit, made in C++?  Oh, whatever.... :Ptongue.gif

Good luck on the assembler!  :)smile.gif  But, I'm pretty sure that the on-calc assembler doesn't assemble programs in TI-BASIC alone, unless I have been very ignorant has to how powerful TI-BASIC really is..... ;)wink.gif

EDIT:  

SPASM doesn't fit you?   o.oblink.gif   Could you elaborate?  Are you looking for a SPASM in a medium-small size or something?  ;)wink.gif

Also, be sure to check out Brass.  It's Windows-only and depends on the .NET Framework, but other than that, it's great.

I'm really looking forward to the completion of your assembler, though.  :)smile.gif.
Title: Bitmap to Binary Application
Post by: Halifax on February 22, 2007, 11:16:00 am
6 smileys. haha. Yeah basically I don't use C++ because I speed and because C is so compact. I don't feel like using mediums or whatever either like cross-platform things so that's another reason. Yeah but basically I want an Assembler that breaks the mold. SPASM follows TASM basically but its just faster. Its hard to explain what I want but its more towards scripting and other things. Otherwise I wouldn't make an Assembler because its a waste of time.
Title: Bitmap to Binary Application
Post by: bfr on February 22, 2007, 11:32:00 am
Scripting?  o.oblink.gif  For an assembler? I'd like to learn more about this.  It may be hard to explain, but you might have to tell people more about you assembler if you plan on having good documentation, unless it is just that you don't have it completely planned out yet (I'm not trying to sound rude, but I'm just curious).  
Title: Bitmap to Binary Application
Post by: Halifax on February 22, 2007, 12:10:00 pm
I understand dude its basically. It's basically going to be shown through examples. Now let me explain in the easiest possible way I can.

One thing is like

ld a,mul(b = 5,(currow),e = (testvar))

you would declare that as static so instead of calculating the multiplication through code with swapping registers and everything the compiler will put 5 in register b and (testvar) in and. Then it will multiply b by (currow) by e. So that will make programs compact and also easier to program.

where number is the output of the compiler. This will make things easier and code more compact and that is just one example. I have other ideas that are floating around but I just can't grab them, so when I get them I will inform you
Title: Bitmap to Binary Application
Post by: JincS on February 22, 2007, 02:32:00 pm
Aaahh...I understand what you're going for...Interesting approach, kind of a pseudo asm/C language...Could be interesting...

**On a side note: C++ is just a wrapper around C with some modifications that are designed to make programming easier (like the use of classes, and streams, instead of printf(), getch(), etc.). So long as you don't use OS-specific functions (like the Windows GUI ones), your code will still be 100% cross-platform compliant (so long as you follow ANSI standards, just like C).

Lesson 1 of my GUI tuts is finally available. 8 pages w/ .5" margins in PDF format, with accompanying source code (zipped = 64Kb). I'll email it to you. More lessons on the way, but they won't have to be as long. BTW lesson 1 will be expanded on (eventually), and I'll get to adding the appendixes in some other time (unnecessary info for beginner GUI coders, but good to know).
Title: Bitmap to Binary Application
Post by: bfr on February 22, 2007, 03:53:00 pm
Could you post your tutorials online, JincS.

Yes!  I was 99% sure that C++ was cross-platform.

Halifax:  Looks nice, but couldn't you just use macros?  
Title: Bitmap to Binary Application
Post by: JincS on February 22, 2007, 05:12:00 pm
Once I get my website finished and online, they will be available there. But until then:

Free C++
Windows 32-bit API Tutorials

Lesson 1: Creating a Simple Window

See attachment.
Title: Bitmap to Binary Application
Post by: Halifax on February 23, 2007, 10:50:00 am
see thats the thing bfr with macros tell me how would you multiple 3 parameters?? You would have to register juggle and multiply them the brute force way or use a routine. But with that the compiler will take it and get the value of register e and a w/e and (currow) and then multiply them and then replace that line in the code with

ld hl,numberoutputbythecompiler

So with macros you wouldn't be able to replace that line with whatever multiplied by whatever. I told you it would be hard to understand

Anyways it compacts code and it saves precious tstates.

**NOTE**: That cannot be used in a loop since it replaces the line with a constant
Title: Bitmap to Binary Application
Post by: Halifax on February 23, 2007, 10:52:00 am
I had to double post just to make sure JincS sees this. Dude o.oblink.gif I already know how to make windows with Win32 API. I can makes windows,dropdown menus,labels, buttons, and pop up messages o.oblink.gif. I thought I told you that ??? Oh well unless you were making that for other people
Title: Bitmap to Binary Application
Post by: JincS on February 24, 2007, 04:54:00 pm
I don't think you told me that...but regardless, this tutorial is the basis for everything else. I had to make sure (all) people have a solid understanding of the basics before I throw in the fun stuff.

On a side note: if you know how to make buttons, you pretty much have everything you know to make ALL controls, all you have to do is change the parameter that says "BUTTON" to one of the following:

"EDIT"
"STATIC"
"COMBOBOX"
etc...

Check out this website:
http://www.foosyerdoos.fsnet.co.uk/

It'll teach you everything you need to know. I won't have time for a few weeks to crank out any more tuts, but this site will give you the basics of making all controls (but don't worry, I do plan to complete my tutorial series, as I intend to publish it).

Vielen Dank!
Title: Bitmap to Binary Application
Post by: Halifax on February 24, 2007, 06:30:00 pm
Yo thats exactly the type of tutorial I was looking for thanks man
Title: Bitmap to Binary Application
Post by: bfr on February 25, 2007, 04:58:00 am
That's a nice website.  I like to learn by example.

I actually would be using wxWidgets or Qt instead of the Windows API, but I haven't been able to get either of them working, and there's WINE to take care of some incompatibilities anyway.  
Title: Bitmap to Binary Application
Post by: JincS on February 25, 2007, 02:52:00 pm
My tuts pretty much take the basics from that site, and expand on them, giving examples on EXACTLY how things work, ways to change them, use events, etc.

It's a great basis, but it's lacking on some key points.