music part done

This commit is contained in:
Antoine Vignau 2024-02-03 19:51:11 +01:00
parent f1f4785adf
commit f20470eed6
9 changed files with 5210 additions and 5146 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,2 +1 @@
playasound=Type(06),AuxType(1000),VersionCreate(70),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)
LaBelleZohra=Type(B3),AuxType(DB00),VersionCreate(70),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,13 @@
mx %00
*-----------------------
* MENU
*-----------------------
strMENU1 str '1- Musique'
strMENU2 str '2- La Belle Zohra'
*-----------------------
* ATARI
*-----------------------
@ -444,13 +451,9 @@ snd58 asc '58'
*--- Donnees Sound Tool Set
waveSTART ds 4 ; waveStart
waveSIZE ds 2 ; waveSize
waveSTART ds 4 ; waveStart (long)
waveSIZE ds 2 ; waveSize en octets
waveFREQ dw 214 ; freqOffset
dw $0000 ; docBuffer
dw $0000 ; bufferSize
ds 4 ; nextWavePtr
dw 255 ; volSetting
tblSTR1 ds 10*2 ; pointeur sur la premi<6D>re phrase
tblSTR2 ds 10*2 ; pointeur sur la seconde phrase

View File

@ -385,7 +385,7 @@ affiche_objet ; X is object
jsr set_objet
_HideCursor
PushLong #fondParamPtr
PushLong #fondParamPtr
_PaintPixels
_ShowCursor
ao1 rts
@ -401,12 +401,12 @@ set_objet txa
lda objet_y,x
sta iconToSourceRect
sta iconToDestPoint
lda icon_x,x
lda objet_x,x
sta iconToSourceRect+2
sta iconToDestPoint+2
lda icon_yy,x
lda objet_yy,x
sta iconToSourceRect+4
lda icon_xx,x
lda objet_xx,x
sta iconToSourceRect+6
rts
@ -415,8 +415,8 @@ set_objet txa
*-----------------------
set_language
PushWord #0
PushWord #$29
PushWord #0
PushWord #$29
_ReadBParam
pla
cmp #20
@ -665,12 +665,39 @@ scrolling
verif
rts
*-----------------------
* CHOIX D'ENTREE
*-----------------------
antoine
@t #strMENU1;#11
@t #strMENU2;#14
]lp pha
PushWord #%00000000_00001010
PushLong #taskREC
_GetNextEvent
pla
beq ]lp
lda taskREC ; une touche ?
cmp #keyDownEvt
bne ]lp
lda taskMESSAGE ; entre 0 et 9 ?
cmp #'1'
beq laZIK
cmp #'2'
bne ]lp
rts
laZIK jmp musique
*-----------------------
* INIT - OK
*-----------------------
* init
init PushWord #0
init PushWord #$ffff
_ClearScreen
jsr init_resolution
@ -1197,11 +1224,11 @@ mu_1 jsr init_musique
sta i
]lp lda i
jsr rythme
jsr rythme ; charge le rythme
jsr rythme_joue ; joue le rythme
lda i
jsr charge_son
jsr clavier_sonore
jsr charge_son ; charge les sons
jsr clavier_sonore ; joue les sons
bcs mu_exit ; si *, on quitte le clavier sonore
jsr nettoie_musique
inc i
@ -1257,6 +1284,68 @@ init_musique
_ClearScreen
rts
*-----------------------
* THE SOUND INTERRUPT
*-----------------------
mx %00
sndINTERRUPT
* phb
phd
* phk
* plb
clc
xce
rep #$30
lda #$c000
tcd
sep #$20
]lp lda soundctl
bmi ]lp
ldal $e100ca
and #%0000_1111
sta soundctl
lda #$e0 ; which oscillo
sta soundadrl ; has generated
lda sounddata ; the interrupt?
lda sounddata
and #%0011_1110
lsr
cmp #1 ; oscillo 1 (liŽ ˆ 0)
beq sndINTERRUPT1
cmp #3 ; oscillo 3 (liŽ ˆ 2)
bne sndINTERRUPT99
lda #-1
stal fgCLEAR
bra sndINTERRUPT99
sndINTERRUPT1
lda #$a0 ; oscillos 0 & 1
sta soundadrl
lda #%0000_0000
sta sounddata
lda #$a1
sta soundadrl
lda #%0001_1000 ; with interrupt
sta sounddata
sndINTERRUPT99
sep #$30
pld
* plb
clc
rtl
mx %00
*-----------------------
* RYTHME - OK
*-----------------------
@ -1417,15 +1506,15 @@ ensoniq_beat
lda #$ff
sta sounddata
tya ; address pointer (at $4000)
tya ; address pointer (at $0000 and not $4000)
ora #$80
sta soundadrl
lda #$40
lda #$00
sta sounddata
tya
ora #$81
sta soundadrl
lda #$40
lda #$00
sta sounddata
tya ; waveform table size (32K)
@ -1452,7 +1541,121 @@ ensoniq_beat
rts
mx %00
*-----------------------
* SON_JOUE - OK
*-----------------------
* son_joue
son_joue
* 1. on met en RAM son
sei
phd
lda #$c000
tcd
sep #$20
ldal $e100ca
and #%0000_1111
ora #%0110_0000
sta soundctl
lda #$00
sta soundadrl
lda #$80
sta soundadrh
ldx #0
sj_from ldal $aabbcc,x
sta sounddata
inx
sj_eof cpx #$ffff
bne sj_from
* 2. on dŽmarre
ldy #2 ; oscillos 2 & 3
ldal $e100ca ; volume
and #%0000_1111
sta soundctl
tya ; frŽquence basse
sta soundadrl
lda waveFREQ
sta sounddata
tya
ora #$01
sta soundadrl
lda waveFREQ
sta sounddata
tya ; frŽquence haute
ora #$20
sta soundadrl
lda waveFREQ+1
sta sounddata
tya
ora #$21
sta soundadrl
lda waveFREQ+1
sta sounddata
tya ; volume
ora #$40
sta soundadrl
lda #$ff
sta sounddata
tya
ora #$41
sta soundadrl
lda #$ff
sta sounddata
tya ; address pointer (at $8000)
ora #$80
sta soundadrl
lda #$80
sta sounddata
tya
ora #$81
sta soundadrl
lda #$80
sta sounddata
tya ; waveform table size (32K)
ora #$c0
sta soundadrl
lda #%00111111
sta sounddata
tya
ora #$c1
sta soundadrl
lda #%00111111
sta sounddata
tya ; control register
ora #$a0
sta soundadrl
lda #%0000_0010 ; one-shot
sta sounddata
tya
ora #$a1
sta soundadrl
lda #%0001_1010 ; with interrupt
sta sounddata
* 3. on sort et <EFBFBD>a joue
rep #$20
pld
cli
rts
mx %00
*-----------------------
* CHARGE_SON - OK
*-----------------------
@ -1546,7 +1749,7 @@ charge_un_son
tay
asl
tax
lda proEOF+1 ; nombre de pages
lda proEOF ; nombre d'octets
sta tblSIZE,y
lda [3]
@ -1578,16 +1781,6 @@ cus_err2 rts
*-----------------------
clavier_sonore
pha
_GetForeColor
pha
_GetBackColor
PushWord #0
_SetForeColor
PushWord #15
_SetBackColor
ldx #0 ; init keyboard
lda #FALSE
]lp sta sndKEY,x
@ -1596,7 +1789,14 @@ clavier_sonore
cpx #10*2
bcc ]lp
cl_loop pha
dec j ; correct j
cl_loop lda fgCLEAR
beq cl_noclear
jsr paintZIK
stz fgCLEAR
cl_noclear pha
PushWord #%00000000_00001010
PushLong #taskREC
_GetNextEvent
@ -1613,13 +1813,11 @@ cl_loop pha
cmp #'0'
bne cl_1
cl_0 _SetBackColor
_SetForeColor
cl_0 jsr paintZIK ; 0 pour sortir
clc
rts ; on sort
rts ; * pour quitter
cl_exit _SetBackColor
_SetForeColor
cl_exit jsr paintZIK
sec ; dŽfinitivement
rts
@ -1635,26 +1833,33 @@ cl_1 cmp #'1'
asl ; affiche les cha”nes
tax
phx
asl
tay
lda tblSIZE,x
sta waveSIZE
bpl cl_size
lda #$8000 ; on ne dŽpasse pas 32K
cl_size sta sj_eof+1
lda tblFREQ,x
sta waveFREQ
txa
asl
tay
lda ptrSND1,y
sta waveSTART
lda ptrSND1+2,y
sta waveSTART+2
sta sj_from+1
lda ptrSND1+1,y
sta sj_from+2
lda sndKEY,x ; did we press the key?
cmp #TRUE
beq cl_2
lda #TRUE
* lda sndKEY,x ; did we press the key?
* cmp #TRUE
* bne cl_2 ; no, we can play
* brl cl_loop
cl_2 lda #TRUE
sta sndKEY,x
phx
jsr paintZIK
plx
phx
lda tblSTR1,x
ldy #22
jsr t
@ -1664,19 +1869,26 @@ cl_1 cmp #'1'
ldy #23
jsr t
brl cl_loop ; LOGO
cl_2 plx
jsr son_joue ; met le son en RAM son et le joue
brl cl_loop
PushWord #%0000_0000_1000_0000 ; play the sound
_FFStopSound
*---------- The rectangle
PushWord #$0701
PushLong #waveSTART
_FFStartSound
paintZIK PushLong #curPATTERN
_GetPenPat
PushLong #whitePATTERN
_SetPenPat
brl cl_loop
PushLong #zikRECT
_PaintRect
PushLong #curPATTERN
_SetPenPat
rts
zikRECT dw 150,0,200,320
fgCLEAR ds 2 ; -1 set by interrupt
*-----------------------
* MIX - OK
@ -1732,243 +1944,6 @@ fm_1 ldy #$1f
cli
rts
*-----------------------
* ENSONIQ ROUTINES
*-----------------------
initMUSIC lda #$373
sta zikPAGE
lda ptrMUSIC
sta zikMUSIC
lda ptrMUSIC+2
sta zikMUSIC+2
sep #$20
ldal $e100ca
and #$0f
stal $e0c03c
ldy #$04
tya
ora #$00
stal $e0c03e
lda #$d1
stal $e0c03d
tya
ora #$01
stal $e0c03e
lda #$d1
stal $e0c03d
tya
ora #$20
stal $e0c03e
lda #$00
stal $e0c03d
tya
ora #$21
stal $e0c03e
lda #0
stal $e0c03d
tya
ora #$40
stal $e0c03e
lda #$f0
stal $e0c03d
tya
ora #$41
stal $e0c03e
lda #$f0
stal $e0c03d
tya
ora #$80
stal $e0c03e
lda #$3e
stal $e0c03d
tya
ora #$81
stal $e0c03e
lda #$3f
stal $e0c03d
tya
ora #$c0
stal $e0c03e
lda #0
stal $e0c03d
tya
ora #$c1
stal $e0c03e
lda #0
stal $e0c03d
rep #$20
lda #1
sta zikPLAY
rts
*---
mx %00
sndINTERRUPT
phb
phd
phk
plb
clc
xce
rep #$30
lda #$c000
tcd
sep #$20
]lp lda soundctl
bmi ]lp
ldal $e100ca
and #%0000_1111
sta soundctl
lda #$e0 ; which oscillo
sta soundadrl ; has generated
lda sounddata ; the interrupt?
lda sounddata
and #%0011_1110
lsr
cmp #1 ; oscillo 1 (liŽ ˆ 0)
beq sndINTERRUPT1
cmp #5 ; oscillo 5 (liŽ ˆ 4)
beq sndINTERRUPT2
bne sndINTERRUPT99
sndINTERRUPT1
lda #$a0 ; oscillos 0 & 1
sta soundadrl
lda #%0000_0000
sta sounddata
lda #$a1
sta soundadrl
lda #%0001_1000 ; with interrupt
sta sounddata
sndINTERRUPT99
sep #$30
pld
plb
clc
rtl
*---
mx %10
sndINTERRUPT2
ldal $e100ca
and #%0000_1111
ora #%0110_0000
sta soundctl
stz soundadrl
lda soundadrl
ora fgPAGE
eor #1
sta soundadrh
ldy zikMUSIC
lda zikMUSIC+2
pha
plb
]move = $00
lup 256
lda ]move,y
sta sounddata
]move = ]move+1
--^
phk
plb
rep #$20
inc zikMUSIC+1
dec zikPAGE
bne sndINTERRUPT3
* lda whichSND
* beq sndINTERRUPT21
*
* sep #$20
*
* ldal $e100ca
* and #$0f
* sta soundctl
*
* lda #$a4
* sta soundadrl
* lda #%0000_0011
* sta sounddata
* inc soundadrh
* lda #%0001_0011
* sta sounddata
* bra sndINTERRUPT5
*
* mx %00
sndINTERRUPT21
lda waveSIZE
sta zikPAGE
lda waveSTART
sta zikMUSIC
lda waveSTART+2
sta zikMUSIC+2
sndINTERRUPT3
sep #$20
ldal $e100ca
and #%0000_1111
sta soundctl
ldy #$04
ldx fgPAGE
bne sndINTERRUPT4
tya
ora #$a0
sta soundadrl
lda #%0000_1110
sta sounddata
inc soundadrl
lda #%0001_1111
sta sounddata
bra sndINTERRUPT5
sndINTERRUPT4
tya
ora #$a0
sta soundadrl
lda #%0000_1111
sta sounddata
inc soundadrl
lda #%0001_1110
sta sounddata
sndINTERRUPT5
lda fgPAGE
eor #1
sta fgPAGE
sep #$30
pld
plb
clc
rtl
mx %00
*-----------------------
* DATA_FICHIERS_MUSIQUE - OK
*-----------------------

