What is Arkos Tracker? › Forums › Arkos Tracker forum › General discussion › Relocation of AKM binary files loaded into RAM
Tagged: AKM export binary
- This topic has 5 replies, 2 voices, and was last updated 3 years, 5 months ago by amaurycarvalho.
-
AuthorPosts
-
June 2, 2021 at 6:34 pm #30515amaurycarvalhoParticipant
Hi!
I’m working on a project thats needs to dynamically relocate AKM binary files loaded into RAM on the fly, changing the original loading address informed on AT2 file export dialog screen.
Looking on ASM source version of some AKM files, its clear that it’s necessary to navigate on the file structure recalculating all the address fields. Something like this for the first 3 address fields on the file header:
{!{code}!}czo2MTE6XCIKOyBITCA9IEFLTSBvcmlnaW5hbCBhZGRyZXNzIChleHBvcnRlZCBmcm9tIEFUMikKOyBERSA9IEFLTSBuZXcgYWRkcmV7WyYqJl19c3MgKGxvYWRlZCBpbnRvIFJBTSkKU29uZ1JlbG9jYXRpb246CiAgcHVzaCBkZQogICAgeG9yIGEKICAgIGV4IGRlLCBobAogICAgc3tbJiomXX1iYyBobCwgZGUKICAgIGxkIChGQUNUT1IpLCBobAogIHBvcCBobAogIGNhbGwgQWRkcmVzc0ZpZWxkUmVsb2NhdGlvbgogIGNhbGwge1smKiZdfUFkZHJlc3NGaWVsZFJlbG9jYXRpb24KICBjYWxsIEFkZHJlc3NGaWVsZFJlbG9jYXRpb24KICA7IGZpbGUgc3RydWN0dXJlIG5hdml7WyYqJl19Z2F0aW9uIGNvZGUgaGVyZS4uLi4KICByZXQgCgpBZGRyZXNzRmllbGRHZXQ6CiAgcHVzaCBobAogICAgbGQgZSwgKGhsKQogICAgaXtbJiomXX1uYyBobAogICAgbGQgZCwgKGhsKQogIHBvcCBobCAKICByZXQgCgpBZGRyZXNzRmllbGRQdXQ6CiAgbGQgKGhsKSwgZQogIGluYyBoe1smKiZdfWwKICBsZCAoaGwpLCBkCiAgaW5jIGhsCiAgcmV0IAoKQWRkcmVzc1JlbG9jYXRpb246CiAgY2FsbCBBZGRyZXNzRmllbGRHZXQKICB7WyYqJl19ZXggZGUsIGhsCiAgICBsZCBiYywgKEZBQ1RPUikKICAgIGFkZCBobCwgYmMKICBleCBkZSwgaGwKICBjYWxsIEFkZHJlc3NGaWVsZHtbJiomXX1QdXQKICByZXQKXCI7e1smKiZdfQ=={!{/code}!}
I wondering if someone has the official AKM binary file structure documentation and already wrote a routine for this same purpose.
Thanks for any help.
June 2, 2021 at 6:40 pm #30516amaurycarvalhoParticipantFor some reason the example code do not showed into the post, so here it’s again below:
; HL = AKM original address (exported from AT2)
; DE = AKM new address (loaded into RAM)
SongRelocation:
push de
xor a
ex de, hl
sbc hl, de
ld (FACTOR), hl
pop hl
call AddressFieldRelocation
call AddressFieldRelocation
call AddressFieldRelocation
; file structure navigation code here….
retAddressFieldGet:
push hl
ld e, (hl)
inc hl
ld d, (hl)
pop hl
retAddressFieldPut:
ld (hl), e
inc hl
ld (hl), d
inc hl
retAddressRelocation:
call AddressFieldGet
ex de, hl
ld bc, (FACTOR)
add hl, bc
ex de, hl
call AddressFieldPut
retJune 2, 2021 at 9:18 pm #30517TarghanKeymasterHi!
Yeah, sorry about the broken code tag that doesn’t work…
Anyway! The AKM structure is perfectly documented in the package: players/playerAkm/doc/AKM.md
It shouldn’t be hard to make a “relocator”. If you manage to do one, don’t hesitate to send it to me, I can put it in the package (with due credits!).
See ya,
Trg.June 15, 2021 at 12:44 am #30520amaurycarvalhoParticipantThanks very much, Thargan, for your advices!
I found the documentation just in the folder you appointed, and it was sufficient to my project.
The Arkos Tracker 2 is a great tool, so I’m working on an integration of my open source MSX Basic compiler (MSXBAS2ROM) with your incredible minimalist player.
My goal is to create an easy way to a MSX Basic programmer (with no knowledge of assembly) to include and play an Arkos exported AKM/AKX file into a MSX Basic compiled ROM. The “relocator” (thats I wrote in C++) was necessary to build the final ROM in a more flexible way.
You can see my first tests of a MSX Basic compiled program using the minimalist player on the video below (sorry, portuguese only…).
I will soon publish on my project page this new MSXBAS2ROM version with AKM/AKX support, and another video demonstrating how to use it.
So, more news is coming soon!
June 15, 2021 at 8:55 pm #30522TarghanKeymasterHey that’s pretty neat. Once you have a finished versione, maybe I can put it in the package of the application (with due credits!), besides the CPC-Basic AKG wrapper I already did.
June 15, 2021 at 10:39 pm #30523amaurycarvalhoParticipantOf course, Targhan! thanks!!!
I will inform you when its OK to release (its in beta test by now), and I will make for you a zip package with a little documentation explaining how to use it.
-
AuthorPosts
- You must be logged in to reply to this topic.