Coder Social home page Coder Social logo

smooth-player-demo's Introduction

smooth-player-demo

Make sure you clone this repository recursively! It uses two submodules, src/include/hardware.inc and src/smooth-player. Note that downloading a ZIP of this repo won't work for the same reason.

To compile the project, make sure you have RGBDS (at least 0.5.0), GNU Make and Python 3, and run make within this directory. Then, you can just run bin/smooth-player.gb!

Code organization

This demo also serves as an example of how to integrate and use smooth-player.

Look at the files src/playback.asm, src/sample.asm, src/timer_interrupt.asm, and the end of src/utils.asm. For the sample conversion, you may be interested in the rule near the bottom of Makefile.

This repo is based on gb-boilerplate for the general architecture.

Swapping music tracks

To replace the best music ever, included as an example, with your own, follow the following steps:

  • Include the music in raw signed 8-bit format under src/res, for example src/res/samples/nyan_cat.raw.
  • Include the sample: include_sample <Label>, "res/samples/nyan_cat.sample", <size>, <bank>. <Label> is up to you; <size> must match the size of the generated .sample file; and <bank> is the first ROM bank in which the sample will be stored (yes, the sample banks are hardcoded due to technical constraints. Sorry!)
  • Replace RickSample with <Label> in src/playback.asm. You can also delete the include_sample RickSample, ... line, by the way.
  • Compile again, and voilà!

Making the music loop

Add the lines marked with a + to src/playback.asm. Don't add the +es themselves!

     ldh a, [hIsAGB]
     and a
     play_sample RickSample
     ld a, $77
     ldh [rNR50], a
+    ld hl, rTAC
 .lock
+    bit 2, [hl]
+    jr z, SetupPlayback
     ldh a, [rLY]
     and $04
     rra

smooth-player-demo's People

Contributors

issotm avatar

Stargazers

Zayd avatar Bertozzi Julien avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.