mirror of
https://github.com/fadden/6502bench.git
synced 2024-11-19 21:31:30 +00:00
Remove excess whitespace after cycle count comments
If a line has a comment with a cycle count and nothing else, it was getting an extra space or two on the end. Also, added a few end-of-line comments to the 2020 test to show how they interact with the cycle counts.
This commit is contained in:
parent
88e72d1eb8
commit
65fc2cb86e
@ -291,9 +291,17 @@ namespace SourceGen.AsmGen {
|
||||
int cycles = proj.CpuDef.GetCycles(op.Opcode, attr.StatusFlags, attr.BranchTaken,
|
||||
branchCross);
|
||||
if (cycles > 0) {
|
||||
if (!string.IsNullOrEmpty(eolComment)) {
|
||||
eolComment = cycles.ToString() + " " + eolComment;
|
||||
} else {
|
||||
eolComment = cycles.ToString();
|
||||
}
|
||||
} else {
|
||||
if (!string.IsNullOrEmpty(eolComment)) {
|
||||
eolComment = (-cycles).ToString() + "+ " + eolComment;
|
||||
} else {
|
||||
eolComment = (-cycles).ToString() + "+";
|
||||
}
|
||||
}
|
||||
}
|
||||
string commentStr = formatter.FormatEolComment(eolComment);
|
||||
|
@ -13,10 +13,9 @@
|
||||
"Low":0,"High":0,"Hint":"Code"}],"StatusFlagOverrides":{
|
||||
},
|
||||
"Comments":{
|
||||
},
|
||||
"2":"crosses page boundary","28":"branch always","32":"branch never","37":"branch maybe","39":"BRK with E=1","66":"BRK with E=0","105":"should have no effect on cycle counts on 65816"},
|
||||
"LongComments":{
|
||||
"-2147483647":{
|
||||
"Text":"6502bench SourceGen v1.3.0-dev6","BoxMode":false,"MaxWidth":80,"BackgroundColor":0}},
|
||||
},
|
||||
"Notes":{
|
||||
},
|
||||
"UserLabels":{
|
||||
|
@ -1,26 +1,25 @@
|
||||
;6502bench SourceGen v1.3.0-dev6
|
||||
.cpu "65816"
|
||||
* = $10f0
|
||||
.as
|
||||
.xs
|
||||
L10F0 sec ;2
|
||||
xce ;2
|
||||
bra L1108 ;4
|
||||
bra L1108 ;4 crosses page boundary
|
||||
|
||||
.fill 20,$00
|
||||
|
||||
L1108 bra L110A ;3
|
||||
|
||||
L110A lda #$00 ;2
|
||||
beq L1110 ;3
|
||||
beq L1110 ;3 branch always
|
||||
|
||||
.byte $00
|
||||
.byte $00
|
||||
|
||||
L1110 bne L1110 ;2
|
||||
L1110 bne L1110 ;2 branch never
|
||||
lda $1234 ;4
|
||||
beq L1119 ;2+
|
||||
brk ;7
|
||||
beq L1119 ;2+ branch maybe
|
||||
brk ;7 BRK with E=1
|
||||
|
||||
.byte $01
|
||||
|
||||
@ -38,7 +37,7 @@ L1119 lda $22,s ;4
|
||||
asl $05,x ;8+
|
||||
ldx $1235 ;5
|
||||
beq L1134 ;2+
|
||||
brk ;8
|
||||
brk ;8 BRK with E=0
|
||||
|
||||
.byte $02
|
||||
|
||||
@ -64,7 +63,7 @@ L113A rep #$20 ;3
|
||||
lda $1234 ;5
|
||||
adc #$0066 ;3
|
||||
adc $1235 ;5
|
||||
sed ;2
|
||||
sed ;2 should have no effect on cycle counts on 65816
|
||||
adc #$0077 ;3
|
||||
adc $1236 ;5
|
||||
sec ;2
|
||||
|
@ -1,23 +1,22 @@
|
||||
;6502bench SourceGen v1.3.0-dev6
|
||||
org $10f0
|
||||
L10F0 sec ;2
|
||||
xce ;2
|
||||
bra L1108 ;4
|
||||
bra L1108 ;4 crosses page boundary
|
||||
|
||||
ds 20,$00
|
||||
|
||||
L1108 bra L110A ;3
|
||||
|
||||
L110A lda #$00 ;2
|
||||
beq L1110 ;3
|
||||
beq L1110 ;3 branch always
|
||||
|
||||
dfb $00
|
||||
dfb $00
|
||||
|
||||
L1110 bne L1110 ;2
|
||||
L1110 bne L1110 ;2 branch never
|
||||
lda $1234 ;4
|
||||
beq L1119 ;2+
|
||||
brk ;7
|
||||
beq L1119 ;2+ branch maybe
|
||||
brk ;7 BRK with E=1
|
||||
|
||||
dfb $01
|
||||
|
||||
@ -34,7 +33,7 @@ L1119 lda $22,S ;4
|
||||
asl $05,x ;8+
|
||||
ldx $1235 ;5
|
||||
beq L1134 ;2+
|
||||
brk ;8
|
||||
brk ;8 BRK with E=0
|
||||
|
||||
dfb $02
|
||||
|
||||
@ -60,7 +59,7 @@ L113A rep #$20 ;3
|
||||
lda $1234 ;5
|
||||
adc #$0066 ;3
|
||||
adc $1235 ;5
|
||||
sed ;2
|
||||
sed ;2 should have no effect on cycle counts on 65816
|
||||
adc #$0077 ;3
|
||||
adc $1236 ;5
|
||||
sec ;2
|
||||
|
@ -1,26 +1,25 @@
|
||||
;6502bench SourceGen v1.3.0-dev6
|
||||
!cpu 65816
|
||||
* = $10f0
|
||||
!as
|
||||
!rs
|
||||
L10F0 sec ;2
|
||||
xce ;2
|
||||
bra L1108 ;4
|
||||
bra L1108 ;4 crosses page boundary
|
||||
|
||||
!fill 20,$00
|
||||
|
||||
L1108 bra L110A ;3
|
||||
|
||||
L110A lda #$00 ;2
|
||||
beq L1110 ;3
|
||||
beq L1110 ;3 branch always
|
||||
|
||||
!byte $00
|
||||
!byte $00
|
||||
|
||||
L1110 bne L1110 ;2
|
||||
L1110 bne L1110 ;2 branch never
|
||||
lda $1234 ;4
|
||||
beq L1119 ;2+
|
||||
brk ;7
|
||||
beq L1119 ;2+ branch maybe
|
||||
brk ;7 BRK with E=1
|
||||
|
||||
!byte $01
|
||||
|
||||
@ -38,7 +37,7 @@ L1119 lda $22,S ;4
|
||||
asl $05,x ;8+
|
||||
ldx $1235 ;5
|
||||
beq L1134 ;2+
|
||||
brk ;8
|
||||
brk ;8 BRK with E=0
|
||||
|
||||
!byte $02
|
||||
|
||||
@ -64,7 +63,7 @@ L113A rep #$20 ;3
|
||||
lda $1234 ;5
|
||||
adc #$0066 ;3
|
||||
adc $1235 ;5
|
||||
sed ;2
|
||||
sed ;2 should have no effect on cycle counts on 65816
|
||||
adc #$0077 ;3
|
||||
adc $1236 ;5
|
||||
sec ;2
|
||||
|
@ -1,4 +1,3 @@
|
||||
;6502bench SourceGen v1.3.0-dev6
|
||||
.setcpu "65816"
|
||||
; .segment "SEG000"
|
||||
.org $10f0
|
||||
@ -6,22 +5,22 @@
|
||||
.i8
|
||||
L10F0: sec ;2
|
||||
xce ;2
|
||||
bra L1108 ;4
|
||||
bra L1108 ;4 crosses page boundary
|
||||
|
||||
.res 20,$00
|
||||
|
||||
L1108: bra L110A ;3
|
||||
|
||||
L110A: lda #$00 ;2
|
||||
beq L1110 ;3
|
||||
beq L1110 ;3 branch always
|
||||
|
||||
.byte $00
|
||||
.byte $00
|
||||
|
||||
L1110: bne L1110 ;2
|
||||
L1110: bne L1110 ;2 branch never
|
||||
lda $1234 ;4
|
||||
beq L1119 ;2+
|
||||
brk ;7
|
||||
beq L1119 ;2+ branch maybe
|
||||
brk ;7 BRK with E=1
|
||||
|
||||
.byte $01
|
||||
|
||||
@ -39,7 +38,7 @@ L1119: lda $22,S ;4
|
||||
asl $05,x ;8+
|
||||
ldx $1235 ;5
|
||||
beq L1134 ;2+
|
||||
brk ;8
|
||||
brk ;8 BRK with E=0
|
||||
|
||||
.byte $02
|
||||
|
||||
@ -65,7 +64,7 @@ L113A: rep #$20 ;3
|
||||
lda $1234 ;5
|
||||
adc #$0066 ;3
|
||||
adc $1235 ;5
|
||||
sed ;2
|
||||
sed ;2 should have no effect on cycle counts on 65816
|
||||
adc #$0077 ;3
|
||||
adc $1236 ;5
|
||||
sec ;2
|
||||
|
Loading…
Reference in New Issue
Block a user