Skip to content

Commit 976f51f

Browse files
committed
Suprresion des liens symboliques
1 parent dc56d89 commit 976f51f

5 files changed

Lines changed: 271 additions & 1 deletion

File tree

Changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2025-10-20
2+
Suppression des liens symboliques externes
3+
14
2025-10-16
25
Modifications:
36
- CLEAR: ajout de CLEAR ALL | DATABASE

lib/dbf.lib

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/dbf.lib

374 KB
Binary file not shown.

lib/fns.lib

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/fns.lib

220 KB
Binary file not shown.

lib/readline.lib

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/readline.lib

51.2 KB
Binary file not shown.

macros/readline.mac

Lines changed: 0 additions & 1 deletion
This file was deleted.

macros/readline.mac

Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
.ifndef _READLINE_MAC_
2+
SDK::_inputstr_ .set 0
3+
4+
;----------------------------------------------------------------------
5+
;
6+
; usage:
7+
; input prompt [, len [, var]]
8+
;
9+
; note:
10+
; - prompt may be: "string", var
11+
; - len may be: value, var
12+
; if var, will receive the input length on return (X register)
13+
; - var if present will receive the buffer address (AY registers)
14+
;
15+
; Call readline function
16+
;----------------------------------------------------------------------
17+
.macro input prompt, len, var
18+
19+
.ifnblank prompt
20+
.if (.match(.left(1, {prompt}), {"\""}) )
21+
22+
.if .strlen(prompt) > 0
23+
; Le test est inutile, ca65 remontera une erreur avant
24+
.if .match(.right(1,{prompt}), {"\""})
25+
26+
lda #<.ident(.sprintf("_inputstr%d", SDK::_inputstr_))
27+
ldy #>.ident(.sprintf("_inputstr%d", SDK::_inputstr_))
28+
29+
.pushseg
30+
.segment "RODATA"
31+
.ident(.sprintf("_inputstr%d", SDK::_inputstr_)):
32+
.asciiz prompt
33+
.popseg
34+
35+
SDK::_inputstr_ .set SDK::_inputstr_+1
36+
.else
37+
.out "Erreur: '\"' manquant"
38+
.endif
39+
.else
40+
.out "***empty prompt"
41+
lda #$00
42+
ldy #$00
43+
.endif
44+
.else
45+
lda #<prompt
46+
ldy #>prompt
47+
.endif
48+
.else
49+
lda #$00
50+
ldy #$00
51+
.endif
52+
53+
.ifnblank len
54+
.if .const(len)
55+
ldx #len
56+
.else
57+
ldx len
58+
.endif
59+
.else
60+
ldx #$00
61+
.endif
62+
63+
jsr readline
64+
65+
.ifnblank var
66+
sta var
67+
sty var+1
68+
.endif
69+
70+
.ifnblank len
71+
.if .not .const(len)
72+
stx len
73+
.endif
74+
.endif
75+
.endmacro
76+
77+
;----------------------------------------------------------------------
78+
;
79+
; usage:
80+
;
81+
; Call readline function
82+
;----------------------------------------------------------------------
83+
.macro lineinput col, row, fill_char, len, var
84+
.out .sprintf("paramcount = %d", .paramcount)
85+
.out .sprintf("tcount = %d", .tcount(col))
86+
87+
.if (.match(.left(1, {col}), {""}) )
88+
.out "string"
89+
.endif
90+
91+
.if .paramcount = 5
92+
; lineinput col, row, fill_char, len var
93+
gotoxy col, row
94+
95+
.ifnblank fill_char
96+
set_option 1, fill_char
97+
.endif
98+
99+
input "", len, var
100+
101+
.elseif .paramcount = 3
102+
; lineinput fill_char, len, var
103+
.ifnblank col
104+
set_option 1, col
105+
.endif
106+
107+
input "", row, fill_char
108+
109+
.elseif .paramcount = 2
110+
; lineinput len, var
111+
input "", col, row
112+
113+
.elseif .paramcount = 1
114+
; lineinput var
115+
input "", 0, col
116+
117+
.elseif .paramcount = 0
118+
; lineinput
119+
input
120+
.endif
121+
122+
.endmacro
123+
124+
;---------------------------------------------------------------------------
125+
;
126+
;---------------------------------------------------------------------------
127+
.macro set_option option, value
128+
.local _option_, _value_
129+
130+
; 1: fill char
131+
; A := char
132+
; 2: prompt
133+
; AY := prompt address
134+
; 3: hidden input
135+
; A := $40 -> On, $bf -> Off
136+
; no clear screen
137+
; A := $01 -> Off, $fe -> Off
138+
; return if cc
139+
; A := $02 -> On, $fd -> Off
140+
; return if cs
141+
; A := $04 -> On, $fb -> Off
142+
; autoexit
143+
; A := $08 -> On, $f7 -> Off
144+
145+
.if .xmatch({value}, on) .or .xmatch({value}, ON)
146+
.out "on"
147+
_value_ .set $00
148+
149+
.elseif .xmatch({value}, off) .or .xmatch({value}, OFF)
150+
.out "off"
151+
_value_ .set $ff
152+
153+
.else
154+
.out .sprintf("autre: %s", .string(value))
155+
.ifconst value
156+
_value_ .set value
157+
.endif
158+
.endif
159+
160+
.if .xmatch({option}, hidden_char) .or .xmatch({option}, HIDDEN_CHAR)
161+
.out "hidden_char"
162+
_option_ .set 0
163+
164+
.elseif .xmatch({option}, fill_char) .or .xmatch({option}, FILL_CHAR)
165+
.out "fill_char"
166+
_option_ .set 1
167+
168+
.elseif .xmatch({option}, fill_buffer) .or .xmatch({option}, FILL_BUFFER)
169+
; b7
170+
.out "fill_buffer"
171+
_option_ .set 2
172+
;_value_ = $80
173+
174+
.elseif .xmatch({option}, password_mode) .or .xmatch({option}, PASSWORD_MODE)
175+
; b6
176+
.out "password mode"
177+
_option_ .set 3
178+
_value_ .set _value_ ^ $40
179+
180+
.elseif .xmatch({option}, no_cls) .or .xmatch({option}, NO_CLS)
181+
; b0
182+
.out "no_cls"
183+
_option_ .set 3
184+
_value_ .set _value_ ^ $01
185+
186+
.elseif .xmatch({option}, return_if_cc) .or .xmatch({option}, RETURN_IF_CC)
187+
; b1
188+
.out "return if cc"
189+
_option_ .set 3
190+
_value_ .set _value_ ^ $02
191+
192+
.elseif .xmatch({option}, return_if_cs) .or .xmatch({option}, RETURN_IF_CS)
193+
; b2
194+
.out "return if cs"
195+
_option_ .set 3
196+
_value_ .set _value_ ^ $04
197+
198+
.elseif .xmatch({option}, autoexit) .or .xmatch({option}, AUTOEXIT)
199+
; b3
200+
.out "autoexit"
201+
_option_ .set 3
202+
_value_ .set _value_ ^ $08
203+
204+
.else
205+
.error .sprintf("unknown option: %s", .string(option))
206+
.endif
207+
208+
; .out .sprintf("value: %s", .string(_value_))
209+
210+
.ifconst _option_
211+
; .out "constante"
212+
ldx #_option_
213+
.else
214+
; .out "pas constante"
215+
ldx #_option_
216+
.endif
217+
218+
.ifconst value
219+
; .out "constante"
220+
lda #<_value_
221+
ldy #>_value_
222+
.else
223+
; .out "pas constante"
224+
lda #<value
225+
ldy #>value
226+
.endif
227+
228+
jsr readline_set_option
229+
230+
.endmacro
231+
232+
;---------------------------------------------------------------------------
233+
;
234+
;---------------------------------------------------------------------------
235+
.macro set_callback function, address
236+
.local function_id
237+
238+
; 0: Funct+<key>
239+
; 1: KEY_DOWN
240+
; 2: KEY_UP
241+
; 3: KEY_ESC
242+
243+
.if .xmatch({function}, key_funct) .or .xmatch({function}, KEY_FUNCT)
244+
function_id .set 0
245+
246+
.elseif .xmatch({function}, key_down) .or .xmatch({function}, KEY_DOWN)
247+
function_id .set 1
248+
249+
.elseif .xmatch({function}, key_up) .or .xmatch({function}, KEY_UP)
250+
function_id .set 2
251+
252+
.elseif .xmatch({function}, key_esc) .or .xmatch({function}, KEY_ESC)
253+
function_id .set 3
254+
255+
.else
256+
.error .sprintf("unknown callback function: %s", .string(function))
257+
.endif
258+
259+
lda #<(address-1+1)
260+
ldy #>(address-1+1)
261+
ldx #function_id
262+
263+
jsr readline_set_callback
264+
265+
.endmacro
266+
267+
_READLINE_MAC_ = 1
268+
.endif

0 commit comments

Comments
 (0)