Page 2 of 2
Re: Viterbi Encoded Sound Sample
Posted: Mon Aug 09, 2021 4:53 pm
by jbperin
Dbug wrote: ↑Sat Aug 07, 2021 7:52 pm
If you save registers like that, your IRQ is not reentrant, they will overwrite the status.
For reentrant IRQ you need to use different locations for the various calls, generally done using the stack.
DAWN !! you're right
I wonder what it works despite this massive design mistake .. how weird ..
Re: Viterbi Encoded Sound Sample
Posted: Mon Aug 09, 2021 5:38 pm
by jbperin
I added
a few samples to the repository in order to test a little bit:
I already encoded these samples so that they can be used to generate the source code.
To do so:
Edit the scipt
util/genbuf.py and edit the line
to replace LetItWhip by the name one of the pre-encoded sample from the list above
Then open a command shell at the root of the directory and run the command:
This will generate files src\soundbuf.s and src/nbsample.h
Now you can go to src directory and type the command
Code: Select all
osdk_build.bat && osdk_execute.bat
to hear the sample
But the best is to do that on a real Oric because the Oricutron emulator do not properly emulate the Oric sound.
(there's a 6ms flat signal inserted every 46 or 92 ms which really destroys the rendering).
Re: Viterbi Encoded Sound Sample
Posted: Thu Aug 12, 2021 6:46 pm
by jbperin
Dbug wrote: ↑Sat Aug 07, 2021 7:52 pm
jbperin wrote: ↑Sat Aug 07, 2021 7:44 pm
This is why I put the bit $304 just after the jsr TASK_4KHZ and before the 25Hz stuffs in the irq_handler.
Code: Select all
;Preserve registers
sta irq_A: stx irq_X: sty irq_Y
jsr TASK_4KHZ ; TASK_4KHZ_4BITS ;
bit $304
If you save registers like that, your IRQ is not reentrant, they will overwrite the status.
For reentrant IRQ you need to use different locations for the various calls, generally done using the stack.
is it better
that way ?
iss wrote: ↑Fri Aug 06, 2021 5:44 pm
Additionally you can optimize the IRQ routine - you save the registers to ZP *and* save them again with PHA's - use only the first one.
I removed the useless saving of registers
here