working on aiguillage

This commit is contained in:
Antoine Vignau 2023-08-20 20:03:38 +02:00
parent f50fe0abdb
commit ab5da6cb27
6 changed files with 4654 additions and 4760 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -36,6 +36,9 @@ rvb5 ds 2
rvbA ds 2 rvbA ds 2
index_mot ds 2 ; un autre index qui pointe index_mot ds 2 ; un autre index qui pointe
nb_mots ds 2 ; nombre de mots dans la scene nb_mots ds 2 ; nombre de mots dans la scene
mot_clique ds 2 ; index du mot cliquŽ
mot_ancien ds 2 ; index du mot prŽcŽdemment cliquŽ
valeur_condition ds 2 ; valeur condition 2B xx ou 2D yy
aventure ds 2 aventure ds 2
nombre_scenes ds 2 nombre_scenes ds 2
scene_actuelle ds 2 scene_actuelle ds 2

View File

@ -865,7 +865,7 @@ doDIESE jsr next_index
*--- condition&(scene|,pointeur_mots|(scene|)) = *--- condition&(scene|,pointeur_mots|(scene|)) =
*--- ASC(MID$(ligne$,espace%+2,1))*VAL(MID$(ligne$,espace%+1,1)+"1") *--- ASC(MID$(ligne$,espace%+2,1))*VAL(MID$(ligne$,espace%+1,1)+"1")
*--- Ici, on ne fait pas le calcul de la version Atari pour le moment *--- Ici, on ne fait pas le calcul de la version Atari
jsr next_index jsr next_index
@ -1271,13 +1271,53 @@ nouvelle_scene
ns_99 rts ns_99 rts
*----------------------- *-----------------------
* CLIC_MOT * CLIC_MOT - OK
*----------------------- *-----------------------
* clic_mot * clic_mot
* on regarde sur quel mot on a cliquŽ
clic_mot clic_mot
lda taskWHERE+2 ; X
asl
tax
lda x_text,x
bpl tc_1
lda #0
tc_1 pha
lda taskWHERE ; Y
asl
tax
lda y_text,x
clc
adc 1,s
tax
pla
lda texte_index,x
and #$ff
bne tc_2
sec ; pas de mot
rts
tc_2 ldx mot_clique ; on sauvegarde l'ancien mot
stx mot_ancien
sta mot_clique ; et le nouveau
clc ; on a un mot
rts rts
*-----------------------
* AFFICHE_COMMENTAIRE
*-----------------------
* affiche_commentaire
affiche_commentaire
sep #$20
ldal $c034
inc
stal $c034
rep #$20
rts
*----------------------- *-----------------------
* SURLIGNER_MOT * SURLIGNER_MOT
*----------------------- *-----------------------
@ -1703,114 +1743,41 @@ sf_99 sta deplacement
strSUITE asc 'suite ' strSUITE asc 'suite '
*----------------------- *-----------------------
* TEST_CURSEUR * AIGUILLAGE
*----------------------- *-----------------------
* test_curseur * aiguille(scene)
* on regarde si le curseur se trouve sur un mot cliquable * parce que le tableau aiguillag existe
test_curseur aiguille cmp #0
lda taskWHERE+2 beq ai_false
sta x1
lda taskWHERE dec ; prend la scene
sta y1 pha ; calcul l'index dans la dimension NB_MOTS
lda #' '
sta strX1
sta strX1+2
sta strY1
sta strY1+2
sta strX2
sta strX2+2
sta strY2
sta strY2+2
sta strIDX
sta strIDX+2
lda taskWHERE+2 ; X
asl
tax
lda x_text,x
bpl tc_1
lda #0
tc_1 sta x2
pha pha
pha ; index de sc<73>ne
lda taskWHERE ; Y PushWord #NB_MOTS ; taille d'une dimension
asl _Multiply
tax pla
lda y_text,x clc ; 0=>0, 1=>25, 2=>50
sta y2 adc #aiguillage
sta dpFROM ; on pointe sur l'index du premier mot
clc pla
adc 1,s
tax
sta idx
pla ; on a l'index dans le texte
lda texte_index,x ldy mot_clique
dey
lda (dpFROM),y ; la prochaine sc<73>ne
and #$ff and #$ff
ora #'0' sta scene_actuelle
sep #$20
sta strHIT
rep #$20
PushWord x1
PushLong #strX1
PushWord #4
_Int2Hex
PushWord y1 lda #TRUE
PushLong #strY1 sta deplacement
PushWord #4 lda #FALSE
_Int2Hex sta fgSUITEFORCEE
rts
PushWord x2 ai_false lda #FALSE
PushLong #strX2 sta deplacement
PushWord #4 sta fgSUITEFORCEE
_Int2Hex
PushWord y2
PushLong #strY2
PushWord #4
_Int2Hex
PushWord idx
PushLong #strIDX
PushWord #4
_Int2Hex
PushWord #150
PushWord #150
_MoveTo
PushLong #string
_DrawCString
ldal KBD-1
bmi boum
rts rts
boum stal KBDSTROBE-1
lda #texte_index
brk $bd
x1 ds 2
y1 ds 2
x2 ds 2
y2 ds 2
idx ds 2
string asc 'X1='
strX1 asc ' '
asc ' Y1='
strY1 asc ' '
asc ' X2='
strX2 asc ' '
asc ' Y2='
strY2 asc ' '
asc ' IDX='
strIDX asc ' '
asc ' HIT='
strHIT asc ' '00
*----------------------- *-----------------------
* CHARGE_IMAGE - OK * CHARGE_IMAGE - OK
@ -1989,6 +1956,9 @@ help_str16 asc 'OA-Q : quitter le jeu'00
* mots_clicables(texte$) * mots_clicables(texte$)
mots_clicables mots_clicables
lda #-1 ; force un mot diffŽrent en entrŽe de sc<73>ne
sta mot_ancien
lda #0 ; on init les registres (mais pourquoi ?) lda #0 ; on init les registres (mais pourquoi ?)
tax tax
tay tay

