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
*-----------------------
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_paragraphes = 65 ; NOMBRE MAXI DE TEXTES
nombre_objets = 8 ; NOMBRE D'OBJETS
nombre_peches = 7 ; NOMBRE DE PECHES
indicateur ds nombre_indicateurs+1
objet ds nombre_paragraphes+1
peche ds nombre_paragraphes+1
condition ds nombre_paragraphes+1
consequence ds nombre_paragraphes+1
deja_lu ds nombre_paragraphes+1
*--- Les variables globales
MES_DONNEES = *
asc "OBJET"
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
ds nombre_paragraphes*4 ; long
ds 4 ; la fin
ds 4 ; fin de fichier
asc "TEXTELEN"
texteLEN ds 4
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"
icone_objets ds nombre_objets+1 ; ICONES ALLUM<55>ES OU ETEINTES
asc "ICONE_PECHES"
icone_peches ds nombre_peches+1
asc "OBJET_SELECTIONNE"
objet_selectionne ds 2 ; l'objet selectionne
asc "PECHE_SELECTIONNE"
peche_selectionne ds 2 ; le peche selectionne
asc "TEXTE_SELECTIONNE"
texte_selectionne ds 2 ; le texte ˆ afficher
asc "TEXTES_ENCORE_PRESENTS"
textes_encore_presents ds 2 ; false or true
FIN_DATA = *

View File

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

View File

@ -127,9 +127,9 @@ fgRESTART = 2
tdc
sta myDP
lda #ai_affiche
lda #MES_DONNEES
stal $300
lda #^ai_affiche
lda #^MES_DONNEES
stal $302
*--- Version du systeme
@ -253,18 +253,6 @@ noSOUND _HideMenuBar
_FlushEvents
pla
* pha
* pha
* PushLong #0
* PushLong #wMAIN
* PushLong #PAINTMAIN
* PushLong #0
* PushWord #refIsResource
* PushLong #wMAIN
* PushWord #$800e
* _NewWindow2
* PullLong wiMAIN
*----------------------------------------
* INITIALISATIONS
*----------------------------------------
@ -272,12 +260,12 @@ noSOUND _HideMenuBar
entryPOINT
jsr TWILIGHToff
jsr set_language
jsr antoine ; le menu principal
jsr init
jsr antoine ; on change !
restartPOINT
jsr init2
* @fadein ptrFOND;#TRUE
*-----------------------
* MAIN
*-----------------------
@ -287,9 +275,9 @@ mainLOOP PushLong ptrFOND
PushLong #32768
_BlockMove
jsr test_fin
jsr test_objets
jsr test_fin
refreshLOOP
jsr refreshME
@ -315,25 +303,18 @@ taskLOOP inc VBLCounter0
_TaskMaster
pla
beq taskLOOP
asl
tax
jsr (taskTBL,x)
cmp #$bcbc ; on recommence
beq restartPOINT
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
bra taskLOOP ; sinon, on boucle standard
*----------------------------------- Gestion du keyDown
* on gère les open-apple-qqch
@ -377,7 +358,7 @@ tblKEYVALUE
asc 'Zz'
asc '*'
hex ff
tblKEYADDRESS
da doQUIT,doQUIT,doLOAD,doLOAD,doSAVE,doSAVE
da doRESTART,doRESTART
@ -390,7 +371,12 @@ doMUSIK rts
* on compare les coordonnées avec celles du incontent
* 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
* 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
lda #0
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
rts
@ -416,18 +402,32 @@ domu_3 jsr aiguillage ; choisit le texte correspondant
lda #$bebe ; il faudra rafraîchir l'écran
domu_4 rts
*----------------------------------- Gestion des controles
doCONTROL lda taskREC+38
asl
tax
jmp (ctrlTBL,x)
*----------------------------------- Clic dans le contenu de la fenêtre
doCONTENT lda texte_selectionne
doCONTENT lda textes_encore_presents
bne doco_1
jsr doco_3 ; detruit le controle
lda #$bcbc ; et force l'init
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 objet_selectionne
stz texte_selectionne
PushLong haCONTROL ; on enlève le contrôle
doco_3 PushLong haCONTROL ; on enlève le contrôle
_DisposeControl
stz haCONTROL
@ -439,13 +439,6 @@ doco_1 jsr retour ; on marque le texte comme lu
lda #$bdbd ; il faut rafraîchir les objets !
rts ; et on revient
*----------------------------------- Gestion des controles
doCONTROL lda taskREC+38
asl
tax
jmp (ctrlTBL,x)
*----------------------------------------
* RAFRAICHIT LES PALETTES ET LA FENETRE
*----------------------------------------
@ -568,10 +561,25 @@ doLOAD
rts
doLOAD1 jsr copyPATH
jsr loadALL
bcc doLOAD2
rts
doLOAD2 rts
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
dw $2014
adrl proCLOSE
loadKO99 rts
*----------------------------------- Save
@ -595,48 +603,8 @@ doSAVE
rts
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
dw $2014
adrl proCLOSE
loadKO99 rts
*--- Enregistre le fichier de sauvegarde
saveALL jsl GSOS
dw $2002
adrl proDESTROYGAME
@ -663,6 +631,22 @@ saveALL jsl GSOS
adrl proCLOSE
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
@ -685,11 +669,7 @@ doRESTART
beq re1
* jmp resumeMUSIC ; NTP on
re1
* jsr fin_aventure
* jsr initialisation_absolue
* lda #fgRESTART
* sta escape
re1 lda #$bcbc
rts
*----------------------------------- Quit
@ -1413,41 +1393,12 @@ taskTBL da doNOT ; 0 Null
da doNOT ; wInCalledSysEdit
da doNOT ; wInTrackZoom
da doNOT ; wInHitFrame
da doNOT ; wInControl
da doCONTROL ; 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
ctrlTBL da doNOT ; 0
da doNOT ; 1 - textedit
*----------------------------------------
* STD FILE
*----------------------------------------
@ -1528,7 +1479,7 @@ proCREATEGAME
adrl pGAME ; pathname
dw $c3 ; access_code
dw $5d ; file_type
adrl $8020 ; aux_type
adrl $8021 ; aux_type
ds 2 ; storage_type
ds 4 ; eof
ds 4 ; resource_eof