C'est beau !

This commit is contained in:
Antoine Vignau 2024-02-05 20:21:30 +01:00
parent 781638b678
commit 195e60f911
6 changed files with 4997 additions and 4674 deletions

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -151,12 +151,11 @@ theWINDOW dw $0050
ds 4 ds 4
ds 4 ds 4
ds 4 ds 4
winRECT dw 0 ; content rect dw 0 ; content rect
dw 0 dw 0
dw 200 dw 200
dw 320 dw 320
adrl $ffffffff adrl $ffffffff
* adrl teCONTROL
ds 4 ds 4
dw %00000000_00000000 dw %00000000_00000000
@ -181,10 +180,11 @@ teRECT ds 8 ; rect
dw %00000000_00000101 ; textDescriptor dw %00000000_00000101 ; textDescriptor
teTEXT ds 4 ; textRef teTEXT ds 4 ; textRef
teLEN ds 4 ; textLength teLEN ds 4 ; textLength
*--- *---
fenetreRECT ds 8 fenetreRECT ds 8 ; le round rectangle autour du controle
frameRECT ds 8 ; la ligne autour du controle
fenetre_x dw 0,10,10,10,120,10,10,10,10,10 fenetre_x dw 0,10,10,10,120,10,10,10,10,10
fenetre_y dw 0,100,100,100,10,100,100,100,10,100 fenetre_y dw 0,100,100,100,10,100,100,100,10,100

View File

