engine done

This commit is contained in:
Antoine Vignau 2024-02-05 23:40:05 +01:00
parent 195e60f911
commit f8b90dbc6c
7 changed files with 4733 additions and 4939 deletions

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -77,50 +77,58 @@ tblUPPER hex 000102030405060708090A0B0C0D0E0F
* DATA * DATA
*----------------------- *-----------------------
DEBUT_DATA = *
*--- Mes variables
fgTHEEND ds 2 ; LOGO
i ds 2
j ds 2
index ds 2
theA ds 2
theX ds 2
theY ds 2
*--- Variables du jeu
nombre_indicateurs = 18 ; NOMBRE MAXI D'INDICATEURS nombre_indicateurs = 18 ; NOMBRE MAXI D'INDICATEURS
nombre_paragraphes = 65 ; NOMBRE MAXI DE TEXTES nombre_paragraphes = 65 ; NOMBRE MAXI DE TEXTES
nombre_objets = 8 ; NOMBRE D'OBJETS nombre_objets = 8 ; NOMBRE D'OBJETS
nombre_peches = 7 ; NOMBRE DE PECHES nombre_peches = 7 ; NOMBRE DE PECHES
indicateur ds nombre_indicateurs+1 *--- Les variables globales
objet ds nombre_paragraphes+1
peche ds nombre_paragraphes+1 MES_DONNEES = *
condition ds nombre_paragraphes+1
consequence ds nombre_paragraphes+1 asc "OBJET"
deja_lu ds nombre_paragraphes+1 objet ds nombre_paragraphes+3 ; +2 pour couvrir le texte de fin
asc "PECHE"
peche ds nombre_paragraphes+3
asc "CONDITION"
condition ds nombre_paragraphes+3
asc "CONSEQUENCE"
consequence ds nombre_paragraphes+3
asc "TEXTEDEBUT"
texteDEBUT ds 4 texteDEBUT ds 4
ds nombre_paragraphes*4 ; long ds nombre_paragraphes*4 ; long
ds 4 ; la fin
ds 4 ; fin de fichier
asc "TEXTELEN"
texteLEN ds 4 texteLEN ds 4
ds nombre_paragraphes*4 ; long ds nombre_paragraphes*4 ; long
ds 4 ; la fin
ds 4 ; toujours 0
MES_DONNEES = * ; on dŽmarre l'index ˆ 1... *--- Les variables qui s'effacent
DEBUT_DATA = *
i ds 2
j ds 2
index ds 2
theY ds 2
*--- Variables du jeu
asc "INDICATEUR"
indicateur ds nombre_indicateurs+1
asc "DEJA_LU"
deja_lu ds nombre_paragraphes+3
asc "ICONE_OBJETS" asc "ICONE_OBJETS"
icone_objets ds nombre_objets+1 ; ICONES ALLUM<55>ES OU ETEINTES icone_objets ds nombre_objets+1 ; ICONES ALLUM<55>ES OU ETEINTES
asc "ICONE_PECHES" asc "ICONE_PECHES"
icone_peches ds nombre_peches+1 icone_peches ds nombre_peches+1
asc "OBJET_SELECTIONNE"
objet_selectionne ds 2 ; l'objet selectionne objet_selectionne ds 2 ; l'objet selectionne
asc "PECHE_SELECTIONNE"
peche_selectionne ds 2 ; le peche selectionne peche_selectionne ds 2 ; le peche selectionne
asc "TEXTE_SELECTIONNE"
texte_selectionne ds 2 ; le texte ˆ afficher texte_selectionne ds 2 ; le texte ˆ afficher
asc "TEXTES_ENCORE_PRESENTS"
textes_encore_presents ds 2 ; false or true textes_encore_presents ds 2 ; false or true
FIN_DATA = * FIN_DATA = *

View File

