Posted Tue Dec 30, 2003 8:19 PM
Posted Tue Dec 30, 2003 9:13 PM
;Noise 4 : Dropping Object. NoiseDropObject: LDA $DF ;Get Note Count EOR #$03 ;Reverse it as noise does up. NoiseDropObject_2: ASL ;ADDED INSTRUCTION-multiply acc X 2 STA AUDF0 ;Store in Frequency for Channel 00. LDA #$05 STA AUDV0 ;Set Volume on Channel 00. LDA #$06 STA AUDC0 ;Set a Noise on Channel 00. RTS ;Noise 5 : Picking up an Object. NoiseGetObject: LDA $DF ;Get Note Count. JMP NoiseDropObject_2 ;and Make Same noise as Drop.
Posted Tue Dec 30, 2003 9:33 PM
Posted Tue Dec 30, 2003 9:39 PM
Posted Tue Dec 30, 2003 9:56 PM
Posted Tue Dec 30, 2003 10:07 PM
0a90 | X X | 0a91 |X X X| 0a92 | X XXX| 0a93 |X X X | 0a94 | X X| 0a95 |X XX | 0a96 | XX X| 0a97 |XXX X | 0a98 |X XX |
Posted Tue Dec 30, 2003 10:18 PM
Posted Tue Dec 30, 2003 10:29 PM
Posted Tue Dec 30, 2003 11:10 PM
Posted Tue Dec 30, 2003 11:31 PM
Posted Wed Dec 31, 2003 12:16 AM
Posted Wed Dec 31, 2003 1:16 AM
Posted Wed Dec 31, 2003 1:41 AM
Posted Wed Dec 31, 2003 1:53 AM
Posted Sun Jul 11, 2004 9:09 PM
;Noise 0 : Game Over NoiseGameOver: LDA NoteCnt ;3 STA COLUPF ;Color-Luminance Playfield. ;3 STA AUDC0 ;Audio-Control 00 ;3 LSR ;2 STA AUDV0 ;Audio-Volume 00 ;3 LSR ;2 LSR ;2 STA AUDF0 ;Audio-Frequency 00 ;3 RTS ;6I did change the distortion AUDC0 and note AUDF0 by using Glenn Saunder's 2600 sound chart from the Stella Archives. I added the new values after the color-luminance playfield code.
LDA #$0E ;Load 0E for distortion AUC0 ;2 STA AUDC0 ;Set a Noise on Channel 00. ;3 LDA $02 ;Get Frequency 02 ;3 STA AUDF0 ;Store in Frequency for Channel 00. ;3 LDA #$1F ;1F loudest!!! ;2 STA AUDV0 ;Set Volume on Channel 00. ;3Then I tried adding a delay routine from reading AtariArchives.org Assembly language Programming for Atari Computers (Chap 10) similar to this
LDX #50 LDY #0 LOOP DEY BNE LOOP DEX BNE LOOPand turned off the sound to start a new note, but it caused the screen to flip horribly. I read somewhere in the Stella archives about making a note last for 1 second=?cycles, but no mention of how. Could someone please help me with this?
Posted Sun Jul 11, 2004 11:44 PM
;Noise 0 : Game Over NoiseGameOver: LDA #$05 ;distortion 5 ;2 STA AUDC0 ;Audio-Control 00 ;3 LDA #$08 ;volume level 8 ;2 STA AUDV0 ;Audio-Volume 00 ;3 LDA NoteCnt ;load note counter ;3 STA COLUPF ;Color-Luminance Playfield. ;3 TAX ;transfer the counter to X ;2 LDA NoteTbl,X ;load note from the table ;4 STA AUDF0 ;Audio-Frequency 00 ;3 RTS ;6 ;note frequency data NoteTbl: .byte (up to 256 values)
Posted Mon Jul 12, 2004 12:32 AM
;Make A Noise. MakeSound: LDA NoteCnt ;Check Not Count. ;3 BNE MakeSound_2 ;Branch if Noise to be made.;2 STA AUDV0 ;Turn off the Volume. ;3 STA AUDV1 ;3 RTS ;6 MakeSound_2: DEC NoteCnt ;Goto the Next Note. ;5 LDA NoiseType ;Get the Noise Type. ;3 BEQ NoiseGameOver ;Game Over ;2
MakeSound_2: LDA NoiseType ;Get the Noise Type. ;3 BEQ NoiseGameOver ;Game Over ;2 DEC NoteCnt ;Goto the Next Note. ;5I just moved the DEC instruction past the noise type check.
;Noise 0 : Game Over NoiseGameOver: LDA FrameCnt ;load the frame counter ;3 AND #$0F ;check the lower nybble ;2 BNE NoAdjust ;if anything there,do not change;2 DEC NoteCnt ;Goto the Next Note. ;5 NoAdjust:What is happening here is that the frame counter is checked. If the lower bits hold anything at all, it branches over the adjustment done to NoteCnt. In this example, the DEC instruction will only be executed every 16/60 seconds (each note is held for $0F+1 frames...i.e. 16 frames)
LDA #$FF ;2 STA NoteCnt ;Set the note count to maximum;3You'd change that #$FF value to how many notes you have in the table. So if you had 32 notes, you would use #$1F ($1F+1=$20, i.e. 32 notes)
Posted Mon Jul 12, 2004 1:41 AM
;note frequency data NoteTbl: .byte $11;can be any filler value .byte $11,$0E,$0D,$0E,$11,$0E,$0D,$0E,$11,$0E,$0D,$0E,$11,$0E,$0D,$0Eworks (nice twilight zone, I may play a bit with the distortion
BNE MainGameLoop_2 ;If Not Branch.. ;2 LDA #$10 ;Number of notes in table $FF;now 16=0F+1=10 *** NEW ;2 STA $DF ;Set the note count to maximum. ;3 STA $DE ;Set the game to inactive. ;3 LDA #$00 ;Set the noise type to end-noise. ;2 STA $E0 ;3Note (pun not intended) that I had to add an extra value; for some reason the last note is cut during playtesting so I needed to add one more for a filler.
Posted Mon Jul 12, 2004 1:57 AM
LDA NoteCnt ;load note counter ;3 STA COLUPF ;Color-Luminance Playfield;3 TAX ;transfer the counter to X;2
LDA FrameCnt ;load frame counter ;3 STA COLUPF ;Color-Luminance Playfield;3 LDX NoteCnt ;load note counter ;3
Posted Mon Jul 12, 2004 2:06 AM
Posted Mon Jul 12, 2004 12:20 PM
;Noise 0 : Game Over NoiseGameOver: LDA FrameCnt ;load the frame counter ;3 AND #$0F ;check the lower nybble ;2 BNE NoAdjust ;if anything there,do not change;2 DEC NoteCnt ;Goto the Next Note. ;5 NoAdjust:Every note is a quarter note (sort of), since 16 frames are always held. But you could do this instead...
;Noise 0 : Game Over NoiseGameOver: LDX NoteCnt ;load note counter ;3 LDA NoteTbl,X ;load note from the table ;4 LSR ;shift the value downward..;2 LSR ;.. ;2 LSR ;...to remove the frequency;2 ORA #$03 ;...and always set bits 0/1;2 ;i.e. so it's always at least a sixteenth note AND FrameCnt ;check against the frame ctr;3 BNE NoAdjust ;if anything left, do not change;2 DEC NoteCnt ;Goto the Next Note. ;5 NoAdjust: LDA #$05 ;distortion 5 ;2 STA AUDC0 ;Audio-Control 00 ;3 LDA #$08 ;volume level 8 ;2 STA AUDV0 ;Audio-Volume 00 ;3 LDA FrameCnt ;load frame counter ;3 STA COLUPF ;Color-Luminance Playfield.;3 LDX NoteCnt ;load note counter ;3 LDA NoteTbl,X ;load note from the table ;4 STA AUDF0 ;Audio-Frequency 00 ;3 RTS ;6That takes a bit longer to execute, so I'm not sure about any timing issues. Now in the data table values, you can set the higher bits depending on how long you want each note to play
Posted Mon Jul 12, 2004 12:42 PM
;Noise 0 : Game Over NoiseGameOver: LDX NoteCnt ;load note counter ;3 LDA NoteTbl,X ;load note from the table ;4 LSR ;shift the value downward..;2 LSR ;.. ;2 LSR ;...to remove the frequency;2 ORA #$03 ;...and always set bits 0/1;2 AND FrameCnt ;check against the frame ctr;3 BNE NoAdjust ;if anything left ,do not change;2 DEX ;Goto the Next Note. ;2 ;save 3 cycles not using DEC...we'll need to save X later tho. NoAdjust: LDA #$05 ;distortion 5 ;2 STA AUDC0 ;Audio-Control 00 ;3 LDA #$08 ;volume level 8 ;2 STA AUDV0 ;Audio-Volume 00 ;3 LDA FrameCnt ;load frame counter ;3 STA COLUPF ;Color-Luminance Playfield.;3 STX NoteCnt ;save note counter ;3 ;it's still in X...so we might as well save the adjusted counter there LDA NoteTbl,X ;load note from the table ;4 STA AUDF0 ;Audio-Frequency 00 ;3 RTS ;6
Posted Mon Jul 12, 2004 1:03 PM
BNE MainGameLoop_2 ;If Not Branch.. ;2 LDA #$10 ;# notes in table $FF...now $10 *** NEW;2 STA $DF ;Set the note count to maximum. ;3 STA $DE ;Set the game to inactive. ;3 LDA #$00 ;Set the noise type to end-noise;2 STA $E0 ;3
BNE MainGameLoop_2 ;If Not Branch.. ;2 LDA #$10 ;# notes in table $FF...now $10 *** NEW;2 STA $DF ;Set the note count to maximum. ;3 LDA #$FF ;<- load the "inactive game" value;2 STA $DE ;Set the game to inactive. ;3 LDA #$00 ;Set the noise type to end-noise;2 STA $E0 ;3
Posted Mon Jul 12, 2004 7:58 PM
Posted Mon Jul 12, 2004 9:23 PM
0 members, 0 guests, 0 anonymous users