BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
ciatrklib.c File Reference
#include "blitzlib.h"
#include "blitzexec.h"
#include <exec/interrupts.h>
#include <hardware/custom.h>
#include <hardware/cia.h>
#include <graphics/gfxbase.h>
#include <dos/dos.h>
#include <proto/dos.h>

Data Structures

struct  modent
struct  chan

Macros

#define __NOLIBBASE__
#define DOS_BASE_NAME   dos
#define CUSTOM   ((volatile struct Custom *)0xdff000)
#define CIAAPRA   (*(volatile UBYTE *)0xbfe001)
#define VPOSR_LO   (*(volatile UBYTE *)0xdff006) /* the vertical position, bits 0-7 */
#define ID(a, b, c, d)
#define WORDAT(p)
#define LONGAT(p)
#define CMDW(ch)
#define LAUNDER(ptr)

Typedefs

typedef volatile struct AudChannel aud_t

Functions

void _loadtrkmodule (void)
void _StartTrkModule (void)
void _StopTracker (void)
void _decodemod (void)
void _gettrklen (void)
void _gettrkloc (void)
void _freetrackermodule (void)
void _gettrackerevent (void)
void _checktrackerevent (void)
void _waittrackerevent (void)
void _checkid (void)
void _modtochip2 (void)
void _getmodulename (void)
void _modulepositionjump (void)
void _getmoduleposition (void)
void _pausemodule (void)
void _change_playtype (void)
void _Play_Tracker (void)
void _Volume_Control (void)
void _ChangeTrackerMask (void)
void _maxpatterns (void)
void _inittrackerlib (void)
void _finittrackerlib (void)
void ciatrklib_mt_music (void)
void _loadcheck (void)
void _checkused (void)
void _decodecheck (void)
void _freecheck (void)
static struct modent * slot (ULONG num)
static const UWORD * periods (UBYTE ft)
static aud_t * voice (int ch)
static ULONG globalloc (ULONG size, ULONG flags)
static void globfree (ULONG mem, ULONG size)
static void mt_end (void)
static void resetciaint (void)
static void setciaint (void)
static void settempo (UWORD bpm)
static UWORD set_volume (UWORD v)
static UWORD set_real_mask (UWORD bits)
static ULONG maxpattern (const UBYTE *mod)
static ULONG patternsize (const UBYTE *mod)
static void clearsamplenums (UBYTE *mod, ULONG modlen)
static void maskfinetunes (UBYTE *mod)
static void mt_init (ULONG modlen)
static void waitline (void)
static void playsamples (UWORD chans)
static void pernop (struct chan *ch, aud_t *aud)
static void updatefunk (struct chan *ch)
static void arpeggio (struct chan *ch, aud_t *aud)
static void portaup (struct chan *ch, aud_t *aud)
static void portadown (struct chan *ch, aud_t *aud)
static void fineportaup (struct chan *ch, aud_t *aud)
static void fineportadown (struct chan *ch, aud_t *aud)
static UWORD findperiod (const UWORD *table, UWORD per)
static void settoneporta (struct chan *ch)
static void toneportnochange (struct chan *ch, aud_t *aud)
static void toneportamento (struct chan *ch, aud_t *aud)
static UBYTE wave (UBYTE pos, UBYTE form)
static void vibrato2 (struct chan *ch, aud_t *aud)
static UBYTE newcmd (UBYTE old, UBYTE cmdlo)
static void vibrato (struct chan *ch, aud_t *aud)
static void volumeslide (struct chan *ch, aud_t *aud)
static void toneplusvolslide (struct chan *ch, aud_t *aud)
static void vibratoplusvolslide (struct chan *ch, aud_t *aud)
static void tremolo (struct chan *ch, aud_t *aud)
static void sampleoffset (struct chan *ch)
static void volslideup (struct chan *ch, aud_t *aud, UBYTE delta)
static void volslidedown2 (struct chan *ch, aud_t *aud, UBYTE delta)
static void positionjump (struct chan *ch)
static void volumechange (struct chan *ch, aud_t *aud)
static void patternbreak (struct chan *ch)
static void setspeed (struct chan *ch)
static void filteronoff (struct chan *ch)
static void jumploop (struct chan *ch)
static void karplusstrong (struct chan *ch)
static void doretrig (struct chan *ch, aud_t *aud)
static void retrignote (struct chan *ch, aud_t *aud)
static void volumefineup (struct chan *ch, aud_t *aud)
static void volumefinedown (struct chan *ch, aud_t *aud)
static void notecut (struct chan *ch, aud_t *aud)
static void notedelay (struct chan *ch, aud_t *aud)
static void patterndelay (struct chan *ch)
static void funkit (struct chan *ch)
static void e_commands (struct chan *ch, aud_t *aud)
static void checkefx (struct chan *ch, aud_t *aud)
static void checkmoreefx (struct chan *ch, aud_t *aud)
static void setperiod_regs (struct chan *ch, aud_t *aud)
static void setperiod (struct chan *ch, aud_t *aud)
static void playvoice (struct chan *ch, aud_t *aud, const UBYTE *samples, const UBYTE *note)
static void nextposition (void)
static void dskip (void)
static void nonewallchannels (void)
static void getnewnote (void)
static void mt_music_c (void)
 PlayTracker: one tick of the play routine (mt_music).
