Author Topic: MD homebrew development  (Read 37029 times)

0 Members and 1 Guest are viewing this topic.

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: MD homebrew development
« Reply #30 on: October 05, 2009, 01:56:46 AM »
That was a little humor... and you're doing pretty great here with your tool.
Don't worry i could tell that it was humor , and thanks !

PAUSE is either zero or non-zero, and makes the Z80 code pause almost instantly. It's checked in the tight loop in the Z80 code. Non-zero pauses, and zero un-pauses.
I have studied all the z80 code so pretty much i understand what's going on , but the truth is that your comments in the z80 source really helped.

Negative is a special case meaning repeat forever. So you can tell the driver to play the sample 1 to 127 times, or forever. PLAY isn't checked in the tight loop, so if you set PLAY to zero to stop playback, it may take upwards of 10 seconds to stop. PLAY is checked in the pause loop, so the proper way to stop my sample playback is to pause (which occurs almost instantly), then set PLAY to zero (which will stop almost instantly in the pause loop).
I think i missed this :D

Yeah. Pretty simple... this particular compressed format needs to be four byte aligned. My other musicdemo compression examples over at SpritesMind may be different - for example, my 8:1 compressor doesn't need any alignment at all.
So you have done more demos? I'll have a look at SpritesMind forums :) ..
« Last Edit: October 05, 2009, 02:00:13 AM by Conle »

Offline ChillyWilly

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1753
  • Just a coding machine.

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: MD homebrew development
« Reply #32 on: October 05, 2009, 02:43:09 PM »

Offline ChillyWilly

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1753
  • Just a coding machine.
Re: MD homebrew development
« Reply #33 on: October 06, 2009, 12:48:40 AM »
It's a nice little thread on the evolution of audio compression simple enough to decode in real-time on a Z80.  8)  ::sm-09.gif::

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: MD homebrew development
« Reply #34 on: October 06, 2009, 01:02:01 AM »
It was a very informative and interesting read indeed ~sm-41.gif~  :)  .

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: MD homebrew development
« Reply #35 on: October 06, 2009, 02:24:11 AM »
Hey Chilly Willy , do you know where can i find a descent 68K CPU tutorial/reference manual ? I have found only some general tutorials that don't cover all the commands but the basics  O0O O0O O0O O0O ~sm-34.gif~

Offline ChillyWilly

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1753
  • Just a coding machine.
Re: MD homebrew development
« Reply #36 on: October 06, 2009, 03:20:21 AM »
Hey Chilly Willy , do you know where can i find a descent 68K CPU tutorial/reference manual ? I have found only some general tutorials that don't cover all the commands but the basics  O0O O0O O0O O0O ~sm-34.gif~

http://emu-docs.org/?page=CPU%2068k

You'll find the Programmer's Reference Manual on that page, along with some other docs. Lot's of good documents on the site

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: MD homebrew development
« Reply #37 on: October 06, 2009, 04:07:30 PM »
http://emu-docs.org/?page=CPU%2068k

You'll find the Programmer's Reference Manual on that page, along with some other docs. Lot's of good documents on the site

Excellent site , it has hardware docs for all retro consoles   ::sm-29.gif:: .
I will use these docs for my gb/gbc emulator  too when i start coding it ~sm-42.gif~

Offline ChillyWilly

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1753
  • Just a coding machine.
Re: MD homebrew development
« Reply #38 on: October 07, 2009, 12:18:33 AM »
Excellent site , it has hardware docs for all retro consoles   ::sm-29.gif:: .
I will use these docs for my gb/gbc emulator  too when i start coding it ~sm-42.gif~

I thought you'd like it.  :D

Lots of good docs on all kinds of consoles there. It's the first place I go to when looking for old console info.  ~sm-41.gif~

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: MD homebrew development
« Reply #39 on: December 07, 2009, 03:48:20 AM »
I've been doing alot of research the last few days on how to get started with assembly because its lame to understand how it works & lacking the knowledge to support it.
 ~sm-34.gif~

Z80 seems to be the easiest assembly language to learn , but the downside is that you are limited to run it through emulators & this doesn't help at all.

