+TheBF Posted January 11, 2018 Share Posted January 11, 2018 Has anyone ever coded the example sound programs that begin on page 321? I ran the CHIME sound list with my Forth language player and the data is fine. Then realized it was not hard to make a sound list in VDP RAM and write to the PAD memory addresses in the examples. I run my system with interrupts running most of the time, so I expected something to happen however nothing happened. Things that make you say hmmm... BF 1 Quote Link to comment Share on other sites More sharing options...
+adamantyr Posted January 11, 2018 Share Posted January 11, 2018 I've ran it before and it worked fine. What did you do differently? If you are doing the direct sound method there is one strange thing... you have to store the contents of R11 somewhere or the method won't work. No idea why. Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted January 11, 2018 Share Posted January 11, 2018 I’ve run those sound tables through the fbForth 2.0 sound system and it works fine there. Post your code so we can pore over it with eagle eyes. ...lee Quote Link to comment Share on other sites More sharing options...
+TheBF Posted January 11, 2018 Author Share Posted January 11, 2018 As I mentioned, the sound tables work fine. I can play them with direct 9919 control. I was curious what it takes to run them under ISR control. It looks simple in assembler. I am trying it in Forth with no luck. Here is the code: \ ISR Sound player for Camel99 Forth Jan 10, 2019 BJF \ VDP RAM manager VARIABLE VP \ VDP memory pointer (4K block) HEX 1000 VP ! \ start of free VDP RAM : VHERE ( -- addr) VP @ ; \ FETCH the value in VDP pointer : VALLOT ( n -- ) VP +! ; \ add n to the value in VDP pointer \ Compile a byte in the next available VDP memory location : VC, ( n -- ) VHERE VC! 1 VALLOT ; : VCREATE ( -- <text>) CREATE VHERE , \ compile VDP address in CPU RAM DOES> @ ; \ run time: fetch the VDP address \ setup ISR sound : ISRPLAY ( vaddr -- ) LIMI0 \ interrupts off 83CC ! \ load sound table address 01 83CE C! \ trigger sound processing 83FD C@ 01 OR 83FD C! \ set VDP flag LIMI2 ; \ interrupts on \ VDP BYTE directive: read bytes and compile into VDP RAM : VBYTE ( -- ) \ read input stream of bytes and compile to VDP mem. BEGIN [CHAR] , PARSE-NAME DUP ( -- adr len len ) WHILE EVALUATE DUP FF00 AND ABORT" Not a byte" VC, REPEAT 2DROP ; : /END ( -- ) 0 VC, ; \ compile a zero BYTE into VDP RAM VCREATE PACMAN VBYTE 6,86,0D,97,AC,1A,B7,8 VBYTE 2,8F,08,2 VBYTE 2,AB,23,5 VBYTE 2,86,0D,4 VBYTE 1,BF,3 VBYTE 2,8E,0B,8 VBYTE 2,8A,0A,2 VBYTE 3,AC,1A,B7,8 /END Quote Link to comment Share on other sites More sharing options...
+TheBF Posted January 12, 2018 Author Share Posted January 12, 2018 Forgot to mention that the way it should work is you pass the sound table to ISRPLAY as an argument. PACMAN ISRPLAY <enter> Quote Link to comment Share on other sites More sharing options...
RXB Posted January 12, 2018 Share Posted January 12, 2018 Has anyone ever coded the example sound programs that begin on page 321? I ran the CHIME sound list with my Forth language player and the data is fine. Then realized it was not hard to make a sound list in VDP RAM and write to the PAD memory addresses in the examples. I run my system with interrupts running most of the time, so I expected something to happen however nothing happened. Things that make you say hmmm... BF I have run it from Assembly, GPL and RXB even has a demo using the same code. 1 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted January 12, 2018 Author Share Posted January 12, 2018 Yup. I am sure it works. I just can't understand why, when I do the equivalent things with Forth that I see in Assembler in the book, it doesn't play the list. I even made some little routines in the kernel to start and stop interrupts like in the assembler code. I will have to study Lee's code more closely. It's funny cuz I made the TMS9919 direct sound driver very quickly. :-) I notice that the assembler code is in a loop. Perhaps I am only running the first string of bytes? Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted January 12, 2018 Share Posted January 12, 2018 Yup. I am sure it works. I just can't understand why, when I do the equivalent things with Forth that I see in Assembler in the book, it doesn't play the list. I even made some little routines in the kernel to start and stop interrupts like in the assembler code. I will have to study Lee's code more closely. It's funny cuz I made the TMS9919 direct sound driver very quickly. :-) I notice that the assembler code is in a loop. Perhaps I am only running the first string of bytes? I am not sure studying my code will help because it is talking directly to the sound chip just as your code does. The ISR I wrote to do that does not involve the console ISR’s sound routine at all. I will post the console ISR’s sound routine in a bit. ...lee Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted January 12, 2018 Share Posted January 12, 2018 Here is the Assembler listing of the console ROM code: ROM-4A.lst The ISR begins at “REMOTE” at line #1580 and the sound servicing section begins at “TSTSND” at line #1710. ...lee Quote Link to comment Share on other sites More sharing options...
+TheBF Posted January 12, 2018 Author Share Posted January 12, 2018 Here is the Assembler listing of the console ROM code: ROM-4A.lst The ISR begins at “REMOTE” at line #1580 and the sound servicing section begins at “TSTSND” at line #1710. ...lee Thanks Lee. This is wonderful to have. Yes I noticed that your code talks to the chip and uses some of the same code as Turbo Forth too. I am swimming upstream here maybe but it's fun to try and craft these things in Forth to see what can be done. Thanks again for the listing. Will post what I find. B 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.