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
winRECT dw 0 ; content rect
dw 0 ; content rect
dw 0
dw 200
dw 320
adrl $ffffffff
* adrl teCONTROL
ds 4
dw %00000000_00000000
@ -181,10 +180,11 @@ teRECT ds 8 ; rect
dw %00000000_00000101 ; textDescriptor
teTEXT ds 4 ; textRef
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_y dw 0,100,100,100,10,100,100,100,10,100

View File

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

View File

@ -127,9 +127,9 @@ fgRESTART = 2
tdc
sta myDP
lda #MES_DONNEES
lda #ai_affiche
stal $300
lda #^MES_DONNEES
lda #^ai_affiche
stal $302
*--- Version du systeme
@ -200,6 +200,7 @@ okMEM1 sty ptrIMAGE
sty ptrUNPACK
stx ptrUNPACK+2
stx ptrCONTENT+2 ; le fond de la fenêtre
stx contentToSourceLocInfo+4
*--- Chargement des outils
@ -243,6 +244,8 @@ okSHADOW pha
sta fgSND
noSOUND _HideMenuBar
_InitCursor
_HideCursor
PushWord #0
PushWord #%11111111_11111111
@ -250,8 +253,6 @@ noSOUND _HideMenuBar
_FlushEvents
pla
_InitCursor
* pha
* pha
* PushLong #0
@ -275,15 +276,23 @@ entryPOINT
jsr antoine ; on change !
jsr init2
* @fadein ptrFOND;#TRUE
*-----------------------
* MAIN
*-----------------------
@fadein ptrFOND;#TRUE
mainLOOP jsr test_fin
mainLOOP PushLong ptrFOND
PushLong ptrCONTENT
PushLong #32768
_BlockMove
jsr test_fin
jsr test_objets
refreshLOOP
jsr refreshME
*----------------------------------------
* TASK MASTER
*----------------------------------------
@ -310,17 +319,21 @@ taskLOOP inc VBLCounter0
asl
tax
jsr (taskTBL,x)
bra taskLOOP
* lda escape ; on a une condition de sortie
* cmp #FALSE
* bne main
*
* lda deplacement ; si on doit bouger, on fait un...
* ora fgSUITEFORCEE
* cmp #TRUE
* beq mainLOOP ; ...grand saut
* bne taskLOOP ; ...sinon on attend
cmp #$bdbd ; on a fini de consulter un texte
beq mainLOOP
cmp #$bebe ; on voudrait consulter un texte
beq refreshLOOP
bne taskLOOP ; sinon, on boucle standard
*----------------------------------- Le code habituel
DEBUG sep #$20
ldal $c034
inc
stal $c034
rep #$20
rts
*----------------------------------- Gestion du keyDown
* 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
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
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
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é ?
domu_2 lda peche_selectionne ; on a aussi déjà un péché, saute
bne domu_4
jsr test_peche ; on teste
bcc domu_3
jsr test_peche ; on teste si on a cliqué sur un péché
bcc domu_3 ; on a cliqué dans un péché
lda #0
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
*----------------------------------- Clic dans le contenu de la fenêtre
@ -405,16 +422,22 @@ doCONTENT lda texte_selectionne
bne doco_1
rts
doco_1 stz texte_selectionne
* stz peche_selectionne
* stz objet_selectionne
doco_1 jsr retour ; on marque le texte comme lu
stz peche_selectionne
stz objet_selectionne
stz texte_selectionne
PushLong haCONTROL
PushLong haCONTROL ; on enlève le contrôle
_DisposeControl
PushLong #0
_RefreshDesktop
rts
stz haCONTROL
stz haCONTROL+2
stz taskWHERE
stz taskWHERE+2
lda #$bdbd ; il faut rafraîchir les objets !
rts ; et on revient
*----------------------------------- Gestion des controles
@ -423,6 +446,34 @@ doCONTROL lda taskREC+38
tax
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
*----------------------------------------
@ -438,17 +489,55 @@ PAINTMAIN phb
PushLong wiMAIN
_SetPort
PushLong #fondToSourceLocInfo
PushLong #fondRect
PushLong #contentToSourceLocInfo
PushLong #contentRect
PushWord #0
PushWord #0
PushWord #modeCopy
_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
_DrawControls
_SetPort
pm_none _SetPort
plb
rtl
@ -1116,6 +1205,7 @@ loadBACK _HideCursor
PushLong ptrSCREEN
PushLong #32768
_BlockMove
_ShowCursor
rts
*--- Genere un nombre aleatoire