English Amiga Board


Go Back   English Amiga Board > Other Projects > project.WHDLoad

 
 
Thread Tools
Old 11 May 2024, 22:31   #1
Hungry Horace
Wipe-Out Enthusiast
 
Hungry Horace's Avatar
 
Join Date: Nov 2005
Location: .
Age: 43
Posts: 2,544
Music Routine in Slave?

Hi everyone,

I apologies in advance for any/all ignorance in my queries here, it has been a long time since i've worked on any ASM in any depth, and I have never claimed great knowledge, being mostly a tinkerer in the field.

I have a game with very little sound which i'd like to add more audio to, including additional sound fx and some 3-channel background music.

I have a Resourced version of the game, but reliably compiling this back to a version that doesnt require a new WHDload slave is questionable. I am however easily able to locate a "PlaySound" routine which would potentially be bypassed.

My preference would be to patch in new code using WHDLoad and do the follwing

- adding ptplayer.asm within the whdload slave source
- add a sound/setup routine as part of the slave (this bit is easy enough); loading the module, ideally with the sfx within that mod as instruments
- use ptplayer routines to play the music and trigger samples in place of existing Play Sound routines
- Patch in new sound triggers at relevant points of the game.

The game only use 512k , so there is ample chipmem available for mandating 1 meg and placing all sounds in the second 512k.

However.... I'm having trouble getting ptplayer integrated in the slave.

I am aware that including the routine in a new game compile would be better, but in this case that is far less practical, if i can control all new elements in a nice clean WHDload slave.

So... Is my use of ptplayer in the slave even possible?

Can i include the ptplayer.asm within the slave, as currently i'm hitting a "DOS-Error #205 - bad loadfile hunk" problem when the slave launches? What would be the reason for this? i'm compiling with BASM have marked it as a new code section.
Does the player routine itself need to be be in chip mem or just the module? (although i dont believe this is the cause of problem above)


