diff --git a/examples/README.md b/examples/README.md index ce61bbc2..147371d0 100644 --- a/examples/README.md +++ b/examples/README.md @@ -92,6 +92,12 @@ how to create a program made of multiple files loaded on demand * [Horizontal stars example](a8/horizontal_stars.mfk) – horizontal stars done on one missile +### Music + +* [CMC Player](a8/cmcplayer.mfk) – CMC player with sample music + +* [MPT Player](a8/mptplayer.mfk) – MPT player with sample music + ### Benchmarks * [Grand Theft Antic](a8/grand_theft_antic.mfk) – ANTIC impact on CPU depending on the used graphic mode diff --git a/examples/a8/cmcplayer.mfk b/examples/a8/cmcplayer.mfk new file mode 100644 index 00000000..e8e82239 --- /dev/null +++ b/examples/a8/cmcplayer.mfk @@ -0,0 +1,24 @@ +const word ADDRMUS = $a000 +const word ADDRPLA = $b000 + +byte stop @ ADDRPLA + $62d + +asm void comm(byte register(a) a, byte register(x) x, byte register(y) y) @ ADDRPLA+3 extern +asm void takt() @ ADDRPLA+6 extern + +void main(){ + comm($70,0,ADDRMUS.hi) + comm(0,0,0) + while os_CH == $ff { + if antic_vcount == $10 { + antic_wsync = $e + gtia_colbk = $e + takt() + gtia_colbk = 0 + } + } + comm($40,0,0) +} + +const array player @ ADDRPLA = file("data/cmc_player.rep", 6) +const array music @ ADDRMUS = file("data/echo.cmc", 6) diff --git a/examples/a8/data/cmc_player.rep b/examples/a8/data/cmc_player.rep new file mode 100644 index 00000000..53043b40 Binary files /dev/null and b/examples/a8/data/cmc_player.rep differ diff --git a/examples/a8/data/echo.cmc b/examples/a8/data/echo.cmc new file mode 100644 index 00000000..8b1bb51a Binary files /dev/null and b/examples/a8/data/echo.cmc differ