14 January 2024, 13:19 | #1 |
Registered User
Join Date: Jan 2018
Location: Germany
Posts: 46
|
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; } Any help would be greatly appreciated. Thanks, Flynn |
14 January 2024, 14:18 | #2 |
Natteravn
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 Posagainst 128 instead of the module's file size. |
14 January 2024, 15:24 | #3 |
Registered User
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.
|
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 |
|
|