@ -117,37 +117,87 @@ test_fin
rts rts
*----------------------- *-----------------------
* GESTION DES ICONES DES PECHES * TEST_OBJETS
*-----------------------
* test_objets = affiche les objets possibles
test_objets stz textes_encore_presents
sep #$30
ldx #1
]lp stz icone_objets,x
inx
cpx #nombre_objets
bcc ]lp
beq ]lp
ldx #1
]lp lda deja_lu,x
cmp #FALSE
bne to_1
ldy condition,x
lda indicateur,y
cmp #TRUE
bne to_1
ldy objet,x
lda #TRUE
sta icone_objets,y
sta textes_encore_presents
to_1 inx
cpx #nombre_paragraphes
bcc ]lp
beq ]lp
rep #$30
*-------- Affichage des objets
ldx #1
]lp phx
jsr affiche_objet
plx
inx
cpx #nombre_objets
bcc ]lp
beq ]lp
rts
*-----------------------
* GESTION DES OBJETS
*----------------------- *-----------------------
test_peche stz peche_selectionne test_objet stz objet_selectionne
lda #1 ; from 1 ldx #1 ; from 1
]lp pha ]lp lda icone_objets,x
and #$ff
cmp #TRUE
bne objet_ko
txa
asl asl
tax tay
lda taskWHERE+2 ; compare le X lda taskWHERE+2 ; compare le X
cmp peche_x,x cmp objet_x,y
bcc icone_ko bcc objet_ko
lda peche_xx,x lda objet_xx,y
cmp taskWHERE+2 cmp taskWHERE+2
bcc icone_ko bcc objet_ko
lda taskWHERE ; et le Y lda taskWHERE ; et le Y
cmp peche_y,x cmp objet_y,y
bcc icone_ko bcc objet_ko
lda peche_yy,x lda objet_yy,y
cmp taskWHERE cmp taskWHERE
bcc icone_ko bcc objet_ko
pla ; on a notre ic™ne stx objet_selectionne ; on a notre objet
sta peche_selectionne
clc clc
rts rts
icone_ko pla objet_ko inx
inc cpx #nombre_objets
cmp #nombre_peches ; et non plus nombre_icones
bcc ]lp bcc ]lp
beq ]lp beq ]lp
sec sec
@ -155,52 +205,163 @@ icone_ko pla
*--- *---
efface_peche ; X is object affiche_objet ; X is object
cpx #0 txa
beq ei1 asl
jsr set_peche tay
lda objet_y,y ; x is 2..4..6..8
sta iconToSourceRect
sta iconToDestPoint
lda objet_x,y
sta iconToSourceRect+2
sta iconToDestPoint+2
lda objet_yy,y
sta iconToSourceRect+4
lda objet_xx,y
sta iconToSourceRect+6
_HideCursor lda icone_objets,x
and #$ff
cmp #TRUE
bne efface_objet
PushLong #iconParamPtr
_PaintPixels
rts
efface_objet
PushLong #fondParamPtr PushLong #fondParamPtr
_PaintPixels _PaintPixels
_ShowCursor rts
ei1 rts
*-----------------------
* TEST_PECHES
*-----------------------
* test_peches = affiche les peches possibles
test_peches sep #$30
ldx #1
]lp stz icone_peches,x
inx
cpx #nombre_peches
bcc ]lp
beq ]lp
ldx #1
]lp lda objet,x
cmp objet_selectionne
bne tp_1
lda deja_lu,x
cmp #FALSE
bne tp_1
ldy condition,x
lda indicateur,y
cmp #TRUE
bne tp_1
ldy peche,x
lda #TRUE
sta icone_peches,y
tp_1 inx
cpx #nombre_paragraphes
bcc ]lp
beq ]lp
rep #$30
*-------- Affichage des peches
ldx #1
]lp phx
jsr affiche_peche
plx
inx
cpx #nombre_peches
bcc ]lp
beq ]lp
rts
*-----------------------
* GESTION DES ICONES DES PECHES
*-----------------------
test_peche stz peche_selectionne
ldx #1 ; from 1
]lp lda icone_peches,x
and #$ff
cmp #TRUE
bne peche_ko
txa
asl
tay
lda taskWHERE+2 ; compare le X
cmp peche_x,y
bcc peche_ko
lda peche_xx,y
cmp taskWHERE+2
bcc peche_ko
lda taskWHERE ; et le Y
cmp peche_y,y
bcc peche_ko
lda peche_yy,y
cmp taskWHERE
bcc peche_ko
stx peche_selectionne ; on a notre peche
clc
rts
peche_ko inx
cpx #nombre_peches
bcc ]lp
beq ]lp
sec
rts
*--- *---
affiche_peche ; X is object affiche_peche ; X is object
cpx #0 txa
beq ai1
jsr set_peche
_HideCursor
PushLong #iconParamPtr
_PaintPixels
_ShowCursor
ai1 rts
*---
set_peche txa
asl asl
tax tay
lda peche_y,x ; x is 2..4..6..8 lda peche_y,y ; x is 2..4..6..8
sta iconToSourceRect sta iconToSourceRect
sta iconToDestPoint sta iconToDestPoint
lda peche_x,x lda peche_x,y
sta iconToSourceRect+2 sta iconToSourceRect+2
sta iconToDestPoint+2 sta iconToDestPoint+2
lda peche_yy,x lda peche_yy,y
sta iconToSourceRect+4 sta iconToSourceRect+4
lda peche_xx,x lda peche_xx,y
sta iconToSourceRect+6 sta iconToSourceRect+6
lda icone_peches,x
and #$ff
cmp #TRUE
bne efface_peche
PushLong #iconParamPtr
_PaintPixels
rts rts
efface_peche
PushLong #fondParamPtr
_PaintPixels
rts
*-----------------------
* LES DONNEES
*-----------------------
*--- *---
fondParamPtr fondParamPtr
adrl fondToSourceLocInfo adrl fondToSourceLocInfo
adrl iconToDestLocInfo * adrl iconToDestLocInfo
adrl contentToSourceLocInfo
adrl iconToSourceRect adrl iconToSourceRect
adrl iconToDestPoint adrl iconToDestPoint
dw $0000 ; mode copy dw $0000 ; mode copy
@ -208,7 +369,8 @@ fondParamPtr
iconParamPtr iconParamPtr
adrl iconToSourceLocInfo adrl iconToSourceLocInfo
adrl iconToDestLocInfo * adrl iconToDestLocInfo
adrl contentToSourceLocInfo
adrl iconToSourceRect adrl iconToSourceRect
adrl iconToDestPoint adrl iconToDestPoint
dw $0000 ; mode copy dw $0000 ; mode copy
@ -219,16 +381,17 @@ fondToSourceLocInfo
ds 4 ; ptrFOND - $0000 on entry, high set after _NewHandle ds 4 ; ptrFOND - $0000 on entry, high set after _NewHandle
dw 160 dw 160
dw 0,0,200,320 dw 0,0,200,320
fondRect fondRect
dw 0,0,200,320 dw 0,0,200,320
iconToSourceLocInfo iconToSourceLocInfo
dw mode_320 ; mode 320 dw mode_320 ; mode 320
adrl $8000 ; ptrICON - $8000 on entry, high set after _NewHandle adrl $8000 ; ptrICON - $8000 on entry, high set after ptrFOND
dw 160 dw 160
dw 0,0,200,320 dw 0,0,200,320
iconRect
dw 0,0,200,320
iconToDestLocInfo iconToDestLocInfo
dw mode_320 ; +0 mode 320 dw mode_320 ; +0 mode 320
adrl ptr012000 ; +2 adrl ptr012000 ; +2
@ -240,84 +403,13 @@ iconToSourceRect
iconToDestPoint iconToDestPoint
dw 3,0 dw 3,0
*----------------------- contentToSourceLocInfo
* GESTION DES OBJETS dw mode_320 ; mode 320
*----------------------- adrl $8000 ; ptrCONTENT - $8000 on entry, high set after ptrUNPACK
dw 160
test_objet stz objet_selectionne dw 0,0,200,320
contentRect
lda #1 ; from 1 dw 0,0,200,320
]lp pha
asl
tax
lda taskWHERE+2 ; compare le X
cmp objet_x,x
bcc objet_ko
lda objet_xx,x
cmp taskWHERE+2
bcc objet_ko
lda taskWHERE ; et le Y
cmp objet_y,x
bcc objet_ko
lda objet_yy,x
cmp taskWHERE
bcc objet_ko
pla ; on a notre ic™ne
sta objet_selectionne
clc
rts
objet_ko pla
cmp #nombre_objets ; et non plus nombre_objets
bcc ]lp
beq ]lp
sec
rts
*---
efface_objet ; X is object
cpx #0
beq eo1
jsr set_objet
_HideCursor
PushLong #fondParamPtr
_PaintPixels
_ShowCursor
eo1 rts
*---
affiche_objet ; X is object
cpx #0
beq ao1
jsr set_objet
_HideCursor
PushLong #iconParamPtr
_PaintPixels
_ShowCursor
ao1 rts
*---
set_objet txa
asl
tax
lda objet_y,x ; x is 2..4..6..8
sta iconToSourceRect
sta iconToDestPoint
lda objet_x,x
sta iconToSourceRect+2
sta iconToDestPoint+2
lda objet_yy,x
sta iconToSourceRect+4
lda objet_xx,x
sta iconToSourceRect+6
rts
*----------------------- *-----------------------
* set_language * set_language
@ -419,7 +511,25 @@ antoine
@t #strMENU2;#12 @t #strMENU2;#12
@t #strMENU3;#14 @t #strMENU3;#14
]lp pha pha
pha
_TickCount
pla
clc
adc #5*60 ; 5 secondes
sta theTICK
pla
adc #0
sta theTICK+2
]lp lda taskWHEN+2 ; sort au bout de 5 secondes
cmp theTICK+2
bcc toinet
lda taskWHEN
cmp theTICK
bcs leJEU
toinet pha
PushWord #%00000000_00001010 PushWord #%00000000_00001010
PushLong #taskREC PushLong #taskREC
_GetNextEvent _GetNextEvent
@ -437,10 +547,14 @@ antoine
beq laPREZ beq laPREZ
cmp #'3' cmp #'3'
bne ]lp bne ]lp
rts leJEU rts
laZIK jsr musique laZIK jsr musique
laPREZ jmp presentation laPREZ jmp presentation
*-----------
theTICK ds 4 ; le tick ˆ atteindre (tick + 5x60)
*----------------------- *-----------------------
* INIT - OK * INIT - OK
*----------------------- *-----------------------
@ -481,11 +595,11 @@ init_icones
@loadfile #pFOND;ptrFOND @loadfile #pFOND;ptrFOND
@loadfile #pICONES;ptrICONES @loadfile #pICONES;ptrICONES
PushLong ptrFOND ; sauvegarde le fond de la fen<65>tre PushLong ptrFOND
PushLong ptrCONTENT PushLong ptrCONTENT
PushLong #32768 PushLong #32768
_BlockMove _BlockMove
PushLong #0 PushLong #0
PushLong #0 PushLong #0
PushLong #wMAIN PushLong #wMAIN
@ -623,7 +737,7 @@ it_fin1 rep #$20
lda Debut lda Debut
sec sec
sbc texteDEBUT-4,y sbc texteDEBUT-4,y
dec dec ; on enl<6E>ve 1 ˆ la fin
sta texteLEN-4,y sta texteLEN-4,y
sep #$20 sep #$20
rts rts
@ -646,112 +760,6 @@ it_texte rep #$20
mx %00 mx %00
*-----------------------
* TEST_OBJETS
*-----------------------
* test_objets = affiche les objets possibles
test_objets stz textes_encore_presents
sep #$30
ldx #1
]lp stz icone_objets,x
inx
cpx #nombre_objets
bcc ]lp
beq ]lp
ldx #1
]lp lda deja_lu,x
cmp #FALSE
bne to_1
ldy condition,x
lda indicateur,y
cmp #TRUE
bne to_1
ldy objet,x
lda #TRUE
sta icone_objets,y
sta textes_encore_presents
to_1 inx
cpx #nombre_paragraphes
bcc ]lp
beq ]lp
rep #$30
*-------- Affichage des objets
ldx #1
]lp phx
lda icone_objets,x
and #$ff
cmp #TRUE
bne to_2
jsr affiche_objet
to_2 plx
inx
cpx #nombre_objets
bcc ]lp
beq ]lp
rts
*-----------------------
* TEST_PECHES
*-----------------------
* test_peches = affiche les peches possibles
test_peches sep #$30
ldx #1
]lp stz icone_peches,x
inx
cpx #nombre_peches
bcc ]lp
beq ]lp
ldx #1
]lp lda objet,x
cmp objet_selectionne
bne tp_1
lda deja_lu,x
cmp #FALSE
bne tp_1
ldy condition,x
lda indicateur,y
cmp #TRUE
bne tp_1
ldy peche,x
lda #TRUE
sta icone_peches,y
tp_1 inx
cpx #nombre_paragraphes
bcc ]lp
beq ]lp
rep #$30
*-------- Affichage des peches
ldx #1
]lp phx
lda icone_peches,x
and #$ff
cmp #TRUE
bne do_2
jsr affiche_peche
do_2 plx
inx
cpx #nombre_peches
bcc ]lp
beq ]lp
rts
*----------------------- *-----------------------
* RETOUR * RETOUR
*----------------------- *-----------------------
@ -803,7 +811,22 @@ ai_next inx
lda texte_selectionne lda texte_selectionne
bne ai_affiche bne ai_affiche
rts rts
ai_affiche jmp cree_fenetre
ai_affiche sep #$20
lda objet_selectionne
ora #'0'
sta pIMAGE+19
rep #$20
@loadfile #pIMAGE;ptrCONTENT
* @fadein ptrCONTENT;#TRUE
* PushLong ptrCONTENT
* PushLong ptrSCREEN
* PushLong #32768
* _BlockMove
jmp cree_fenetre
*----------------------- *-----------------------
* PRESENTATION - OK * PRESENTATION - OK
@ -1042,27 +1065,43 @@ carreRECT ds 2 ; y0
* A : objet * A : objet
* X : paragraphe * X : paragraphe
cree_fenetre delta_line = 2
lda #$0fff delta_ctl = 6
stal $019e1e
stal $e19e1e
* 1. les coordonnees de la fenetre cree_fenetre
* 1. les coordonnees de la fenetre et du controle
lda objet_selectionne lda objet_selectionne
asl asl
tax tax
lda fenetre_y,x lda fenetre_y,x
* sta winRECT sta fenetreRECT
clc
adc #delta_line
sta frameRECT
adc #delta_ctl
sta teRECT sta teRECT
lda fenetre_x,x lda fenetre_x,x
* sta winRECT+2 sta fenetreRECT+2
clc
adc #delta_line
sta frameRECT+2
adc #delta_ctl
sta teRECT+2 sta teRECT+2
lda fenetre_yy,x lda fenetre_yy,x
* sta winRECT+4 sta fenetreRECT+4
sec
sbc #delta_line
sta frameRECT+4
sbc #delta_ctl
sta teRECT+4 sta teRECT+4
lda fenetre_xx,x lda fenetre_xx,x
* sta winRECT+6 sta fenetreRECT+6
sec
sbc #delta_line
sta frameRECT+6
sbc #delta_ctl
sta teRECT+6 sta teRECT+6
* 2. on en deduit les dimensions du controle * 2. on en deduit les dimensions du controle
@ -1093,6 +1132,11 @@ cree_fenetre
* 4. on affiche le tout * 4. on affiche le tout
* PushLong #fenetreRECT
* PushWord #$ffff
* PushWord #$ffff
* _SpecialRect
PushLong #0 PushLong #0
PushLong wiMAIN PushLong wiMAIN
PushWord #refIsPointer PushWord #refIsPointer

