Skip to content

Commit

Permalink
docs: Update readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonioND committed Apr 25, 2022
1 parent a432efe commit 352d948
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 147 deletions.
185 changes: 38 additions & 147 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,135 +1,51 @@
GBT PLAYER v3.1.0
=================
GBT Player
==========

Music player library and converter kit for Game Boy and Game Boy Color that can
be used with `RGBDS <https://github.com/gbdev/rgbds>`__ (and, with
limitations, with GBDK). It is also available for Game Boy Advance as a C
library.

Licensed under the MIT license.

Copyright (C) 2009-2022 Antonio Niño Díaz

All rights reserved.

Email: antonio_nd@outlook.com

Web:

- www.skylyrac.net/

Latest version:

- https://github.com/AntonioND/gbt-player

Introduction
------------

**GBT Player** is a music creation environment for GB, GBC and GBA. It is formed
by **mod2gbt**, which converts a mod file into a gbt (GameBoy Tracker) file, and
GBT Player, which will be used to play that song in the GB, GBC or GBA. It's the
same idea as the old Lemon player, but greatly improved. Because of this
workflow, there are a lot of limitations that the GB/GBA doesn't impose, but that
are needed so that the mod file and the result on the GB/GBA are similar.
by:

- **mod2gbt**: Converts MOD files into GBT (GameBoy Tracker) format.
- **s3m2gbt**: Converts S3M files into GBT (GameBoy Tracker) format.
- **GBT Player**: Library to play GBT format on GB, GBC or GBA.

``GBT Player`` is writen in 100% assembly for GB/GBC and in C for GBA. That
means that it is fast, it won't need a lot of CPU time (around 7%? in GB, and
barely noticeable in GBA), and you will have a lot of time for your game logic.
It's the same idea as the old Lemon player for Game Boy, but greatly improved.
Because of this workflow, there are a lot of limitations that the GB/GBA
doesn't impose, but that are needed so that the mod file and the result on the
GB/GBA are similar.

For GB/GBC, there is source code for **RGBDS**, the main option for Game Boy
development (in my opinion). There is also legacy code for an old version that
also supported **GBDK**, but it's mostly unmaintained.
As of version 4.0.0 there is a big split between the GB/GBC version and the GBA
version.

For GBA, the code is just in C, and it doesn't depend on any library apart from
a few standard library headers.
- For GB/GBC, there is source code for **RGBDS**, the main option for Game Boy
development (in my opinion). There is also legacy code for an old version that
also supported **GBDK**, but it's mostly unmaintained. Note that there is no
S3M support for GB/GBC, only for GBA.

``mod2gbt`` is writen in C, and should compile anywhere.
- For GBA, the code is just in C, and it doesn't depend on any library apart from
a few standard library headers.

GBT Player is open source, and it is licensed under the MIT license. That means
that you can use and modify it but you have to give credit for the original
work. It would be nice to you tell me if you use it, anyway. :)

IMPORTANT NOTE: Version 1.x.x converted songs won't work with player version
2.0.0 or higher. The same happens with 2.x.x and version 3.0.0. They have to be
converted again.

How to compile the example
--------------------------

Compile ``mod2gbt``. In Windows you can use a command line like:

``gcc -o mod2gbt.exe mod2gbt``

A Makefile for Linux has been included in case you are feeling lazy. Just do:

``make``

Put ``rgbasm``, ``rgbfix`` and ``rgblink`` in the ``gb/rgbds`` folder and
run the bat/sh file in the ``rbgds_example`` folder. A compiled GB binary is
included.

Notes
-----

A nice tracker to modify the mod file is **OpenMPT**. You can download it here:

http://openmpt.org/

I don't use bat or sh files in my projects, I use makefiles, but I thought that
the examples would be too simple for a makefile to be useful.

``instr_test.gb`` is a sample of the default sounds.

``range_test.gb`` is just a test of what notes the GB can reach (C3 - B8).

``effects_test.gb`` tests arpeggio and "cut note" effects.

``volume_test.gb`` tests the range of volumes supported by each channel.

The mod file isn't 100% accurate. Sounds are a bit different from the real ones,
so you should make roms and test them in emulators or real GB often.

If you don't like the speed conversion done by ``mod2gbt`` (from 50 Hz to 60 Hz)
you can use the ``-speed`` argument for ``mod2gbt``. The speed will be higher
and it will probably have to be adjusted manually.

The initial speed of the song is set by the start function, and it will run at
that speed until it finds a change speed command in the song. If the first step
of your song takes forever, this is the reason.

**For GB/GBC**: When creating **really** big ROMs (more than 4 MiB), the define
``GBT_USE_MBC5_512BANKS`` in ``gbt_player.inc`` should be uncommented to allow
allocation of the music data in banks higher than 255. Also, songs must be
converted adding ``-512-banks`` to the ``mod2gbt`` command line.

GBDK notes
----------

GBDK: http://gbdk.sourceforge.net/

``GBDK`` default assembler (``as-gbz80``) is no longer supported. ``RGBDS`` must
be used, and I don't really know if ``GBDK`` will work with latest ``RGBDS``
version. Adding ``-W--asm=rgbds`` to the command line when compiling ``GBDK``
code should make it work, but it hasn't been tested.

Since new functionality needs advanced macros like ``BANK()``, which are only
supported by ``RGBDS``, the ``GBDK`` version is discontinued. The latest version
that can be used with ``GBDK`` default assembler (2.1.2) is in the folder
``legacy_gbdk``, as well as the corresponding converter. I don't really know if
the same effect can be obtained with ``as-gbz80``. If it can be done, open an
issue and I may update ``GBDK`` version again. For now, this old legacy version
is mostly unmaintained.

