Code review adaptations, removed "cc65_" prefix from functions

This commit is contained in:
IrgendwerA8
2019-03-29 22:36:01 +01:00
committed by Oliver Schmidt
parent 435f417c64
commit 3d8c3a4948
21 changed files with 107 additions and 148 deletions

View File

@@ -4,7 +4,7 @@
; CC65 library: 32by16 => 16 signed division
;
.export _cc65_idiv32by16r16
.export _idiv32by16r16
.import idiv32by16r16, incsp4
.include "zeropage.inc"
@@ -13,7 +13,7 @@
;---------------------------------------------------------------------------
; 32by16 division.
.proc _cc65_idiv32by16r16
.proc _idiv32by16r16
pha ; Save rhs

View File

@@ -4,7 +4,7 @@
; CC65 library: 16x16 => 32 signed multiplication
;
.export _cc65_imul16x16r32
.export _imul16x16r32
.import imul16x16r32, popax
.include "zeropage.inc"
@@ -14,7 +14,7 @@
; 16x16 => 32 signed multiplication routine.
.proc _cc65_imul16x16r32
.proc _imul16x16r32
sta ptr1
stx ptr1+1

View File

@@ -5,7 +5,7 @@
; CC65 library: 8x8 => 16 signed multiplication
;
.export _cc65_imul8x8r16
.export _imul8x8r16
.import imul8x8r16, popa, ptr1:zp
@@ -13,7 +13,7 @@
; 8x8 => 16 signed multiplication routine.
.proc _cc65_imul8x8r16
.proc _imul8x8r16
sta ptr1
jsr popa

View File

@@ -8,15 +8,15 @@
; See "LICENSE" file for legal information.
;
;
; unsigned int __fastcall__ _mul20(unsigned char value);
; unsigned int __fastcall__ mul20(unsigned char value);
;
; REMARKS: Function is defined to return with carry-flag cleared
.importzp tmp4
.export __mul20
.export _mul20
.proc __mul20 ; = 30 bytes, 41/46 cycles
.proc _mul20 ; = 30 bytes, 41/46 cycles
sta tmp4 ; remember value for later addition...
ldx #0 ; clear high-byte
@@ -24,7 +24,7 @@
bcc mul4 ; high-byte affected?
ldx #2 ; this will be the 1st high-bit soon...
mul4: asl a ; * 4
mul4: asl a ; * 4
bcc mul5 ; high-byte affected?
inx ; => yes, apply to 0 high-bit
clc ; prepare addition
@@ -36,9 +36,9 @@ mul5: adc tmp4 ; * 5
mul10: stx tmp4 ; continue with classic shifting...
asl a ; * 10
rol tmp4
rol tmp4
asl a ; * 20
asl a ; * 20
rol tmp4
ldx tmp4 ; deliver high-byte in X

View File

@@ -8,15 +8,15 @@
; See "LICENSE" file for legal information.
;
;
; unsigned int __fastcall__ _mul40(unsigned char value);
; unsigned int __fastcall__ mul40(unsigned char value);
;
; REMARKS: Function is defined to return with carry-flag cleared
.importzp tmp4
.export __mul40
.export _mul40
.proc __mul40 ; = 33 bytes, 48/53 cycles
.proc _mul40 ; = 33 bytes, 48/53 cycles
sta tmp4 ; remember value for later addition...
ldx #0 ; clear high-byte
@@ -24,7 +24,7 @@
bcc mul4 ; high-byte affected?
ldx #2 ; this will be the 1st high-bit soon...
mul4: asl a ; * 4
mul4: asl a ; * 4
bcc mul5 ; high-byte affected?
inx ; => yes, apply to 0 high-bit
clc ; prepare addition
@@ -36,9 +36,9 @@ mul5: adc tmp4 ; * 5
mul10: stx tmp4 ; continue with classic shifting...
asl a ; * 10
rol tmp4
rol tmp4
asl a ; * 20
asl a ; * 20
rol tmp4
asl a ; * 40

View File

@@ -13,7 +13,7 @@
; Ullrich von Bassewitz, 2009-10-29
;
.export _cc65_cos, _cc65_sin
.export _cos, _sin
; ---------------------------------------------------------------------------
@@ -23,7 +23,7 @@
.rodata
_cc65_sintab:
_sintab:
.byte $00, $04, $09, $0D, $12, $16, $1B, $1F, $24, $28
.byte $2C, $31, $35, $3A, $3E, $42, $47, $4B, $4F, $53
.byte $58, $5C, $60, $64, $68, $6C, $70, $74, $78, $7C
@@ -41,7 +41,7 @@ _cc65_sintab:
.code
_cc65_cos:
_cos:
; cos(x) = sin(x+90)
@@ -55,7 +55,7 @@ _cc65_cos:
@L1: cpx #>360
bne @L2
cmp #<360
@L2: bcc _cc65_sin
@L2: bcc _sin
sbc #<360
bcs @L3
@@ -71,7 +71,7 @@ _cc65_cos:
;
; Plus special handling for the values missing in the table.
_cc65_sin:
_sin:
; If the high byte is non zero, argument is > 255
@@ -114,7 +114,7 @@ L1: cmp #87
L2: tay
ldx #0
lda _cc65_sintab,y
lda _sintab,y
rts
; 180..360°. sin(x) = -sin(x-180). Since the argument is in range 0..180
@@ -155,7 +155,7 @@ L5: ldx #$FF
L6: tay
txa ; A = $FF
eor _cc65_sintab,y
eor _sintab,y
adc #1
bcc L7
inx

View File

@@ -4,7 +4,7 @@
; CC65 library: 32by16 => 16 unsigned division
;
.export _cc65_udiv32by16r16
.export _udiv32by16r16
.import udiv32by16r16m, incsp4
.include "zeropage.inc"
@@ -13,7 +13,7 @@
;---------------------------------------------------------------------------
; 32by16 division.
.proc _cc65_udiv32by16r16
.proc _udiv32by16r16
sta ptr3
stx ptr3+1 ; Store rhs

View File

@@ -4,7 +4,7 @@
; CC65 library: 16x16 => 32 unsigned multiplication
;
.export _cc65_umul16x16r32
.export _umul16x16r32
.import umul16x16r32, popax
.include "zeropage.inc"
@@ -13,7 +13,7 @@
;---------------------------------------------------------------------------
; 16x16 => 32 unsigned multiplication routine.
.proc _cc65_umul16x16r32
.proc _umul16x16r32
sta ptr1
stx ptr1+1

View File

@@ -4,7 +4,7 @@
; CC65 library: 16x8 => 32 unsigned multiplication
;
.export _cc65_umul16x8r32
.export _umul16x8r32
.import umul8x16r24, popax
.include "zeropage.inc"
@@ -14,7 +14,7 @@
; 16x8 => 32 unsigned multiplication routine. We use 8x16 => 24 and clear
; the high byte of the result
.proc _cc65_umul16x8r32
.proc _umul16x8r32
sta ptr1
lda #0

View File

@@ -4,7 +4,7 @@
; CC65 library: 8x8 => 16 unsigned multiplication
;
.export _cc65_umul8x8r16
.export _umul8x8r16
.import umul8x8r16, popa, ptr1:zp
@@ -12,7 +12,7 @@
; 8x8 => 16 unsigned multiplication routine.
.proc _cc65_umul8x8r16
.proc _umul8x8r16
sta ptr1
jsr popa