View File

@ -127,9 +127,9 @@ fgRESTART = 2
tdc tdc
sta myDP sta myDP
lda #MES_DONNEES lda #ai_affiche
stal $300 stal $300
lda #^MES_DONNEES lda #^ai_affiche
stal $302 stal $302
*--- Version du systeme *--- Version du systeme
@ -200,6 +200,7 @@ okMEM1 sty ptrIMAGE
sty ptrUNPACK sty ptrUNPACK
stx ptrUNPACK+2 stx ptrUNPACK+2
stx ptrCONTENT+2 ; le fond de la fenêtre stx ptrCONTENT+2 ; le fond de la fenêtre
stx contentToSourceLocInfo+4
*--- Chargement des outils *--- Chargement des outils
@ -243,6 +244,8 @@ okSHADOW pha
sta fgSND sta fgSND
noSOUND _HideMenuBar noSOUND _HideMenuBar
_InitCursor
_HideCursor
PushWord #0 PushWord #0
PushWord #%11111111_11111111 PushWord #%11111111_11111111
@ -250,8 +253,6 @@ noSOUND _HideMenuBar
_FlushEvents _FlushEvents
pla pla
_InitCursor
* pha * pha
* pha * pha
* PushLong #0 * PushLong #0
@ -275,15 +276,23 @@ entryPOINT
jsr antoine ; on change ! jsr antoine ; on change !
jsr init2 jsr init2
* @fadein ptrFOND;#TRUE
*----------------------- *-----------------------
* MAIN * MAIN
*----------------------- *-----------------------
@fadein ptrFOND;#TRUE mainLOOP PushLong ptrFOND
PushLong ptrCONTENT
mainLOOP jsr test_fin PushLong #32768
_BlockMove
jsr test_fin
jsr test_objets jsr test_objets
refreshLOOP
jsr refreshME
*---------------------------------------- *----------------------------------------
* TASK MASTER * TASK MASTER
*---------------------------------------- *----------------------------------------
@ -310,17 +319,21 @@ taskLOOP inc VBLCounter0
asl asl
tax tax
jsr (taskTBL,x) jsr (taskTBL,x)
bra taskLOOP
* lda escape ; on a une condition de sortie cmp #$bdbd ; on a fini de consulter un texte
* cmp #FALSE beq mainLOOP
* bne main cmp #$bebe ; on voudrait consulter un texte
* beq refreshLOOP
* lda deplacement ; si on doit bouger, on fait un... bne taskLOOP ; sinon, on boucle standard
* ora fgSUITEFORCEE
* cmp #TRUE *----------------------------------- Le code habituel
* beq mainLOOP ; ...grand saut
* bne taskLOOP ; ...sinon on attend DEBUG sep #$20
ldal $c034
inc
stal $c034
rep #$20
rts
*----------------------------------- Gestion du keyDown *----------------------------------- Gestion du keyDown
* on gère les open-apple-qqch * on gère les open-apple-qqch
@ -382,21 +395,25 @@ doMOUSEUP lda objet_selectionne ; on a déjà un objet, saute
* 1. vérifie si on a cliqué dans un objet * 1. vérifie si on a cliqué dans un objet
jsr test_objet ; on teste jsr test_objet ; on teste si on a cliqué sur un objet
bcc domu_1 ; on a clique dans un objet bcc domu_1 ; on a clique dans un objet
lda #0
rts
domu_1 jsr test_peches ; on a clique dans un objet, affiche les peches qui correspondent
lda #$bebe ; il faudra rafraîchir l'écran
rts rts
domu_1 jmp test_peches ; on a clique dans un objet, affiche les peches qui correspondent
* 2. on a déjà un objet, a-t-on cliqué dans un péché ? * 2. on a déjà un objet, a-t-on cliqué dans un péché ?
domu_2 lda peche_selectionne ; on a aussi déjà un péché, saute domu_2 lda peche_selectionne ; on a aussi déjà un péché, saute
bne domu_4 bne domu_4
jsr test_peche ; on teste jsr test_peche ; on teste si on a cliqué sur un péché
bcc domu_3 bcc domu_3 ; on a cliqué dans un péché
lda #0
rts rts
domu_3 jmp aiguillage ; choisit le texte correspondant domu_3 jsr aiguillage ; choisit le texte correspondant
lda #$bebe ; il faudra rafraîchir l'écran
domu_4 rts domu_4 rts
*----------------------------------- Clic dans le contenu de la fenêtre *----------------------------------- Clic dans le contenu de la fenêtre
@ -405,16 +422,22 @@ doCONTENT lda texte_selectionne
bne doco_1 bne doco_1
rts rts
doco_1 stz texte_selectionne doco_1 jsr retour ; on marque le texte comme lu
* stz peche_selectionne stz peche_selectionne
* stz objet_selectionne stz objet_selectionne
stz texte_selectionne
PushLong haCONTROL PushLong haCONTROL ; on enlève le contrôle
_DisposeControl _DisposeControl
PushLong #0 stz haCONTROL
_RefreshDesktop stz haCONTROL+2
rts
stz taskWHERE
stz taskWHERE+2
lda #$bdbd ; il faut rafraîchir les objets !
rts ; et on revient
*----------------------------------- Gestion des controles *----------------------------------- Gestion des controles
@ -423,6 +446,34 @@ doCONTROL lda taskREC+38
tax tax
jmp (ctrlTBL,x) jmp (ctrlTBL,x)
*----------------------------------------
* RAFRAICHIT LES PALETTES ET LA FENETRE
*----------------------------------------
refreshME pea $0000 ; la palette
lda ptrCONTENT+2
pha
lda ptrCONTENT
clc
adc #32256
pha
_SetColorTable
lda #$0fff ; LOGO - force les couleurs en attendant !
stal $019e1e
stal $e19e1e
PushLong #0
_RefreshDesktop
PushWord #0
PushWord #%11111111_11111111
PushWord #0
_FlushEvents
pla
rts
*---------------------------------------- *----------------------------------------
* FENETRES * FENETRES
*---------------------------------------- *----------------------------------------
@ -438,17 +489,55 @@ PAINTMAIN phb
PushLong wiMAIN PushLong wiMAIN
_SetPort _SetPort
PushLong #fondToSourceLocInfo PushLong #contentToSourceLocInfo
PushLong #fondRect PushLong #contentRect
PushWord #0 PushWord #0
PushWord #0 PushWord #0
PushWord #modeCopy PushWord #modeCopy
_PPToPort _PPToPort
lda haCONTROL
ora haCONTROL+2
bne pm_ok
brl pm_none
pm_ok PushLong #curPATTERN
_GetPenPat
PushLong #curPENSIZE
_GetPenSize
PushLong #whitePATTERN
_SetPenPat
PushLong #fenetreRECT
PushWord #16
PushWord #16
_PaintRRect
PushLong #blackPATTERN
_SetPenPat
PushWord #2
PushWord #2
_SetPenSize
PushLong #frameRECT
PushWord #16
PushWord #16
_FrameRRect
PushWord curPENSIZE
PushWord curPENSIZE+2
_SetPenSize
PushLong #curPATTERN
_SetPenPat
PushLong wiMAIN PushLong wiMAIN
_DrawControls _DrawControls
_SetPort pm_none _SetPort
plb plb
rtl rtl
@ -1116,6 +1205,7 @@ loadBACK _HideCursor
PushLong ptrSCREEN PushLong ptrSCREEN
PushLong #32768 PushLong #32768
_BlockMove _BlockMove
_ShowCursor
rts rts
*--- Genere un nombre aleatoire *--- Genere un nombre aleatoire