My other option is to simply enhance the existing playsound routine to add more sounds (i've pretty much done this already) but if i could find a route to have a playing mod file and maximise the use of that, it would be much better.

Another consideration would be to have a CDDA player which triggers from whdload - again, something i may consider do anyway, but has the usual limitations compared with 'traditional' WHD packages.

Any thoughts, comments, guidance, more than welcome, thank you.
Hungry Horace is offline  
Old 11 May 2024, 23:36   #2
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,303
Quote:
Can i include the ptplayer.asm within the slave, as currently i'm hitting a "DOS-Error #205 - bad loadfile hunk" problem when the slave launches?
whdload slaves can't have more than 1 section, and all code should be relocatable. Keeping it in one section is easy, but I'm not sure that ptplayer is fully relocatable. Maybe.

At any rate, ptplayer is a good choice, but maybe create an exe with ptplayer in it, that you can load & relocate at a given address using resload_Relocate. The exe should not be started but have some vectors to init, etc. at start. You can call it from whdload easily then.

Quote:
Another consideration would be to have a CDDA player which triggers from whdload - again, something i may consider do anyway, but has the usual limitations compared with 'traditional' WHD packages.
this is going to be difficult, as you cannot call the OS from whdload, or even bang IDE hardware. If you want to enhance with CD audio, it's better to use CD32load extra slave, and it will be CD32 only.
jotd is offline  
Old 12 May 2024, 00:21   #3
Hungry Horace
Wipe-Out Enthusiast
 
Hungry Horace's Avatar
 
Join Date: Nov 2005
Location: .
Age: 43
Posts: 2,544
Thanks Jotd - the CDDA is a secondary consideration, so i'd be happy to look at using CD32load approach should i go down that route....

The single section i suspect explains my problem - very useful to know.

I have compiled ptplayer separately without any issue, which can also be loaded into the spare chipmem space without any problem - this issue then would be knowing what offsets/address to call without having direct labels.... that might take me a bit of work!
Hungry Horace is offline  
Old 12 May 2024, 02:46   #4
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 9,014
What's the game?
Galahad/FLT is offline  
Old 12 May 2024, 14:53   #5
Hungry Horace
Wipe-Out Enthusiast
 
Hungry Horace's Avatar
 
Join Date: Nov 2005
Location: .
Age: 43
Posts: 2,544
Bloodwych - many reviews cite the lack of sound as one of the areas it scores lower, but usually excelling on Playability scores.

My nephews are very keen to play the game (with us having used the characters on the table-top!) so i'd like to give them the best possible experience of it, with added atmosphere from the sound.

Having added the CD32 controls and having made a new level set, i feel fairly comfortable around the game code... i just struggle with the lower level Amiga side of things.
Hungry Horace is offline  
Old 12 May 2024, 17:57   #6
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,789
Probably no help at all I noticed some system friendly games - if you use hippo player to start a mod it will continue in the game but obviously sound clashes with in game SFX
Retro1234 is offline  
Old 12 May 2024, 19:23   #7
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 9,014
If the game code has is able to be reassembled with no issues, I would forgo the WHDLoad route entirely.

Change the game to 1 meg minimum and have it be able to quit back to dos so it's its own version that is hard drive installable.
Galahad/FLT is offline  
Old 12 May 2024, 20:13   #8
Hungry Horace
Wipe-Out Enthusiast
 
Hungry Horace's Avatar
 
Join Date: Nov 2005
Location: .
Age: 43
Posts: 2,544
Quote:
Originally Posted by Galahad/FLT View Post
If the game code has is able to be reassembled with no issues, I would forgo the WHDLoad route entirely.
That's the ticket - sadly, there *are* issues with it - simply not enough of the resourcing is documented and there are clearly missing elements that need to be resolved, and/or elements of data which are still embedded in the code. I've made some efforts to increase the level of labelling of routines over time and see if i can extract data blocks that can instead be added as INCBINs

https://github.com/HoraceAndTheSpide...elled_data.asm



It's great for thumbing through and getting an idea of where things are, or how they work, but i sadly feel that unless someone with a stronger ability with 68k ASM works on it, it will never be at a stage where the whole thing can be vastly enhanced (add new routines, graphics etc - elements that require it to be full relocatable.)

Sadly, with the passing of TAG last year, we are never likely to see the original source either.


Whilst i was previously able to get a very close compile done (several years ago) - efforts in the past week or so have been less successful, and i am sure it would eventually "fall over" due to missed labels etc.



I've started a little bit with Jean's idea today, of including a pre-compiled ptplayer in the second 512k, and i've worked out the addresses for a few key routines, but so far still silence! (although it does actually run, so i'm likely missing something i hope is simple enough)
Hungry Horace is offline  
Old 12 May 2024, 20:17   #9
Hungry Horace
Wipe-Out Enthusiast
 
Hungry Horace's Avatar
 
Join Date: Nov 2005
Location: .
Age: 43
Posts: 2,544
I'll add that if i did have a fully compilable version, you'd have seen even more level sets and mods from me over the years and not just the one!
Hungry Horace is offline  
Old 13 May 2024, 22:40   #10
Hungry Horace
Wipe-Out Enthusiast
 
Hungry Horace's Avatar
 
Join Date: Nov 2005
Location: .
Age: 43
Posts: 2,544
After some head-scratching, i have finally managed to get some music playing in-game, but it seems it is not triggered automatically by setting up the _mt_install_cia and _mt_init routines....

in fact, despite those, i am having to call _mt_music manually - this then messes with my CD32 pad routine (it works, but music plays very fast when i am calling both)

I will have to continue to experiment, but it's certainly looking more possible now.
Hungry Horace 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
Doing a Sound Priority routine Shatterhand Coders. Blitz Basic 15 24 October 2018 13:28
final fight slave doesn't support the intro music turrican3 support.Games 2 12 November 2013 17:14
Keyboard routine BippyM Coders. General 2 15 July 2007 12:15
SetPoint routine MidJasper request.Other 2 03 February 2007 20:10
Looking for some routine code Amiga1992 Coders. General 4 17 December 2003 23:51

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 15:00.

Top

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