Page 1 of 1

Adding Files to a Bin

Posted: Tue Feb 09, 2010 5:32 pm
by Alex Khan
I've got all these files sound images code ...

How do I pop them all into one bin file ?

So the Emulator can run it ?

:roll:

Anyone with a suggestion ?

Re: Adding Files to a Bin

Posted: Tue Feb 09, 2010 6:09 pm
by TmEE co.(TM)
When using a typical assembler you got INCBIN and INCLUDE to add external files to your program. INCBIN is for binary data, INCLUDE is for data that will get assembled. Some assemlbers have BINCLUDE instead of INCBIN....

as for BasiEgaXorz which you probably ask about, I have no clue

Posted: Tue Feb 09, 2010 6:33 pm
by Shiru
BEX has incbin alternative, 'datafile'. There are ton of examples coming together with BEX, check 'testpicture.bex'.

Posted: Wed Feb 10, 2010 6:35 am
by Alex Khan
TmEE co.(TM):

Can I bother you for a simple step by step tutorial on how to group all my files in one large Bin file ? :oops:


Shiru:

I will check the sample code

Posted: Wed Feb 10, 2010 7:22 pm
by Chilly Willy
If you want a filesystem type method of accessing the data, google for "romfs" - it's perhaps the most common method used to access files in a rom via filesystem methods.

Posted: Wed Feb 10, 2010 8:08 pm
by mic_
No need for a tutorial, just open up a command line prompt and use the COPY command:

copy /B file1.bin + file2.bin + file3.bin output.bin

..Or however many files you want to combine.
But I don't see much advantage to this - you should be able to INCBIN as many files as you wish from your program.

Posted: Wed Feb 10, 2010 9:44 pm
by Chilly Willy
It comes down to the programmer - it's the programmer's responsibility to determine how they wish the data to be stored and accessed. There are literally too many methods to list; it's a matter of learning how to program and determining when certain techniques work better than others. There are thousands of sites already on the web that teach beginning programming lessons. I suggest using them. Trying to learn how to program starting with a console (especially old and limited ones) can be an exercise in futility. Learn to program, THEN try to program old consoles. Concentrate on C and assembly language, especially if your final goal is programming something like the Genesis.

Posted: Thu Feb 11, 2010 9:24 am
by Alex Khan
Okay let me try all three of your methods ... :)



Chilly, as Apollo said to Rocky in in Rocky 3:


"There is no tomorrow ROCK There is no tomorrow! "

I don't have years :(

Posted: Thu Feb 11, 2010 5:33 pm
by Chilly Willy
Well, you don't need to spend YEARS learning to program... unless you really suck at it. :wink:

Most of the various site that teach programming I've seen can be gone through in a few days to a couple weeks, depending on how much time you put into it. And reading a book or two on C programming (like C for Dummies) would take a week at best.

They'll cover things you won't find here, like what makefiles do.

Posted: Mon Feb 15, 2010 8:44 am
by Alex Khan
Thanks Chilly that was encouraging. :)

Okay I will level with you I am working with a small team.

There is already a programmer involved and he's a good programmer but new to game programming.

Also he can't speak English or barely write the language.

So I need to guide him on the programming for a Sega game. :)

Posted: Mon Feb 15, 2010 7:03 pm
by Chilly Willy
That makes a bit more sense why you'd ask some of those things. :D

Well, the game part of the programming shouldn't be any trouble for him. So given that, I recommend having him first look over the demos and stuff that's released with code.

There are the examples in Stef's mini devkit. There are my compressed audio examples which are also based on one of those examples. There is the MD Myth Menu I released here (and elsewhere). I'm sure some of the demos in the demo forum have code... I've seen a few.

There's a few main points of a game that are platform specific -

Files for the data for the game: We've mentioned a few things already, namely, using incbin on the binary files, conversion to C arrays using bin2c, and using romfs.

Display: He'll need to look at example code for setting and using the VDP, as well as read the Genesis docs.

Sound: There are a number of music players posted here - he can look at the "driver" code included to see how the Z80 handles the FM chip and the PSG chip. He needs a good understanding of Z80 assembly language, and then the hardware manual for the YM2612 and PSG. My threads on compressed audio playback have examples of playing back PCM digital sounds that are compressed in various manners.

Input: Reading pads and mice are pretty easy. There's code posted here that shows how to read regular pads, six-button pads, mice, and the Team Player.

Here's a great page for Genesis docs: http://emu-docs.org/?page=Genesis

Posted: Wed Feb 17, 2010 9:10 am
by Alex Khan
Right now it's being done in the Basi compiler.

That thing works like a charm write Basic code for a Bex file and Presto ! There is a Rom just waiting to run in the compiler's directory.

I would have loved to use Stef Kit but I can't get it to integrate with either Blocks or Eclipse.

Even added Stefan on Facebook to try and communicate with him to understand why integration is such a pain in the rear end. Menaing his library with IDE.

Okay he's been controlling the VDP with Basi sample code would he also have to look at the Stef Dev Kit sample code ?

Well scratch that he would considering both are two different languages.

Yes the music is an issue I was talking to Shiru he has written a sound engine for Basi I tested it it works.

But sound sampling for character voices and effects is an issue Shiru said sharing the Yamaha for music and sampling is an issue.

Chilly I have a BOATLOAD of Documents from Eidolon's Inn including stuff on the Z80.

Will check the link you provided.

Also will check your threads on compressed audio playback.

I am going to have to learn all I can and then translate for the programmer he's Zilch on English !

Here's what I am thinking Higher Level language coding for sprites, tiles and music in Basi.

Then a Z80 sampling engine in Z80 Assembly!

What do you think ?

Chilly could you point me in the direction of a tutorial on Z80 assembly the docs I have are on the M68K and X86.

When you mean players you mean stuff like MODPSG2 AND TFMAKER ?

Well for Basi ? Yes Input is easy ... there's a 6 button option for the genesis really ?

Thanks for taking the time to steer me in the right direction Chilly.

Posted: Wed Feb 17, 2010 11:10 pm
by Chilly Willy
For Z80 info, go to: http://www.z80.info/

Most of the popular processors have an info page like that.

To use Stef's Mini Devkit (or my own linux one), you need to understand C in general, and gcc in particular as that's what the toolchain is based on. In general, you have a makefile which tells gcc what to compile and link into the finished product. Makefiles can get complicated, but the ones for the Genesis tend to be pretty simple. Look at the ones that come with Stef's examples and other open source Genesis homebrew. I can't repeat that enough - go to the demos forum and get all the demos out and check for the ones that have source. Go to the Neo Myth threads in this forum and get my Neo Myth arcs as they have code.

Posted: Tue Mar 02, 2010 5:32 pm
by Alex Khan
Sweet Chilly let me check your Neo Myth thread as a first step.