2024-06-10 21:37:54 +02:00
|
|
|
native_mode .macro
|
|
|
|
clc
|
|
|
|
xce
|
|
|
|
.endmacro
|
|
|
|
|
|
|
|
long_a .macro
|
|
|
|
rep #$20
|
|
|
|
.al
|
|
|
|
.endmacro
|
|
|
|
|
|
|
|
short_a .macro
|
|
|
|
sep #$20
|
|
|
|
.as
|
|
|
|
.endmacro
|
|
|
|
|
|
|
|
long_i .macro
|
|
|
|
rep #$10
|
|
|
|
.xl
|
|
|
|
.endmacro
|
|
|
|
|
|
|
|
short_i .macro
|
|
|
|
sep #$10
|
|
|
|
.xs
|
|
|
|
.endmacro
|
2024-06-10 22:53:27 +02:00
|
|
|
|
|
|
|
save_registers .macro
|
|
|
|
php
|
|
|
|
.long_a
|
|
|
|
.long_i
|
|
|
|
pha
|
|
|
|
phx
|
|
|
|
phy
|
2024-06-11 00:10:32 +02:00
|
|
|
.short_a
|
|
|
|
.long_i
|
2024-06-10 22:53:27 +02:00
|
|
|
.endmacro
|
|
|
|
|
|
|
|
restore_registers .macro
|
|
|
|
.long_a
|
|
|
|
.long_i
|
|
|
|
ply
|
|
|
|
plx
|
|
|
|
pla
|
|
|
|
plp
|
2024-06-11 00:10:32 +02:00
|
|
|
.short_a
|
|
|
|
.long_i
|
2024-06-10 22:53:27 +02:00
|
|
|
.endmacro
|
2024-06-11 00:10:32 +02:00
|
|
|
|
2024-06-13 06:31:20 +02:00
|
|
|
; Copies up to 64KB (aligned to bank boundaries)
|
2024-06-11 00:10:32 +02:00
|
|
|
memcpy .macro dest, src, count
|
|
|
|
.save_registers
|
|
|
|
.long_a
|
|
|
|
|
2024-06-13 06:31:20 +02:00
|
|
|
ldx #<>\src
|
|
|
|
ldy #<>\dest
|
|
|
|
lda #\count - 1
|
2024-06-11 00:10:32 +02:00
|
|
|
|
2024-06-13 06:31:20 +02:00
|
|
|
.if \dest > \src
|
|
|
|
mvp #`\src, #`\dest
|
2024-06-11 00:10:32 +02:00
|
|
|
.else
|
2024-06-13 06:31:20 +02:00
|
|
|
mvn #`\src, #`\dest
|
2024-06-11 00:10:32 +02:00
|
|
|
.endif
|
2024-06-13 06:31:20 +02:00
|
|
|
|
2024-06-11 00:10:32 +02:00
|
|
|
.restore_registers
|
|
|
|
.endmacro
|