View File

@ -18,6 +18,7 @@
use 4/Locator.Macs
use 4/Mem.Macs
use 4/Menu.Macs
use 4/MIDISyn.Macs
use 4/Misc.Macs
use 4/Print.Macs
use 4/Qd.Macs
@ -59,6 +60,7 @@ GSOS = $e100a8
*-------------- GUI
wMAIN = 1
alertQUIT = $0100
alertRESTART = $0200
@ -96,7 +98,7 @@ ptrE12000 = $e12000
*---
TRUE = 1
TRUE = 255
FALSE = 0
fgLOAD = 1 ; flags for choix_aventure
@ -122,7 +124,6 @@ fgRESTART = 2
tdc
sta myDP
*--- Version du systeme
jsl GSOS
@ -170,10 +171,7 @@ koMEM pha
okMEM1 sty ptrIMAGE
stx ptrIMAGE+2
sep #$10 ; save pointer+2
stx saveBACK1+3 ; for interactions
stx loadBACK1+3 ; with the toolbox
rep #$10
stx ptrBACKGND+2
*--- 64K pour les images du jeu
@ -214,9 +212,19 @@ okMEM1 sty ptrIMAGE
pla
brl meQUIT0
*---
okTOOL PushWord #0
_GetMasterSCB
pla
bmi okSHADOW ; shadowing is on if bit 15 is set
lda #^ptrE12000 ; shadowing is off, use slow RAM
sta ptrSCREEN+2
*--- Et la musique...
okTOOL pha
okSHADOW pha
_SoundToolStatus
pla
bne noSOUND
@ -234,20 +242,32 @@ noSOUND _HideMenuBar
_InitCursor
PushLong #0
PushWord #5 ; SetDeskPat
PushWord #$4000
PushWord #$0000
PushLong #0
PushWord #5 ; SetDeskPat
PushWord #$4000
PushWord #$0000
_Desktop
pla
pla
PushLong #0
_GetPort
PullLong mainPORT
* PushLong #0
* _GetPort
* PullLong mainPORT
*
* PushLong mainPORT
* _SetPort
PushLong mainPORT
_SetPort
pha
pha
PushLong #0
PushLong #wMAIN
PushLong #PAINTMAIN
PushLong #0
PushWord #refIsResource
PushLong #wMAIN
PushWord #$800e
_NewWindow2
PullLong wiMAIN
*----------------------------------------
* INITIALISATIONS
@ -257,7 +277,7 @@ entryPOINT
jsr TWILIGHToff
jsr set_language
jsr init
jsr musique
jsr antoine ; on change !
jsr init2
*-----------------------
@ -277,22 +297,23 @@ mainLOOP jsr teste_fin
taskLOOP inc VBLCounter0
PushWord #0
PushWord #0
PushWord #$c000
PushWord #0
PushWord #0
PushWord #0
PushWord #$c000
PushWord #0
_HandleDiskInsert
pla
pla
pha
PushWord #%00000000_00001010
PushLong #taskREC
_GetNextEvent
* jsr checkREPLAY
PushWord #0
PushWord #%11111111_11111111
PushLong #taskREC
_TaskMaster
pla
beq taskLOOP
lda taskREC
asl
tax
jsr (taskTBL,x)
@ -374,7 +395,24 @@ doMOUSEUP
* rts
*mup2 jsr aiguille ; on aiguille le joueur (1 ou 2 clics)
rts
*----------------------------------- Gestion des controles
doCONTROL
lda taskREC+38
asl
tax
jmp (ctrlTBL,x)
*----------------------------------------
* FENETRES
*----------------------------------------
PAINTMAIN
PushLong wiMAIN
_DrawControls
rtl
*-----------------------------------
* AUTRES ROUTINES
*-----------------------------------
@ -812,7 +850,7 @@ fadeIN pha
ldy #$2000
sty Arrivee
ldx #$00e1
ldx ptrSCREEN+2
stx Arrivee+2
ldy #$7e00
@ -899,7 +937,7 @@ fadeIN6 dey
fadeOUT lda #$9e00
sta Debut
lda #$00e1
lda ptrSCREEN+2
sta Debut+2
_HideCursor
@ -1065,34 +1103,24 @@ lenDATA ds 4
* SAVE THE SHR SCREEN
*-----------------------------------
saveBACK
_HideCursor
ldx #$8000-2
]lp ldal $e12000,x
saveBACK1 stal $000000,x
dex
dex
bpl ]lp
exitBACK _ShowCursor
saveBACK _HideCursor
PushLong ptrSCREEN
PushLong ptrBACKGND
PushLong #32768
_BlockMove
_ShowCursor
rts
*-----------------------------------
* RESTORE THE SHR SCREEN
*-----------------------------------
loadBACK
_HideCursor
ldx #$8000-2
loadBACK1 ldal $000000,x
stal $012000,x
stal $e12000,x
dex
dex
bpl loadBACK1
bmi exitBACK
loadBACK _HideCursor
PushLong ptrBACKGND
PushLong ptrSCREEN
PushLong #32768
_BlockMove
rts
*--- Genere un nombre aleatoire
@ -1146,16 +1174,21 @@ nowWAIT1 pha
* DATA
*----------------------------------------
*----------------------- Fenetres
wiMAIN ds 4
*----------------------- Memory manager
mainID ds 2 ; app ID
myID ds 2 ; user ID
myDP ds 2
mainPORT ds 4 ; default grafport
SStopREC ds 4
ptrSCREEN adrl ptr012000 ; l'écran actif
ptrIMAGE ds 4 ; $0000: where a scene image is loaded
ptrBACKGND adrl $8000 ; $8000: where the screen is saved
ptrFOND ds 4 ; $0000: fond de jeu
ptrICONES adrl $8000 ; $0000: fond d'icônes du jeu
ptrUNPACK ds 4 ; $0000: where the background picture is laoded
@ -1203,6 +1236,45 @@ temp ds 2
saveLANGUAGE ds 2
*----------------------------------- Quickdraw II
palette320 dw $0000,$0777,$0841,$072C,$000F,$0080,$0F70,$0D00
dw $0FA9,$0FF0,$00E0,$04DF,$0DAF,$078F,$0CCC,$0FFF
palette640 dw $0000,$000F,$00F0,$0FFF,$0000,$000F,$0FF0,$0FFF
dw $0000,$0F00,$00F0,$0FFF,$0000,$000F,$0FF0,$0FFF
blackPATTERN ds 32,$00
ds 32,$11
ds 32,$22
ds 32,$33
ds 32,$44
ds 32,$55
ds 32,$66
ds 32,$77
ds 32,$88
ds 32,$99
ds 32,$aa
ds 32,$bb
ds 32,$cc
ds 32,$dd
ds 32,$ee
whitePATTERN ds 32,$ff
checkeredPATTERN
hex 0F0F0F0F
hex F0F0F0F0
hex 0F0F0F0F
hex F0F0F0F0
hex 0F0F0F0F
hex F0F0F0F0
hex 0F0F0F0F
hex F0F0F0F0
curPATTERN ds 32
curPENSIZE ds 4
*----------------------- Tool locator
verSTR1 str 'System 6.0.1 Required!'
@ -1226,6 +1298,13 @@ taskWHEN ds 4 ; wmWhen +6
taskWHERE ds 4 ; wmWhere +10
taskMODIFIERS ds 2 ; wmModifiers +14
taskDATA ds 4 ; wmTaskData +16
adrl $001fffff ; wmTaskMask +20
ds 4 ; wmLastClickTick +24
ds 2 ; wmClickCount +28
ds 4 ; wmTaskData2 +30
ds 4 ; wmTaskData3 +34
ds 4 ; wmTaskData4 +38
ds 4 ; wmLastClickPt +42
taskTBL da doNOT ; 0 Null
da doMOUSEDOWN ; 1 mouseDownEvt
@ -1243,6 +1322,57 @@ taskTBL da doNOT ; 0 Null
da doNOT ; D app2Evt
da doNOT ; E app3Evt
da doNOT ; F app4Evt
da doNOT ; wInDesk
da doNOT ; wInMenuBar
da doNOT ; wCLickCalled
da doNOT ; wInContent - was doCONTENT
da doNOT ; wInDrag
da doNOT ; wInGrow
da doNOT ; wInGoAway
da doNOT ; wInZoom
da doNOT ; wInInfo
da doNOT ; wInSpecial
da doNOT ; wInDeskItem
da doNOT ; wInFrame
da doNOT ; wInactMenu
da doNOT ; wInClosedNDA
da doNOT ; wInCalledSysEdit
da doNOT ; wInTrackZoom
da doNOT ; wInHitFrame
da doNOT ; wInControl
da doNOT ; wInControlMenu
ctrlTBL da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
da doNOT
*----------------------------------------
* STD FILE