Skip to content

Commit 8ec321d

Browse files
committed
Fix global macro name and export
1 parent c43487c commit 8ec321d

13 files changed

Lines changed: 145 additions & 86 deletions

CONTRIBUTING.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,20 @@ or output value
7676

7777
#### Other keywords under evaluation
7878
* a @example keyword (optional) for pointing to other source code where method is used
79-
* a @note keyword (optional) for a simple usage code
79+
* a @note keyword (optional) for a simple usage code
80+
81+
### Declaration case type
82+
Labels must use the **Snake Case with all capital letters**.
83+
<pre>
84+
.label PAGE0_PAGE_POINTER = $D507
85+
</pre>
86+
87+
Macro must use the **Pascal Case**.
88+
<pre>
89+
.macro BasicUpstart128() { }
90+
</pre>
91+
92+
Functions must use the **Camel Case**.
93+
<pre>
94+
.function incArgument() { }
95+
</pre>

lib/cia-global.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
*
4848
* @since 1.0.0
4949
*/
50-
.macro c128lib_GetFirePressedPort1() { GetFirePressedPort1() }
50+
.macro @c128lib_GetFirePressedPort1() { GetFirePressedPort1() }
5151

5252
/**
5353
* @brief Checks if the fire button is pressed on joystick port 2.
@@ -61,7 +61,7 @@
6161
*
6262
* @since 1.0.0
6363
*/
64-
.macro c128lib_GetFirePressedPort2() { GetFirePressedPort2() }
64+
.macro @c128lib_GetFirePressedPort2() { GetFirePressedPort2() }
6565

6666
/**
6767
* @brief Disables the interrupts from both CIA chips.
@@ -74,5 +74,5 @@
7474
*
7575
* @since 1.1.0
7676
*/
77-
.macro c128lib_DisableCIAInterrupts() { DisableCIAInterrupts() }
77+
.macro @c128lib_DisableCIAInterrupts() { DisableCIAInterrupts() }
7878

lib/common-global.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
*
6565
* @since 1.0.0
6666
*/
67-
.macro c128lib_fbne(label) { fbne(label) }
67+
.macro @c128lib_Fbne(label) { Fbne(label) }
6868

6969
/**
7070
* @brief This macro provides a far branch if minus (BMI) operation.
@@ -81,4 +81,4 @@
8181
*
8282
* @since 1.0.0
8383
*/
84-
.macro c128lib_fbmi(label) { fbmi(label) }
84+
.macro @c128lib_Fbmi(label) { Fbmi(label) }

lib/common.asm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@
3333

3434
.filenamespace c128lib
3535

