apolkosnik / ptreplay_ahi

ProTracker player library
The Unlicense
0 stars 0 forks source link

Implement PTPatternData() #2

Open apolkosnik opened 1 month ago

apolkosnik commented 1 month ago

NAME PTPatternData -- Returns the adress of specified pattern/row (V4)

SYNOPSIS RowData=PTPatternData(Module, PatternNum, RowNum) D0 A0 D0 D1

    APTR PTPatternData(struct Module *, UBYTE, UBYTE);

FUNCTION This function returns a pointer to the given row in the specified pattern.

INPUTS Module - Pointer to the module you which to examine. PatternNum - The pattern (0-127) you want to examine. RowNum - And finaly which row (0-63) to examine.

RESULT RowData - A pointer to the given position

apolkosnik commented 1 month ago

For now, this is what I have

` dbug(("ptreplay::PTPatternData TESTME!\n"));

pt_mod_s* mod;
pt_pattern_s *p;
APTR *ptd;

if ((Pattern <= 127) && (Row <= 63)) {
    ObtainSemaphore(&module->mutex);
    //PtGetAttr(module->mod_handle, PTPLAY_PatternData, &res);
    mod = (pt_mod_s *)module->mod_handle;

    p = mod->pattern + mod->pos[Pattern];       /* pattern */

    ptd = p->data[Row];                         /* patterndata */

    ReleaseSemaphore(&module->mutex);
}

return ptd;`