Re: mockingboard from assembly



somewhere in your program, before you make sound effects, you
must initialize and reset both 6522 chips on the mockingboard:

**********************************************************************
JSR INIT ;INIT BOTH 6522'S
JSR INIT2

JSR RESET ;RESET BOTH 6522'S
JSR RESET2


**********************************************************

when you want to make a sound:

LDA #<Soundtable;SET ADDRESS OF SOUND PARAMETERS
STA PTR2 ;
LDA #>Soundtable;
STA PTR2+1 ;
JSR MKSOUND2 ;MAKE THE SOUND on chip#2


**********************************************************8



;TABLE ACCESS ROUTINE
;FOR SLOT 4
*
*sounds are stored as tables of 15 parameters.
*this routine expects (PTR) or (PTR2) to point to
*the address of the sound parameter table
*
*it loads the sound parameters, and send them to
*the mockingboard card.
*
*ptr = chip#1
*ptr2 = chip#2



*
*ROUTINES FOR FIRST 6255
*



START JSR RESET ;RESET SOUND CHIP

LDY #$00 ;USED TO IDENTIFY REGISTER

LOOP44 STY ORA ;# OF SOUND CHIP

JSR LATCH

LDA (PTR),Y ;GET DATA FROM TABLE

STA ORA

JSR WRITE ;STORE IN REGISTER

CPY #$0F ;END OF DATA?

BEQ DONE ;YES, EXIT

INY

JMP LOOP44 ;NO, GET NEXT SET

DONE RTS ;RETURN

*

*ROUTINES FOR SECOND 6522

*

MKSOUND2 JSR RESET2 ;SAME INSTRUCTIONS AS

LDY #$00 ;ABOVE

LOOP2 STY ORA2

JSR LATCH2

LDA (PTR2),Y

STA ORA2

JSR WRITE2

CPY #$0F

BEQ DONE2

INY

JMP LOOP2

DONE2 RTS








*************************************************************************************

*PRIMARY ROUTINES
*FOR SLOT 4
*
*this code has INIT, LATCH, WRITE, and RESET
*routines for both 6522 chips.
*
*MB.TABLE calls this code, so you never have to
*mess with it


;ADDRESSES FOR FIRST 6522

ORB EQU $C400 ;PORT B

ORA EQU $C401 ;PORT A

DDRB EQU $C402 ;DATA DIRECTION REGISTER (A)

DDRA EQU $C403 ;DATA DIRECTION REGISTER (B)

;ADDRESSES FOR SECOND 6522

ORB2 EQU $C480 ;PORT B

ORA2 EQU $C481 ;PORT A

DDRB2 EQU $C482 ;DATA DIRECTION REGISTER (B)

DDRA2 EQU $C483 ;DATA DIRECTION REGISTER (A)

*

*ROUTINES FOR FIRST 6522

*

INIT LDA #$FF ;SET PORT A FOR OUTPUT

STA DDRA

LDA #$07 ;SET PORT B FOR OUTPUT

STA DDRB

RTS ;RETURN

*

LATCH LDA #$07 ;SEND "LATCH COMMAND"

STA ORB ;TO SOUND CHIP

LDA #$04 ;THROUGH PORT B

STA ORB

RTS ;RETURN

*

WRITE LDA #$06 ;SEND "WRITE COMMAND"

STA ORB ;TO SOUND CHIP

LDA #$04 ;THROUGH PORT B

STA ORB

RTS ;RETURN

*

RESET LDA #$00 ;SEND "RESET COMMAND"

STA ORB ;TO SOUND CHIP

LDA #$04 ;THROUGH PORT B

STA ORB

RTS ;RETURN

*

*ROUTINES FOR SECOND 6522

*

INIT2 LDA #$FF ;SET PORT A FOR OUTPUT

STA DDRA2

LDA #$07 ;SET PORT B FOR OUTPUT

STA DDRB2

RTS ;RETURN

*



LATCH2 LDA #$07 ;SEND "LATCH COMMAND"

STA ORB2 ;TO SOUND CHIP

LDA #$04 ;THROUGH PORT B

STA ORB2

RTS ;RETURN

*

WRITE2 LDA #$06 ;SEND "WRITECOMMAND"

STA ORB2 ;TO SOUND CHIP

LDA #$04 ;THROUGH PORT B

STA ORB2

RTS ;RETURN

*
RESET2

LDA #$00 ;SEND "RESET COMMAND"

STA ORB2 ;TO SOUND CHIP

LDA #$04 ;THROUGH PORT B

STA ORB2

RTS ;RETURN

.



Relevant Pages

  • Re: Doctor Who slow DMD and some gameplay
    ... When you find a leg of a chip on the data line shorted to ground, ... Fliptronics board to the sound board and then the DMD controller ... game plays fast and display looks great. ...
    (rec.games.pinball)
  • Re: Bally Fathom sound problems
    ... No first flash means a bad U6, ... Techno Guide: The U1 chip tests the U6 RAM. ... The U1 chip now tests the first PIA U7. ... No fourth flash means sound generator U12 is bad. ...
    (rec.games.pinball)
  • Re: Doctor Who slow DMD and some gameplay
    ... If you find a leg of the chip that beeps to ground on ... Fliptronics board to the sound board and then the DMD controller ... game plays fast and display looks great. ... I had to how it was behaving was right off the bat, the ball gets ...
    (rec.games.pinball)
  • Re: Bally Fathom sound problems
    ... No first flash means a bad U6, ... Techno Guide: The U1 chip tests the U6 RAM. ... The U1 chip now tests the first PIA U7. ... No fourth flash means sound generator U12 is bad. ...
    (rec.games.pinball)
  • Re: TECH: FunHouse No Sound at Start Up and Weird Noise Video Demo
    ... If reseating the connector doesn't fix the problem, ... that Isolates the Sound Board ... doesn't seem to work prior to the diagnostics reset because if it did, ... mainly start up versus entering diagnostics. ...
    (rec.games.pinball)

Loading