Skip to content

Commit 1a45666

Browse files
committed
Forward reference exports.
1 parent 97f7884 commit 1a45666

File tree

4 files changed

+41
-37
lines changed

4 files changed

+41
-37
lines changed

src/fileioc/fileioc.asm

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ include '../include/library.inc'
44

55
library 'FILEIOC', 3
66

7+
;-------------------------------------------------------------------------------
8+
; no dependencies
9+
;-------------------------------------------------------------------------------
10+
711
;-------------------------------------------------------------------------------
812
; v1 functions
913
;-------------------------------------------------------------------------------
@@ -44,11 +48,6 @@ library 'FILEIOC', 3
4448
export ti_AllocEqu
4549
;-------------------------------------------------------------------------------
4650

47-
;-------------------------------------------------------------------------------
48-
dependencies
49-
; none
50-
;-------------------------------------------------------------------------------
51-
5251
;-------------------------------------------------------------------------------
5352
resizeBytes := $E30C0C
5453
currSlot := $E30C11

src/graphx/graphx.asm

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ include '../include/library.inc'
44

55
library 'GRAPHX', 8
66

7+
;-------------------------------------------------------------------------------
8+
; no dependencies
9+
;-------------------------------------------------------------------------------
10+
711
;-------------------------------------------------------------------------------
812
; v1 functions
913
;-------------------------------------------------------------------------------
@@ -122,11 +126,6 @@ library 'GRAPHX', 8
122126
;-------------------------------------------------------------------------------
123127
export gfx_SetCharData
124128

125-
;-------------------------------------------------------------------------------
126-
dependencies
127-
; none
128-
;-------------------------------------------------------------------------------
129-
130129
;-------------------------------------------------------------------------------
131130
LcdSize := LcdWidth*LcdHeight
132131
InterruptStackSize := 4000 ; minimum stack size to provide for interrupts if moving the stack

src/include/library.inc

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,55 @@ include 'ti84pceg.inc'
33
include 'tiformat.inc'
44

55
macro library? name*,version*
6-
76
local lib
87
element lib.base
8+
virtual
9+
lib.exports.area::
10+
end virtual
11+
virtual
12+
lib.relocations.area::
13+
end virtual
914

10-
macro dependencies?
11-
irpv export, lib.exports
12-
dw export
13-
end irpv
14-
lib.dependencies = $
15-
lib.base_offset = $%
16-
org lib.base
17-
end macro
15+
format ti archived appvar name
16+
org 0
17+
db 192,193,version
18+
dw lib.exports
19+
lib.dependencies:
20+
lib.base_offset := $%
21+
org lib.base
1822

1923
macro export? function*
20-
lib.exports equ function-lib.base
24+
virtual lib.exports.area
25+
dw function-lib.base
26+
end virtual
2127
end macro
2228

2329
macro @ez80.word @value*
2430
local value, address
2531
value = @value
2632
address = $
2733
if value relativeto lib.base
28-
lib.relocations equ address-lib.base
34+
virtual lib.relocations.area
35+
dw address-lib.base
36+
end virtual
2937
@ez80.word value-lib.base
3038
else
3139
@ez80.word value
3240
end if
3341
end macro
3442

35-
format ti archived appvar name
36-
org 0
37-
lib.init = $
38-
db 192,193,version
39-
4043
postpone
41-
lib.end = $% - lib.base_offset
42-
irpv relocation, lib.relocations
43-
dw relocation
44-
end irpv
44+
virtual lib.exports.area
45+
load lib.exports: $-$$ from $$
46+
end virtual
47+
virtual lib.relocations.area
48+
load lib.relocations: $-$$ from $$
49+
end virtual
50+
51+
lib.end_offset := $%
52+
dw lib.relocations
4553
dl lib.dependencies
46-
dl lib.end
47-
54+
dl lib.end_offset - lib.base_offset
4855
end postpone
4956

5057
purge library?

src/keypadc/keypadc.asm

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ include '../include/library.inc'
44

55
library 'KEYPADC', 2
66

7+
;-------------------------------------------------------------------------------
8+
; no dependencies
9+
;-------------------------------------------------------------------------------
10+
711
;-------------------------------------------------------------------------------
812
; v1 functions
913
;-------------------------------------------------------------------------------
@@ -13,11 +17,6 @@ library 'KEYPADC', 2
1317
export kb_Reset
1418
;-------------------------------------------------------------------------------
1519

16-
;-------------------------------------------------------------------------------
17-
dependencies
18-
; none
19-
;-------------------------------------------------------------------------------
20-
2120
;-------------------------------------------------------------------------------
2221
kb_Scan:
2322
; Scans the keypad and updates data registers

0 commit comments

Comments
 (0)