static void change_volume_levels (void)
static void freetrackermodule_c (ULONG num)
static ULONG loadtrkmodule_c (ULONG num, ULONG name, struct DosLibrary *dos)
 LoadTrackerModule(TrackerModule#,Name): load a module file into chip memory.
static BB_BOOL modtochip (ULONG num)
static void decodemod_c (ULONG num, ULONG addr)
 DecodeModule TrackerModule#,ModuleAddress: use a module in memory.
static ULONG gettrklen_c (ULONG num)
 GetTrackerSize(TrackerModule#): the length of a slot's module.
static ULONG gettrkloc_c (ULONG num)
 GetTrackerLocation(TrackerModule#): the address of a slot's module.
static void freetrk_c (ULONG num)
 FreeTrackerModule TrackerModule#: free a slot's module.
static ULONG checkid_c (ULONG num)
 CheckTrackerID(TrackerModule#): is the slot's module a Protracker module?
static ULONG modtochip2_c (ULONG arg)
 ModuleToChip(TrackerModule#): does nothing (RTS).
static ULONG getmodulename_c (ULONG num)
 GetModuleName$(TrackerModule#): the name of a slot's module.
static ULONG starttrkmodule_c (ULONG num)
 StartTracker(TrackerModule#): play a slot's module.
static void stoptracker_c (void)
 StopTracker: stop playing (mt_end: volumes 0, audio DMA off).
static ULONG maxpatterns_c (ULONG num)
 ModulePatterns(Module #): the number of patterns of the module.
static ULONG gettrackerevent_c (ULONG old)
 GetTrackerEvent: the value of the last tracker event (effect 8).
static ULONG checktrackerevent_c (ULONG old)
 CheckTrackerEvent: has a new tracker event come?
static void waittrackerevent_c (const void *caller_a6)
 WaitTrackerEvent: wait for the next tracker event.
static void modulepositionjump_c (ULONG pos)
 ModulePositionJump (Position#): jump to a song position.
static ULONG getmoduleposition_c (ULONG old)
 GetModulePosition: the current song position.
static void pausemodule_c (void)
 PauseModule: pause or continue the playing module.
static void change_playtype_c (void)
 ChangeTrackerVBlank: play without the CIA interrupt.
static void volume_control_c (ULONG vol)
 TrackerVolume (Volume Range: 0-64): the master volume.
static void changetrackermask_c (ULONG mask)
 ChangeTrackerMask Channel_Mask: the voices to play.
static void inittrackerlib_c (void)
 init: install the CIA interrupt and clear the module slots.
static void finittrackerlib_c (void)
 finit: stop playing and remove the CIA interrupt.
static void slotcheck_c (ULONG num)
static void loadcheck_c (ULONG num)
static void checkused_c (ULONG num)
static void decodecheck_c (ULONG num)
static void freecheck_c (ULONG num)

Variables

struct { 
   UBYTE   pause_status 
   UBYTE   play_type 
   UWORD   old_volume 
   UWORD   master_volume 
   UWORD   volume_flag 
   UBYTE   master_mask 
   UBYTE   master_mask_lo 
   struct modent   modtable [10] 
} libvars
struct { 
   UWORD   RealTempo 
   volatile struct CIA *   CIAAaddr 
   char   CIAAname [14] 
   char   CIABname [14] 
   struct Library *   CIAAbase 
   ULONG   TimerFlag 
   ULONG   TimerValue 
   UBYTE *   mt_data 
   char   GfxName [18] 
   struct Interrupt   MusicIntServer 
   char   musintname [20] 
   volatile struct Custom *volatile   endcustom 
} ciapart
struct { 
   UBYTE   FunkTable [16] 
   UBYTE   VibratoTable [32] 
   UWORD   PeriodTable [16 *36] 
   struct chan   chan [4] 
   struct AudChannel   fake_channel 
   UBYTE   fake_rest [60 - sizeof(struct AudChannel)] 
   UBYTE *   SampleStarts [32] 
   UBYTE *   SongDataPtr 
   UBYTE   speed 
   UBYTE   counter 
   UBYTE   SongPos 
   UBYTE   PBreakPos 
   UBYTE   PosJumpFlag 
   UBYTE   PBreakFlag 
   UBYTE   LowMask 
   UBYTE   PattDelTime 
   UBYTE   PattDelTime2 
   UBYTE   Enable 
   UWORD   PatternPos 
   UWORD   DMACONtemp 
   UBYTE   TrkEvt 
   UBYTE   LstEvt 
} playdata
static BPTR hand
static BPTR lock
static ULONG fname
static ULONG fib
static ULONG readerr
static ULONG thismod
static const char mess [] = "Tracker: File error! (Not found?)"
static const char mess2 [] = "Tracker Library Error"
static const UBYTE * patdata

Macro Definition Documentation

◆ __NOLIBBASE__

#define __NOLIBBASE__

◆ CIAAPRA

#define CIAAPRA   (*(volatile UBYTE *)0xbfe001)

◆ CMDW

#define CMDW ( ch)
Value:
((UWORD)((ch)->n.f.cmd << 8 | (ch)->n.f.cmdlo)) /* MOVE.W n_cmd(A6) */
static void ch(struct out *o, char c)
Definition xtra_ab3.c:487

◆ CUSTOM

#define CUSTOM   ((volatile struct Custom *)0xdff000)

◆ DOS_BASE_NAME

#define DOS_BASE_NAME   dos

◆ ID

#define ID ( a,
b,
c,
d )
Value:
((ULONG)(a) << 24 | (ULONG)(b) << 16 | (c) << 8 | (d))
ULONG WORD UWORD c
Definition 2dlib.c:2491
static struct @065163037313156332013005143365272036211065172003 d

◆ LAUNDER

#define LAUNDER ( ptr)
Value:
__asm__("" : "+a"(ptr))

◆ LONGAT

#define LONGAT ( p)
Value:
(*(ULONG *)(p))

◆ VPOSR_LO

#define VPOSR_LO   (*(volatile UBYTE *)0xdff006) /* the vertical position, bits 0-7 */

◆ WORDAT

#define WORDAT ( p)
Value:
(*(UWORD *)(p))

Typedef Documentation

◆ aud_t

typedef volatile struct AudChannel aud_t

Function Documentation

◆ _change_playtype()

void _change_playtype ( void )

◆ _ChangeTrackerMask()

void _ChangeTrackerMask ( void )

◆ _checkid()

void _checkid ( void )

◆ _checktrackerevent()

void _checktrackerevent ( void )

◆ _checkused()

void _checkused ( void )

◆ _decodecheck()

void _decodecheck ( void )

◆ _decodemod()

void _decodemod ( void )

◆ _finittrackerlib()

void _finittrackerlib ( void )

◆ _freecheck()

void _freecheck ( void )

◆ _freetrackermodule()

void _freetrackermodule ( void )

◆ _getmodulename()

void _getmodulename ( void )

◆ _getmoduleposition()

void _getmoduleposition ( void )

◆ _gettrackerevent()

void _gettrackerevent ( void )

◆ _gettrklen()

void _gettrklen ( void )

◆ _gettrkloc()

void _gettrkloc ( void )

◆ _inittrackerlib()

void _inittrackerlib ( void )

◆ _loadcheck()

void _loadcheck ( void )

◆ _loadtrkmodule()

void _loadtrkmodule ( void )

◆ _maxpatterns()

void _maxpatterns ( void )

◆ _modtochip2()

void _modtochip2 ( void )

◆ _modulepositionjump()

void _modulepositionjump ( void )

◆ _pausemodule()

void _pausemodule ( void )

◆ _Play_Tracker()

void _Play_Tracker ( void )

◆ _StartTrkModule()

void _StartTrkModule ( void )

◆ _StopTracker()

void _StopTracker ( void )

◆ _Volume_Control()

void _Volume_Control ( void )

◆ _waittrackerevent()

void _waittrackerevent ( void )

◆ arpeggio()

void arpeggio ( struct chan * ch,
aud_t * aud )
static

◆ change_playtype_c()

void change_playtype_c ( void )
static

ChangeTrackerVBlank: play without the CIA interrupt.

Stops playing (mt_end) and removes the CIA interrupt (ResetCIAInt); from then on the program calls PlayTracker itself and StartTracker installs no interrupt. Ends a pause of PauseModule (fixed, #1076).

◆ change_volume_levels()

void change_volume_levels ( void )
static

◆ changetrackermask_c()

void changetrackermask_c ( ULONG mask)
static

ChangeTrackerMask Channel_Mask: the voices to play.

Bit 0 = voice 1 ... bit 3 = voice 4. A masked voice writes its registers into fake_channel; its volume is set to 0 at once.

Parameters
maskd0.w: the voice bits

◆ checkefx()

void checkefx ( struct chan * ch,
aud_t * aud )
static

◆ checkid_c()

ULONG checkid_c ( ULONG num)
static

CheckTrackerID(TrackerModule#): is the slot's module a Protracker module?

Tests the id at $438 for "M.K." or "M!K!". "Not a module" and an empty slot (length 0) are False (fixed, #430: the original returned the long at ADDRESS 0, MOVE.l 0,d0). Error check (_checkused): slots 0-8, a module in the slot.

Parameters
numd0: the slot
Returns
d0: -1 for a module, else 0

◆ checkmoreefx()

void checkmoreefx ( struct chan * ch,
aud_t * aud )
static

◆ checktrackerevent_c()

ULONG checktrackerevent_c ( ULONG old)
static

CheckTrackerEvent: has a new tracker event come?

A new event (one that differs from the last seen) is marked seen. No new event is False (fixed, #431: the original loaded only the low byte of d0 with the last event's value).

Parameters
oldd0: the caller's d0
Returns
d0.w: -1 for a new event (a word, not BB_BOOL); else 0

◆ checkused_c()

void checkused_c ( ULONG num)
static

◆ ciatrklib_mt_music()

void ciatrklib_mt_music ( void )

◆ clearsamplenums()

void clearsamplenums ( UBYTE * mod,
ULONG modlen )
static

◆ decodecheck_c()

void decodecheck_c ( ULONG num)
static

◆ decodemod_c()

void decodemod_c ( ULONG num,
ULONG addr )
static

DecodeModule TrackerModule#,ModuleAddress: use a module in memory.

The slot gets the address, length 1 (so CheckTrackerID works) and flag 0. A module in chip memory (an address below $200000, compared unsigned: fixed, #432, the original's BLT took every address from $80000000 up for chip memory) stays where it is; one from other memory is copied to chip memory, with the size + 3 (fixed, #434: the original added the 3 as a word), flag 2; when that memory is missing the slot keeps the old address with flag 2 and the new length (#433; memlib's globalloc ends the program instead). The size comes from mt_init's scan of the song positions (all 128, Fixed (#477)). Error check (_decodecheck): slots 0-8, no loaded or copied module in the slot.

Parameters
numd0: the slot
addrd1: the module

◆ doretrig()

void doretrig ( struct chan * ch,
aud_t * aud )
static

◆ dskip()

void dskip ( void )
static

◆ e_commands()

void e_commands ( struct chan * ch,
aud_t * aud )
static

◆ filteronoff()

void filteronoff ( struct chan * ch)
static

◆ findperiod()

UWORD findperiod ( const UWORD * table,
UWORD per )
static

◆ fineportadown()

void fineportadown ( struct chan * ch,
aud_t * aud )
static

◆ fineportaup()

void fineportaup ( struct chan * ch,
aud_t * aud )
static

◆ finittrackerlib_c()

void finittrackerlib_c ( void )
static

finit: stop playing and remove the CIA interrupt.

ResetCIAInt (unless ChangeTrackerVBlank removed it) removes the vector with its timer's bit (fixed, #448: the original always used bit 0); it leaves the filter as it is (fixed, #449). The module slots are not freed here.

◆ freecheck_c()

void freecheck_c ( ULONG num)
static

◆ freetrackermodule_c()

void freetrackermodule_c ( ULONG num)
static

◆ freetrk_c()

void freetrk_c ( ULONG num)
static

FreeTrackerModule TrackerModule#: free a slot's module.

The memory of a loaded or copied module is freed; a module that plays from the slot is not stopped. Error check (_freecheck): slots 0-8, and not the loaded or copied module that plays (fixed, #436: the original's _slotcheck let it be freed while the play routine went on reading it).

Parameters
numd0: the slot

◆ funkit()

void funkit ( struct chan * ch)
static

◆ getmodulename_c()

ULONG getmodulename_c ( ULONG num)
static

GetModuleName$(TrackerModule#): the name of a slot's module.

Up to 20 characters of the module's name, at a3, and a 0. An empty slot is the empty string (fixed, #437: the original wrote nothing, not even the 0, and returned slot*10 as the length). Error check (_checkused): slots 0-8, a module in the slot.

Parameters
numd0: the slot
Returns
d0: the length (counted as a word)

◆ getmoduleposition_c()

ULONG getmoduleposition_c ( ULONG old)
static

GetModulePosition: the current song position.

Parameters
oldd0: the caller's d0
Returns
d0.b: the position (the rest of d0 as it was)

◆ getnewnote()

void getnewnote ( void )
static

◆ gettrackerevent_c()

ULONG gettrackerevent_c ( ULONG old)
static

GetTrackerEvent: the value of the last tracker event (effect 8).

Effect 8 is seen on the row's tick (fixed, #435: the original saw it only on the ticks between the rows). Only the low byte of d0 changes (declared byte, not a defect).

Parameters
oldd0: the caller's d0
Returns
d0.b: the event value

◆ gettrklen_c()

ULONG gettrklen_c ( ULONG num)
static

GetTrackerSize(TrackerModule#): the length of a slot's module.

Error check (_checkused): slots 0-8, a module in the slot.

Parameters
numd0.w: the slot
Returns
d0: the length (file size + 3 for a loaded one, see LoadTrackerModule; 1 for a module DecodeModule left in place)

◆ gettrkloc_c()

ULONG gettrkloc_c ( ULONG num)
static

GetTrackerLocation(TrackerModule#): the address of a slot's module.

Error check (_checkused): slots 0-8, a module in the slot.

Parameters
numd0: the slot
Returns
d0: the address, 0 for an empty slot

◆ globalloc()

ULONG globalloc ( ULONG size,
ULONG flags )
static

◆ globfree()

void globfree ( ULONG mem,
ULONG size )
static

◆ inittrackerlib_c()

void inittrackerlib_c ( void )
static

init: install the CIA interrupt and clear the module slots.

SetCIAInt (mt_music every 1/50 s on timer A of ciaa, else timer B of ciab; the ICR bits 0 and 1, fixed, #450: the original read them from the addresses 1 and 2), slots 0-7 cleared (DBNE from 7), master volume 64, all four voices on. The play type is cleared first (fixed, #1165: the original kept it, so after a run with ChangeTrackerVBlank the next run of the program from the editor installed no CIA interrupt, here nor in StartTracker, and played nothing without PlayTracker).

◆ jumploop()

void jumploop ( struct chan * ch)
static

◆ karplusstrong()

void karplusstrong ( struct chan * ch)
static

◆ loadcheck_c()

void loadcheck_c ( ULONG num)
static

◆ loadtrkmodule_c()

ULONG loadtrkmodule_c ( ULONG num,
ULONG name,
struct DosLibrary * dos )
static

LoadTrackerModule(TrackerModule#,Name): load a module file into chip memory.

The slot is freed first; Lock, Examine (FileInfoBlock of memlib), memory of the file size + 3 (fixed, #442: the original added as a byte and lost the carry) from memlib's globalloc (not checked, #440: memlib ends the program when it fails), Open by name while the lock is held, Read, Close, UnLock; flag 1 (fixed, #1146: the original called OpenFromLock, dos V36, and crashed on Kickstart 1.x). The compiler loads DOSBase into a6 (fixed, #443: the original's !libs was empty, the dos calls went through whatever a6 held). A failing Lock, FileInfoBlock or Examine is a runtime error ("Tracker: File error! (Not found?)", "Tracker Library Error"), the last two leave the lock allocated (#441). A failed open frees the slot and unlocks the lock (#1146: the original passed the handle to Read untested). A Read error frees the slot (fixed, #444: the original also unlocked the lock that OpenFromLock had taken over, a second time after Close). Error check (_loadcheck): slots 0-8, the slot must be empty.

Parameters
numd0: the slot
named1: the file name
dosa6: dos.library (!libs {doslib,la6})
Returns
d0: -1 when the file was read, IoErr() after a failed open or a Read error (so not BB_BOOL)

◆ maskfinetunes()

void maskfinetunes ( UBYTE * mod)
static

◆ maxpattern()

ULONG maxpattern ( const UBYTE * mod)
static

◆ maxpatterns_c()

ULONG maxpatterns_c ( ULONG num)
static

ModulePatterns(Module #): the number of patterns of the module.

The highest pattern number of the song positions + 1, from mt_init's scan (fixed, #445: the original returned the song length, byte 950 of the module). Error check (_checkused): slots 0-8, a module in the slot.

Parameters
numd0: the slot
Returns
d0.b: the number of patterns, 0 for an empty slot

◆ modtochip()

BB_BOOL modtochip ( ULONG num)
static

◆ modtochip2_c()

ULONG modtochip2_c ( ULONG arg)
static

ModuleToChip(TrackerModule#): does nothing (RTS).

By design (#446): the module is not copied, DecodeModule does that; the documentation: "the command has no function".

Parameters
argd0: the slot
Returns
d0: the argument

◆ modulepositionjump_c()

void modulepositionjump_c ( ULONG pos)
static

ModulePositionJump (Position#): jump to a song position.

Stores n - 1, as effect Bxx does: at the next tick mt_NextPosition increments it and the song continues at position n (fixed, #447: the original stored n, the song went on at n + 1).

Parameters
posd0.b: the position

◆ mt_end()

void mt_end ( void )
static

◆ mt_init()

void mt_init ( ULONG modlen)
static

◆ mt_music_c()

void mt_music_c ( void )
static

PlayTracker: one tick of the play routine (mt_music).

Also the code of the CIA interrupt (MusicIntServer); after ChangeTrackerVBlank the program calls PlayTracker itself, once per tick. Nothing happens unless a module plays (mt_Enable). The bugs of the Protracker 2.3A routine are listed in the head of the file.

◆ newcmd()

UBYTE newcmd ( UBYTE old,
UBYTE cmdlo )
static

◆ nextposition()

void nextposition ( void )
static

◆ nonewallchannels()

void nonewallchannels ( void )
static

◆ notecut()

void notecut ( struct chan * ch,
aud_t * aud )
static

◆ notedelay()

void notedelay ( struct chan * ch,
aud_t * aud )
static

◆ patternbreak()

void patternbreak ( struct chan * ch)
static

◆ patterndelay()

void patterndelay ( struct chan * ch)
static

◆ patternsize()

ULONG patternsize ( const UBYTE * mod)
static

◆ pausemodule_c()

void pausemodule_c ( void )
static

PauseModule: pause or continue the playing module.

Toggles: a module that plays (mt_Enable) is stopped (mt_end), the module this call paused plays on at the next call. Fixed (#1076): StartTracker, StopTracker, ChangeTrackerVBlank and freeing the paused module's slot end the pause, and without a module that plays the call does nothing; the original toggled its state whatever happened in between, so after a pause the next PauseModule only enabled playing (a module started again was not paused, a stopped one or the module of a freed slot played again), and two calls played a stopped module again (tests ciatrklib-pause-state-kept, ciatrklib-pause-after-stop). Accepted: a module that stopped itself (F00) is not continued by two PauseModule any more.

◆ periods()

const UWORD * periods ( UBYTE ft)
static

◆ pernop()

void pernop ( struct chan * ch,
aud_t * aud )
static

◆ playsamples()

void playsamples ( UWORD chans)
static

◆ playvoice()

void playvoice ( struct chan * ch,
aud_t * aud,
const UBYTE * samples,
const UBYTE * note )
static

◆ portadown()

void portadown ( struct chan * ch,
aud_t * aud )
static

◆ portaup()

void portaup ( struct chan * ch,
aud_t * aud )
static

◆ positionjump()

void positionjump ( struct chan * ch)
static

◆ resetciaint()

void resetciaint ( void )
static

◆ retrignote()

void retrignote ( struct chan * ch,
aud_t * aud )
static

◆ sampleoffset()

void sampleoffset ( struct chan * ch)
static

◆ set_real_mask()

UWORD set_real_mask ( UWORD bits)
static

◆ set_volume()

UWORD set_volume ( UWORD v)
static

◆ setciaint()

void setciaint ( void )
static

◆ setperiod()

void setperiod ( struct chan * ch,
aud_t * aud )
static

◆ setperiod_regs()

void setperiod_regs ( struct chan * ch,
aud_t * aud )
inlinestatic

◆ setspeed()

void setspeed ( struct chan * ch)
static

◆ settempo()

void settempo ( UWORD bpm)
static

◆ settoneporta()

void settoneporta ( struct chan * ch)
static

◆ slot()

struct modent * slot ( ULONG num)
static

◆ slotcheck_c()

void slotcheck_c ( ULONG num)
static

◆ starttrkmodule_c()

ULONG starttrkmodule_c ( ULONG num)
static

StartTracker(TrackerModule#): play a slot's module.

Resets the CIA tempo (removes the interrupt), installs it again unless ChangeTrackerVBlank was used, mt_init (its scan: Fixed (#477); the first long of every sample inside the module cleared, fixed, #438) and enables playing. Error check (_checkused): slots 0-8, a module in the slot.

Parameters
numd0: the slot
Returns
d0: -1 when it plays; 0 for an empty slot (fixed, #451: the original's MOVEM restored the slot number over the 0)

◆ stoptracker_c()

void stoptracker_c ( void )
static

StopTracker: stop playing (mt_end: volumes 0, audio DMA off).

Ends a pause of PauseModule (fixed, #1076: the original left it, the next PauseModule played the stopped module again).

◆ toneplusvolslide()

void toneplusvolslide ( struct chan * ch,
aud_t * aud )
static

◆ toneportamento()

void toneportamento ( struct chan * ch,
aud_t * aud )
static

◆ toneportnochange()

void toneportnochange ( struct chan * ch,
aud_t * aud )
static

◆ tremolo()

void tremolo ( struct chan * ch,
aud_t * aud )
static

◆ updatefunk()

void updatefunk ( struct chan * ch)
static

◆ vibrato()

void vibrato ( struct chan * ch,
aud_t * aud )
static

◆ vibrato2()

void vibrato2 ( struct chan * ch,
aud_t * aud )
static

◆ vibratoplusvolslide()

void vibratoplusvolslide ( struct chan * ch,
aud_t * aud )
static

◆ voice()

aud_t * voice ( int ch)
static

◆ volslidedown2()

void volslidedown2 ( struct chan * ch,
aud_t * aud,
UBYTE delta )
static

◆ volslideup()

void volslideup ( struct chan * ch,
aud_t * aud,
UBYTE delta )
static

◆ volume_control_c()

void volume_control_c ( ULONG vol)
static

TrackerVolume (Volume Range: 0-64): the master volume.

Values above 64 are ignored. Every volume 0-64 also changes the volumes of the notes that play now (Change_Volume_Levels; fixed, #452: the original did that only for 0 < volume < 64, so TrackerVolume 0 and 64 did not reach them); new notes get note volume * master / 64.

Parameters
vold0.w: the volume

◆ volumechange()

void volumechange ( struct chan * ch,
aud_t * aud )
static

◆ volumefinedown()

void volumefinedown ( struct chan * ch,
aud_t * aud )
static

◆ volumefineup()

void volumefineup ( struct chan * ch,
aud_t * aud )
static

◆ volumeslide()

void volumeslide ( struct chan * ch,
aud_t * aud )
static

◆ waitline()

void waitline ( void )
static

◆ waittrackerevent_c()

void waittrackerevent_c ( const void * caller_a6)
static

WaitTrackerEvent: wait for the next tracker event.

Marks the current event seen, then WaitTOF (-270) until the event changes. The compiler loads GfxBase into a6 (fixed, #453: the original's !libs was empty, WaitTOF went through whatever a6 held).

Parameters
caller_a6a6: graphics.library (!libs {graphicslib,la6})

◆ wave()

UBYTE wave ( UBYTE pos,
UBYTE form )
static

Variable Documentation

◆ chan

struct chan chan[4]

◆ CIAAaddr

volatile struct CIA* CIAAaddr

◆ CIAAbase

struct Library* CIAAbase

◆ CIAAname

char CIAAname[14]

◆ CIABname

char CIABname[14]

◆ [struct]

struct { ... } ciapart
Initial value:
= {
125, NULL, "ciaa.resource", "ciab.resource", NULL, 0, 0, NULL, "graphics.library",
{ { NULL, NULL, NT_INTERRUPT, 5, ciapart.musintname }, NULL, (VOID (*)())ciatrklib_mt_music },
"Protracker MusicInt", CUSTOM,
}
#define CUSTOM
Definition blitzcoplib.c:234
static struct @265265226224150065146057152374044346222265235147 ciapart
void ciatrklib_mt_music(void)

◆ counter

UBYTE counter

◆ DMACONtemp

UWORD DMACONtemp

◆ Enable

UBYTE Enable

◆ endcustom

volatile struct Custom* volatile endcustom

◆ fake_channel

struct AudChannel fake_channel

◆ fake_rest

UBYTE fake_rest[60 - sizeof(struct AudChannel)]

◆ fib

ULONG fib
static

◆ fname

ULONG fname
static

◆ FunkTable

UBYTE FunkTable[16]

◆ GfxName

char GfxName[18]

◆ hand

BPTR hand
static

◆ [struct]

struct { ... } libvars

◆ lock

BPTR lock
static

◆ LowMask

UBYTE LowMask

◆ LstEvt

UBYTE LstEvt

◆ master_mask

UBYTE master_mask

◆ master_mask_lo

UBYTE master_mask_lo

◆ master_volume

UWORD master_volume

◆ mess

const char mess[] = "Tracker: File error! (Not found?)"
static

◆ mess2

const char mess2[] = "Tracker Library Error"
static

◆ modtable

struct modent modtable[10]

◆ mt_data

UBYTE* mt_data

◆ MusicIntServer

struct Interrupt MusicIntServer

◆ musintname

char musintname[20]

◆ old_volume

UWORD old_volume

◆ patdata

const UBYTE* patdata
static

◆ PattDelTime

UBYTE PattDelTime

◆ PattDelTime2

UBYTE PattDelTime2

◆ PatternPos

UWORD PatternPos

◆ pause_status

UBYTE pause_status

◆ PBreakFlag

UBYTE PBreakFlag

◆ PBreakPos

UBYTE PBreakPos

◆ PeriodTable

UWORD PeriodTable[16 *36]

◆ play_type

UBYTE play_type

◆ [struct]

struct { ... } playdata

◆ PosJumpFlag

UBYTE PosJumpFlag

◆ readerr

ULONG readerr
static

◆ RealTempo

UWORD RealTempo

◆ SampleStarts

UBYTE* SampleStarts[32]

◆ SongDataPtr

UBYTE* SongDataPtr

◆ SongPos

UBYTE SongPos

◆ speed

UBYTE speed

◆ thismod

ULONG thismod
static

◆ TimerFlag

ULONG TimerFlag

◆ TimerValue

ULONG TimerValue

◆ TrkEvt

UBYTE TrkEvt

◆ VibratoTable

UBYTE VibratoTable[32]

◆ volume_flag

UWORD volume_flag