36-
.function incArgument(arg) {
37-
.return CmdArgument(arg.getType(), arg.getValue() + 1)
38-
}
39-
4036
/**
4137
* @brief This macro sets up a BASIC program for the Commodore 128.
4238
*
@@ -63,6 +59,10 @@ upstartEnd:
6359
.pc = $1c0e "Basic End"
6460
}
6561

62+
.function incArgument(arg) {
63+
.return CmdArgument(arg.getType(), arg.getValue() + 1)
64+
}
65+
6666
/**
6767
* @brief This macro provides a far branch if not equal (BNE) operation.
6868
*
@@ -76,11 +76,11 @@ upstartEnd:
7676
*
7777
* @param[in] label The label to jump to if the zero flag is not set.
7878
*
79-
* @note Use c128lib_fbne in common-global.asm
79+
* @note Use c128lib_Fbne in common-global.asm
8080
*
8181
* @since 1.0.0
8282
*/
83-
.macro fbne(label) {
83+
.macro Fbne(label) {
8484
here: // we have to add 2 to "here", because relative jump is counted right after bne xx, and this instruction takes 2 bytes
8585
.if (here > label) {
8686
// jump back
@@ -116,11 +116,11 @@ upstartEnd:
116116
*
117117
* @param[in] label The label to jump to if the negative flag is set.
118118
*
119-
* @note Use c128lib_fbmi in common-global.asm
119+
* @note Use c128lib_Fbmi in common-global.asm
120120
*
121121
* @since 1.0.0
122122
*/
123-
.macro fbmi(label) {
123+
.macro Fbmi(label) {
124124
here: // we have to add 2 to "here", because relative jump is counted right after bne xx, and this instruction takes 2 bytes
125125
.if (here > label) {
126126
// jump back

lib/io-global.asm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
*
5050
* @since 1.0.0
5151
*/
52-
.macro c128lib_OpenIOChannel(filenumber, devicenumber, secondary) { OpenIOChannel(filenumber, devicenumber, secondary) }
52+
.macro @c128lib_OpenIOChannel(filenumber, devicenumber, secondary) { OpenIOChannel(filenumber, devicenumber, secondary) }
5353

5454
/**
5555
* @brief Sets the name for I/O operations.
@@ -64,7 +64,7 @@
6464
*
6565
* @since 1.0.0
6666
*/
67-
.macro c128lib_SetIOName(length, address) { SetIOName(length, address) }
67+
.macro @c128lib_SetIOName(length, address) { SetIOName(length, address) }
6868

6969
/**
7070
* @brief Sets the input channel.
@@ -79,7 +79,7 @@
7979
*
8080
* @since 1.0.0
8181
*/
82-
.macro c128lib_SetInputChannel(filenumber) { SetInputChannel(filenumber) }
82+
.macro @c128lib_SetInputChannel(filenumber) { SetInputChannel(filenumber) }
8383

8484
/**
8585
* @brief Sets the output channel.
@@ -92,7 +92,7 @@
9292
*
9393
* @since 1.0.0
9494
*/
95-
.macro c128lib_SetOutputChannel(filenumber) { SetOutputChannel(filenumber) }
95+
.macro @c128lib_SetOutputChannel(filenumber) { SetOutputChannel(filenumber) }
9696

9797
/**
9898
* @brief Opens a file for I/O operations.
@@ -108,4 +108,4 @@
108108
*
109109
* @since 1.0.0
110110
*/
111-
.macro c128lib_OpenFile(length, address, filenumber, devicenumber, secondary) { OpenFile(length, address, filenumber, devicenumber, secondary) }
111+
.macro @c128lib_OpenFile(length, address, filenumber, devicenumber, secondary) { OpenFile(length, address, filenumber, devicenumber, secondary) }

lib/math-global.asm

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
*
5252
* @since 1.0.0
5353
*/
54-
.macro c128lib_Add16(value, dest) { Add16(value, dest) }
54+
.macro @c128lib_Add16(value, dest) { Add16(value, dest) }
5555

5656
/**
5757
* @brief This macro performs a 16-bit subtraction operation.
@@ -70,7 +70,7 @@
7070
*
7171
* @since 1.0.0
7272
*/
73-
.macro c128lib_Sub16(value, dest) { Sub16(value, dest) }
73+
.macro @c128lib_Sub16(value, dest) { Sub16(value, dest) }
7474

7575
/**
7676
* @brief This macro performs a 16-bit arithmetic shift left (ASL) operation.
@@ -86,7 +86,7 @@
8686
*
8787
* @since 1.0.0
8888
*/
89-
.macro c128lib_Asl16(address) { Asl16(address) }
89+
.macro @c128lib_Asl16(address) { Asl16(address) }
9090

9191
/**
9292
* @brief This macro performs a 16-bit increment operation.
@@ -101,7 +101,7 @@
101101
*
102102
* @since 1.0.0
103103
*/
104-
.macro c128lib_Inc16(address) { Inc16(address) }
104+
.macro @c128lib_Inc16(address) { Inc16(address) }
105105

106106
/**
107107
* @brief This macro performs a 16-bit decrement operation.
@@ -117,7 +117,7 @@
117117
*
118118
* @since 1.0.0
119119
*/
120-
.macro c128lib_Dec16(address) { Dec16(address) }
120+
.macro @c128lib_Dec16(address) { Dec16(address) }
121121

122122
/**
123123
* @brief Divides a 16 bit number by a 16 bit number
@@ -134,7 +134,7 @@
134134
*
135135
* @since 1.0.0
136136
*/
137-
.macro c128lib_Div16By16(dividend, divisor, remainder) { Div16By16(dividend, divisor, remainder) }
137+
.macro @c128lib_Div16By16(dividend, divisor, remainder) { Div16By16(dividend, divisor, remainder) }
138138

139139
/**
140140
* @brief Divides a 16 bit number by a 8 bit number
@@ -151,4 +151,4 @@
151151
*
152152
* @since 1.0.0
153153
*/
154-
.macro c128lib_Div16By8(dividend, divisor, remainder) { Div16By8(dividend, divisor, remainder) }
154+
.macro @c128lib_Div16By8(dividend, divisor, remainder) { Div16By8(dividend, divisor, remainder) }

lib/mem-global.asm

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,17 @@
4949
* @remark Register .A will be modified.
5050
* @remark Flags N and Z will be affected.
5151
*
52-
* @note Usage: c128lib_copyFast($C000, $C100, 256) // Copies 256 bytes from memory location $C000 to $C100
52+
* @note Usage: c128lib_CopyFast($C000, $C100, 256) // Copies 256 bytes from memory location $C000 to $C100
5353
*
5454
* @since 1.0.0
5555
*/
56-
.macro c128lib_copyFast(source, destination, count) { copyFast(source, destination, count) }
56+
.macro @c128lib_CopyFast(source, destination, count) { CopyFast(source, destination, count) }
5757

5858
/**
5959
* @brief This macro copies a block of memory from one location to another using page relocation.
6060
*
6161
* @details This macro also handles the page relocation of the memory block during the copy operation.
62-
* It's slower than @sa copyFast but it uses much less memory, especially for large memory blocks copy.
62+
* It's slower than @sa c128lib_CopyFast but it uses much less memory, especially for large memory blocks copy.
6363
*
6464
* @param[in] source The starting address of the memory block to be copied.
6565
* @param[in] destination The starting address of the location where the memory block will be copied to.
@@ -69,13 +69,13 @@
6969
* @remark Flags N and Z will be affected.
7070
* @remark Zeropage location $fe will be used.
7171
*
72-
* @note Usage: c128lib_copyWithRelocation($C000, $C100, 256) // Copies 256 bytes from memory location $C000 to $C100 with relocation
72+
* @note Usage: c128lib_CopyWithRelocation($C000, $C100, 256) // Copies 256 bytes from memory location $C000 to $C100 with relocation
7373
* @note Minimum length is set to 5 because it's not convenient to use this
7474
* macro for lower values.
7575
*
7676
* @since 1.0.0
7777
*/
78-
.macro c128lib_copyWithRelocation(source, destination, count) { copyWithRelocation(source, destination, count) }
78+
.macro @c128lib_CopyWithRelocation(source, destination, count) { CopyWithRelocation(source, destination, count) }
7979

8080
/**
8181
* @brief This macro fills memory with a specified value.
@@ -88,11 +88,11 @@
8888
* @remark Registers .A and .X will be modified.
8989
* @remark Flags N and Z will be affected.
9090
*
91-
* @note Usage: c128lib_fillMemory($0400, $E0) // Fills the screen starting from memory location $0400 with the value $E0
91+
* @note Usage: c128lib_FillMemory($0400, $E0) // Fills the screen starting from memory location $0400 with the value $E0
9292
*
9393
* @since 1.0.0
9494
*/
95-
.macro c128lib_fillMemory(address, length, value) { fillMemory(address, length, value) }
95+
.macro @c128lib_FillMemory(address, length, value) { FillMemory(address, length, value) }
9696

9797
/**
9898
* @brief This macro compares a 16-bit value with a 16-bit memory location.
@@ -108,11 +108,11 @@
108108
* @remark Register .A will be modified.
109109
* @remark Flags N, Z and C will be affected.
110110
*
111-
* @note Usage: cmp16($1234, $C000) // Compares the 16-bit value $1234 with the 16-bit memory location starting at $C000
111+
* @note Usage: c128lib_Cmp16($1234, $C000) // Compares the 16-bit value $1234 with the 16-bit memory location starting at $C000
112112
*
113113
* @since 1.0.0
114114
*/
115-
.macro @c128lib_cmp16(value, address) { cmp16(value, address) }
115+
.macro @c128lib_Cmp16(value, address) { Cmp16(value, address) }
116116

117117
/**
118118
* @brief Fills two-byte located in memory address "mem" with byte "value".
@@ -125,4 +125,4 @@
125125
*
126126
* @since 1.0.0
127127
*/
128-
.macro @c128lib_set16(value, address) { set16(value, address) }
128+
.macro @c128lib_Set16(value, address) { Set16(value, address) }

0 commit comments

Comments
 (0)