View File

@ -297,8 +297,6 @@ mainLOOP lda scene_actuelle
taskLOOP inc VBLCounter0 taskLOOP inc VBLCounter0
jsr test_curseur
* PushWord #0 * PushWord #0
* PushWord #%11111111_11111111 * PushWord #%11111111_11111111
* PushLong #taskREC * PushLong #taskREC
@ -381,19 +379,23 @@ doMOUSEUP
lda scene_actuelle ; a-t-on des mots cliquables ? lda scene_actuelle ; a-t-on des mots cliquables ?
jsr suite_forcee jsr suite_forcee
lda fgSUITEFORCEE ; non, on sort lda fgSUITEFORCEE
cmp #FALSE cmp #FALSE
beq mup1 beq mup1
rts rts ; non, on sort
mup1 jsr clic_mot ; oui, on vérifie si on a cliqué sur un mot => mot$ mup1 jsr clic_mot ; oui, on vérifie si on a cliqué sur un mot => mot$
bcs mup9 ; on sort sans clic sur un mot bcc mup2 ; oui
jsr aiguillage ; on aiguille le joueur rts
lda #TRUE ; aiguillons les amis ! mup2 lda mot_clique ; a-t-on cliqué de nouveau sur le même mot ?
sta deplacement cmp mot_ancien
beq mup3
mup9 rts jsr affiche_commentaire
rts
mup3 lda scene_actuelle
jsr aiguille ; on aiguille le joueur si c'est le second clic
rts
*----------------------------------- *-----------------------------------
* AUTRES ROUTINES * AUTRES ROUTINES
@ -440,8 +442,7 @@ mainPORT ds 4
*----------------------------------- Open *----------------------------------- Open
doLOAD doLOAD jsr suspendMUSIC ; NTP off
jsr suspendMUSIC ; NTP off
jsr saveBACK jsr saveBACK
PushWord #30 PushWord #30
@ -465,8 +466,7 @@ doLOAD1
*----------------------------------- Save *----------------------------------- Save
doSAVE doSAVE jsr suspendMUSIC ; NTP off
jsr suspendMUSIC ; NTP off
jsr saveBACK jsr saveBACK
PushWord #25 PushWord #25
@ -594,8 +594,7 @@ saveIT
*----------------------------------- Restart - LOGO (must handle escape) *----------------------------------- Restart - LOGO (must handle escape)
doRESTART doRESTART jsr saveBACK
jsr saveBACK
PushWord #0 PushWord #0
PushWord #5 PushWord #5
@ -613,13 +612,11 @@ doRESTART
beq re1 beq re1
rts rts
re1 re1 jmp initialisation_relative
jmp initialisation_relative
*----------------------------------- Quit *----------------------------------- Quit
doQUIT doQUIT jsr saveBACK
jsr saveBACK
PushWord #0 PushWord #0
PushWord #5 PushWord #5
@ -639,8 +636,7 @@ doQUIT
*----------------------------------- Quit *----------------------------------- Quit
meQUIT meQUIT jsr stopNTP
jsr stopNTP
meQUIT0 meQUIT0
PushWord #refIsHandle PushWord #refIsHandle
@ -666,8 +662,7 @@ meQUIT1
* MEMOIRE * MEMOIRE
*---------------------------------------- *----------------------------------------
make64KB make64KB pha
pha
pha pha
PushLong #$010000 PushLong #$010000
PushWord myID PushWord myID

Binary file not shown.