This is an article I wrote related to bank switching:

http://www.skylyrac.net/2015-04-08-gbt-player-usage.html

To compile the ``GBDK`` example: Open the bat file, change it to set the correct
path to your ``lcc`` binary and double clic the bat.

Changelog
---------

- Version 4.0.0 (2022/4/25)

- This is a GBA only release.
- Break between GB and GBA versions. In the future they may be reunified.
- Added support for S3M files to the GBA version.
- Added ``s3m2gbt`` tool.

- Version 3.1.0 (2022/4/19)

- Bugfix release for GBA.
Expand Down Expand Up @@ -234,42 +150,17 @@ Changelog

- Initial release

To Do
About
-----

- Store channel 3 samples in RAM to be able to change them in execution time by
the user?
- End song callback? Special effect for callback? To synchronize game events or
things like that.
- ``WLA-DX`` version.

Known bugs
----------

- Effect ``Dxx``, when used the last step of a pattern, will jump 2 patterns
instead of 1.

License
-------

```
Copyright (c) 2009-2022 Antonio Niño Díaz <antonio_nd@outlook.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
Licensed under the MIT license.

Copyright (C) 2009-2022 Antonio Niño Díaz

All rights reserved.

Email: antonio_nd@outlook.com

Web: www.skylyrac.net/

Latest version: https://github.com/AntonioND/gbt-player
115 changes: 115 additions & 0 deletions gb/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
GBT Player v3.1.0
=================

Music player library and converter kit for Game Boy and Game Boy Color that can
be used with `RGBDS <https://github.com/gbdev/rgbds>`__ (and, with
limitations, with GBDK).

IMPORTANT NOTE: Version 1.x.x converted songs won't work with player version
2.0.0 or higher. The same happens with 2.x.x and version 3.0.0. They have to be
converted again.

How to compile the example
--------------------------

Compile ``mod2gbt``. In Windows you can use a command line like:

``gcc -o mod2gbt.exe mod2gbt``

A Makefile for Linux has been included in case you are feeling lazy. Just do:

``make``

Put ``rgbasm``, ``rgbfix`` and ``rgblink`` in the ``gb/rgbds`` folder and
run the bat/sh file in the ``rbgds_example`` folder. A compiled GB binary is
included.

Notes
-----

A nice tracker to modify the mod file is **OpenMPT**. You can download it here:

http://openmpt.org/

I don't use bat or sh files in my projects, I use makefiles, but I thought that
the examples would be too simple for a makefile to be useful.

``instr_test.gb`` is a sample of the default sounds.

``range_test.gb`` is just a test of what notes the GB can reach (C3 - B8).

``effects_test.gb`` tests arpeggio and "cut note" effects.

``volume_test.gb`` tests the range of volumes supported by each channel.

The mod file isn't 100% accurate. Sounds are a bit different from the real ones,
so you should make roms and test them in emulators or real GB often.

If you don't like the speed conversion done by ``mod2gbt`` (from 50 Hz to 60 Hz)
you can use the ``-speed`` argument for ``mod2gbt``. The speed will be higher
and it will probably have to be adjusted manually.

The initial speed of the song is set by the start function, and it will run at
that speed until it finds a change speed command in the song. If the first step
of your song takes forever, this is the reason.

**For GB/GBC**: When creating **really** big ROMs (more than 4 MiB), the define
``GBT_USE_MBC5_512BANKS`` in ``gbt_player.inc`` should be uncommented to allow
allocation of the music data in banks higher than 255. Also, songs must be
converted adding ``-512-banks`` to the ``mod2gbt`` command line.

GBDK notes
----------

GBDK: http://gbdk.sourceforge.net/

``GBDK`` default assembler (``as-gbz80``) is no longer supported. ``RGBDS`` must
be used, and I don't really know if ``GBDK`` will work with latest ``RGBDS``
version. Adding ``-W--asm=rgbds`` to the command line when compiling ``GBDK``
code should make it work, but it hasn't been tested.

Since new functionality needs advanced macros like ``BANK()``, which are only
supported by ``RGBDS``, the ``GBDK`` version is discontinued. The latest version
that can be used with ``GBDK`` default assembler (2.1.2) is in the folder
``legacy_gbdk``, as well as the corresponding converter. I don't really know if
the same effect can be obtained with ``as-gbz80``. If it can be done, open an
issue and I may update ``GBDK`` version again. For now, this old legacy version
is mostly unmaintained.

This is an article I wrote related to bank switching:

http://www.skylyrac.net/2015-04-08-gbt-player-usage.html

To compile the ``GBDK`` example: Open the bat file, change it to set the correct
path to your ``lcc`` binary and double clic the bat.

To Do
-----

- Store channel 3 samples in RAM to be able to change them in execution time by
the user?
- End song callback? Special effect for callback? To synchronize game events or
things like that.
- ``WLA-DX`` version.

Known bugs
----------

- Effect ``Dxx``, when used the last step of a pattern, will jump 2 patterns
instead of 1.

About
-----

Licensed under the MIT license.

Copyright (C) 2009-2022 Antonio Niño Díaz

All rights reserved.

Email: antonio_nd@outlook.com

Web: www.skylyrac.net/

Latest version: https://github.com/AntonioND/gbt-player

Loading

0 comments on commit 352d948

Please # to comment.