@ -38,21 +38,6 @@ soundadrh = $3f ; $c03f
jsr cree_fenetre jsr cree_fenetre
eom eom
*-----------------------
* DATA_ERROR - OK
*-----------------------
* data_error
data_error pha
PushLong #pgmSTR1
PushLong #pgmSTR2
PushLong #errSTR3
PushLong #errSTR2
_TLTextMountVolume
pla
sec
rts
*----------------------- *-----------------------
* LOAD_TEXTE - OK * LOAD_TEXTE - OK
*----------------------- *-----------------------
@ -110,12 +95,20 @@ lt_err1 jsl GSOS
lt_err2 rts lt_err2 rts
*----------------------- *-----------------------
* TEST LA FIN DU JEU * TEST_FIN - OK
*----------------------- *-----------------------
* test_fin = a-t-on parcouru tous les textes ?
test_fin test_fin lda textes_encore_presents
beq tf_gagne
rts rts
tf_gagne lda #nombre_objets+1
sta objet_selectionne
lda #nombre_paragraphes+1
sta texte_selectionne
jmp cree_fenetre
*----------------------- *-----------------------
* TEST_OBJETS * TEST_OBJETS
*----------------------- *-----------------------
@ -486,27 +479,13 @@ tblLANG asc 'us' ; 0
asc 'hi' asc 'hi'
asc 'us' ; 19 asc 'us' ; 19
*-----------------------
* THE_END - OK
*-----------------------
* the_end
the_end
* @cree_fenetre #9;pointeur_paragraphes
* jsr pre_scrolling
PushWord #0
_ClearScreen
lda #TRUE
sta fgTHEEND
rts
*----------------------- *-----------------------
* CHOIX D'ENTREE - OK * CHOIX D'ENTREE - OK
*----------------------- *-----------------------
antoine antoine PushWord #$ffff
_ClearScreen
@t #strMENU1;#10 @t #strMENU1;#10
@t #strMENU2;#12 @t #strMENU2;#12
@t #strMENU3;#14 @t #strMENU3;#14
@ -560,31 +539,27 @@ theTICK ds 4 ; le tick
*----------------------- *-----------------------
* init * init
init PushWord #$ffff init jsr init_icones
_ClearScreen jsr init_souris
rts jsr load_texte
jsr init_texte
jmp mouse_on
*----------------------- *-----------------------
* INIT2 - OK * INIT2 - OK
*----------------------- *-----------------------
init2 init2 sep #$20
* ldx #FIN_DATA-DEBUT_DATA
*]lp stz fgTHEEND,x
* dex
* bne ]lp
ldx #0 ; l'indicateur 0 est toujours vrai ldx #FIN_DATA-DEBUT_DATA
sep #$20 ]lp stz DEBUT_DATA,x
lda #TRUE dex
bne ]lp
lda #TRUE ; l'indicateur 0 est toujours vrai
sta indicateur,x sta indicateur,x
rep #$20 rep #$20
rts
jsr init_icones
jsr init_souris
jsr load_texte
jsr init_texte
jmp mouse_on
*----------------------- *-----------------------
* INIT_ICONES - OK * INIT_ICONES - OK
@ -648,7 +623,7 @@ it_ok jsr it_fin ; le pointeur de fin
jsr it_texte ; le pointeur du texte jsr it_texte ; le pointeur du texte
inx inx
cpx #nombre_paragraphes cpx #nombre_paragraphes+2 ; pour traiter la fin
bcc ]lp bcc ]lp
beq ]lp beq ]lp
@ -1104,19 +1079,7 @@ cree_fenetre
sbc #delta_ctl sbc #delta_ctl
sta teRECT+6 sta teRECT+6
* 2. on en deduit les dimensions du controle * 2. on ajoute le texte et sa longueur
* lda fenetre_yy,x
* sec
* sbc fenetre_y,x
* sta teRECT+4
*
* lda fenetre_xx,x
* sec
* sbc fenetre_x,x
* sta teRECT+6
* 3. on ajoute le texte et sa longueur
lda texte_selectionne lda texte_selectionne
asl asl
@ -1130,30 +1093,14 @@ cree_fenetre
lda texteLEN,x lda texteLEN,x
sta teLEN sta teLEN
* 4. on affiche le tout * 3. on affiche le tout
* PushLong #fenetreRECT
* PushWord #$ffff
* PushWord #$ffff
* _SpecialRect
PushLong #0 PushLong #0
PushLong wiMAIN PushLong wiMAIN
PushWord #refIsPointer PushWord #refIsPointer
PushLong #teCONTROL PushLong #teCONTROL
_NewControl2 _NewControl2
PullLong haCONTROL PullLong haCONTROL
* PushLong #0
* PushLong #0
* PushLong #wMAIN
* PushLong #PAINTMAIN
* PushLong #0
* PushWord #refIsPointer
* PushLong #theWINDOW
* PushWord #$800e
* _NewWindow2
* PullLong wiMAIN
rts rts
*----------------------- *-----------------------

View File

