Jump to content
IGNORED

Editor Assembler Sound examples question


TheBF

Recommended Posts

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

  • Like 1
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Here is the Assembler listing of the console ROM code: attachicon.gifROM-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

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...