After reading a couple of ebooks with assembler tutorials , i found a great ebook and a great assembly language(i don't know , it feels okay!).

The free e-book is : "cs50-asm.pdf" and it covers pretty much every aspect of MIPS language.

Now the good thing? There is a MIPS simulator app called SPIM( console & gui ) and its multiplatform(right now im running it on my ubuntu machine :D).

I think that this is the best combination for someone who's looking a way to get into assembly.

MIPS is an excellent language & with the simulator its just the best thing that you can get!

The ebook also covers the basic usage of SPIM and how to run your program & print the registers.

Hope it helps.

Links ->
http://pages.cs.wisc.edu/~larus/spim.html
http://www.eecs.harvard.edu/~ellard/Courses/

(ps : Assuming that one knows at least basic programming , binary math &basic hw knowledge )

Offline Nintendud

  • Jr. Member
  • **
  • Posts: 84
Re: MD homebrew development
« Reply #40 on: June 17, 2010, 05:31:46 AM »
So, I'm interested in learning more about Genesis development (finally). I know this topic is a bit old, but I have a few questions.

  • ChillyWilly, any updates to your Genesis dev kit?
    Okay, here's archives for my latest gendev toolchain and "SDK". The SDK is the source for bin2c, libheap, libmd, libromfs, and zasm. The binaries are all in the toolchain archive in the proper place. Note that this arc, unlike previous ones, is entirely 32 bit. Most 64 bit linux distros can handle that, but you may need 32 bit compatibility libraries installed. The SH compiler has been updated to the latest KPIT 902 release.

    gendev-20090925.7z
    gendev-sdk-20090925.7z
  • If I were to make a game for the Genesis, would I be able to do it all in C, or is it usually necessary, for speed reasons, to need assembly?
  • Any tips/pointers/websites/helpful tools other than the ones already posted in this thread?

I haven't done much research into anything yet, but I'm going to start on that tonight. Thanks!

Offline ChillyWilly

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1753
  • Just a coding machine.
Re: MD homebrew development
« Reply #41 on: June 17, 2010, 08:31:17 AM »
1. Let's collect a bunch of my MD/32X stuff here for convenience.

ASL - assembler for BIG assembly only projects: asl142bld54.7z
GCC - latest archive of my gcc based tools: gendev-20100411.7z
libff - used in reading SD cards: libff-2010-04-03.zip
DMA audio test for 32X: DMAAudioTest32X.zip
libmd - used for C projects on the MD: libmd.zip
musicdemo4 - shows how to use the Z80 to play compressed PCM (also uses libmd): musicdemo4.7z
Wolf32X - latest beta on Wolf3D for the 32X: w3d-sod-sw-b5.zip

Remember, to use my toolchains, you need to make a couple exports in the terminal before you can make the project.

For a MD project:
Code: [Select]
export GENDEV=/home/jlfenton/Tools/gendev
export PATH=$GENDEV/m68k/bin:$GENDEV/bin:$PATH

For a 32X project:
Code: [Select]
export GENDEV=/home/jlfenton/Tools/gendev
export PATH=$GENDEV/sh2/bin:$GENDEV/m68k/bin:$GENDEV/bin:$PATH

ASL shouldn't need any exports.

Offline Conle

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2203
Re: MD homebrew development
« Reply #42 on: June 17, 2010, 12:32:45 PM »
Quote
If I were to make a game for the Genesis, would I be able to do it all in C, or is it usually necessary, for speed reasons, to need assembly?

Depends the game & how you manage and partition your resources but you can always combine asm with C.

One thing you need to do with libmd and i found it randomly when i was looking at the code , is to remove
the bitmap buffer!It takes up alot of work ram.

Just change in bitmap.h :

extern u8 BitmapBuffer[BITMAP_PITCH * BITMAP_PIXHEIGHT];

To this:
extern u8* BitmapBuffer;

And in bitmap.c:
u8 BitmapBuffer[BITMAP_PITCH * BITMAP_PIXHEIGHT];

To this:
u8* BitmapBuffer;

Compile again the code , and don't do any bitmap calls because it will just...crash  :D

Edit->>>There are also many look up tables for math functions , so you might wanna remove
 anything that you don't need.
 ~sm-67.gif~.gif




Quote
Any tips/pointers/websites/helpful tools other than the ones already posted in this thread?

I don't think there are many resources.Just try and look at source code...I did the same when i was doing my babysteps in 68K asm...
i was reading ChillyWilly's comments in ....neo2.s & crt0.s.....  O0O  O0O  O0O  O0O  O0O  O0O  O0O  O0O  ::sm-08.gif::

The only thing i would recommend (if you ever decide to learn 68k assembly) is to read the M68000 programmer's reference manual.  ~sm-58.gif~.gif
ChillyWilly recommended this to me and it has helped alot since then(I've used to have just the paper with the instruction set.  ~sm-73.gif~.gif  Don't do this
to yourself   ~sm-34.gif~).

If you can't find it , i can attach it here :)

« Last Edit: June 17, 2010, 12:57:42 PM by Conle »

Offline ChillyWilly

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1753
  • Just a coding machine.
Re: MD homebrew development
« Reply #43 on: June 18, 2010, 01:31:57 AM »
I just made libmd from Stef's Mini Devkit... I look at it more for an example of how to do things than as a usable devkit.  ~sm-64.gif~.gif

I recommend beginners get a hold of all the demo code they can and look over it all.