@ -127,9 +127,9 @@ fgRESTART = 2
tdc tdc
sta myDP sta myDP
lda #ai_affiche lda #MES_DONNEES
stal $300 stal $300
lda #^ai_affiche lda #^MES_DONNEES
stal $302 stal $302
*--- Version du systeme *--- Version du systeme
@ -253,18 +253,6 @@ noSOUND _HideMenuBar
_FlushEvents _FlushEvents
pla pla
* pha
* pha
* PushLong #0
* PushLong #wMAIN
* PushLong #PAINTMAIN
* PushLong #0
* PushWord #refIsResource
* PushLong #wMAIN
* PushWord #$800e
* _NewWindow2
* PullLong wiMAIN
*---------------------------------------- *----------------------------------------
* INITIALISATIONS * INITIALISATIONS
*---------------------------------------- *----------------------------------------
@ -272,12 +260,12 @@ noSOUND _HideMenuBar
entryPOINT entryPOINT
jsr TWILIGHToff jsr TWILIGHToff
jsr set_language jsr set_language
jsr antoine ; le menu principal
jsr init jsr init
jsr antoine ; on change !
restartPOINT
jsr init2 jsr init2
* @fadein ptrFOND;#TRUE
*----------------------- *-----------------------
* MAIN * MAIN
*----------------------- *-----------------------
@ -287,9 +275,9 @@ mainLOOP PushLong ptrFOND
PushLong #32768 PushLong #32768
_BlockMove _BlockMove
jsr test_fin
jsr test_objets jsr test_objets
jsr test_fin
refreshLOOP refreshLOOP
jsr refreshME jsr refreshME
@ -315,25 +303,18 @@ taskLOOP inc VBLCounter0
_TaskMaster _TaskMaster
pla pla
beq taskLOOP beq taskLOOP
asl asl
tax tax
jsr (taskTBL,x) jsr (taskTBL,x)
cmp #$bcbc ; on recommence
beq restartPOINT
cmp #$bdbd ; on a fini de consulter un texte cmp #$bdbd ; on a fini de consulter un texte
beq mainLOOP beq mainLOOP
cmp #$bebe ; on voudrait consulter un texte cmp #$bebe ; on voudrait consulter un texte
beq refreshLOOP beq refreshLOOP
bne taskLOOP ; sinon, on boucle standard bra taskLOOP ; sinon, on boucle standard
*----------------------------------- Le code habituel
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
@ -377,7 +358,7 @@ tblKEYVALUE
asc 'Zz' asc 'Zz'
asc '*' asc '*'
hex ff hex ff
tblKEYADDRESS tblKEYADDRESS
da doQUIT,doQUIT,doLOAD,doLOAD,doSAVE,doSAVE da doQUIT,doQUIT,doLOAD,doLOAD,doSAVE,doSAVE
da doRESTART,doRESTART da doRESTART,doRESTART
@ -390,7 +371,12 @@ doMUSIK rts
* on compare les coordonnées avec celles du incontent * on compare les coordonnées avec celles du incontent
* si dans le même rectangle, on traite * si dans le même rectangle, on traite
doMOUSEUP lda objet_selectionne ; on a déjà un objet, saute doMOUSEUP lda textes_encore_presents ; on a fini le jeu
bne domu_0
lda #$bcbc
rts
domu_0 lda objet_selectionne ; on a déjà un objet, saute
bne domu_2 bne domu_2
* 1. vérifie si on a cliqué dans un objet * 1. vérifie si on a cliqué dans un objet
@ -399,7 +385,7 @@ doMOUSEUP lda objet_selectionne ; on a déjà un objet, saute
bcc domu_1 ; on a clique dans un objet bcc domu_1 ; on a clique dans un objet
lda #0 lda #0
rts rts
domu_1 jsr test_peches ; on a clique dans un objet, affiche les peches qui correspondent domu_1 jsr test_peches ; on a clique dans un objet, affiche les peches correspondants
lda #$bebe ; il faudra rafraîchir l'écran lda #$bebe ; il faudra rafraîchir l'écran
rts rts
@ -416,18 +402,32 @@ domu_3 jsr aiguillage ; choisit le texte correspondant
lda #$bebe ; il faudra rafraîchir l'écran lda #$bebe ; il faudra rafraîchir l'écran
domu_4 rts domu_4 rts
*----------------------------------- Gestion des controles
doCONTROL lda taskREC+38
asl
tax
jmp (ctrlTBL,x)
*----------------------------------- Clic dans le contenu de la fenêtre *----------------------------------- Clic dans le contenu de la fenêtre
doCONTENT lda texte_selectionne doCONTENT lda textes_encore_presents
bne doco_1 bne doco_1
jsr doco_3 ; detruit le controle
lda #$bcbc ; et force l'init
rts rts
doco_1 jsr retour ; on marque le texte comme lu doco_1 lda texte_selectionne
bne doco_2
rts
doco_2 jsr retour ; on marque le texte comme lu
stz peche_selectionne stz peche_selectionne
stz objet_selectionne stz objet_selectionne
stz texte_selectionne stz texte_selectionne
PushLong haCONTROL ; on enlève le contrôle doco_3 PushLong haCONTROL ; on enlève le contrôle
_DisposeControl _DisposeControl
stz haCONTROL stz haCONTROL
@ -439,13 +439,6 @@ doco_1 jsr retour ; on marque le texte comme lu
lda #$bdbd ; il faut rafraîchir les objets ! lda #$bdbd ; il faut rafraîchir les objets !
rts ; et on revient rts ; et on revient
*----------------------------------- Gestion des controles
doCONTROL lda taskREC+38
asl
tax
jmp (ctrlTBL,x)
*---------------------------------------- *----------------------------------------
* RAFRAICHIT LES PALETTES ET LA FENETRE * RAFRAICHIT LES PALETTES ET LA FENETRE
*---------------------------------------- *----------------------------------------
@ -568,10 +561,25 @@ doLOAD
rts rts
doLOAD1 jsr copyPATH doLOAD1 jsr copyPATH
jsr loadALL
bcc doLOAD2 jsl GSOS
rts dw $2010
doLOAD2 rts adrl proOPENGAME
bcs loadKO99
lda proOPENGAME+2
sta proREADGAME+2
sta proCLOSE+2
jsl GSOS
dw $2012
adrl proREADGAME
jsl GSOS
dw $2014
adrl proCLOSE
loadKO99 rts
*----------------------------------- Save *----------------------------------- Save
@ -595,48 +603,8 @@ doSAVE
rts rts
doSAVE1 jsr copyPATH doSAVE1 jsr copyPATH
jmp saveALL
*--- Recopie le filename du fichier de sauvegarde
copyPATH sep #$20
ldx #16-1
]lp lda namePATH1,x
sta pGAME+4,x
dex
bpl ]lp
lda namePATH
inc
inc
sta pGAME
rep #$20
rts
*--- Charge le fichier de sauvegarde en mémoire
loadALL jsl GSOS
dw $2010
adrl proOPENGAME
bcs loadKO99
lda proOPENGAME+2
sta proREADGAME+2
sta proCLOSE+2
jsl GSOS
dw $2012
adrl proREADGAME
jsl GSOS jsl GSOS
dw $2014
adrl proCLOSE
loadKO99 rts
*--- Enregistre le fichier de sauvegarde
saveALL jsl GSOS
dw $2002 dw $2002
adrl proDESTROYGAME adrl proDESTROYGAME
@ -663,6 +631,22 @@ saveALL jsl GSOS
adrl proCLOSE adrl proCLOSE
saveKO99 rts saveKO99 rts
*--- Recopie le filename du fichier de sauvegarde
copyPATH sep #$20
ldx #16-1
]lp lda namePATH1,x
sta pGAME+4,x
dex
bpl ]lp
lda namePATH
inc
inc
sta pGAME
rep #$20
rts
*----------------------------------- Restart *----------------------------------- Restart
@ -685,11 +669,7 @@ doRESTART
beq re1 beq re1
* jmp resumeMUSIC ; NTP on * jmp resumeMUSIC ; NTP on
re1 re1 lda #$bcbc
* jsr fin_aventure
* jsr initialisation_absolue
* lda #fgRESTART
* sta escape
rts rts
*----------------------------------- Quit *----------------------------------- Quit
@ -1413,41 +1393,12 @@ taskTBL da doNOT ; 0 Null
da doNOT ; wInCalledSysEdit da doNOT ; wInCalledSysEdit
da doNOT ; wInTrackZoom da doNOT ; wInTrackZoom
da doNOT ; wInHitFrame da doNOT ; wInHitFrame
da doNOT ; wInControl da doCONTROL ; wInControl
da doNOT ; wInControlMenu da doNOT ; wInControlMenu
ctrlTBL da doNOT ctrlTBL da doNOT ; 0
da doNOT da doNOT ; 1 - textedit
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 * STD FILE
*---------------------------------------- *----------------------------------------
@ -1528,7 +1479,7 @@ proCREATEGAME
adrl pGAME ; pathname adrl pGAME ; pathname
dw $c3 ; access_code dw $c3 ; access_code
dw $5d ; file_type dw $5d ; file_type
adrl $8020 ; aux_type adrl $8021 ; aux_type
ds 2 ; storage_type ds 2 ; storage_type
ds 4 ; eof ds 4 ; eof
ds 4 ; resource_eof ds 4 ; resource_eof