English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 14 January 2024, 13:19   #1
FlynnTheAvatar
Registered User
 
FlynnTheAvatar's Avatar
 
Join Date: Jan 2018
Location: Germany
Posts: 46
Question Implementing PTReplay PTSongPattern

Hi,

I am currently trying to implement PTSongPattern in Fredrik Wikstrom's ptreplay library for AmigaOS 4.1.

I peaked (=disassembled) the m68k version of it (6.6) and came up this this naive implementation:

Code:
UBYTE _PTReplay_PTSongPattern(struct PTReplayIFace *Self,
 struct Module *module, UWORD Pos)
{
    dbug(("ptreplay::PTSongPattern\n"));

    UBYTE* p = (UBYTE *) module->file_data;
    if (Pos <= module->file_size) {
        return p[952 + Pos];
    }

 return (UBYTE)0;
}
Sorry, I have no idea about the library or the ProTracker file format. Does this suffice, or do I need to aquire the mutex before peeing into the loaded file?

Any help would be greatly appreciated.

Thanks,
Flynn
FlynnTheAvatar is offline  
Old 14 January 2024, 14:18   #2
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,499
Should be ok. The "song arrangement list" with all pattern-numbers is indeed at offset 952. Those are constants which should never change, so you can read them any time.

Although there is a maximum of 128 positions, so I would better check
Pos
against 128 instead of the module's file size.
phx is offline  
Old 14 January 2024, 15:24   #3
FlynnTheAvatar
Registered User
 
FlynnTheAvatar's Avatar
 
Join Date: Jan 2018
Location: Germany
Posts: 46
Thank you very much. The information that there are max 128 positions is really helpful. I updated the code with your suggestion and I am testing the new library at the moment.
FlynnTheAvatar is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
[OS3.2] Feature request : implementing shift/ctrl + del/backspace shortcuts mahen support.AmigaOS 9 15 January 2022 18:05
implementing some 68881 unimplemented instructions on 68040 jotd Coders. Asm / Hardware 2 29 December 2020 17:52
ptreplay.library gets stuck on PTPlay (fd2pragma used wrong?) thyslo Coders. C/C++ 14 22 October 2020 19:12
Distorted sound with ptreplay neoman Coders. Language 12 05 December 2012 13:15
implementing multiple layers in gfx software fishyfish Coders. General 1 17 October 2010 12:37

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 21:32.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.10937 seconds with 13 queries