content
stringlengths 5
1.04M
| avg_line_length
float64 1.75
12.9k
| max_line_length
int64 2
244k
| alphanum_fraction
float64 0
0.98
| licenses
sequence | repository_name
stringlengths 7
92
| path
stringlengths 3
249
| size
int64 5
1.04M
| lang
stringclasses 2
values |
---|---|---|---|---|---|---|---|---|
ORG 0009
ADDR: WORD 06B0 ; address of first two characters
ORG 2FF
ZERO: WORD 0000
BUF-A: WORD ?
BUF-C: WORD ?
SAVE_A_C: WORD ?
MOV BUF-A
ROL
MOV BUF-C
ROR
BR SAVE_A_C
LOAD_A_C: WORD ?
CLA
ADD BUF-C
ROR
CLA
CMA
AND BUF-A
BR LOAD_A_C
CONSTF: WORD FF00 ; const for zeroing low 8 bits
CONST0: WORD 00FF ; const for zeroing high 8 bits
STOP: HLT
STOPC: WORD 000D ; stop character
CHECK: WORD ? ; character checking
JSR SAVE_A_C
AND CONST0
SUB STOPC
BMI STOP
BEQ STOP
JSR LOAD_A_C
BR CHECK
ZERO: WORD 0000
CSHIFT: WORD FFF8 ; const -8 to shift
TIMES: WORD ?
SHIFT: WORD ? ; bit shift
JSR SAVE_A_C
CLA
ADD CSHIFT
MOV TIMES
JSR LOAD_A_C
ROLL: ROR
ISZ TIMES
BR ROLL
BR SHIFT
ORG 03DD
BEGIN: CLA
START: BEQ SELECT ; if A == 0 => select new two characters
BR SEND ; else send low 8 bits
SELECT: ADD (ADDR)
JSR SHIFT
SEND: JSR CHECK
SPIN TSF 3
BR SPIN
OUT 3
AND CONSTF ; zeroing low 8 bits in A
BEQ SELECT
JSR SHIFT
ROR ; additional shift due to bit C
BR SEND | 17.032258 | 58 | 0.666667 | [
"MIT"
] | SunnyCapt/csbasics | lab5/prog.bcomp.asm | 1,056 | Assembly |
<%
from pwnlib.shellcraft.amd64.linux import syscall
%>
<%page args="fd, iovec, count"/>
<%docstring>
Invokes the syscall writev. See 'man 2 writev' for more information.
Arguments:
fd(int): fd
iovec(iovec): iovec
count(int): count
</%docstring>
${syscall('SYS_writev', fd, iovec, count)}
| 19.5625 | 69 | 0.664537 | [
"MIT"
] | FDlucifer/binjitsu | pwnlib/shellcraft/templates/amd64/linux/writev.asm | 313 | Assembly |
;---------------------------------------------------------------;
; ;
; Banchor ;
; Boss Data ;
; ;
;---------------------------------------------------------------;
DSXMIN = 16
DSXMAX = 128-16
B_INI_YX = ((COLS*8/2)-4)*256+(ROWS*8)-16
;------------------------------------------------
; X & Y offsets used when drawing 16x16 boss sprite
;------------------------------------------------
bossDrawTable:
.db 8,0
.db -8,8
.db 8,0
;------------------------------------------------
; x & y offsets when creating boss death explosions
;------------------------------------------------
bossExplodeTable:
.db -1,0
.db 10,8
.db 9,-1
.db 0,9
;------------------------------------------------
; Change list entries to add after Heath defeated
;------------------------------------------------
heathChangeList:
.db 5
.db 20,STONE_WALL_1,33
.db 21,DOOR_DOWN,183
.db 4,DOOR_UP,7
.db 16,GRASS,78
.db 16,GRASS,94
;------------------------------------------------
; Change list entries to add after Dezemon defeated
;------------------------------------------------
dezemonChangeList:
.db 5
.db 60,BRICK_FLOOR,91
.db 60,BRICK_FLOOR,107
.db 60,CLOSED_DOOR_UP,8
.db 39,STAIRS_DOWN_L,65
.db 42,WOOD_BRIDGE_V,89
;------------------------------------------------
; Change list entries to add after Wendeg defeated
;------------------------------------------------
wendegChangeList:
.db 4
.db 79,CLOSED_DOOR_UP,7
.db 79,ICE_FLOOR,45
.db 69,STAIRS_DOWN_R,92
.db 75,GRASS,72
;------------------------------------------------
; Change list entries to add after Belkath defeated
;------------------------------------------------
belkathChangeList:
.db 4
.db 120,CLOSED_DOOR_DOWN,151
.db 125,DIRT,75
.db 101,GRASS,151
.db 114,STAIRS_DOWN_R,46
;------------------------------------------------
; Change list entries to add after Anazar defeated
;------------------------------------------------
anazarChangeList:
.db 3
.db 146,CLOSED_DOOR_UP,13
.db 145,STONE_FLOOR,74
.db 131,STAIRS_DOWN_R,46
;------------------------------------------------
; Change list entries to add after Margoth defeated
;------------------------------------------------
margothChangeList:
.db 3
.db 173,CLOSED_DOOR_UP,2
.db 173,BLUESTONE_FLOOR,58
.db 164,STAIRS_DOWN_R,174
;------------------------------------------------
; Change list entries to add after Drurcux defeated
;------------------------------------------------
durcruxChangeList:
.db 3
.db 215,CLOSED_DOOR_UP,29
.db 215,DARKSTONE_FLOOR,43
.db 189,STAIRS_DOWN_R,78
;------------------------------------------------
; Change list entries to add after Banchor defeated
;------------------------------------------------
banchorChangeList:
.db 1
.db 248,CLOSED_DOOR_UP,8
;------------------------------------------------
; Wendeg data
;------------------------------------------------
wendegStarPattern1:
.db -2,-1
.db -2,0
.db -1,0
.db -1,1
.db -1,1
.db -1,1
.db -1,2
.db -1,2
.db -1,2
.db -1,3
WENDEG_STAR_STEPS = ($-wendegStarPattern1)/2
wendegStarPattern2:
.db 0,-1
.db 0,0
.db 0,0
.db 0,1
.db 0,1
.db 0,1
.db 0,2
.db 0,2
.db 0,2
.db 0,3
wendegStarPattern3:
.db 2,-1
.db 2,0
.db 1,0
.db 1,1
.db 1,1
.db 1,1
.db 1,2
.db 1,2
.db 1,2
.db 1,3
;------------------------------------------------
; Belkath data
;------------------------------------------------
bBounceTop:
.db 9,11,13,15
BELKATH_TOP = 8
bBounceBottom:
.db 1,3,5,7
BELKATH_BOTTOM = (ROWS*8)-5
bBounceLeft:
.db 1,3,13,15
BELKATH_LEFT = 8
bBounceRight:
.db 5,7,9,11
BELKATH_RIGHT = (COLS*8)-8-5
;------------------------------------------------
; Anazar data
;------------------------------------------------
anazarHorizTable:
.db 0,0,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,0,0
ANAZAR_HORIZ_MAX = $-anazarHorizTable
anazarVertTable:
.db 0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,1,1,1,1,1,1,1,1,0,0,0,0,0
aBounceTop:
.db 0,15,14,13,12,11,10,9,8,9,10,11,12,13,14,15
ANAZAR_TOP = BELKATH_TOP
aBounceBottom:
.db 0,1,2,3,4,5,6,7,8,7,6,5,4,3,2,1
ANAZAR_BOTTOM = BELKATH_BOTTOM
aBounceLeft:
.db 0,1,2,3,4,3,2,1,0,15,14,13,12,13,14,15
ANAZAR_LEFT = BELKATH_LEFT
aBounceRight:
.db 8,7,6,5,4,5,6,7,8,9,10,11,12,11,10,9
ANAZAR_RIGHT = BELKATH_RIGHT
;------------------------------------------------
; Durcrux data
;------------------------------------------------
durcruxBullets:
.db 0,2,14
.db 1,3,15
.db 2,4,0
.db 3,5,1
.db 4,6,2
.db 5,7,3
.db 6,8,4
.db 7,9,5
.db 8,10,6
.db 9,11,7
.db 10,12,8
.db 11,13,9
.db 12,14,10
.db 13,15,11
.db 14,0,12
.db 15,1,13
;------------------------------------------------
; Banchor data
;------------------------------------------------
banchorConeTable:
.db 2,5,8,10,13,16
BANCHOR_CONE_SIZE = $-banchorConeTable
;------------------------------------------------
; boss room layout
;------------------------------------------------
bossRoom:
.db $08,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$09,$0A
.db $05,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$07
.db $04,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$06
.db $05,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$07
.db $04,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$06
.db $05,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$07
.db $04,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$06
.db $05,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$07
.db $04,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$06
.db $05,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$07
.db $04,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$00,$01,$06
.db $05,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$02,$03,$07
;------------------------------------------------
; sprite definitions
;------------------------------------------------
sprBoss1 = sprBoss
sprBoss2 = sprBoss1+(64*4)
sprBoss3 = sprBoss2+(64*4)
sprBoss4 = sprBoss3+(64*4)
sprBossBullet = sprBoss4+(64*4)
.end
| 27.869919 | 111 | 0.392503 | [
"MIT"
] | CiaranGruber/Ti-84-Calculator | Games/banchorce/source/bossdat.asm | 6,856 | Assembly |
; ----------------------------------------------------------------
; Z88DK INTERFACE LIBRARY FOR THE BIFROST* ENGINE - RELEASE 1.2/L
;
; See "bifrost_l.h" for further details
; ----------------------------------------------------------------
; void BIFROSTL_drawTileL(unsigned int row, unsigned int col, unsigned int tile)
; callee
SECTION code_clib
SECTION code_bifrost_l
PUBLIC BIFROSTL_drawTileL_callee
EXTERN asm_BIFROSTL_drawTileL
BIFROSTL_drawTileL_callee:
pop hl ; RET address
pop bc ; C=tile
pop de ; E=col
ex (sp),hl ; L=row
ld d,l ; D=row
ld a,c ; A=tile
jp asm_BIFROSTL_drawTileL ; execute 'draw_tile'
| 27.444444 | 80 | 0.503374 | [
"BSD-2-Clause"
] | ByteProject/Puddle-BuildTools | FictionTools/z88dk/libsrc/_DEVELOPMENT/arch/zx/bifrost_l/c/sccz80/BIFROSTL_drawTileL_callee.asm | 741 | Assembly |
* Sprite cf10
*
* Mode 4
* +|------------+
* - gg ggg g g -
* |g g gg g g|
* |g g g g g|
* |g gg g g g|
* |g g g g g|
* |g g g g g|
* | gg g ggg g |
* +|------------+
*
section sprite
xdef sp_cf10
xref sp_zero
sp_cf10
dc.w $0100,$0000
dc.w 13,7,0,0
dc.l sc4_cf10-*
dc.l sp_zero-*
dc.l 0
sc4_cf10
dc.w $6E00,$9000
dc.w $8900,$A800
dc.w $8800,$A800
dc.w $8C00,$A800
dc.w $8800,$A800
dc.w $8800,$A800
dc.w $6900,$D000
*
end
| 13.69697 | 17 | 0.50885 | [
"BSD-2-Clause"
] | olifink/smsqe | iod/con2/sprite/cf10.asm | 452 | Assembly |
; A073363: Nested floor product of n and fractions (k+1)/k for all k>0 (mod 6), divided by 6.
; Submitted by Jamie Morken
; 1,7,28,84,175,421,847,1288,1939,3780,5656,9247,15148,22099,25375,39676,54607,75208,90559,129360,166321,209832,240268,320719,399595,536956,672672,816733,906444,1115275,1321741,1595832,1908088,2323944
add $0,1
seq $0,112563 ; Sieve performed by successive iterations of steps where step m is: keep m terms, remove the next 5 and repeat; as m = 1,2,3,.. the remaining terms form this sequence.
div $0,6
| 65.625 | 200 | 0.76 | [
"Apache-2.0"
] | ckrause/loda-programs | oeis/073/A073363.asm | 525 | Assembly |
Name: ys_bbbros.asm
Type: file
Size: 99220
Last-Modified: '2016-05-13T04:50:37Z'
SHA-1: AAB4C70A42EE46F8C9D87D0B248ABF6C669B2DFE
Description: null
| 21 | 47 | 0.816327 | [
"MIT"
] | prismotizm/gigaleak | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver0/sfc/ys_bbbros.asm | 147 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r13
push %r15
push %rax
push %rbp
push %rbx
push %rsi
lea addresses_UC_ht+0x3bd4, %rax
clflush (%rax)
nop
nop
nop
nop
nop
and $50805, %r15
movb (%rax), %r12b
add %r13, %r13
lea addresses_normal_ht+0x164d4, %rbp
nop
nop
nop
xor $23640, %rsi
movl $0x61626364, (%rbp)
nop
add $63738, %rsi
lea addresses_WT_ht+0x7c54, %r13
xor %rax, %rax
and $0xffffffffffffffc0, %r13
vmovaps (%r13), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %rsi
nop
nop
nop
nop
sub $37641, %rbx
lea addresses_D_ht+0x954, %r15
nop
nop
nop
nop
nop
xor %r13, %r13
mov (%r15), %r12w
sub $26051, %r13
lea addresses_WC_ht+0x15154, %r12
nop
xor %rsi, %rsi
movb $0x61, (%r12)
sub $7838, %rsi
lea addresses_WT_ht+0x1a9a6, %r12
dec %rax
movups (%r12), %xmm5
vpextrq $0, %xmm5, %rsi
nop
nop
nop
nop
xor %rbx, %rbx
lea addresses_D_ht+0xdc54, %rsi
nop
nop
nop
nop
add %rbp, %rbp
mov (%rsi), %r15
nop
nop
nop
nop
nop
sub $59632, %r12
lea addresses_normal_ht+0x570f, %r13
nop
nop
nop
nop
xor %rax, %rax
movb (%r13), %r15b
nop
nop
nop
nop
add %rbx, %rbx
lea addresses_A_ht+0x7424, %rax
nop
add $27470, %r15
movb $0x61, (%rax)
nop
nop
nop
nop
nop
sub $58000, %r12
pop %rsi
pop %rbx
pop %rbp
pop %rax
pop %r15
pop %r13
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r14
push %r15
push %r9
push %rbp
push %rbx
push %rdi
push %rdx
// Store
lea addresses_WT+0x146d4, %r15
nop
nop
nop
nop
nop
and %rdi, %rdi
movl $0x51525354, (%r15)
nop
nop
nop
xor $26870, %r15
// Load
lea addresses_PSE+0x1f0ec, %rdx
clflush (%rdx)
nop
sub %r14, %r14
movups (%rdx), %xmm0
vpextrq $1, %xmm0, %rbx
nop
nop
nop
nop
nop
add $47261, %r15
// Store
lea addresses_D+0x6c54, %r9
nop
add $29857, %r15
mov $0x5152535455565758, %rbx
movq %rbx, (%r9)
nop
nop
nop
inc %rbx
// Store
lea addresses_WT+0x2b9, %r14
clflush (%r14)
nop
nop
sub %rbx, %rbx
mov $0x5152535455565758, %rdx
movq %rdx, (%r14)
nop
nop
nop
nop
sub $13453, %r14
// Store
lea addresses_PSE+0x172c, %rdi
nop
nop
nop
add $30910, %r9
mov $0x5152535455565758, %rbp
movq %rbp, (%rdi)
nop
nop
nop
nop
dec %rdi
// Faulty Load
mov $0x23f1490000000054, %r9
nop
nop
nop
nop
cmp %r15, %r15
movb (%r9), %r14b
lea oracles, %r15
and $0xff, %r14
shlq $12, %r14
mov (%r15,%r14,1), %r14
pop %rdx
pop %rdi
pop %rbx
pop %rbp
pop %r9
pop %r15
pop %r14
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_NC', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_PSE', 'same': False, 'AVXalign': False, 'congruent': 3}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_D', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_WT', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 8, 'NT': False, 'type': 'addresses_PSE', 'same': False, 'AVXalign': False, 'congruent': 3}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'size': 1, 'NT': True, 'type': 'addresses_NC', 'same': True, 'AVXalign': True, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_UC_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'STOR', 'dst': {'size': 4, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'size': 32, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': True, 'congruent': 10}}
{'OP': 'LOAD', 'src': {'size': 2, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 6}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_WC_ht', 'same': False, 'AVXalign': False, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'size': 16, 'NT': False, 'type': 'addresses_WT_ht', 'same': False, 'AVXalign': False, 'congruent': 1}}
{'OP': 'LOAD', 'src': {'size': 8, 'NT': False, 'type': 'addresses_D_ht', 'same': False, 'AVXalign': False, 'congruent': 9}}
{'OP': 'LOAD', 'src': {'size': 1, 'NT': False, 'type': 'addresses_normal_ht', 'same': False, 'AVXalign': False, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'size': 1, 'NT': False, 'type': 'addresses_A_ht', 'same': False, 'AVXalign': False, 'congruent': 2}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 32.355263 | 2,999 | 0.652162 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/AVXALIGN/_zr_/i9-9900K_12_0xca.log_21829_714.asm | 7,377 | Assembly |
; A193767: The number of dominoes in a largest saturated domino covering of the 4 by n board.
; 2,5,8,12,14,17,21,24,26,30,33,36,39,42,45,48,51,54,57,60,63,66,69,72,75,78,81,84,87,90,93,96,99,102,105,108,111,114,117,120,123,126,129,132,135,138,141,144,147,150,153,156,159,162,165,168,171,174,177
mov $3,$0
lpb $0
mod $0,3
mul $0,4
pow $1,$4
lpe
add $1,2
mov $2,$3
mul $2,3
add $1,$2
mov $0,$1
| 26.666667 | 201 | 0.665 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/193/A193767.asm | 400 | Assembly |
; $Id: ASMAtomicUoDecU32.asm 69111 2017-10-17 14:26:02Z vboxsync $
;; @file
; IPRT - ASMAtomicUoDecU32().
;
;
; Copyright (C) 2014-2017 Oracle Corporation
;
; This file is part of VirtualBox Open Source Edition (OSE), as
; available from http://www.virtualbox.org. This file is free software;
; you can redistribute it and/or modify it under the terms of the GNU
; General Public License (GPL) as published by the Free Software
; Foundation, in version 2 as it comes in the "COPYING" file of the
; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
;
; The contents of this file may alternatively be used under the terms
; of the Common Development and Distribution License Version 1.0
; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
; VirtualBox OSE distribution, in which case the provisions of the
; CDDL are applicable instead of those of the GPL.
;
; You may elect to license modified versions of this file under the
; terms and conditions of either the GPL or the CDDL or both.
;
;*******************************************************************************
;* Header Files *
;*******************************************************************************
%include "iprt/asmdefs.mac"
BEGINCODE
;;
; Atomically decrement an unsigned 32-bit value, unordered.
;
; @param pu32 x86:esp+4 gcc:rdi msc:rcx
; @returns the new decremented value.
;
BEGINPROC_EXPORTED ASMAtomicUoDecU32
mov eax, -1
%ifdef RT_ARCH_AMD64
%ifdef ASM_CALL64_MSC
xadd [rcx], eax
%else
xadd [rdi], eax
%endif
%elifdef RT_ARCH_X86
mov ecx, [esp + 04h]
xadd [ecx], eax
%endif
dec eax
ret
ENDPROC ASMAtomicUoDecU32
| 32.385965 | 80 | 0.624594 | [
"MIT"
] | Nurzamal/rest_api_docker | vbox/src/VBox/Runtime/common/asm/ASMAtomicUoDecU32.asm | 1,846 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r14
push %r8
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0xc617, %rax
nop
sub $49786, %rsi
mov (%rax), %rcx
nop
nop
nop
nop
inc %r12
lea addresses_D_ht+0x1d487, %r10
and $17431, %r8
movb $0x61, (%r10)
and $37515, %rcx
lea addresses_D_ht+0x1ecc1, %rsi
lea addresses_WC_ht+0xd357, %rdi
nop
nop
nop
nop
and %r14, %r14
mov $10, %rcx
rep movsb
nop
nop
nop
nop
nop
lfence
lea addresses_normal_ht+0x7e67, %rsi
lea addresses_WT_ht+0x15e97, %rdi
clflush (%rsi)
nop
and $26966, %rax
mov $105, %rcx
rep movsq
nop
nop
nop
nop
cmp %rax, %rax
lea addresses_normal_ht+0x4997, %rsi
lea addresses_D_ht+0xee97, %rdi
nop
nop
nop
nop
nop
add %r8, %r8
mov $14, %rcx
rep movsq
nop
nop
nop
nop
cmp $31596, %r12
lea addresses_WC_ht+0x15a97, %rax
nop
nop
nop
add %r10, %r10
movups (%rax), %xmm1
vpextrq $0, %xmm1, %r12
nop
nop
nop
nop
dec %r8
lea addresses_WT_ht+0x1ee97, %r12
nop
nop
xor $16848, %r8
movb (%r12), %al
nop
cmp $22402, %r8
lea addresses_WC_ht+0x6397, %rsi
lea addresses_A_ht+0xf367, %rdi
nop
nop
sub %r14, %r14
mov $73, %rcx
rep movsw
nop
and %r10, %r10
lea addresses_WT_ht+0x8297, %rsi
lea addresses_D_ht+0x144ed, %rdi
clflush (%rdi)
and $23502, %r12
mov $89, %rcx
rep movsb
nop
nop
xor %r8, %r8
lea addresses_WT_ht+0x7697, %r8
clflush (%r8)
nop
nop
nop
nop
sub $23664, %r10
movb $0x61, (%r8)
nop
nop
and %rsi, %rsi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r8
pop %r14
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r12
push %rax
push %rbp
push %rdx
// Store
lea addresses_normal+0x12097, %r10
nop
inc %r12
movl $0x51525354, (%r10)
nop
nop
nop
nop
nop
and %rdx, %rdx
// Faulty Load
lea addresses_US+0x1f697, %rdx
nop
xor $53456, %rbp
movups (%rdx), %xmm4
vpextrq $1, %xmm4, %r12
lea oracles, %r11
and $0xff, %r12
shlq $12, %r12
mov (%r11,%r12,1), %r12
pop %rdx
pop %rbp
pop %rax
pop %r12
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'NT': False, 'same': False, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_normal', 'AVXalign': False, 'size': 4}}
[Faulty Load]
{'src': {'NT': False, 'same': True, 'congruent': 0, 'type': 'addresses_US', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'NT': False, 'same': False, 'congruent': 6, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 8}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 4, 'type': 'addresses_D_ht', 'AVXalign': False, 'size': 1}}
{'src': {'same': False, 'congruent': 1, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_WC_ht'}}
{'src': {'same': True, 'congruent': 4, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 11, 'type': 'addresses_WT_ht'}}
{'src': {'same': False, 'congruent': 7, 'type': 'addresses_normal_ht'}, 'OP': 'REPM', 'dst': {'same': True, 'congruent': 9, 'type': 'addresses_D_ht'}}
{'src': {'NT': False, 'same': True, 'congruent': 9, 'type': 'addresses_WC_ht', 'AVXalign': False, 'size': 16}, 'OP': 'LOAD'}
{'src': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1}, 'OP': 'LOAD'}
{'src': {'same': False, 'congruent': 7, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}}
{'src': {'same': False, 'congruent': 10, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_D_ht'}}
{'OP': 'STOR', 'dst': {'NT': False, 'same': False, 'congruent': 9, 'type': 'addresses_WT_ht', 'AVXalign': False, 'size': 1}}
{'44': 12833, '48': 1892, '49': 149, '20': 4, '00': 5894, '46': 1052, '08': 1, 'ff': 4}
00 00 44 48 00 44 44 46 48 00 44 00 48 00 44 46 00 00 00 44 48 44 44 44 44 00 00 00 44 44 00 44 44 46 44 44 44 46 00 44 44 00 44 44 46 44 44 44 44 00 44 44 00 00 44 48 00 44 44 44 44 48 44 46 44 00 44 44 48 00 44 00 44 00 00 44 44 48 00 44 44 48 44 44 00 44 00 44 44 00 00 44 44 00 44 44 44 00 44 44 48 44 44 44 46 44 48 00 44 44 44 46 44 46 00 44 44 00 00 44 44 00 48 44 44 00 00 00 44 00 00 00 00 44 48 00 44 00 44 44 44 00 00 44 44 48 44 44 48 44 48 48 44 44 00 44 48 44 44 00 44 44 44 48 44 44 46 00 00 44 44 00 00 44 44 00 44 44 00 00 44 44 48 00 44 44 00 00 00 44 44 44 44 44 44 44 44 44 44 46 00 44 00 00 44 00 44 44 44 44 44 00 44 44 00 44 44 46 00 44 44 48 44 44 44 00 00 00 44 00 00 44 44 46 44 44 00 44 00 46 00 00 00 44 44 46 44 00 00 44 00 00 00 00 44 46 00 44 44 00 44 44 00 00 48 44 48 00 44 44 44 00 00 44 44 44 00 44 44 00 48 44 44 00 00 44 44 00 00 44 44 44 00 44 44 44 44 00 44 46 00 44 44 00 00 44 46 44 44 46 48 00 44 44 00 44 44 00 00 44 44 44 44 44 44 44 48 44 44 44 00 44 00 00 44 44 44 00 46 00 44 44 44 00 44 44 44 44 44 44 44 44 44 46 00 44 48 00 44 44 48 46 44 44 48 44 44 44 00 44 00 00 00 44 44 46 00 00 49 00 44 44 48 00 44 44 48 44 00 00 48 00 44 44 44 00 44 44 44 44 44 44 00 44 44 44 48 00 44 44 00 44 44 44 00 44 44 00 48 44 44 00 44 44 44 00 00 44 44 00 00 44 44 46 00 00 44 00 00 44 44 48 00 48 44 44 46 00 44 44 44 00 44 44 48 44 44 49 48 00 44 44 00 00 44 44 44 48 00 44 00 44 00 44 44 00 44 44 44 00 44 44 44 00 44 00 44 44 00 44 48 48 44 00 44 00 44 44 44 48 44 44 48 44 44 48 00 48 44 00 44 00 44 44 00 44 48 44 44 44 00 44 00 46 00 44 44 00 44 44 46 44 44 44 48 44 44 44 00 00 00 44 46 00 44 48 44 00 44 44 48 44 44 00 48 00 46 44 00 44 44 44 44 00 44 44 48 44 44 00 48 44 44 44 00 00 44 46 00 44 44 44 48 44 44 00 00 44 44 00 00 44 44 44 00 44 44 46 00 44 44 00 44 44 44 44 44 44 44 44 44 44 44 44 00 44 48 00 44 44 00 44 44 46 00 44 44 46 48 44 44 48 44 44 44 46 44 00 44 00 00 44 44 00 44 44 44 00 00 44 44 00 44 48 00 00 44 44 00 44 44 44 44 00 44 44 00 00 44 44 00 44 44 48 44 44 48 00 44 44 46 44 44 44 44 44 44 46 00 44 44 48 48 44 44 44 00 44 44 00 44 44 00 44 44 46 44 44 00 00 44 44 44 00 00 00 46 00 44 44 44 00 00 44 00 00 48 00 00 44 00 44 44 48 44 44 00 48 44 44 44 00 00 44 44 00 44 44 44 44 00 44 44 44 46 00 00 44 44 44 00 00 44 44 48 46 44 00 00 44 48 44 44 46 00 44 44 00 44 44 00 44 44 00 46 44 00 44 44 44 00 00 44 44 44 48 44 44 48 44 00 00 48 00 44 44 44 44 48 44 44 00 44 44 44 00 00 44 44 48 44 44 48 00 44 48 44 44 48 00 44 44 44 44 44 46 44 44 44 00 44 44 44 44 48 44 44 44 44 44 46 00 44 44 00 44 00 00 00 44 44 48 00 44 44 00 44 44 00 44 44 44 00 44 00 44 00 44 44 44 00 00 00 44 48 44 44 48 00 44 44 44 44 44 44 00 44 44 00 00 00 44 44 00 44 00 46 00 44 00 46 00 44 00 00 44 44 44 00 00 44 00 44 00 00 44 44 44 00 44 44 44 44 00 44 46 00 44 44 00 00 00 44 46 00 44 44 46 44 48 48 44 48 44 44 00 00 44 00 44 44 44 44 48 44 44 44 46 00 44 44 48 44 48 48 44 44 44 46 44 44 44 00 44 44 00 00 00 44 44 00 44 44 00 00 44 44 44 48 44
*/
| 37.119565 | 2,999 | 0.656076 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/US/_ht_zr_un_/i9-9900K_12_0xa0.log_21829_1169.asm | 6,830 | Assembly |
ZNAKI EQU 30H
LJMP START
ORG 100H
START:
MOV ZNAKI, #01011011B
MOV R3, #010101B
START2:
MOV R2, #0
WYSW:
SETB P1.6
MOV R0, #CSDS
MOV A, R3
MOVX @R0, A
MOV R0, #CSDB
;MOV R1, #ZNAKI
MOV A, ZNAKI
MOVX @R0, A
CLR P1.6
MOV A, #1
CALL DELAY_MS
INC R2
CJNE R2, #6, WYSW
SJMP START2 | 18.043478 | 28 | 0.457831 | [
"MIT"
] | Epacik/8051-ASM-Plugin | dataToTestOn/asm/5/prog03.asm | 415 | Assembly |
; A254869: Seventh partial sums of cubes (A000578).
; 1,15,111,561,2211,7293,21021,54483,129558,286858,598026,1184118,2242266,4083366,7184166,12257850,20348031,32951985,52179985,80958735,123288165,184562235,271965915,394962165,565884540,800652996,1119632580,1548656956,2120241156,2875010556,3863375868,5147486916,6803501133,8924206083,11622038883,15032549181,19318356343,24673655721,31329333321,39558752871,49684284210,62084647086,77203149870,95556908370,117747135870,144470601730,176532362370,214859875230,260518613355,314729305605,378886935141,454581636795,543621642201,648058430151,770214248551,912712183593,1078508961336,1270930676808,1493711656008,1751036666808,2047586705736,2388588598968,2779868667576,3227910719176,3739918640601,4323883879095,4988658112791,5744031424905,6600816310155,7570937856405,8667530459445,9905041444155,11299341981070,12867845703570,14629635447570,16605598552686,18818571181410,21293492130846,24057566630046,27140440634946,30574386152343,34394498144281,38638903584633,43348983260583,48569606933133,54349382492691,60740919768243,67801109671581,75591419381556,84178204297356,93633037514380,104033057601396,115461335483340,128007261260340,141766951820340,156843680130060,173348327116965,191399857083435,211125817623435,232662865041685,256157316305631,281765728591425,309655507516641,340005545184591,373006889197866,408863443832118,447792704595126,490026527430858,535811933863558,585411953412858,639106504647546,697193316282918,759988889764611,827829504820461,901072269501261,980096216271315,1065303445750401,1157120319750175,1255998705290175,1362417271321425,1476882839929200,1599931793830800,1732131542029200,1874082045529200,2026417405069200,2189807512868976,2364959770441840,2552620874568336,2753578673578161,2968664096137311,3198753154788543,3444769026545121,3707684212890483,3988522781589933,4288362692774733,4608338211814051,4949642411546118,5313529766496666,5701318841770266,6114395079358566,6554213684668650,7022302616134806,7520265680837910,8049785739118410,8612628021231535,9210643559156865
lpb $0,1
mov $3,$0
cal $3,254469 ; Sixth partial sums of cubes (A000578).
sub $0,1
add $2,$3
mov $1,$2
lpe
add $1,1
| 179.75 | 1,977 | 0.900325 | [
"Apache-2.0"
] | karttu/loda | programs/oeis/254/A254869.asm | 2,157 | Assembly |
Name: ys_chip7.asm
Type: file
Size: 38906
Last-Modified: '2016-05-13T04:50:32Z'
SHA-1: 4585360FB4DACB01E02230CE77D4199E94DF1BA5
Description: null
| 20.857143 | 47 | 0.815068 | [
"MIT"
] | prismotizm/gigaleak | other.7z/SFC.7z/SFC/ソースデータ/ヨッシーアイランド/日本_Ver0/chip/ys_chip7.asm | 146 | Assembly |
.global s_prepare_buffers
s_prepare_buffers:
push %r12
push %r9
push %rax
push %rbp
push %rcx
push %rdi
push %rdx
push %rsi
lea addresses_A_ht+0x1d8c5, %rsi
lea addresses_WT_ht+0x24b9, %rdi
nop
and %r9, %r9
mov $107, %rcx
rep movsq
nop
nop
nop
nop
nop
xor %rax, %rax
lea addresses_D_ht+0xb8c5, %rbp
nop
nop
nop
nop
dec %rax
movl $0x61626364, (%rbp)
nop
nop
nop
sub %rsi, %rsi
lea addresses_WC_ht+0x7285, %rsi
nop
xor $32027, %rax
movups (%rsi), %xmm1
vpextrq $0, %xmm1, %rdi
nop
nop
nop
nop
add $10848, %r9
lea addresses_WC_ht+0xb2c5, %rbp
cmp %rcx, %rcx
movb $0x61, (%rbp)
nop
nop
nop
nop
and %rax, %rax
lea addresses_WC_ht+0xb415, %rsi
nop
sub $20211, %rdx
mov (%rsi), %rbp
nop
nop
nop
nop
xor $7066, %rsi
lea addresses_WC_ht+0x1cec5, %rsi
lea addresses_A_ht+0x1a1c5, %rdi
nop
nop
xor $50921, %rbp
mov $33, %rcx
rep movsl
nop
nop
and $44752, %rdi
lea addresses_D_ht+0x182c5, %rsi
lea addresses_UC_ht+0x9fc5, %rdi
clflush (%rdi)
cmp $48117, %r12
mov $31, %rcx
rep movsb
nop
nop
nop
xor %rbp, %rbp
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %rbp
pop %rax
pop %r9
pop %r12
ret
.global s_faulty_load
s_faulty_load:
push %r10
push %r11
push %r13
push %rbp
push %rbx
push %rcx
push %rdi
// Load
lea addresses_US+0xfe9d, %rdi
xor $47482, %rcx
mov (%rdi), %r11
nop
nop
nop
nop
and %rbx, %rbx
// Faulty Load
lea addresses_WT+0x8ac5, %r10
nop
nop
nop
nop
cmp $51749, %rbp
vmovups (%r10), %ymm3
vextracti128 $1, %ymm3, %xmm3
vpextrq $0, %xmm3, %rbx
lea oracles, %rcx
and $0xff, %rbx
shlq $12, %rbx
mov (%rcx,%rbx,1), %rbx
pop %rdi
pop %rcx
pop %rbx
pop %rbp
pop %r13
pop %r11
pop %r10
ret
/*
<gen_faulty_load>
[REF]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
{'src': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_US'}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'congruent': 0, 'AVXalign': False, 'same': True, 'size': 32, 'NT': False, 'type': 'addresses_WT'}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'src': {'congruent': 9, 'same': False, 'type': 'addresses_A_ht'}, 'OP': 'REPM', 'dst': {'congruent': 1, 'same': False, 'type': 'addresses_WT_ht'}}
{'OP': 'STOR', 'dst': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 4, 'NT': False, 'type': 'addresses_D_ht'}}
{'src': {'congruent': 5, 'AVXalign': False, 'same': False, 'size': 16, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'OP': 'STOR', 'dst': {'congruent': 10, 'AVXalign': False, 'same': False, 'size': 1, 'NT': False, 'type': 'addresses_WC_ht'}}
{'src': {'congruent': 3, 'AVXalign': False, 'same': False, 'size': 8, 'NT': False, 'type': 'addresses_WC_ht'}, 'OP': 'LOAD'}
{'src': {'congruent': 10, 'same': False, 'type': 'addresses_WC_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_A_ht'}}
{'src': {'congruent': 11, 'same': False, 'type': 'addresses_D_ht'}, 'OP': 'REPM', 'dst': {'congruent': 3, 'same': False, 'type': 'addresses_UC_ht'}}
{'00': 21829}
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*/
| 39.322368 | 2,999 | 0.658022 | [
"MIT"
] | danielmgmi/medusa | Transynther/_processed/NONE/_zr_/i7-7700_9_0xca.log_21829_1178.asm | 5,977 | Assembly |
; A157371: a(n) = (n+1)*(9-9*n+5*n^2-n^3).
; 9,8,9,0,-55,-216,-567,-1216,-2295,-3960,-6391,-9792,-14391,-20440,-28215,-38016,-50167,-65016,-82935,-104320,-129591,-159192,-193591,-233280,-278775,-330616,-389367,-455616,-529975,-613080,-705591,-808192,-921591,-1046520,-1183735,-1334016,-1498167,-1677016,-1871415,-2082240,-2310391,-2556792,-2822391,-3108160,-3415095,-3744216,-4096567,-4473216,-4875255,-5303800,-5759991,-6244992,-6759991,-7306200,-7884855,-8497216,-9144567,-9828216,-10549495,-11309760,-12110391,-12952792,-13838391,-14768640,-15745015,-16769016,-17842167,-18966016,-20142135,-21372120,-22657591,-24000192,-25401591,-26863480,-28387575,-29975616,-31629367,-33350616,-35141175,-37002880,-38937591,-40947192,-43033591,-45198720,-47444535,-49773016,-52186167,-54686016,-57274615,-59954040,-62726391,-65593792,-68558391,-71622360,-74787895,-78057216,-81432567,-84916216,-88510455,-92217600,-96039991,-99979992,-104039991,-108222400,-112529655,-116964216,-121528567,-126225216,-131056695,-136025560,-141134391,-146385792,-151782391,-157326840,-163021815,-168870016,-174874167,-181037016,-187361335,-193849920,-200505591,-207331192,-214329591,-221503680,-228856375,-236390616,-244109367,-252015616,-260112375,-268402680,-276889591,-285576192,-294465591,-303560920,-312865335,-322382016,-332114167,-342065016,-352237815,-362635840,-373262391,-384120792,-395214391,-406546560,-418120695,-429940216,-442008567,-454329216,-466905655,-479741400,-492839991,-506204992,-519839991,-533748600,-547934455,-562401216,-577152567,-592192216,-607523895,-623151360,-639078391,-655308792,-671846391,-688695040,-705858615,-723341016,-741146167,-759278016,-777740535,-796537720,-815673591,-835152192,-854977591,-875153880,-895685175,-916575616,-937829367,-959450616,-981443575,-1003812480,-1026561591,-1049695192,-1073217591,-1097133120,-1121446135,-1146161016,-1171282167,-1196814016,-1222761015,-1249127640,-1275918391,-1303137792,-1330790391,-1358880760,-1387413495,-1416393216,-1445824567,-1475712216,-1506060855,-1536875200,-1568159991,-1599919992,-1632159991,-1664884800,-1698099255,-1731808216,-1766016567,-1800729216,-1835951095,-1871687160,-1907942391,-1944721792,-1982030391,-2019873240,-2058255415,-2097182016,-2136658167,-2176689016,-2217279735,-2258435520,-2300161591,-2342463192,-2385345591,-2428814080,-2472873975,-2517530616,-2562789367,-2608655616,-2655134775,-2702232280,-2749953591,-2798304192,-2847289591,-2896915320,-2947186935,-2998110016,-3049690167,-3101933016,-3154844215,-3208429440,-3262694391,-3317644792,-3373286391,-3429624960,-3486666295,-3544416216,-3602880567,-3662065216,-3721976055,-3782619000
sub $0,1
pow $0,2
sub $0,1
pow $0,2
sub $0,9
sub $1,$0
| 267.8 | 2,578 | 0.79537 | [
"Apache-2.0"
] | jmorken/loda | programs/oeis/157/A157371.asm | 2,678 | Assembly |
// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by Nisan and Schocken, MIT Press.
// File name: projects/04/Fill.asm
// Runs an infinite loop that listens to the keyboard input.
// When a key is pressed (any key), the program blackens the screen,
// i.e. writes "black" in every pixel;
// the screen should remain fully black as long as the key is pressed.
// When no key is pressed, the program clears the screen, i.e. writes
// "white" in every pixel;
// the screen should remain fully clear as long as no key is pressed.
(INIT)
@8192
D=A
@cnt
M=D
@SCREEN
D=A
@scr
M=D
@KBD
D=M
@PUSHED
D;JNE
@flag
M=0
@LOOP
0;JMP
(PUSHED)
@flag
M=1
@LOOP
0;JMP
(LOOP)
@flag
D=M
@FILL
D;JNE
@scr
A=M
M=0
@NEXT
0;JMP
(FILL)
@scr
A=M
M=-1
@NEXT
0;JMP
(NEXT)
@scr
M=M+1
@cnt
MD=M-1
@INIT
D;JEQ
@LOOP
0;JMP
| 14.810811 | 72 | 0.531022 | [
"CC0-1.0"
] | kentakuramochi/nand2tetris_study | 04/fill/Fill.asm | 1,096 | Assembly |
; A130453: A097806 * A059268.
; 1,2,2,2,4,4,2,4,8,8,2,4,8,16,16,2,4,8,16,32,32,2,4,8,16,32,64,64,2,4,8,16,32,64,128,128
seq $0,128219 ; A000012 * A127701. a(1) = 1, a(2) = 2, a(3) = 2; by rows, n-1 terms of 2, 3, 4...followed by "n".
seq $0,304517 ; a(n) = 16*2^n - 11 (n>=1).
div $0,64
add $0,1
| 37.125 | 113 | 0.558923 | [
"Apache-2.0"
] | ckrause/cm | programs/oeis/130/A130453.asm | 297 | Assembly |
;======================================================================================================================
; FAMISTUDIO SOUND ENGINE (3.2.0)
; Copyright (c) 2019-2021 Mathieu Gauthier
;
; Copying and distribution of this file, with or without
; modification, are permitted in any medium without royalty provided
; the copyright notice and this notice are preserved in all source
; code copies. This file is offered as-is, without any warranty.
;======================================================================================================================
;======================================================================================================================
; This is the FamiStudio sound engine. It is used by the NSF and ROM exporter of FamiStudio and can be used to make
; games. It supports every feature from FamiStudio, some of them are toggeable to save CPU/memory.
;
; This is essentially a heavily modified version of FamiTone2 by Shiru. A lot of his code and comments are still
; present here, so massive thanks to him!! I am not trying to steal his work or anything, i renamed a lot of functions
; and variables because at some point it was becoming a mess of coding standards and getting hard to maintain.
;
; Moderately advanced users can probably figure out how to use the sound engine simply by reading these comments.
; For more in-depth documentation, please go to:
;
; https://famistudio.org/doc/soundengine/
;======================================================================================================================
;======================================================================================================================
; INTERFACE
;
; The interface is pretty much the same as FamiTone2, with a slightly different naming convention. The subroutines you
; can call from your game are:
;
; - famistudio_init : Initialize the engine with some music data.
; - famistudio_music_play : Start music playback with a specific song.
; - famistudio_music_pause : Pause/unpause music playback.
; - famistudio_music_stop : Stops music playback.
; - famistudio_sfx_init : Initialize SFX engine with SFX data.
; - famistudio_sfx_play : Play a SFX.
; - famistudio_sfx_sample_play : Play a DPCM SFX.
; - famistudio_update : Updates the music/SFX engine, call once per frame, ideally from NMI.
;
; You can check the demo ROM to see how they are used or check out the online documentation for more info.
;======================================================================================================================
;======================================================================================================================
; CONFIGURATION
;
; There are 2 main ways of configuring the engine.
;
; 1) The simplest way is right here, in the section below. Simply comment/uncomment these defines, and move on
; with your life.
;
; 2) The second way is "externally", using definitions coming from elsewhere in your app or the command line. If you
; wish do so, simply define FAMISTUDIO_CFG_EXTERNAL=1 and this whole section will be ignored. You are then
; responsible for providing all configuration. This is useful if you have multiple projects that needs
; different configurations, while pointing to the same code file. This is how the provided demos and FamiStudio
; uses it.
;
; Note that unless specified, the engine uses "if" and not "ifdef" for all boolean values so you need to define these
; to non-zero values. Undefined values will be assumed to be zero.
;
; There are 4 main things to configure, each of them will be detailed below.
;
; 1) Segments (ZP/RAM/PRG)
; 2) Audio expansion
; 3) Global engine parameters
; 4) Supported features
;======================================================================================================================
.ifndef FAMISTUDIO_CFG_EXTERNAL
FAMISTUDIO_CFG_EXTERNAL = 0
.endif
; Set this to configure the sound engine from outside (in your app, or from the command line)
.if !FAMISTUDIO_CFG_EXTERNAL
;======================================================================================================================
; 1) SEGMENT CONFIGURATION
;
; You need to tell where you want to allocate the zeropage, RAM and code. This section will be slightly different for
; each assembler.
;
; For ASM6, you need to specify the .enum location for zeroage and RAM/BSS as well as the .org for the engine code.
;======================================================================================================================
FAMISTUDIO_ASM6_ZP_ENUM = $0000
FAMISTUDIO_ASM6_BSS_ENUM = $0200
FAMISTUDIO_ASM6_CODE_BASE = $8000
;======================================================================================================================
; 2) AUDIO EXPANSION CONFIGURATION
;
; You can enable up to one audio expansion (FAMISTUDIO_EXP_XXX). Enabling more than one expansion will lead to
; undefined behavior. Memory usage goes up as more complex expansions are used. The audio expansion you choose
; **MUST MATCH** with the data you will load in the engine. Loading a FDS song while enabling VRC6 will lead to
; undefined behavior.
;======================================================================================================================
; Konami VRC6 (2 extra square + saw)
; FAMISTUDIO_EXP_VRC6 = 1
; Konami VRC7 (6 FM channels)
; FAMISTUDIO_EXP_VRC7 = 1
; Nintendo MMC5 (2 extra squares, extra DPCM not supported)
; FAMISTUDIO_EXP_MMC5 = 1
; Sunsoft S5B (2 extra squares, advanced features not supported.)
; FAMISTUDIO_EXP_S5B = 1
; Famicom Disk System (extra wavetable channel)
; FAMISTUDIO_EXP_FDS = 1
; Namco 163 (between 1 and 8 extra wavetable channels) + number of channels.
; FAMISTUDIO_EXP_N163 = 1
; FAMISTUDIO_EXP_N163_CHN_CNT = 4
;======================================================================================================================
; 3) GLOBAL ENGINE CONFIGURATION
;
; These are parameters that configures the engine, but are independent of the data you will be importing, such as
; which platform (PAL/NTSC) you want to support playback for, whether SFX are enabled or not, etc. They all have the
; form FAMISTUDIO_CFG_XXX.
;======================================================================================================================
; One of these MUST be defined (PAL or NTSC playback). Note that only NTSC support is supported when using any of the audio expansions.
; FAMISTUDIO_CFG_PAL_SUPPORT = 1
FAMISTUDIO_CFG_NTSC_SUPPORT = 1
; Support for sound effects playback + number of SFX that can play at once.
; FAMISTUDIO_CFG_SFX_SUPPORT = 1
; FAMISTUDIO_CFG_SFX_STREAMS = 2
; Blaarg's smooth vibrato technique. Eliminates phase resets ("pops") on square channels.
; FAMISTUDIO_CFG_SMOOTH_VIBRATO = 1
; Enables DPCM playback support.
FAMISTUDIO_CFG_DPCM_SUPPORT = 1
; Must be enabled if you are calling sound effects from a different thread than the sound engine update.
; FAMISTUDIO_CFG_THREAD = 1
;======================================================================================================================
; 4) SUPPORTED FEATURES CONFIGURATION
;
; Every feature supported in FamiStudio is supported by this sound engine. If you know for sure that you are not using
; specific features in your music, you can disable them to save memory/processing time. Using a feature in your song
; and failing to enable it will likely lead to crashes (BRK), or undefined behavior. They all have the form
; FAMISTUDIO_USE_XXX.
;======================================================================================================================
; Must be enabled if the songs you will be importing have been created using FamiTracker tempo mode. If you are using
; FamiStudio tempo mode, this must be undefined. You cannot mix and match tempo modes, the engine can only run in one
; mode or the other.
; More information at: https://famistudio.org/doc/song/#tempo-modes
; FAMISTUDIO_USE_FAMITRACKER_TEMPO = 1
; Must be enabled if the songs uses delayed notes or delayed cuts. This is obviously only available when using
; FamiTracker tempo mode as FamiStudio tempo mode does not need this.
; FAMISTUDIO_USE_FAMITRACKER_DELAYED_NOTES_OR_CUTS = 1
; Must be enabled if any song uses the volume track. The volume track allows manipulating the volume at the track level
; independently from instruments.
; More information at: https://famistudio.org/doc/pianoroll/#editing-volume-tracks-effects
FAMISTUDIO_USE_VOLUME_TRACK = 1
; Must be enabled if any song uses slides on the volume track. Volume track must be enabled too.
; More information at: https://famistudio.org/doc/pianoroll/#editing-volume-tracks-effects
; FAMISTUDIO_USE_VOLUME_SLIDES = 1
; Must be enabled if any song uses the pitch track. The pitch track allows manipulating the pitch at the track level
; independently from instruments.
; More information at: https://famistudio.org/doc/pianoroll/#pitch
FAMISTUDIO_USE_PITCH_TRACK = 1
; Must be enabled if any song uses slide notes. Slide notes allows portamento and slide effects.
; More information at: https://famistudio.org/doc/pianoroll/#slide-notes
FAMISTUDIO_USE_SLIDE_NOTES = 1
; Must be enabled if any song uses slide notes on the noise channel too.
; More information at: https://famistudio.org/doc/pianoroll/#slide-notes
; FAMISTUDIO_USE_NOISE_SLIDE_NOTES = 1
; Must be enabled if any song uses the vibrato speed/depth effect track.
; More information at: https://famistudio.org/doc/pianoroll/#vibrato-depth-speed
FAMISTUDIO_USE_VIBRATO = 1
; Must be enabled if any song uses arpeggios (not to be confused with instrument arpeggio envelopes, those are always
; supported).
; More information at: (TODO)
FAMISTUDIO_USE_ARPEGGIO = 1
; Must be enabled if any song uses the "Duty Cycle" effect (equivalent of FamiTracker Vxx, also called "Timbre").
; FAMISTUDIO_USE_DUTYCYCLE_EFFECT = 1
.endif
; Memory location of the DPCM samples. Must be between $c000 and $ffc0, and a multiple of 64.
.ifndef FAMISTUDIO_DPCM_OFF
FAMISTUDIO_DPCM_OFF = $c000
.endif
;======================================================================================================================
; END OF CONFIGURATION
;
; Ideally, you should not have to change anything below this line.
;======================================================================================================================
;======================================================================================================================
; INTERNAL DEFINES (Do not touch)
;======================================================================================================================
.ifndef FAMISTUDIO_EXP_VRC6
FAMISTUDIO_EXP_VRC6 = 0
.endif
.ifndef FAMISTUDIO_EXP_VRC7
FAMISTUDIO_EXP_VRC7 = 0
.endif
.ifndef FAMISTUDIO_EXP_MMC5
FAMISTUDIO_EXP_MMC5 = 0
.endif
.ifndef FAMISTUDIO_EXP_S5B
FAMISTUDIO_EXP_S5B = 0
.endif
.ifndef FAMISTUDIO_EXP_FDS
FAMISTUDIO_EXP_FDS = 0
.endif
.ifndef FAMISTUDIO_EXP_N163
FAMISTUDIO_EXP_N163 = 0
.endif
.ifndef FAMISTUDIO_EXP_N163_CHN_CNT
FAMISTUDIO_EXP_N163_CHN_CNT = 1
.endif
.ifndef FAMISTUDIO_CFG_PAL_SUPPORT
FAMISTUDIO_CFG_PAL_SUPPORT = 0
.endif
.ifndef FAMISTUDIO_CFG_NTSC_SUPPORT
.if FAMISTUDIO_CFG_PAL_SUPPORT
FAMISTUDIO_CFG_NTSC_SUPPORT = 0
.else
FAMISTUDIO_CFG_NTSC_SUPPORT = 1
.endif
.endif
.if FAMISTUDIO_CFG_NTSC_SUPPORT && FAMISTUDIO_CFG_PAL_SUPPORT
FAMISTUDIO_DUAL_SUPPORT = 1
.else
FAMISTUDIO_DUAL_SUPPORT = 0
.endif
.ifndef FAMISTUDIO_CFG_SFX_SUPPORT
FAMISTUDIO_CFG_SFX_SUPPORT = 0
FAMISTUDIO_CFG_SFX_STREAMS = 0
.endif
.ifndef FAMISTUDIO_CFG_SFX_STREAMS
FAMISTUDIO_CFG_SFX_STREAMS = 1
.endif
.ifndef FAMISTUDIO_CFG_SMOOTH_VIBRATO
FAMISTUDIO_CFG_SMOOTH_VIBRATO = 0
.endif
.ifndef FAMISTUDIO_CFG_DPCM_SUPPORT
FAMISTUDIO_CFG_DPCM_SUPPORT = 0
.endif
.ifndef FAMISTUDIO_CFG_EQUALIZER
FAMISTUDIO_CFG_EQUALIZER = 0
.endif
.ifndef FAMISTUDIO_USE_FAMITRACKER_TEMPO
FAMISTUDIO_USE_FAMITRACKER_TEMPO = 0
.endif
.ifndef FAMISTUDIO_USE_FAMITRACKER_DELAYED_NOTES_OR_CUTS
FAMISTUDIO_USE_FAMITRACKER_DELAYED_NOTES_OR_CUTS = 0
.endif
.ifndef FAMISTUDIO_USE_VOLUME_TRACK
FAMISTUDIO_USE_VOLUME_TRACK = 0
.endif
.ifndef FAMISTUDIO_USE_VOLUME_SLIDES
FAMISTUDIO_USE_VOLUME_SLIDES = 0
.endif
.ifndef FAMISTUDIO_USE_PITCH_TRACK
FAMISTUDIO_USE_PITCH_TRACK = 0
.endif
.ifndef FAMISTUDIO_USE_SLIDE_NOTES
FAMISTUDIO_USE_SLIDE_NOTES = 0
.endif
.ifndef FAMISTUDIO_USE_NOISE_SLIDE_NOTES
FAMISTUDIO_USE_NOISE_SLIDE_NOTES = 0
.endif
.ifndef FAMISTUDIO_USE_VIBRATO
FAMISTUDIO_USE_VIBRATO = 0
.endif
.ifndef FAMISTUDIO_USE_ARPEGGIO
FAMISTUDIO_USE_ARPEGGIO = 0
.endif
.ifndef FAMISTUDIO_USE_DUTYCYCLE_EFFECT
FAMISTUDIO_USE_DUTYCYCLE_EFFECT = 0
.endif
.ifndef FAMISTUDIO_CFG_THREAD
FAMISTUDIO_CFG_THREAD = 0
.endif
.if (FAMISTUDIO_EXP_VRC6 + FAMISTUDIO_EXP_VRC7 + FAMISTUDIO_EXP_MMC5 + FAMISTUDIO_EXP_S5B + FAMISTUDIO_EXP_FDS + FAMISTUDIO_EXP_N163) = 0
FAMISTUDIO_EXP_NONE = 1
.else
FAMISTUDIO_EXP_NONE = 0
.endif
.if (FAMISTUDIO_EXP_VRC7 + FAMISTUDIO_EXP_N163 + FAMISTUDIO_EXP_FDS)
FAMISTUDIO_EXP_NOTE_START = 5
.endif
.if FAMISTUDIO_EXP_VRC6
FAMISTUDIO_EXP_NOTE_START = 7
.endif
.if FAMISTUDIO_USE_NOISE_SLIDE_NOTES && (FAMISTUDIO_USE_SLIDE_NOTES = 0)
.error "Noise slide notes can only be used when regular slide notes are enabled too."
.endif
.if FAMISTUDIO_USE_VOLUME_SLIDES && (FAMISTUDIO_USE_VOLUME_TRACK = 0)
.error "Volume slides can only be used when the volume track is enabled too."
.endif
.if FAMISTUDIO_USE_FAMITRACKER_DELAYED_NOTES_OR_CUTS && (FAMISTUDIO_USE_FAMITRACKER_TEMPO = 0)
.error "Delayed notes or cuts only make sense when using FamiTracker tempo."
.endif
.if (FAMISTUDIO_EXP_VRC6 + FAMISTUDIO_EXP_VRC7 + FAMISTUDIO_EXP_MMC5 + FAMISTUDIO_EXP_S5B + FAMISTUDIO_EXP_FDS + FAMISTUDIO_EXP_N163) > 1
.error "Only one audio expansion can be enabled."
.endif
.if FAMISTUDIO_EXP_N163 && ((FAMISTUDIO_EXP_N163_CHN_CNT < 1) || (FAMISTUDIO_EXP_N163_CHN_CNT > 8))
.error "N163 only supports between 1 and 8 channels."
.endif
.ifndef FAMISTUDIO_ASM6_ZP_ENUM
.error "You need to set FAMISTUDIO_ASM6_ZP_ENUM to the location of the zeropage variables."
.endif
.ifndef FAMISTUDIO_ASM6_BSS_ENUM
.error "You need to set FAMISTUDIO_ASM6_BSS_ENUM to the location of the RAM/BSS variables."
.endif
.ifndef FAMISTUDIO_ASM6_CODE_BASE
.error "You need to set FAMISTUDIO_ASM6_CODE_BASE to the location of the engine code."
.endif
FAMISTUDIO_DPCM_PTR = (FAMISTUDIO_DPCM_OFF & $3fff) >> 6
.if FAMISTUDIO_EXP_NONE
FAMISTUDIO_NUM_ENVELOPES = 3+3+2+3
FAMISTUDIO_NUM_PITCH_ENVELOPES = 3
FAMISTUDIO_NUM_CHANNELS = 5
FAMISTUDIO_NUM_DUTY_CYCLES = 3
.endif
.if FAMISTUDIO_EXP_VRC6
FAMISTUDIO_NUM_ENVELOPES = 3+3+2+3+3+3+3
FAMISTUDIO_NUM_PITCH_ENVELOPES = 6
FAMISTUDIO_NUM_CHANNELS = 8
FAMISTUDIO_NUM_DUTY_CYCLES = 6
.endif
.if FAMISTUDIO_EXP_VRC7
FAMISTUDIO_NUM_ENVELOPES = 3+3+2+3+2+2+2+2+2+2
FAMISTUDIO_NUM_PITCH_ENVELOPES = 9
FAMISTUDIO_NUM_CHANNELS = 11
FAMISTUDIO_NUM_DUTY_CYCLES = 3
.endif
.if FAMISTUDIO_EXP_FDS
FAMISTUDIO_NUM_ENVELOPES = 3+3+2+3+2
FAMISTUDIO_NUM_PITCH_ENVELOPES = 4
FAMISTUDIO_NUM_CHANNELS = 6
FAMISTUDIO_NUM_DUTY_CYCLES = 3
.endif
.if FAMISTUDIO_EXP_MMC5
FAMISTUDIO_NUM_ENVELOPES = 3+3+2+3+3+3
FAMISTUDIO_NUM_PITCH_ENVELOPES = 5
FAMISTUDIO_NUM_CHANNELS = 7
FAMISTUDIO_NUM_DUTY_CYCLES = 5
.endif
.if FAMISTUDIO_EXP_N163
FAMISTUDIO_NUM_ENVELOPES = 3+3+2+3+(FAMISTUDIO_EXP_N163_CHN_CNT*2)
FAMISTUDIO_NUM_PITCH_ENVELOPES = 3+FAMISTUDIO_EXP_N163_CHN_CNT
FAMISTUDIO_NUM_CHANNELS = 5+FAMISTUDIO_EXP_N163_CHN_CNT
FAMISTUDIO_NUM_DUTY_CYCLES = 3
.endif
.if FAMISTUDIO_EXP_S5B
FAMISTUDIO_NUM_ENVELOPES = 3+3+2+3+2+2+2
FAMISTUDIO_NUM_PITCH_ENVELOPES = 6
FAMISTUDIO_NUM_CHANNELS = 8
FAMISTUDIO_NUM_DUTY_CYCLES = 3
.endif
.if FAMISTUDIO_EXP_NONE
FAMISTUDIO_NUM_VOLUME_SLIDES = 4
.else
FAMISTUDIO_NUM_VOLUME_SLIDES = FAMISTUDIO_NUM_CHANNELS ; DPCM volume is unused.
.endif
.if FAMISTUDIO_USE_NOISE_SLIDE_NOTES
FAMISTUDIO_NUM_SLIDES = FAMISTUDIO_NUM_PITCH_ENVELOPES + 1
.else
FAMISTUDIO_NUM_SLIDES = FAMISTUDIO_NUM_PITCH_ENVELOPES
.endif
; Keep the noise slide at the end so the pitch envelopes/slides are in sync.
FAMISTUDIO_NOISE_SLIDE_INDEX = FAMISTUDIO_NUM_SLIDES - 1
FAMISTUDIO_CH0_ENVS = 0
FAMISTUDIO_CH1_ENVS = 3
FAMISTUDIO_CH2_ENVS = 6
FAMISTUDIO_CH3_ENVS = 8
FAMISTUDIO_EXPANSION_CH0_IDX = 5
.if FAMISTUDIO_EXP_VRC6
FAMISTUDIO_VRC6_CH0_PITCH_ENV_IDX = 3
FAMISTUDIO_VRC6_CH1_PITCH_ENV_IDX = 4
FAMISTUDIO_VRC6_CH2_PITCH_ENV_IDX = 5
.endif
.if FAMISTUDIO_EXP_VRC7
FAMISTUDIO_VRC7_CH0_PITCH_ENV_IDX = 3
FAMISTUDIO_VRC7_CH1_PITCH_ENV_IDX = 4
FAMISTUDIO_VRC7_CH2_PITCH_ENV_IDX = 5
FAMISTUDIO_VRC7_CH3_PITCH_ENV_IDX = 6
FAMISTUDIO_VRC7_CH4_PITCH_ENV_IDX = 7
FAMISTUDIO_VRC7_CH5_PITCH_ENV_IDX = 8
.endif
.if FAMISTUDIO_EXP_FDS
FAMISTUDIO_FDS_CH0_PITCH_ENV_IDX = 3
.endif
.if FAMISTUDIO_EXP_MMC5
FAMISTUDIO_MMC5_CH0_PITCH_ENV_IDX = 3
FAMISTUDIO_MMC5_CH1_PITCH_ENV_IDX = 4
.endif
.if FAMISTUDIO_EXP_N163
FAMISTUDIO_N163_CH0_PITCH_ENV_IDX = 3
FAMISTUDIO_N163_CH1_PITCH_ENV_IDX = 4
FAMISTUDIO_N163_CH2_PITCH_ENV_IDX = 5
FAMISTUDIO_N163_CH3_PITCH_ENV_IDX = 6
FAMISTUDIO_N163_CH4_PITCH_ENV_IDX = 7
FAMISTUDIO_N163_CH5_PITCH_ENV_IDX = 8
FAMISTUDIO_N163_CH6_PITCH_ENV_IDX = 9
FAMISTUDIO_N163_CH7_PITCH_ENV_IDX = 10
.endif
.if FAMISTUDIO_EXP_S5B
FAMISTUDIO_S5B_CH0_PITCH_ENV_IDX = 3
FAMISTUDIO_S5B_CH1_PITCH_ENV_IDX = 4
FAMISTUDIO_S5B_CH2_PITCH_ENV_IDX = 5
.endif
.if FAMISTUDIO_EXP_VRC6
FAMISTUDIO_VRC6_CH0_IDX = 5
FAMISTUDIO_VRC6_CH1_IDX = 6
FAMISTUDIO_VRC6_CH2_IDX = 7
.else
FAMISTUDIO_VRC6_CH0_IDX = -1
FAMISTUDIO_VRC6_CH1_IDX = -1
.endif
.if FAMISTUDIO_EXP_VRC7
FAMISTUDIO_VRC7_CH0_IDX = 5
FAMISTUDIO_VRC7_CH1_IDX = 6
FAMISTUDIO_VRC7_CH2_IDX = 7
FAMISTUDIO_VRC7_CH3_IDX = 8
FAMISTUDIO_VRC7_CH4_IDX = 9
FAMISTUDIO_VRC7_CH5_IDX = 10
.endif
.if FAMISTUDIO_EXP_FDS
FAMISTUDIO_FDS_CH0_IDX = 5
.endif
.if FAMISTUDIO_EXP_MMC5
FAMISTUDIO_MMC5_CH0_IDX = 5
FAMISTUDIO_MMC5_CH1_IDX = 6
.else
FAMISTUDIO_MMC5_CH0_IDX = -1
FAMISTUDIO_MMC5_CH1_IDX = -1
.endif
.if FAMISTUDIO_EXP_N163
FAMISTUDIO_N163_CH0_IDX = 5
FAMISTUDIO_N163_CH1_IDX = 6
FAMISTUDIO_N163_CH2_IDX = 7
FAMISTUDIO_N163_CH3_IDX = 8
FAMISTUDIO_N163_CH4_IDX = 9
FAMISTUDIO_N163_CH5_IDX = 10
FAMISTUDIO_N163_CH6_IDX = 11
FAMISTUDIO_N163_CH7_IDX = 12
.endif
.if FAMISTUDIO_EXP_S5B
FAMISTUDIO_S5B_CH0_IDX = 5
FAMISTUDIO_S5B_CH1_IDX = 6
FAMISTUDIO_S5B_CH2_IDX = 7
.endif
.if FAMISTUDIO_EXP_VRC6
FAMISTUDIO_VRC6_CH0_ENVS = 11
FAMISTUDIO_VRC6_CH1_ENVS = 14
FAMISTUDIO_VRC6_CH2_ENVS = 17
.endif
.if FAMISTUDIO_EXP_VRC7
FAMISTUDIO_VRC7_CH0_ENVS = 11
FAMISTUDIO_VRC7_CH1_ENVS = 13
FAMISTUDIO_VRC7_CH2_ENVS = 15
FAMISTUDIO_VRC7_CH3_ENVS = 17
FAMISTUDIO_VRC7_CH4_ENVS = 19
FAMISTUDIO_VRC7_CH5_ENVS = 21
.endif
.if FAMISTUDIO_EXP_FDS
FAMISTUDIO_FDS_CH0_ENVS = 11
.endif
.if FAMISTUDIO_EXP_MMC5
FAMISTUDIO_MMC5_CH0_ENVS = 11
FAMISTUDIO_MMC5_CH1_ENVS = 14
.endif
.if FAMISTUDIO_EXP_N163
FAMISTUDIO_N163_CH0_ENVS = 11
FAMISTUDIO_N163_CH1_ENVS = 13
FAMISTUDIO_N163_CH2_ENVS = 15
FAMISTUDIO_N163_CH3_ENVS = 17
FAMISTUDIO_N163_CH4_ENVS = 19
FAMISTUDIO_N163_CH5_ENVS = 21
FAMISTUDIO_N163_CH6_ENVS = 23
FAMISTUDIO_N163_CH7_ENVS = 25
.endif
.if FAMISTUDIO_EXP_S5B
FAMISTUDIO_S5B_CH0_ENVS = 11
FAMISTUDIO_S5B_CH1_ENVS = 13
FAMISTUDIO_S5B_CH2_ENVS = 15
.endif
.if FAMISTUDIO_EXP_VRC6
FAMISTUDIO_VRC6_CH0_DUTY_IDX = 3
FAMISTUDIO_VRC6_CH1_DUTY_IDX = 4
FAMISTUDIO_VRC6_CH2_DUTY_IDX = 5
.endif
.if FAMISTUDIO_EXP_MMC5
FAMISTUDIO_MMC5_CH0_DUTY_IDX = 3
FAMISTUDIO_MMC5_CH1_DUTY_IDX = 4
.endif
FAMISTUDIO_ENV_VOLUME_OFF = 0
FAMISTUDIO_ENV_NOTE_OFF = 1
FAMISTUDIO_ENV_DUTY_OFF = 2
FAMISTUDIO_VRC7_PITCH_SHIFT = 3
.if (FAMISTUDIO_EXP_N163_CHN_CNT > 4)
FAMISTUDIO_N163_PITCH_SHIFT = 5
.endif
.if (FAMISTUDIO_EXP_N163_CHN_CNT > 2) & (FAMISTUDIO_EXP_N163_CHN_CNT <= 4)
FAMISTUDIO_N163_PITCH_SHIFT = 4
.endif
.if (FAMISTUDIO_EXP_N163_CHN_CNT > 1) & (FAMISTUDIO_EXP_N163_CHN_CNT <= 2)
FAMISTUDIO_N163_PITCH_SHIFT = 3
.endif
.if (FAMISTUDIO_EXP_N163_CHN_CNT = 1)
FAMISTUDIO_N163_PITCH_SHIFT = 2
.endif
.if FAMISTUDIO_EXP_VRC7
FAMISTUDIO_PITCH_SHIFT = FAMISTUDIO_VRC7_PITCH_SHIFT
.else
.if FAMISTUDIO_EXP_N163
FAMISTUDIO_PITCH_SHIFT = FAMISTUDIO_N163_PITCH_SHIFT
.else
FAMISTUDIO_PITCH_SHIFT = 0
.endif
.endif
.if FAMISTUDIO_EXP_N163
FAMISTUDIO_N163_CHN_MASK = (FAMISTUDIO_EXP_N163_CHN_CNT - 1) << 4
.endif
.if FAMISTUDIO_CFG_SFX_SUPPORT
FAMISTUDIO_SFX_STRUCT_SIZE = 15
FAMISTUDIO_SFX_CH0 = FAMISTUDIO_SFX_STRUCT_SIZE * 0
FAMISTUDIO_SFX_CH1 = FAMISTUDIO_SFX_STRUCT_SIZE * 1
FAMISTUDIO_SFX_CH2 = FAMISTUDIO_SFX_STRUCT_SIZE * 2
FAMISTUDIO_SFX_CH3 = FAMISTUDIO_SFX_STRUCT_SIZE * 3
.endif
;======================================================================================================================
; RAM VARIABLES (You should not have to play with these)
;======================================================================================================================
.enum FAMISTUDIO_ASM6_BSS_ENUM
famistudio_env_value: .dsb FAMISTUDIO_NUM_ENVELOPES
famistudio_env_repeat: .dsb FAMISTUDIO_NUM_ENVELOPES
famistudio_env_addr_lo: .dsb FAMISTUDIO_NUM_ENVELOPES
famistudio_env_addr_hi: .dsb FAMISTUDIO_NUM_ENVELOPES
famistudio_env_ptr: .dsb FAMISTUDIO_NUM_ENVELOPES
famistudio_pitch_env_value_lo: .dsb FAMISTUDIO_NUM_PITCH_ENVELOPES
famistudio_pitch_env_value_hi: .dsb FAMISTUDIO_NUM_PITCH_ENVELOPES
famistudio_pitch_env_repeat: .dsb FAMISTUDIO_NUM_PITCH_ENVELOPES
famistudio_pitch_env_addr_lo: .dsb FAMISTUDIO_NUM_PITCH_ENVELOPES
famistudio_pitch_env_addr_hi: .dsb FAMISTUDIO_NUM_PITCH_ENVELOPES
famistudio_pitch_env_ptr: .dsb FAMISTUDIO_NUM_PITCH_ENVELOPES
.if FAMISTUDIO_USE_PITCH_TRACK
famistudio_pitch_env_fine_value: .dsb FAMISTUDIO_NUM_PITCH_ENVELOPES
.endif
.if FAMISTUDIO_USE_SLIDE_NOTES
famistudio_slide_step: .dsb FAMISTUDIO_NUM_SLIDES
famistudio_slide_pitch_lo: .dsb FAMISTUDIO_NUM_SLIDES
famistudio_slide_pitch_hi: .dsb FAMISTUDIO_NUM_SLIDES
.endif
famistudio_chn_ptr_lo: .dsb FAMISTUDIO_NUM_CHANNELS
famistudio_chn_ptr_hi: .dsb FAMISTUDIO_NUM_CHANNELS
famistudio_chn_note: .dsb FAMISTUDIO_NUM_CHANNELS
famistudio_chn_instrument: .dsb FAMISTUDIO_NUM_CHANNELS
famistudio_chn_repeat: .dsb FAMISTUDIO_NUM_CHANNELS
famistudio_chn_return_lo: .dsb FAMISTUDIO_NUM_CHANNELS
famistudio_chn_return_hi: .dsb FAMISTUDIO_NUM_CHANNELS
famistudio_chn_ref_len: .dsb FAMISTUDIO_NUM_CHANNELS
.if FAMISTUDIO_USE_VOLUME_TRACK
famistudio_chn_volume_track: .dsb FAMISTUDIO_NUM_CHANNELS
.if FAMISTUDIO_USE_VOLUME_SLIDES
famistudio_chn_volume_slide_step: .dsb FAMISTUDIO_NUM_VOLUME_SLIDES
famistudio_chn_volume_slide_target: .dsb FAMISTUDIO_NUM_VOLUME_SLIDES
.endif
.endif
.if FAMISTUDIO_USE_VIBRATO || FAMISTUDIO_USE_ARPEGGIO
famistudio_chn_env_override: .dsb FAMISTUDIO_NUM_CHANNELS ; bit 7 = pitch, bit 0 = arpeggio.
.endif
.if FAMISTUDIO_USE_FAMITRACKER_DELAYED_NOTES_OR_CUTS
famistudio_chn_note_delay: .dsb FAMISTUDIO_NUM_CHANNELS
famistudio_chn_cut_delay: .dsb FAMISTUDIO_NUM_CHANNELS
.endif
.if FAMISTUDIO_EXP_N163 || FAMISTUDIO_EXP_VRC7 || FAMISTUDIO_EXP_FDS
famistudio_chn_inst_changed: .dsb FAMISTUDIO_NUM_CHANNELS-5
.endif
.if FAMISTUDIO_CFG_EQUALIZER
famistudio_chn_note_counter: .dsb FAMISTUDIO_NUM_CHANNELS
.endif
.if FAMISTUDIO_EXP_VRC6
famistudio_vrc6_saw_volume: .dsb 1 ; -1 = 1/4, 0 = 1/2, 1 = Full
.endif
.if FAMISTUDIO_EXP_VRC7
famistudio_chn_vrc7_prev_hi: .dsb 6
famistudio_chn_vrc7_patch: .dsb 6
famistudio_chn_vrc7_trigger: .dsb 6 ; bit 0 = new note triggered, bit 7 = note released.
.endif
.if FAMISTUDIO_EXP_N163
famistudio_chn_n163_wave_len: .dsb FAMISTUDIO_EXP_N163_CHN_CNT
.endif
.if FAMISTUDIO_USE_DUTYCYCLE_EFFECT
famistudio_duty_cycle: .dsb FAMISTUDIO_NUM_DUTY_CYCLES
.endif
.if FAMISTUDIO_USE_FAMITRACKER_TEMPO
famistudio_tempo_step_lo: .dsb 1
famistudio_tempo_step_hi: .dsb 1
famistudio_tempo_acc_lo: .dsb 1
famistudio_tempo_acc_hi: .dsb 1
.if FAMISTUDIO_USE_FAMITRACKER_DELAYED_NOTES_OR_CUTS
famistudio_tempo_advance_row: .dsb 1
.endif
.else
famistudio_tempo_env_ptr_lo: .dsb 1
famistudio_tempo_env_ptr_hi: .dsb 1
famistudio_tempo_env_counter: .dsb 1
famistudio_tempo_env_idx: .dsb 1
famistudio_tempo_frame_num: .dsb 1
famistudio_tempo_frame_cnt: .dsb 1
.endif
famistudio_pal_adjust: .dsb 1
famistudio_song_list_lo: .dsb 1
famistudio_song_list_hi: .dsb 1
famistudio_instrument_lo: .dsb 1
famistudio_instrument_hi: .dsb 1
famistudio_dpcm_list_lo: .dsb 1 ; TODO: Not needed if DPCM support is disabled.
famistudio_dpcm_list_hi: .dsb 1 ; TODO: Not needed if DPCM support is disabled.
famistudio_dpcm_effect: .dsb 1 ; TODO: Not needed if DPCM support is disabled.
famistudio_pulse1_prev: .dsb 1
famistudio_pulse2_prev: .dsb 1
famistudio_song_speed = famistudio_chn_instrument+4
.if FAMISTUDIO_EXP_MMC5
famistudio_mmc5_pulse1_prev: .dsb 1
famistudio_mmc5_pulse2_prev: .dsb 1
.endif
.if FAMISTUDIO_EXP_FDS
famistudio_fds_mod_speed: .dsb 2
famistudio_fds_mod_depth: .dsb 1
famistudio_fds_mod_delay: .dsb 1
famistudio_fds_override_flags: .dsb 1 ; Bit 7 = mod speed overriden, bit 6 mod depth overriden
.endif
.if FAMISTUDIO_EXP_VRC7
famistudio_vrc7_dummy: .dsb 1 ; TODO: Find a dummy address i can simply write to without side effects.
.endif
; FDS, N163 and VRC7 have very different instrument layout and are 16-bytes, so we keep them seperate.
.if FAMISTUDIO_EXP_FDS || FAMISTUDIO_EXP_N163 || FAMISTUDIO_EXP_VRC7
famistudio_exp_instrument_lo: .dsb 1
famistudio_exp_instrument_hi: .dsb 1
.endif
.if FAMISTUDIO_CFG_SFX_SUPPORT
famistudio_output_buf: .dsb 11
famistudio_sfx_addr_lo: .dsb 1
famistudio_sfx_addr_hi: .dsb 1
famistudio_sfx_base_addr: .dsb (FAMISTUDIO_CFG_SFX_STREAMS * FAMISTUDIO_SFX_STRUCT_SIZE)
; TODO: Refactor SFX memory layout. These uses a AoS approach, not fan.
famistudio_sfx_repeat = famistudio_sfx_base_addr + 0
famistudio_sfx_ptr_lo = famistudio_sfx_base_addr + 1
famistudio_sfx_ptr_hi = famistudio_sfx_base_addr + 2
famistudio_sfx_offset = famistudio_sfx_base_addr + 3
famistudio_sfx_buffer = famistudio_sfx_base_addr + 4
.endif
.ende
;======================================================================================================================
; ZEROPAGE VARIABLES
;
; These are only used as temporary variable during the famistudio_xxx calls.
; Feel free to alias those with other ZP values in your programs to save a few bytes.
;======================================================================================================================
.enum FAMISTUDIO_ASM6_ZP_ENUM
famistudio_r0: .dsb 1
famistudio_r1: .dsb 1
famistudio_r2: .dsb 1
famistudio_ptr0: .dsb 2
famistudio_ptr1: .dsb 2
famistudio_ptr0_lo = famistudio_ptr0+0
famistudio_ptr0_hi = famistudio_ptr0+1
famistudio_ptr1_lo = famistudio_ptr1+0
famistudio_ptr1_hi = famistudio_ptr1+1
.ende
;======================================================================================================================
; CODE
;======================================================================================================================
.base FAMISTUDIO_ASM6_CODE_BASE
FAMISTUDIO_APU_PL1_VOL = $4000
FAMISTUDIO_APU_PL1_SWEEP = $4001
FAMISTUDIO_APU_PL1_LO = $4002
FAMISTUDIO_APU_PL1_HI = $4003
FAMISTUDIO_APU_PL2_VOL = $4004
FAMISTUDIO_APU_PL2_SWEEP = $4005
FAMISTUDIO_APU_PL2_LO = $4006
FAMISTUDIO_APU_PL2_HI = $4007
FAMISTUDIO_APU_TRI_LINEAR = $4008
FAMISTUDIO_APU_TRI_LO = $400a
FAMISTUDIO_APU_TRI_HI = $400b
FAMISTUDIO_APU_NOISE_VOL = $400c
FAMISTUDIO_APU_NOISE_LO = $400e
FAMISTUDIO_APU_NOISE_HI = $400f
FAMISTUDIO_APU_DMC_FREQ = $4010
FAMISTUDIO_APU_DMC_RAW = $4011
FAMISTUDIO_APU_DMC_START = $4012
FAMISTUDIO_APU_DMC_LEN = $4013
FAMISTUDIO_APU_SND_CHN = $4015
FAMISTUDIO_APU_FRAME_CNT = $4017
.if FAMISTUDIO_EXP_VRC6
FAMISTUDIO_VRC6_PL1_VOL = $9000
FAMISTUDIO_VRC6_PL1_LO = $9001
FAMISTUDIO_VRC6_PL1_HI = $9002
FAMISTUDIO_VRC6_PL2_VOL = $a000
FAMISTUDIO_VRC6_PL2_LO = $a001
FAMISTUDIO_VRC6_PL2_HI = $a002
FAMISTUDIO_VRC6_SAW_VOL = $b000
FAMISTUDIO_VRC6_SAW_LO = $b001
FAMISTUDIO_VRC6_SAW_HI = $b002
.endif
.if FAMISTUDIO_EXP_VRC7
FAMISTUDIO_VRC7_SILENCE = $e000
FAMISTUDIO_VRC7_REG_SEL = $9010
FAMISTUDIO_VRC7_REG_WRITE = $9030
FAMISTUDIO_VRC7_REG_LO_1 = $10
FAMISTUDIO_VRC7_REG_LO_2 = $11
FAMISTUDIO_VRC7_REG_LO_3 = $12
FAMISTUDIO_VRC7_REG_LO_4 = $13
FAMISTUDIO_VRC7_REG_LO_5 = $14
FAMISTUDIO_VRC7_REG_LO_6 = $15
FAMISTUDIO_VRC7_REG_HI_1 = $20
FAMISTUDIO_VRC7_REG_HI_2 = $21
FAMISTUDIO_VRC7_REG_HI_3 = $22
FAMISTUDIO_VRC7_REG_HI_4 = $23
FAMISTUDIO_VRC7_REG_HI_5 = $24
FAMISTUDIO_VRC7_REG_HI_6 = $25
FAMISTUDIO_VRC7_REG_VOL_1 = $30
FAMISTUDIO_VRC7_REG_VOL_2 = $31
FAMISTUDIO_VRC7_REG_VOL_3 = $32
FAMISTUDIO_VRC7_REG_VOL_4 = $33
FAMISTUDIO_VRC7_REG_VOL_5 = $34
FAMISTUDIO_VRC7_REG_VOL_6 = $35
.endif
.if FAMISTUDIO_EXP_MMC5
FAMISTUDIO_MMC5_PL1_VOL = $5000
FAMISTUDIO_MMC5_PL1_SWEEP = $5001
FAMISTUDIO_MMC5_PL1_LO = $5002
FAMISTUDIO_MMC5_PL1_HI = $5003
FAMISTUDIO_MMC5_PL2_VOL = $5004
FAMISTUDIO_MMC5_PL2_SWEEP = $5005
FAMISTUDIO_MMC5_PL2_LO = $5006
FAMISTUDIO_MMC5_PL2_HI = $5007
FAMISTUDIO_MMC5_PCM_MODE = $5010
FAMISTUDIO_MMC5_SND_CHN = $5015
.endif
.if FAMISTUDIO_EXP_N163
FAMISTUDIO_N163_SILENCE = $e000
FAMISTUDIO_N163_ADDR = $f800
FAMISTUDIO_N163_DATA = $4800
FAMISTUDIO_N163_REG_FREQ_LO = $78
FAMISTUDIO_N163_REG_PHASE_LO = $79
FAMISTUDIO_N163_REG_FREQ_MID = $7a
FAMISTUDIO_N163_REG_PHASE_MID = $7b
FAMISTUDIO_N163_REG_FREQ_HI = $7c
FAMISTUDIO_N163_REG_PHASE_HI = $7d
FAMISTUDIO_N163_REG_WAVE = $7e
FAMISTUDIO_N163_REG_VOLUME = $7f
.endif
.if FAMISTUDIO_EXP_S5B
FAMISTUDIO_S5B_ADDR = $c000
FAMISTUDIO_S5B_DATA = $e000
FAMISTUDIO_S5B_REG_LO_A = $00
FAMISTUDIO_S5B_REG_HI_A = $01
FAMISTUDIO_S5B_REG_LO_B = $02
FAMISTUDIO_S5B_REG_HI_B = $03
FAMISTUDIO_S5B_REG_LO_C = $04
FAMISTUDIO_S5B_REG_HI_C = $05
FAMISTUDIO_S5B_REG_NOISE = $06
FAMISTUDIO_S5B_REG_TONE = $07
FAMISTUDIO_S5B_REG_VOL_A = $08
FAMISTUDIO_S5B_REG_VOL_B = $09
FAMISTUDIO_S5B_REG_VOL_C = $0a
FAMISTUDIO_S5B_REG_ENV_LO = $0b
FAMISTUDIO_S5B_REG_ENV_HI = $0c
FAMISTUDIO_S5B_REG_SHAPE = $0d
FAMISTUDIO_S5B_REG_IO_A = $0e
FAMISTUDIO_S5B_REG_IO_B = $0f
.endif
.if FAMISTUDIO_EXP_FDS
FAMISTUDIO_FDS_WAV_START = $4040
FAMISTUDIO_FDS_VOL_ENV = $4080
FAMISTUDIO_FDS_FREQ_LO = $4082
FAMISTUDIO_FDS_FREQ_HI = $4083
FAMISTUDIO_FDS_SWEEP_ENV = $4084
FAMISTUDIO_FDS_SWEEP_BIAS = $4085
FAMISTUDIO_FDS_MOD_LO = $4086
FAMISTUDIO_FDS_MOD_HI = $4087
FAMISTUDIO_FDS_MOD_TABLE = $4088
FAMISTUDIO_FDS_VOL = $4089
FAMISTUDIO_FDS_ENV_SPEED = $408A
.endif
.if !FAMISTUDIO_CFG_SFX_SUPPORT
; Output directly to APU
FAMISTUDIO_ALIAS_PL1_VOL = FAMISTUDIO_APU_PL1_VOL
FAMISTUDIO_ALIAS_PL1_LO = FAMISTUDIO_APU_PL1_LO
FAMISTUDIO_ALIAS_PL1_HI = FAMISTUDIO_APU_PL1_HI
FAMISTUDIO_ALIAS_PL2_VOL = FAMISTUDIO_APU_PL2_VOL
FAMISTUDIO_ALIAS_PL2_LO = FAMISTUDIO_APU_PL2_LO
FAMISTUDIO_ALIAS_PL2_HI = FAMISTUDIO_APU_PL2_HI
FAMISTUDIO_ALIAS_TRI_LINEAR = FAMISTUDIO_APU_TRI_LINEAR
FAMISTUDIO_ALIAS_TRI_LO = FAMISTUDIO_APU_TRI_LO
FAMISTUDIO_ALIAS_TRI_HI = FAMISTUDIO_APU_TRI_HI
FAMISTUDIO_ALIAS_NOISE_VOL = FAMISTUDIO_APU_NOISE_VOL
FAMISTUDIO_ALIAS_NOISE_LO = FAMISTUDIO_APU_NOISE_LO
.else
; Otherwise write to the output buffer
FAMISTUDIO_ALIAS_PL1_VOL = famistudio_output_buf + 0
FAMISTUDIO_ALIAS_PL1_LO = famistudio_output_buf + 1
FAMISTUDIO_ALIAS_PL1_HI = famistudio_output_buf + 2
FAMISTUDIO_ALIAS_PL2_VOL = famistudio_output_buf + 3
FAMISTUDIO_ALIAS_PL2_LO = famistudio_output_buf + 4
FAMISTUDIO_ALIAS_PL2_HI = famistudio_output_buf + 5
FAMISTUDIO_ALIAS_TRI_LINEAR = famistudio_output_buf + 6
FAMISTUDIO_ALIAS_TRI_LO = famistudio_output_buf + 7
FAMISTUDIO_ALIAS_TRI_HI = famistudio_output_buf + 8
FAMISTUDIO_ALIAS_NOISE_VOL = famistudio_output_buf + 9
FAMISTUDIO_ALIAS_NOISE_LO = famistudio_output_buf + 10
.endif
;======================================================================================================================
; FAMISTUDIO_INIT (public)
;
; Reset APU, initialize the sound engine with some music data.
;
; [in] a : Playback platform, zero for PAL, non-zero for NTSC.
; [in] x : Pointer to music data (lo)
; [in] y : Pointer to music data (hi)
;======================================================================================================================
famistudio_init:
music_data_ptr = famistudio_ptr0
stx famistudio_song_list_lo
sty famistudio_song_list_hi
stx music_data_ptr+0
sty music_data_ptr+1
.if FAMISTUDIO_DUAL_SUPPORT
tax
beq @pal
lda #97
@pal:
.else
.if FAMISTUDIO_CFG_PAL_SUPPORT
lda #0
.endif
.if FAMISTUDIO_CFG_NTSC_SUPPORT
lda #97
.endif
.endif
sta famistudio_pal_adjust
jsr famistudio_music_stop
; Instrument address
ldy #1
lda (music_data_ptr),y
sta famistudio_instrument_lo
iny
lda (music_data_ptr),y
sta famistudio_instrument_hi
iny
; Expansions instrument address
.if FAMISTUDIO_EXP_FDS || FAMISTUDIO_EXP_N163 || FAMISTUDIO_EXP_VRC7
lda (music_data_ptr),y
sta famistudio_exp_instrument_lo
iny
lda (music_data_ptr),y
sta famistudio_exp_instrument_hi
iny
.endif
; Sample list address
lda (music_data_ptr),y
sta famistudio_dpcm_list_lo
iny
lda (music_data_ptr),y
sta famistudio_dpcm_list_hi
lda #$80 ; Previous pulse period MSB, to not write it when not changed
sta famistudio_pulse1_prev
sta famistudio_pulse2_prev
lda #$0f ; Enable channels, stop DMC
sta FAMISTUDIO_APU_SND_CHN
lda #$80 ; Disable triangle length counter
sta FAMISTUDIO_APU_TRI_LINEAR
lda #$00 ; Load noise length
sta FAMISTUDIO_APU_NOISE_HI
lda #$30 ; Volumes to 0
sta FAMISTUDIO_APU_PL1_VOL
sta FAMISTUDIO_APU_PL2_VOL
sta FAMISTUDIO_APU_NOISE_VOL
lda #$08 ; No sweep
sta FAMISTUDIO_APU_PL1_SWEEP
sta FAMISTUDIO_APU_PL2_SWEEP
.if FAMISTUDIO_EXP_VRC7
@init_vrc7:
lda #0
sta FAMISTUDIO_VRC7_SILENCE ; Enable VRC7 audio.
.endif
.if FAMISTUDIO_EXP_MMC5
@init_mmc5:
lda #$00
sta FAMISTUDIO_MMC5_PCM_MODE
lda #$03
sta FAMISTUDIO_MMC5_SND_CHN
.endif
.if FAMISTUDIO_EXP_S5B
@init_s5b:
lda #FAMISTUDIO_S5B_REG_TONE
sta FAMISTUDIO_S5B_ADDR
lda #$38 ; No noise, just 3 tones for now.
sta FAMISTUDIO_S5B_DATA
.endif
jmp famistudio_music_stop
;======================================================================================================================
; FAMISTUDIO_MUSIC_STOP (public)
;
; Stops any music currently playing, if any. Note that this will not update the APU, so sound might linger. Calling
; famistudio_update after this will update the APU.
;
; [in] no input params.
;======================================================================================================================
famistudio_music_stop:
lda #0
sta famistudio_song_speed
sta famistudio_dpcm_effect
ldx #0
@set_channels:
sta famistudio_chn_repeat,x
sta famistudio_chn_instrument,x
sta famistudio_chn_note,x
sta famistudio_chn_ref_len,x
.if FAMISTUDIO_USE_VOLUME_TRACK
sta famistudio_chn_volume_track,x
.endif
.if FAMISTUDIO_USE_VIBRATO || FAMISTUDIO_USE_ARPEGGIO
sta famistudio_chn_env_override,x
.endif
.if FAMISTUDIO_CFG_EQUALIZER
sta famistudio_chn_note_counter,x
.endif
.if FAMISTUDIO_USE_FAMITRACKER_DELAYED_NOTES_OR_CUTS
lda #$ff
sta famistudio_chn_note_delay,x
sta famistudio_chn_cut_delay,x
lda #0
.endif
inx
cpx #FAMISTUDIO_NUM_CHANNELS
bne @set_channels
.if FAMISTUDIO_USE_DUTYCYCLE_EFFECT
ldx #0
@set_duty_cycles:
sta famistudio_duty_cycle,x
inx
cpx #FAMISTUDIO_NUM_DUTY_CYCLES
bne @set_duty_cycles
.endif
.if FAMISTUDIO_USE_SLIDE_NOTES
ldx #0
@set_slides:
sta famistudio_slide_step, x
inx
cpx #FAMISTUDIO_NUM_SLIDES
bne @set_slides
.endif
.if FAMISTUDIO_USE_VOLUME_SLIDES
ldx #0
@set_volume_slides:
sta famistudio_chn_volume_slide_step, x
sta famistudio_chn_volume_slide_target, x
inx
cpx #FAMISTUDIO_NUM_VOLUME_SLIDES
bne @set_volume_slides
.endif
ldx #0
@set_envelopes:
lda #<famistudio_dummy_envelope
sta famistudio_env_addr_lo,x
lda #>famistudio_dummy_envelope
sta famistudio_env_addr_hi,x
lda #0
sta famistudio_env_repeat,x
sta famistudio_env_value,x
sta famistudio_env_ptr,x
inx
cpx #FAMISTUDIO_NUM_ENVELOPES
bne @set_envelopes
ldx #0
@set_pitch_envelopes:
lda #<famistudio_dummy_pitch_envelope
sta famistudio_pitch_env_addr_lo,x
lda #>famistudio_dummy_pitch_envelope
sta famistudio_pitch_env_addr_hi,x
lda #0
sta famistudio_pitch_env_repeat,x
sta famistudio_pitch_env_value_lo,x
sta famistudio_pitch_env_value_hi,x
.if FAMISTUDIO_USE_PITCH_TRACK
sta famistudio_pitch_env_fine_value,x
.endif
lda #1
sta famistudio_pitch_env_ptr,x
inx
cpx #FAMISTUDIO_NUM_PITCH_ENVELOPES
bne @set_pitch_envelopes
jmp famistudio_sample_stop
;======================================================================================================================
; FAMISTUDIO_MUSIC_PLAY (public)
;
; Plays a song from the loaded music data (from a previous call to famistudio_init).
;
; [in] a : Song index.
;======================================================================================================================
famistudio_music_play:
tmp = famistudio_ptr0_lo
song_list_ptr = famistudio_ptr0
temp_env_ptr = famistudio_ptr1
ldx famistudio_song_list_lo
stx song_list_ptr+0
ldx famistudio_song_list_hi
stx song_list_ptr+1
ldy #0
cmp (song_list_ptr),y
bcc @valid_song
rts ; Invalid song index.
@valid_song:
.if FAMISTUDIO_NUM_CHANNELS = 5
asl
sta tmp
asl
tax
asl
adc tmp
stx tmp
adc tmp
.elseif FAMISTUDIO_NUM_CHANNELS = 6
asl
asl
asl
asl
.elseif FAMISTUDIO_NUM_CHANNELS = 7
asl
sta tmp
asl
asl
asl
adc tmp
.elseif FAMISTUDIO_NUM_CHANNELS = 8
asl
asl
sta tmp
asl
asl
adc tmp
.elseif FAMISTUDIO_NUM_CHANNELS = 9
asl
sta tmp
asl
tax
asl
asl
adc tmp
stx tmp
adc tmp
.elseif FAMISTUDIO_NUM_CHANNELS = 10
asl
asl
asl
sta tmp
asl
adc tmp
.elseif FAMISTUDIO_NUM_CHANNELS = 11
asl
sta tmp
asl
asl
tax
asl
adc tmp
stx tmp
adc tmp
.elseif FAMISTUDIO_NUM_CHANNELS = 12
asl
asl
sta tmp
asl
tax
asl
adc tmp
stx tmp
adc tmp
.elseif FAMISTUDIO_NUM_CHANNELS = 13
asl
sta tmp
asl
asl
asl
asl
sec
sbc tmp
clc
.elseif FAMISTUDIO_NUM_CHANNELS = 28 ; This is only used by the multiple expansion version.
asl
asl
sta tmp
asl
asl
asl
sec
sbc tmp
clc
.endif
.if FAMISTUDIO_EXP_FDS || FAMISTUDIO_EXP_VRC7 || FAMISTUDIO_EXP_N163
adc #7 ; We have an extra expansion instrument pointer for these.
.else
adc #5
.endif
tay
lda famistudio_song_list_lo
sta song_list_ptr+0
jsr famistudio_music_stop
ldx #0
@set_channels:
; Channel data address
lda (song_list_ptr),y
sta famistudio_chn_ptr_lo,x
iny
lda (song_list_ptr),y
sta famistudio_chn_ptr_hi,x
iny
lda #0
sta famistudio_chn_repeat,x
sta famistudio_chn_instrument,x
sta famistudio_chn_note,x
sta famistudio_chn_ref_len,x
.if FAMISTUDIO_USE_VOLUME_TRACK
lda #$f0
sta famistudio_chn_volume_track,x
.endif
.if FAMISTUDIO_USE_FAMITRACKER_DELAYED_NOTES_OR_CUTS
lda #$ff
sta famistudio_chn_note_delay,x
sta famistudio_chn_cut_delay,x
.endif
@nextchannel:
inx
cpx #FAMISTUDIO_NUM_CHANNELS
bne @set_channels
.if FAMISTUDIO_USE_FAMITRACKER_TEMPO
lda famistudio_pal_adjust
beq @pal
iny
iny
@pal:
; Tempo increment.
lda (song_list_ptr),y
sta famistudio_tempo_step_lo
iny
lda (song_list_ptr),y
sta famistudio_tempo_step_hi
lda #0 ; Reset tempo accumulator
sta famistudio_tempo_acc_lo
lda #6 ; Default speed
sta famistudio_tempo_acc_hi
sta famistudio_song_speed ; Apply default speed, this also enables music
.else
lda (song_list_ptr),y
sta famistudio_tempo_env_ptr_lo
sta temp_env_ptr+0
iny
lda (song_list_ptr),y
sta famistudio_tempo_env_ptr_hi
sta temp_env_ptr+1
iny
lda (song_list_ptr),y
.if FAMISTUDIO_DUAL_SUPPORT ; Dual mode
ldx famistudio_pal_adjust
bne @ntsc_target
ora #1
@ntsc_target:
.elseif FAMISTUDIO_CFG_PAL_SUPPORT ; PAL only
ora #1
.endif
tax
lda famistudio_tempo_frame_lookup, x ; Lookup contains the number of frames to run (0,1,2) to maintain tempo
sta famistudio_tempo_frame_num
ldy #0
sty famistudio_tempo_env_idx
lda (temp_env_ptr),y
clc
adc #1
sta famistudio_tempo_env_counter
lda #6
sta famistudio_song_speed ; Non-zero simply so the song isnt considered paused.
.endif
.if FAMISTUDIO_EXP_VRC7
lda #0
ldx #5
@clear_vrc7_loop:
sta famistudio_chn_vrc7_prev_hi, x
sta famistudio_chn_vrc7_patch, x
sta famistudio_chn_vrc7_trigger,x
dex
bpl @clear_vrc7_loop
.endif
.if FAMISTUDIO_EXP_VRC6
lda #0
sta famistudio_vrc6_saw_volume
.endif
.if FAMISTUDIO_EXP_FDS
lda #0
sta famistudio_fds_mod_speed+0
sta famistudio_fds_mod_speed+1
sta famistudio_fds_mod_depth
sta famistudio_fds_mod_delay
sta famistudio_fds_override_flags
.endif
.if FAMISTUDIO_EXP_N163 || FAMISTUDIO_EXP_VRC7 || FAMISTUDIO_EXP_FDS
lda #0
ldx #(FAMISTUDIO_NUM_CHANNELS-5)
@clear_inst_changed_loop:
sta famistudio_chn_inst_changed, x
dex
bpl @clear_inst_changed_loop
.endif
.if FAMISTUDIO_EXP_N163
lda #0
ldx #FAMISTUDIO_EXP_N163_CHN_CNT
@clear_n163_loop:
sta famistudio_chn_n163_wave_len, x
dex
bpl @clear_n163_loop
.endif
@skip:
rts
;======================================================================================================================
; FAMISTUDIO_MUSIC_PAUSE (public)
;
; Pause/unpause the currently playing song. Note that this will not update the APU, so sound might linger. Calling
; famistudio_update after this will update the APU.
;
; [in] a : zero to play, non-zero to pause.
;======================================================================================================================
famistudio_music_pause:
tax
beq @unpause
@pause:
jsr famistudio_sample_stop
lda #0
sta famistudio_env_value+FAMISTUDIO_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_CH1_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_CH2_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_CH3_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.if FAMISTUDIO_EXP_VRC6
sta famistudio_env_value+FAMISTUDIO_VRC6_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_VRC6_CH1_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_VRC6_CH2_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_VRC7
sta famistudio_env_value+FAMISTUDIO_VRC7_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_VRC7_CH1_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_VRC7_CH2_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_VRC7_CH3_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_VRC7_CH4_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_VRC7_CH5_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_FDS
sta famistudio_env_value+FAMISTUDIO_FDS_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_MMC5
sta famistudio_env_value+FAMISTUDIO_MMC5_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_MMC5_CH1_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_N163
sta famistudio_env_value+FAMISTUDIO_N163_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_N163_CH1_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_N163_CH2_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_N163_CH3_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_N163_CH4_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_N163_CH5_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_N163_CH6_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_N163_CH7_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_S5B
sta famistudio_env_value+FAMISTUDIO_S5B_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_S5B_CH1_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
sta famistudio_env_value+FAMISTUDIO_S5B_CH2_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
lda famistudio_song_speed ; <= 0 pauses the music
ora #$80
bne @done
@unpause:
lda famistudio_song_speed ; > 0 unpause music
and #$7f
@done:
sta famistudio_song_speed
rts
;======================================================================================================================
; FAMISTUDIO_GET_NOTE_PITCH_MACRO (internal)
;
; Uber-macro used to compute the final pitch of a note, taking into account the current note, arpeggios, instrument
; pitch envelopes, slide notes and fine pitch tracks.
;
; [in] x : note index.
; [in] y : slide/pitch envelope index.
; [out] famistudio_ptr1 : Final note pitch.
;======================================================================================================================
.macro famistudio_get_note_pitch_macro pitch_env_offset, pitch_shift, note_table_lsb, note_table_msb
pitch = famistudio_ptr1
tmp_ror = famistudio_r0
.if FAMISTUDIO_USE_PITCH_TRACK
; Pitch envelope + fine pitch (sign extended)
clc
lda famistudio_pitch_env_fine_value+pitch_env_offset, y
adc famistudio_pitch_env_value_lo+pitch_env_offset, y
sta pitch+0
lda famistudio_pitch_env_fine_value+pitch_env_offset, y
and #$80
beq pos
lda #$ff
pos:
adc famistudio_pitch_env_value_hi+pitch_env_offset, y
sta pitch+1
.else
; Pitch envelope only
lda famistudio_pitch_env_value_lo+pitch_env_offset, y
sta pitch+0
lda famistudio_pitch_env_value_hi+pitch_env_offset, y
sta pitch+1
.endif
.if FAMISTUDIO_USE_SLIDE_NOTES
; Check if there is an active slide.
lda famistudio_slide_step+pitch_env_offset, y
beq no_slide
; Add slide
.if pitch_shift >= 1
; These channels dont have fractional part for slides and have the same shift for slides + pitch.
clc
lda famistudio_slide_pitch_lo+pitch_env_offset, y
adc pitch+0
sta pitch+0
lda famistudio_slide_pitch_hi+pitch_env_offset, y
adc pitch+1
sta pitch+1
.else
; Most channels have 1 bit of fraction for slides.
lda famistudio_slide_pitch_hi+pitch_env_offset, y
cmp #$80 ; Sign extend upcoming right shift.
ror ; We have 1 bit of fraction for slides, shift right hi byte.
sta tmp_ror
lda famistudio_slide_pitch_lo+pitch_env_offset, y
ror ; Shift right low byte.
clc
adc pitch+0
sta pitch+0
lda tmp_ror
adc pitch+1
sta pitch+1
.endif
.endif
no_slide:
.if pitch_shift >= 1
asl pitch+0
rol pitch+1
.if pitch_shift >= 2
asl pitch+0
rol pitch+1
.if pitch_shift >= 3
asl pitch+0
rol pitch+1
.if pitch_shift >= 4
asl pitch+0
rol pitch+1
.if pitch_shift >= 5
asl pitch+0
rol pitch+1
.endif
.endif
.endif
.endif
.endif
; Finally, add note pitch.
clc
lda note_table_lsb,x
adc pitch+0
sta pitch+0
lda note_table_msb,x
adc pitch+1
sta pitch+1
.endm
famistudio_get_note_pitch:
famistudio_get_note_pitch_macro 0, 0, famistudio_note_table_lsb, famistudio_note_table_msb
rts
.if FAMISTUDIO_EXP_VRC6
famistudio_get_note_pitch_vrc6_saw:
famistudio_get_note_pitch_macro 0, 0, famistudio_saw_note_table_lsb, famistudio_saw_note_table_msb
rts
.endif
;======================================================================================================================
; FAMISTUDIO_SMOOTH_VIBRATO (internal)
;
; Implementation of Blaarg's smooth vibrato to eliminate pops on square channels. Called either from regular channel
; updates or from SFX code.
;
; [in] a : new hi period.
;======================================================================================================================
.macro famistudio_smooth_vibrato pulse_lo, pulse_prev, reg_hi, reg_lo, reg_sweep
; Blaarg's smooth vibrato technique, only used if high period delta is 1 or -1.
tax ; X = new hi-period
sec
sbc pulse_prev ; A = signed hi-period delta.
beq done
stx pulse_prev
tay
iny ; We only care about -1 ($ff) and 1. Adding one means we only check of 0 or 2, we already checked for zero (so < 3).
cpy #$03
bcs hi_delta_too_big
ldx #$40
stx FAMISTUDIO_APU_FRAME_CNT ; Reset frame counter in case it was about to clock
lda famistudio_smooth_vibrato_period_lo_lookup, y ; Be sure low 8 bits of timer period are $ff (for positive delta), or $00 (for negative delta)
sta reg_lo
lda famistudio_smooth_vibrato_sweep_lookup, y ; Sweep enabled, shift = 7, set negative flag or delta is negative..
sta reg_sweep
lda #$c0
sta FAMISTUDIO_APU_FRAME_CNT ; Clock sweep immediately
lda #$08
sta reg_sweep ; Disable sweep
lda pulse_lo
sta reg_lo ; Restore lo-period.
jmp done
hi_delta_too_big:
stx reg_hi
done:
.endm
;======================================================================================================================
; FAMISTUDIO_UPDATE_CHANNEL_SOUND (internal)
;
; Uber-macro used to update the APU registers for a given 2A03/VRC6/MMC5 channel. This macro is an absolute mess, but
; it is still more maintainable than having many different functions.
;
; [in] no input params.
;======================================================================================================================
.macro famistudio_update_channel_sound idx, env_offset, pulse_prev, vol_ora, hi_ora, reg_hi, reg_lo, reg_vol, reg_sweep
tmp = famistudio_r0
pitch = famistudio_ptr1
lda famistudio_chn_note+idx
bne nocut
jmp set_volume
nocut:
clc
adc famistudio_env_value+env_offset+FAMISTUDIO_ENV_NOTE_OFF
.if idx = 3 ; Noise channel is a bit special
.if FAMISTUDIO_USE_NOISE_SLIDE_NOTES
; Check if there is an active slide on the noise channel.
ldy famistudio_slide_step+FAMISTUDIO_NOISE_SLIDE_INDEX
beq no_noise_slide
; We have 4 bits of fraction for noise slides.
sta tmp
lda famistudio_slide_pitch_lo+FAMISTUDIO_NOISE_SLIDE_INDEX
sta pitch+0
lda famistudio_slide_pitch_hi+FAMISTUDIO_NOISE_SLIDE_INDEX
cmp #$80
ror
ror pitch+0
cmp #$80
ror
ror pitch+0
cmp #$80
ror
ror pitch+0
cmp #$80
ror
lda pitch+0
ror
clc
adc tmp
.endif
no_noise_slide:
and #$0f
eor #$0f
sta tmp
ldx famistudio_env_value+env_offset+FAMISTUDIO_ENV_DUTY_OFF
lda famistudio_duty_lookup, x
asl a
and #$80
ora tmp
.else
.if FAMISTUDIO_DUAL_SUPPORT
clc
adc famistudio_pal_adjust
.endif
tax
; This basically does same as "famistudio_channel_to_pitch_env"
.if idx < 3
ldy #idx
.else
ldy #(idx - 2)
.endif
.if FAMISTUDIO_EXP_VRC6 && idx = 7
jsr famistudio_get_note_pitch_vrc6_saw
.else
jsr famistudio_get_note_pitch
.endif
lda pitch+0
sta reg_lo
lda pitch+1
.if pulse_prev && (!FAMISTUDIO_CFG_SFX_SUPPORT || !reg_sweep)
.if reg_sweep && FAMISTUDIO_CFG_SMOOTH_VIBRATO
famistudio_smooth_vibrato famistudio_ptr1, pulse_prev, reg_hi, reg_lo, reg_sweep
.else
cmp pulse_prev
beq compute_volume
sta pulse_prev
.endif
.endif
.if hi_ora
ora hi_ora
.endif
.endif ; idx = 3
.if (!pulse_prev) || (!reg_sweep) || FAMISTUDIO_CFG_SFX_SUPPORT || (!FAMISTUDIO_CFG_SMOOTH_VIBRATO)
sta reg_hi
.endif
compute_volume:
.if FAMISTUDIO_USE_VOLUME_TRACK
lda famistudio_chn_volume_track+idx
.if FAMISTUDIO_USE_VOLUME_SLIDES
; During a slide, the lower 4 bits are fraction.
and #$f0
.endif
ora famistudio_env_value+env_offset+FAMISTUDIO_ENV_VOLUME_OFF
tax
lda famistudio_volume_table, x
.else
lda famistudio_env_value+env_offset+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_VRC6 && idx = 7
; VRC6 saw has 6-bits
ldx famistudio_vrc6_saw_volume
bmi set_volume
asl
ldx famistudio_vrc6_saw_volume
beq set_volume
asl
.endif
set_volume:
.if idx = 0 || idx = 1 || idx = 3 || (FAMISTUDIO_EXP_MMC5 && (idx = FAMISTUDIO_MMC5_CH0_IDX || idx = FAMISTUDIO_MMC5_CH1_IDX))
ldx famistudio_env_value+env_offset+FAMISTUDIO_ENV_DUTY_OFF
ora famistudio_duty_lookup, x
.elseif FAMISTUDIO_EXP_VRC6 && (idx = FAMISTUDIO_VRC6_CH0_IDX || idx = FAMISTUDIO_VRC6_CH1_IDX)
ldx famistudio_env_value+env_offset+FAMISTUDIO_ENV_DUTY_OFF
ora famistudio_vrc6_duty_lookup, x
.endif
.if vol_ora
ora vol_ora
.endif
sta reg_vol
.endm
.if FAMISTUDIO_EXP_FDS
;======================================================================================================================
; FAMISTUDIO_UPDATE_FDS_CHANNEL_SOUND (internal)
;
; Updates the FDS audio registers.
;
; [in] no input params.
;======================================================================================================================
famistudio_update_fds_channel_sound:
pitch = famistudio_ptr1
lda famistudio_chn_note+FAMISTUDIO_FDS_CH0_IDX
bne @nocut
jmp @set_volume
@nocut:
clc
adc famistudio_env_value+FAMISTUDIO_FDS_CH0_ENVS+FAMISTUDIO_ENV_NOTE_OFF
tax
ldy #0
famistudio_get_note_pitch_macro FAMISTUDIO_FDS_CH0_PITCH_ENV_IDX, 0, famistudio_fds_note_table_lsb, famistudio_fds_note_table_msb
lda pitch+0
sta FAMISTUDIO_FDS_FREQ_LO
lda pitch+1
sta FAMISTUDIO_FDS_FREQ_HI
@check_mod_delay:
lda famistudio_fds_mod_delay
beq @zero_delay
dec famistudio_fds_mod_delay
lda #$80
sta FAMISTUDIO_FDS_MOD_HI
bne @compute_volume
@zero_delay:
lda famistudio_fds_mod_speed+1
sta FAMISTUDIO_FDS_MOD_HI
lda famistudio_fds_mod_speed+0
sta FAMISTUDIO_FDS_MOD_LO
lda famistudio_fds_mod_depth
ora #$80
sta FAMISTUDIO_FDS_SWEEP_ENV
@compute_volume:
.if FAMISTUDIO_USE_VOLUME_TRACK
lda famistudio_chn_volume_track+FAMISTUDIO_FDS_CH0_IDX
.if FAMISTUDIO_USE_VOLUME_SLIDES
; During a slide, the lower 4 bits are fraction.
and #$f0
.endif
ora famistudio_env_value+FAMISTUDIO_FDS_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
tax
lda famistudio_volume_table, x
.else
lda famistudio_env_value+FAMISTUDIO_FDS_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
asl ; FDS volume is 6-bits, but clamped to 32. Just double it.
@set_volume:
ora #$80
sta FAMISTUDIO_FDS_VOL_ENV
lda #0
sta famistudio_fds_override_flags
rts
.endif
.if FAMISTUDIO_EXP_VRC7
famistudio_vrc7_reg_table_lo:
.byte FAMISTUDIO_VRC7_REG_LO_1, FAMISTUDIO_VRC7_REG_LO_2, FAMISTUDIO_VRC7_REG_LO_3, FAMISTUDIO_VRC7_REG_LO_4, FAMISTUDIO_VRC7_REG_LO_5, FAMISTUDIO_VRC7_REG_LO_6
famistudio_vrc7_reg_table_hi:
.byte FAMISTUDIO_VRC7_REG_HI_1, FAMISTUDIO_VRC7_REG_HI_2, FAMISTUDIO_VRC7_REG_HI_3, FAMISTUDIO_VRC7_REG_HI_4, FAMISTUDIO_VRC7_REG_HI_5, FAMISTUDIO_VRC7_REG_HI_6
famistudio_vrc7_vol_table:
.byte FAMISTUDIO_VRC7_REG_VOL_1, FAMISTUDIO_VRC7_REG_VOL_2, FAMISTUDIO_VRC7_REG_VOL_3, FAMISTUDIO_VRC7_REG_VOL_4, FAMISTUDIO_VRC7_REG_VOL_5, FAMISTUDIO_VRC7_REG_VOL_6
famistudio_vrc7_env_table:
.byte FAMISTUDIO_VRC7_CH0_ENVS, FAMISTUDIO_VRC7_CH1_ENVS, FAMISTUDIO_VRC7_CH2_ENVS, FAMISTUDIO_VRC7_CH3_ENVS, FAMISTUDIO_VRC7_CH4_ENVS, FAMISTUDIO_VRC7_CH5_ENVS
famistudio_vrc7_invert_vol_table:
.byte $0f, $0e, $0d, $0c, $0b, $0a, $09, $08, $07, $06, $05, $04, $03, $02, $01, $00
; From nesdev wiki.
famistudio_vrc7_wait_reg_write:
stx famistudio_vrc7_dummy
ldx #$08
@wait_loop:
dex
bne @wait_loop
ldx famistudio_vrc7_dummy
rts
; From nesdev wiki.
famistudio_vrc7_wait_reg_select:
rts
;======================================================================================================================
; FAMISTUDIO_UPDATE_VRC7_CHANNEL_SOUND (internal)
;
; Updates the VRC7 audio registers for a given channel.
;
; [in] y: VRC7 channel idx (0,1,2,3,4,5)
;======================================================================================================================
famistudio_update_vrc7_channel_sound:
pitch = famistudio_ptr1
lda #0
sta famistudio_chn_inst_changed,y
lda famistudio_chn_vrc7_trigger,y
bpl @check_cut
@release:
; Untrigger note.
lda famistudio_vrc7_reg_table_hi,y
sta FAMISTUDIO_VRC7_REG_SEL
jsr famistudio_vrc7_wait_reg_select
lda famistudio_chn_vrc7_prev_hi, y
and #$ef ; remove trigger
sta famistudio_chn_vrc7_prev_hi, y
sta FAMISTUDIO_VRC7_REG_WRITE
jsr famistudio_vrc7_wait_reg_write
rts
@check_cut:
lda famistudio_chn_note+FAMISTUDIO_VRC7_CH0_IDX,y
bne @nocut
@cut:
; Untrigger note.
lda famistudio_vrc7_reg_table_hi,y
sta FAMISTUDIO_VRC7_REG_SEL
jsr famistudio_vrc7_wait_reg_select
lda famistudio_chn_vrc7_prev_hi, y
and #$cf ; Remove trigger + sustain
sta famistudio_chn_vrc7_prev_hi, y
sta FAMISTUDIO_VRC7_REG_WRITE
jsr famistudio_vrc7_wait_reg_write
rts
@nocut:
; Read note, apply arpeggio
clc
ldx famistudio_vrc7_env_table,y
adc famistudio_env_value+FAMISTUDIO_ENV_NOTE_OFF,x
tax
; Apply pitch envelope, fine pitch & slides
famistudio_get_note_pitch_macro FAMISTUDIO_VRC7_CH0_PITCH_ENV_IDX, FAMISTUDIO_VRC7_PITCH_SHIFT, famistudio_vrc7_note_table_lsb, famistudio_vrc7_note_table_msb
; Compute octave by dividing by 2 until we are <= 512 (0x100).
ldx #0
@compute_octave_loop:
lda pitch+1
cmp #2
bcc @octave_done
lsr
sta pitch+1
ror pitch+0
inx
jmp @compute_octave_loop
@octave_done:
; Write pitch (lo)
lda famistudio_vrc7_reg_table_lo,y
sta FAMISTUDIO_VRC7_REG_SEL
jsr famistudio_vrc7_wait_reg_select
lda pitch+0
sta FAMISTUDIO_VRC7_REG_WRITE
jsr famistudio_vrc7_wait_reg_write
; Un-trigger previous note if needed.
lda famistudio_chn_vrc7_prev_hi, y
and #$10 ; set trigger.
beq @write_hi_period
lda famistudio_chn_vrc7_trigger,y
beq @write_hi_period
@untrigger_prev_note:
lda famistudio_vrc7_reg_table_hi,y
sta FAMISTUDIO_VRC7_REG_SEL
jsr famistudio_vrc7_wait_reg_select
lda famistudio_chn_vrc7_prev_hi,y
and #$ef ; remove trigger
sta FAMISTUDIO_VRC7_REG_WRITE
jsr famistudio_vrc7_wait_reg_write
@write_hi_period:
; Write pitch (hi)
lda famistudio_vrc7_reg_table_hi,y
sta FAMISTUDIO_VRC7_REG_SEL
jsr famistudio_vrc7_wait_reg_select
txa
asl
ora #$30
ora pitch+1
sta famistudio_chn_vrc7_prev_hi, y
sta FAMISTUDIO_VRC7_REG_WRITE
jsr famistudio_vrc7_wait_reg_write
; Read/multiply volume
ldx famistudio_vrc7_env_table,y
.if FAMISTUDIO_USE_VOLUME_TRACK
lda famistudio_chn_volume_track+FAMISTUDIO_VRC7_CH0_IDX, y
.if FAMISTUDIO_USE_VOLUME_SLIDES
; During a slide, the lower 4 bits are fraction.
and #$f0
.endif
ora famistudio_env_value+FAMISTUDIO_ENV_VOLUME_OFF,x
.else
lda famistudio_env_value+FAMISTUDIO_ENV_VOLUME_OFF,x
.endif
tax
lda #0
sta famistudio_chn_vrc7_trigger,y
@update_volume:
; Write volume
lda famistudio_vrc7_vol_table,y
sta FAMISTUDIO_VRC7_REG_SEL
jsr famistudio_vrc7_wait_reg_select
.if FAMISTUDIO_USE_VOLUME_TRACK
lda famistudio_volume_table,x
tax
.endif
lda famistudio_vrc7_invert_vol_table,x
ora famistudio_chn_vrc7_patch,y
sta FAMISTUDIO_VRC7_REG_WRITE
jsr famistudio_vrc7_wait_reg_write
rts
.endif
.if FAMISTUDIO_EXP_N163
famistudio_n163_reg_table_lo:
.byte FAMISTUDIO_N163_REG_FREQ_LO - $00
.byte FAMISTUDIO_N163_REG_FREQ_LO - $08
.byte FAMISTUDIO_N163_REG_FREQ_LO - $10
.byte FAMISTUDIO_N163_REG_FREQ_LO - $18
.byte FAMISTUDIO_N163_REG_FREQ_LO - $20
.byte FAMISTUDIO_N163_REG_FREQ_LO - $28
.byte FAMISTUDIO_N163_REG_FREQ_LO - $30
.byte FAMISTUDIO_N163_REG_FREQ_LO - $38
famistudio_n163_reg_table_mid:
.byte FAMISTUDIO_N163_REG_FREQ_MID - $00
.byte FAMISTUDIO_N163_REG_FREQ_MID - $08
.byte FAMISTUDIO_N163_REG_FREQ_MID - $10
.byte FAMISTUDIO_N163_REG_FREQ_MID - $18
.byte FAMISTUDIO_N163_REG_FREQ_MID - $20
.byte FAMISTUDIO_N163_REG_FREQ_MID - $28
.byte FAMISTUDIO_N163_REG_FREQ_MID - $30
.byte FAMISTUDIO_N163_REG_FREQ_MID - $38
famistudio_n163_reg_table_hi:
.byte FAMISTUDIO_N163_REG_FREQ_HI - $00
.byte FAMISTUDIO_N163_REG_FREQ_HI - $08
.byte FAMISTUDIO_N163_REG_FREQ_HI - $10
.byte FAMISTUDIO_N163_REG_FREQ_HI - $18
.byte FAMISTUDIO_N163_REG_FREQ_HI - $20
.byte FAMISTUDIO_N163_REG_FREQ_HI - $28
.byte FAMISTUDIO_N163_REG_FREQ_HI - $30
.byte FAMISTUDIO_N163_REG_FREQ_HI - $38
famistudio_n163_vol_table:
.byte FAMISTUDIO_N163_REG_VOLUME - $00
.byte FAMISTUDIO_N163_REG_VOLUME - $08
.byte FAMISTUDIO_N163_REG_VOLUME - $10
.byte FAMISTUDIO_N163_REG_VOLUME - $18
.byte FAMISTUDIO_N163_REG_VOLUME - $20
.byte FAMISTUDIO_N163_REG_VOLUME - $28
.byte FAMISTUDIO_N163_REG_VOLUME - $30
.byte FAMISTUDIO_N163_REG_VOLUME - $38
famistudio_n163_env_table:
.byte FAMISTUDIO_N163_CH0_ENVS
.byte FAMISTUDIO_N163_CH1_ENVS
.byte FAMISTUDIO_N163_CH2_ENVS
.byte FAMISTUDIO_N163_CH3_ENVS
.byte FAMISTUDIO_N163_CH4_ENVS
.byte FAMISTUDIO_N163_CH5_ENVS
.byte FAMISTUDIO_N163_CH6_ENVS
.byte FAMISTUDIO_N163_CH7_ENVS
;======================================================================================================================
; FAMISTUDIO_UPDATE_N163_CHANNEL_SOUND (internal)
;
; Updates the N163 audio registers for a given channel.
;
; [in] y: N163 channel idx (0,1,2,3,4,5,6,7)
;======================================================================================================================
famistudio_update_n163_channel_sound:
pitch = famistudio_ptr1
pitch_hi = famistudio_r2
lda famistudio_chn_note+FAMISTUDIO_N163_CH0_IDX,y
bne @nocut
ldx #0 ; This will fetch volume 0.
bne @nocut
jmp @update_volume
@nocut:
; Read note, apply arpeggio
clc
ldx famistudio_n163_env_table,y
adc famistudio_env_value+FAMISTUDIO_ENV_NOTE_OFF,x
tax
; Apply pitch envelope, fine pitch & slides
famistudio_get_note_pitch_macro FAMISTUDIO_N163_CH0_PITCH_ENV_IDX, FAMISTUDIO_N163_PITCH_SHIFT, famistudio_n163_note_table_lsb, famistudio_n163_note_table_msb
; Convert 16-bit -> 18-bit.
asl pitch+0
rol pitch+1
lda #0
adc #0
sta pitch_hi
asl pitch+0
rol pitch+1
rol pitch_hi
; Write pitch
lda famistudio_n163_reg_table_lo,y
sta FAMISTUDIO_N163_ADDR
lda pitch+0
sta FAMISTUDIO_N163_DATA
lda famistudio_n163_reg_table_mid,y
sta FAMISTUDIO_N163_ADDR
lda pitch+1
sta FAMISTUDIO_N163_DATA
lda famistudio_n163_reg_table_hi,y
sta FAMISTUDIO_N163_ADDR
lda famistudio_chn_n163_wave_len,y
ora pitch_hi
sta FAMISTUDIO_N163_DATA
; Read/multiply volume
ldx famistudio_n163_env_table,y
.if FAMISTUDIO_USE_VOLUME_TRACK
lda famistudio_chn_volume_track+FAMISTUDIO_N163_CH0_IDX, y
.if FAMISTUDIO_USE_VOLUME_SLIDES
; During a slide, the lower 4 bits are fraction.
and #$f0
.endif
ora famistudio_env_value+FAMISTUDIO_ENV_VOLUME_OFF,x
.else
lda famistudio_env_value+FAMISTUDIO_ENV_VOLUME_OFF,x
.endif
tax
@update_volume:
; Write volume
lda famistudio_n163_vol_table,y
sta FAMISTUDIO_N163_ADDR
.if FAMISTUDIO_USE_VOLUME_TRACK
lda famistudio_volume_table,x
.else
txa
.endif
ora #FAMISTUDIO_N163_CHN_MASK
sta FAMISTUDIO_N163_DATA
lda #0
sta famistudio_chn_inst_changed,y
rts
.endif
.if FAMISTUDIO_EXP_S5B
famistudio_s5b_reg_table_lo:
.byte FAMISTUDIO_S5B_REG_LO_A, FAMISTUDIO_S5B_REG_LO_B, FAMISTUDIO_S5B_REG_LO_C
famistudio_s5b_reg_table_hi:
.byte FAMISTUDIO_S5B_REG_HI_A, FAMISTUDIO_S5B_REG_HI_B, FAMISTUDIO_S5B_REG_HI_C
famistudio_s5b_vol_table:
.byte FAMISTUDIO_S5B_REG_VOL_A, FAMISTUDIO_S5B_REG_VOL_B, FAMISTUDIO_S5B_REG_VOL_C
famistudio_s5b_env_table:
.byte FAMISTUDIO_S5B_CH0_ENVS, FAMISTUDIO_S5B_CH1_ENVS, FAMISTUDIO_S5B_CH2_ENVS
;======================================================================================================================
; FAMISTUDIO_UPDATE_S5B_CHANNEL_SOUND (internal)
;
; Updates the S5B audio registers for a given channel.
;
; [in] y: S5B channel idx (0,1,2)
;======================================================================================================================
famistudio_update_s5b_channel_sound:
pitch = famistudio_ptr1
lda famistudio_chn_note+FAMISTUDIO_S5B_CH0_IDX,y
bne @nocut
ldx #0 ; This will fetch volume 0.
beq @update_volume
@nocut:
; Read note, apply arpeggio
clc
ldx famistudio_s5b_env_table,y
adc famistudio_env_value+FAMISTUDIO_ENV_NOTE_OFF,x
tax
; Apply pitch envelope, fine pitch & slides
famistudio_get_note_pitch_macro FAMISTUDIO_S5B_CH0_PITCH_ENV_IDX, 0, famistudio_note_table_lsb, famistudio_note_table_msb
; Write pitch
lda famistudio_s5b_reg_table_lo,y
sta FAMISTUDIO_S5B_ADDR
lda pitch+0
sta FAMISTUDIO_S5B_DATA
lda famistudio_s5b_reg_table_hi,y
sta FAMISTUDIO_S5B_ADDR
lda pitch+1
sta FAMISTUDIO_S5B_DATA
; Read/multiply volume
ldx famistudio_s5b_env_table,y
.if FAMISTUDIO_USE_VOLUME_TRACK
lda famistudio_chn_volume_track+FAMISTUDIO_S5B_CH0_IDX, y
.if FAMISTUDIO_USE_VOLUME_SLIDES
; During a slide, the lower 4 bits are fraction.
and #$f0
.endif
ora famistudio_env_value+FAMISTUDIO_ENV_VOLUME_OFF,x
.else
lda famistudio_env_value+FAMISTUDIO_ENV_VOLUME_OFF,x
.endif
tax
@update_volume:
; Write volume
lda famistudio_s5b_vol_table,y
sta FAMISTUDIO_S5B_ADDR
.if FAMISTUDIO_USE_VOLUME_TRACK
lda famistudio_volume_table,x
sta FAMISTUDIO_S5B_DATA
.else
stx FAMISTUDIO_S5B_DATA
.endif
rts
.endif
;======================================================================================================================
; FAMISTUDIO_UPDATE_ROW (internal)
;
; Advance the song for a given channel. Will read any new note or effect (if any) and load any new
;
; [in] x: channel index (also true when leaving the function)
;======================================================================================================================
famistudio_update_row:
.if !FAMISTUDIO_CFG_DPCM_SUPPORT
cpx #4
beq @no_new_note
.endif
jsr famistudio_channel_update
bcc @no_new_note
txa
tay
ldx famistudio_channel_env,y
lda famistudio_chn_instrument,y
cpy #4 ; TODO: If samples are disabled, there is no point in doing this test most of the time.
.if FAMISTUDIO_EXP_VRC6 || FAMISTUDIO_EXP_MMC5 || FAMISTUDIO_EXP_S5B
bne @base_instrument
.else
bcc @base_instrument
.endif
.if FAMISTUDIO_EXP_FDS || FAMISTUDIO_EXP_VRC7 || FAMISTUDIO_EXP_N163
beq @dpcm
.if FAMISTUDIO_EXP_FDS
@fds_instrument:
jsr famistudio_set_fds_instrument
jmp @new_note
.endif
.if FAMISTUDIO_EXP_VRC7
@vrc7_instrument:
jsr famistudio_set_vrc7_instrument
jmp @new_note
.endif
.if FAMISTUDIO_EXP_N163
@n163_instrument:
jsr famistudio_set_n163_instrument
jmp @new_note
.endif
.endif
@dpcm:
.if FAMISTUDIO_CFG_DPCM_SUPPORT
lda famistudio_chn_note+4
bne @play_sample
jsr famistudio_sample_stop
ldx #4
bne @no_new_note
@play_sample:
jsr famistudio_music_sample_play
ldx #4
jmp @new_note
.endif
@base_instrument:
jsr famistudio_set_instrument
@new_note:
.if FAMISTUDIO_CFG_EQUALIZER
lda #9
sta famistudio_chn_note_counter, x
.endif
@no_new_note:
rts
.if FAMISTUDIO_USE_FAMITRACKER_DELAYED_NOTES_OR_CUTS
;======================================================================================================================
; FAMISTUDIO_UPDATE_ROW_WITH_DELAYS (internal)
;
; Advance the song for a given channel, but while managing notes/cuts delays.
;
; [in] x: channel index (also true when leaving the function)
;======================================================================================================================
famistudio_update_row_with_delays:
; Is the tempo telling us to advance by 1 row?
lda famistudio_tempo_advance_row
beq @check_delayed_note
; Tempo says we need to advance, was there a delayed note wairing?
lda famistudio_chn_note_delay,x
bmi @advance
; Need to clear any pending delayed note before advancing (will be inaudible).
@clear_delayed_note:
lda #$ff
sta famistudio_chn_note_delay,x
jsr famistudio_update_row ; This is the update for the de delayed note.
jmp @advance
; Tempo said we didnt need to advance, see if there is delayed note with a counter that reached zero.
@check_delayed_note:
lda famistudio_chn_note_delay,x
bmi @check_delayed_cut
sec
sbc #1
sta famistudio_chn_note_delay,x
bpl @check_delayed_cut ; When wrapping from 0 -> 0xff, we play the note.
; Finally, advance by 1 row.
@advance:
jsr famistudio_update_row
; Handle delayed cuts.
@check_delayed_cut:
lda famistudio_chn_cut_delay,x
bmi @done
sec
sbc #1
sta famistudio_chn_cut_delay,x
bpl @done ; When wrapping from 0 -> 0xff, we play the note.
; Write a stop note.
lda #0
sta famistudio_chn_note,x
@done:
rts
.endif
;======================================================================================================================
; FAMISTUDIO_UPDATE (public)
;
; Main update function, should be called once per frame, ideally at the end of NMI. Will update the tempo, advance
; the song if needed, update instrument and apply any change to the APU registers.
;
; [in] no input params.
;======================================================================================================================
famistudio_update:
pitch_env_type = famistudio_r0
temp_pitch = famistudio_r1
tempo_env_ptr = famistudio_ptr0
env_ptr = famistudio_ptr0
pitch_env_ptr = famistudio_ptr0
.if FAMISTUDIO_CFG_THREAD
lda famistudio_ptr0_lo
pha
lda famistudio_ptr0_hi
pha
.endif
lda famistudio_song_speed ; Speed 0 means that no music is playing currently
bmi @pause ; Bit 7 set is the pause flag
bne @update
@pause:
.if !FAMISTUDIO_USE_FAMITRACKER_TEMPO
lda #1
sta famistudio_tempo_frame_cnt
.endif
jmp @update_sound
;----------------------------------------------------------------------------------------------------------------------
@update:
.if FAMISTUDIO_USE_FAMITRACKER_TEMPO
lda famistudio_tempo_acc_hi
cmp famistudio_song_speed
.if FAMISTUDIO_USE_FAMITRACKER_DELAYED_NOTES_OR_CUTS
ldx #0
stx famistudio_tempo_advance_row
bcc @update_row
.else
bcc @update_envelopes
.endif
sbc famistudio_song_speed ; Carry is set.
sta famistudio_tempo_acc_hi
.if FAMISTUDIO_USE_FAMITRACKER_DELAYED_NOTES_OR_CUTS
ldx #1
stx famistudio_tempo_advance_row
.endif
.else ; FamiStudio tempo
; Decrement envelope counter, see if we need to advance.
dec famistudio_tempo_env_counter
beq @advance_tempo_envelope
lda #1
jmp @store_frame_count
@advance_tempo_envelope:
; Advance the envelope by one step.
lda famistudio_tempo_env_ptr_lo
sta tempo_env_ptr+0
lda famistudio_tempo_env_ptr_hi
sta tempo_env_ptr+1
inc famistudio_tempo_env_idx
ldy famistudio_tempo_env_idx
lda (tempo_env_ptr),y
bpl @store_counter ; Negative value means we loop back to to index 1.
@tempo_envelope_end:
ldy #1
sty famistudio_tempo_env_idx
lda (tempo_env_ptr),y
@store_counter:
; Reset the counter
sta famistudio_tempo_env_counter
lda famistudio_tempo_frame_num
bne @store_frame_count
jmp @skip_frame
@store_frame_count:
sta famistudio_tempo_frame_cnt
.endif
;----------------------------------------------------------------------------------------------------------------------
@update_row:
ldx #0
@channel_loop:
.if FAMISTUDIO_USE_FAMITRACKER_DELAYED_NOTES_OR_CUTS
jsr famistudio_update_row_with_delays
.else
jsr famistudio_update_row
.endif
inx
cpx #FAMISTUDIO_NUM_CHANNELS
bne @channel_loop
;----------------------------------------------------------------------------------------------------------------------
@update_envelopes:
ldx #0
@env_process:
lda famistudio_env_repeat,x
beq @env_read
dec famistudio_env_repeat,x
bne @env_next
@env_read:
lda famistudio_env_addr_lo,x
sta env_ptr+0
lda famistudio_env_addr_hi,x
sta env_ptr+1
ldy famistudio_env_ptr,x
@env_read_value:
lda (env_ptr),y
bpl @env_special ; Values below 128 used as a special code, loop or repeat
clc ; Values above 128 are output value+192 (output values are signed -63..64)
adc #256-192
sta famistudio_env_value,x
iny
bne @env_next_store_ptr
@env_special:
bne @env_set_repeat ; Zero is the loop point, non-zero values used for the repeat counter
iny
lda (env_ptr),y ; Read loop position
tay
jmp @env_read_value
@env_set_repeat:
iny
sta famistudio_env_repeat,x ; Store the repeat counter value
@env_next_store_ptr:
tya
sta famistudio_env_ptr,x
@env_next:
inx
cpx #FAMISTUDIO_NUM_ENVELOPES
bne @env_process
;----------------------------------------------------------------------------------------------------------------------
@update_pitch_envelopes:
ldx #0
jmp @pitch_env_process
@pitch_relate_update_with_last_value:
lda famistudio_pitch_env_repeat,x
sec
sbc #1
sta famistudio_pitch_env_repeat,x
and #$7f
beq @pitch_env_read
lda famistudio_pitch_env_addr_lo,x
sta pitch_env_ptr+0
lda famistudio_pitch_env_addr_hi,x
sta pitch_env_ptr+1
ldy famistudio_pitch_env_ptr,x
dey
dey
lda (pitch_env_ptr),y
clc
adc #256-192
sta temp_pitch
clc
adc famistudio_pitch_env_value_lo,x
sta famistudio_pitch_env_value_lo,x
lda temp_pitch
bpl @pitch_relative_last_pos
lda #$ff
@pitch_relative_last_pos:
adc famistudio_pitch_env_value_hi,x
sta famistudio_pitch_env_value_hi,x
jmp @pitch_env_next
@pitch_env_process:
lda famistudio_pitch_env_repeat,x
cmp #$81
bcs @pitch_relate_update_with_last_value
and #$7f
beq @pitch_env_read
dec famistudio_pitch_env_repeat,x
bne @pitch_env_next
@pitch_env_read:
lda famistudio_pitch_env_addr_lo,x
sta pitch_env_ptr+0
lda famistudio_pitch_env_addr_hi,x
sta pitch_env_ptr+1
ldy #0
lda (pitch_env_ptr),y
sta pitch_env_type ; First value is 0 for absolute envelope, 0x80 for relative.
ldy famistudio_pitch_env_ptr,x
@pitch_env_read_value:
lda (pitch_env_ptr),y
bpl @pitch_env_special
clc
adc #256-192
bit pitch_env_type
bmi @pitch_relative
@pitch_absolute:
sta famistudio_pitch_env_value_lo,x
ora #0
bmi @pitch_absolute_neg
lda #0
jmp @pitch_absolute_set_value_hi
@pitch_absolute_neg:
lda #$ff
@pitch_absolute_set_value_hi:
sta famistudio_pitch_env_value_hi,x
iny
jmp @pitch_env_next_store_ptr
@pitch_relative:
sta temp_pitch
clc
adc famistudio_pitch_env_value_lo,x
sta famistudio_pitch_env_value_lo,x
lda temp_pitch
and #$80
bpl @pitch_relative_pos
lda #$ff
@pitch_relative_pos:
adc famistudio_pitch_env_value_hi,x
sta famistudio_pitch_env_value_hi,x
iny
jmp @pitch_env_next_store_ptr
@pitch_env_special:
bne @pitch_env_set_repeat
iny
lda (pitch_env_ptr),y
tay
jmp @pitch_env_read_value
@pitch_env_set_repeat:
iny
ora pitch_env_type ; This is going to set the relative flag in the hi-bit.
sta famistudio_pitch_env_repeat,x
@pitch_env_next_store_ptr:
tya
sta famistudio_pitch_env_ptr,x
@pitch_env_next:
inx
cpx #FAMISTUDIO_NUM_PITCH_ENVELOPES
bne @pitch_env_process
.if FAMISTUDIO_USE_SLIDE_NOTES
;----------------------------------------------------------------------------------------------------------------------
@update_slides:
ldx #0
@slide_process:
lda famistudio_slide_step,x ; Zero repeat means no active slide.
beq @slide_next
clc ; Add step to slide pitch (16bit + 8bit signed).
lda famistudio_slide_step,x
adc famistudio_slide_pitch_lo,x
sta famistudio_slide_pitch_lo,x
lda famistudio_slide_step,x
and #$80
beq @positive_slide
@negative_slide:
lda #$ff
adc famistudio_slide_pitch_hi,x
sta famistudio_slide_pitch_hi,x
bpl @slide_next
jmp @clear_slide
@positive_slide:
adc famistudio_slide_pitch_hi,x
sta famistudio_slide_pitch_hi,x
bmi @slide_next
@clear_slide:
lda #0
sta famistudio_slide_step,x
@slide_next:
inx
cpx #FAMISTUDIO_NUM_SLIDES
bne @slide_process
.endif
.if FAMISTUDIO_USE_VOLUME_SLIDES
; FIXME : This seem wayyyy more complicated than it should.
; - The track volume has 4 bits of fraction : VVVVFFFF
; - The slide step is signed : SVVVFFFF
; - The slide target (end volume) is simply : VVVV0000
;
; foreach slides
; if step != 0
; volume += step
; if step > 0 && volume >= target || step < 0 && volume <= target
; volume = target
; step = 0
@update_volume_slides:
ldx #0
@volume_side_process:
lda famistudio_chn_volume_slide_step,x
beq @volume_slide_next
clc
bmi @negative_volume_slide
@positive_volume_slide:
; If the slide goes up, stop if we hit the target or go over it, over 15 (carry will be set)
adc famistudio_chn_volume_track,x
bcs @clear_volume_slide
sta famistudio_chn_volume_track,x
cmp famistudio_chn_volume_slide_target,x
bcc @volume_slide_next
bcs @clear_volume_slide
@negative_volume_slide:
; If the slide goes do, stop if we hit the target or go below it, or below zero.
; This is a bit trickier since we cant rely on the carry or any flag to
; tell us if we wrapped around.
adc famistudio_chn_volume_track,x
ldy famistudio_chn_volume_track,x
bmi @slide_upper_half
@slide_lower_half:
sta famistudio_chn_volume_track,x
cmp famistudio_chn_volume_slide_target,x
beq @clear_volume_slide
bmi @clear_volume_slide
bcc @volume_slide_next
@slide_upper_half:
sta famistudio_chn_volume_track,x
cmp famistudio_chn_volume_slide_target,x
beq @clear_volume_slide
bcs @volume_slide_next
@clear_volume_slide:
lda famistudio_chn_volume_slide_target,x
sta famistudio_chn_volume_track,x
lda #0
sta famistudio_chn_volume_slide_step,x
@volume_slide_next:
inx
cpx #FAMISTUDIO_NUM_VOLUME_SLIDES
bne @volume_side_process
.endif
.if FAMISTUDIO_CFG_EQUALIZER
@update_equalizer:
ldx #0
@eq_channel_loop:
lda famistudio_chn_note_counter, x
beq @no_note
dec famistudio_chn_note_counter, x
@no_note:
inx
cpx #FAMISTUDIO_NUM_CHANNELS
bne @eq_channel_loop
.endif
;----------------------------------------------------------------------------------------------------------------------
@update_sound:
famistudio_update_channel_sound 0, FAMISTUDIO_CH0_ENVS, famistudio_pulse1_prev, 0, 0, FAMISTUDIO_ALIAS_PL1_HI, FAMISTUDIO_ALIAS_PL1_LO, FAMISTUDIO_ALIAS_PL1_VOL, FAMISTUDIO_APU_PL1_SWEEP
famistudio_update_channel_sound 1, FAMISTUDIO_CH1_ENVS, famistudio_pulse2_prev, 0, 0, FAMISTUDIO_ALIAS_PL2_HI, FAMISTUDIO_ALIAS_PL2_LO, FAMISTUDIO_ALIAS_PL2_VOL, FAMISTUDIO_APU_PL2_SWEEP
famistudio_update_channel_sound 2, FAMISTUDIO_CH2_ENVS, 0, #$80, 0, FAMISTUDIO_ALIAS_TRI_HI, FAMISTUDIO_ALIAS_TRI_LO, FAMISTUDIO_ALIAS_TRI_LINEAR, 0
famistudio_update_channel_sound 3, FAMISTUDIO_CH3_ENVS, 0, #$f0, 0, FAMISTUDIO_ALIAS_NOISE_LO, 0, FAMISTUDIO_ALIAS_NOISE_VOL, 0
.if FAMISTUDIO_EXP_VRC6
@update_vrc6_sound:
famistudio_update_channel_sound FAMISTUDIO_VRC6_CH0_IDX, FAMISTUDIO_VRC6_CH0_ENVS, 0, 0, #$80, FAMISTUDIO_VRC6_PL1_HI, FAMISTUDIO_VRC6_PL1_LO, FAMISTUDIO_VRC6_PL1_VOL, 0
famistudio_update_channel_sound FAMISTUDIO_VRC6_CH1_IDX, FAMISTUDIO_VRC6_CH1_ENVS, 0, 0, #$80, FAMISTUDIO_VRC6_PL2_HI, FAMISTUDIO_VRC6_PL2_LO, FAMISTUDIO_VRC6_PL2_VOL, 0
famistudio_update_channel_sound FAMISTUDIO_VRC6_CH2_IDX, FAMISTUDIO_VRC6_CH2_ENVS, 0, 0, #$80, FAMISTUDIO_VRC6_SAW_HI, FAMISTUDIO_VRC6_SAW_LO, FAMISTUDIO_VRC6_SAW_VOL, 0
.endif
.if FAMISTUDIO_EXP_MMC5
@update_mmc5_sound:
famistudio_update_channel_sound FAMISTUDIO_MMC5_CH0_IDX, FAMISTUDIO_MMC5_CH0_ENVS, famistudio_mmc5_pulse1_prev, 0, 0, FAMISTUDIO_MMC5_PL1_HI, FAMISTUDIO_MMC5_PL1_LO, FAMISTUDIO_MMC5_PL1_VOL, 0
famistudio_update_channel_sound FAMISTUDIO_MMC5_CH1_IDX, FAMISTUDIO_MMC5_CH1_ENVS, famistudio_mmc5_pulse2_prev, 0, 0, FAMISTUDIO_MMC5_PL2_HI, FAMISTUDIO_MMC5_PL2_LO, FAMISTUDIO_MMC5_PL2_VOL, 0
.endif
.if FAMISTUDIO_EXP_FDS
@update_fds_sound:
jsr famistudio_update_fds_channel_sound
.endif
.if FAMISTUDIO_EXP_VRC7
@update_vrc7_sound:
ldy #0
@vrc7_channel_loop:
jsr famistudio_update_vrc7_channel_sound
iny
cpy #6
bne @vrc7_channel_loop
.endif
.if FAMISTUDIO_EXP_N163
@update_n163_sound:
ldy #0
@n163_channel_loop:
jsr famistudio_update_n163_channel_sound
iny
cpy #FAMISTUDIO_EXP_N163_CHN_CNT
bne @n163_channel_loop
.endif
.if FAMISTUDIO_EXP_S5B
@update_s5b_sound:
ldy #0
@s5b_channel_loop:
jsr famistudio_update_s5b_channel_sound
iny
cpy #3
bne @s5b_channel_loop
.endif
@update_sound_done:
.if FAMISTUDIO_USE_FAMITRACKER_TEMPO
lda famistudio_song_speed
bmi @skip_famitracker_tempo_update ; bit 7 = paused
clc ; Update frame counter that considers speed, tempo, and PAL/NTSC
lda famistudio_tempo_acc_lo
adc famistudio_tempo_step_lo
sta famistudio_tempo_acc_lo
lda famistudio_tempo_acc_hi
adc famistudio_tempo_step_hi
sta famistudio_tempo_acc_hi
@skip_famitracker_tempo_update:
.else
; See if we need to run a double frame (playing NTSC song on PAL)
dec famistudio_tempo_frame_cnt
beq @skip_frame
jmp @update_row
.endif
@skip_frame:
;----------------------------------------------------------------------------------------------------------------------
.if FAMISTUDIO_CFG_SFX_SUPPORT
; Process all sound effect streams
.if FAMISTUDIO_CFG_SFX_STREAMS > 0
ldx #FAMISTUDIO_SFX_CH0
jsr famistudio_sfx_update
.endif
.if FAMISTUDIO_CFG_SFX_STREAMS > 1
ldx #FAMISTUDIO_SFX_CH1
jsr famistudio_sfx_update
.endif
.if FAMISTUDIO_CFG_SFX_STREAMS > 2
ldx #FAMISTUDIO_SFX_CH2
jsr famistudio_sfx_update
.endif
.if FAMISTUDIO_CFG_SFX_STREAMS > 3
ldx #FAMISTUDIO_SFX_CH3
jsr famistudio_sfx_update
.endif
; Send data from the output buffer to the APU
lda famistudio_output_buf ; Pulse 1 volume
sta FAMISTUDIO_APU_PL1_VOL
lda famistudio_output_buf+1 ; Pulse 1 period LSB
sta FAMISTUDIO_APU_PL1_LO
lda famistudio_output_buf+2 ; Pulse 1 period MSB, only applied when changed
.if FAMISTUDIO_CFG_SMOOTH_VIBRATO
famistudio_smooth_vibrato famistudio_output_buf+1, famistudio_pulse1_prev, FAMISTUDIO_APU_PL1_HI, FAMISTUDIO_APU_PL1_LO, FAMISTUDIO_APU_PL1_SWEEP
.else
cmp famistudio_pulse1_prev
beq @no_pulse1_upd
sta famistudio_pulse1_prev
sta FAMISTUDIO_APU_PL1_HI
.endif
@no_pulse1_upd:
lda famistudio_output_buf+3 ; Pulse 2 volume
sta FAMISTUDIO_APU_PL2_VOL
lda famistudio_output_buf+4 ; Pulse 2 period LSB
sta FAMISTUDIO_APU_PL2_LO
lda famistudio_output_buf+5 ; Pulse 2 period MSB, only applied when changed
.if FAMISTUDIO_CFG_SMOOTH_VIBRATO
famistudio_smooth_vibrato famistudio_output_buf+4, famistudio_pulse2_prev, FAMISTUDIO_APU_PL2_HI, FAMISTUDIO_APU_PL2_LO, FAMISTUDIO_APU_PL2_SWEEP
.else
cmp famistudio_pulse2_prev
beq @no_pulse2_upd
sta famistudio_pulse2_prev
sta FAMISTUDIO_APU_PL2_HI
.endif
@no_pulse2_upd:
lda famistudio_output_buf+6 ; Triangle volume (plays or not)
sta FAMISTUDIO_APU_TRI_LINEAR
lda famistudio_output_buf+7 ; Triangle period LSB
sta FAMISTUDIO_APU_TRI_LO
lda famistudio_output_buf+8 ; Triangle period MSB
sta FAMISTUDIO_APU_TRI_HI
lda famistudio_output_buf+9 ; Noise volume
sta FAMISTUDIO_APU_NOISE_VOL
lda famistudio_output_buf+10 ; Noise period
sta FAMISTUDIO_APU_NOISE_LO
.endif
.if FAMISTUDIO_CFG_THREAD
pla
sta famistudio_ptr0_hi
pla
sta famistudio_ptr0_lo
.endif
rts
;======================================================================================================================
; FAMISTUDIO_SET_INSTRUMENT (internal)
;
; Internal function to set an instrument for a given channel. Will initialize all instrument envelopes.
;
; [in] x: first envelope index for this channel.
; [in] y: channel index
; [in] a: instrument index.
;======================================================================================================================
famistudio_set_instrument:
intrument_ptr = famistudio_ptr0
chan_idx = famistudio_r1
tmp_x = famistudio_r2
sty chan_idx
asl ; Instrument number is pre multiplied by 4
tay
lda famistudio_instrument_hi
adc #0 ; Use carry to extend range for 64 instruments
sta intrument_ptr+1
lda famistudio_instrument_lo
sta intrument_ptr+0
; Volume envelope
lda (intrument_ptr),y
sta famistudio_env_addr_lo,x
iny
lda (intrument_ptr),y
iny
sta famistudio_env_addr_hi,x
inx
; Arpeggio envelope
.if FAMISTUDIO_USE_ARPEGGIO
stx tmp_x
ldx chan_idx
lda famistudio_chn_env_override,x ; Check if its overriden by arpeggio.
lsr
ldx tmp_x
bcc @read_arpeggio_ptr
iny ; Instrument arpeggio is overriden by arpeggio, dont touch!
jmp @init_envelopes
.endif
@read_arpeggio_ptr:
lda (intrument_ptr),y
sta famistudio_env_addr_lo,x
iny
lda (intrument_ptr),y
sta famistudio_env_addr_hi,x
@init_envelopes:
; Initialize volume + arpeggio envelopes.
lda #1
sta famistudio_env_ptr-1,x ; Reset volume envelope pointer to 1 (volume have releases point in index 0)
lda #0
sta famistudio_env_repeat-1,x
sta famistudio_env_repeat,x
sta famistudio_env_ptr,x
; Duty cycle envelope
lda chan_idx
cmp #2 ; Triangle has no duty.
.if !FAMISTUDIO_EXP_S5B
bne @duty
.else
beq @no_duty
cmp #FAMISTUDIO_S5B_CH0_IDX ; S5B has no duty.
bcc @duty
.endif
@no_duty:
iny
iny
bne @pitch_env
@duty:
inx
iny
lda (intrument_ptr),y
sta famistudio_env_addr_lo,x
iny
lda (intrument_ptr),y
sta famistudio_env_addr_hi,x
lda #0
sta famistudio_env_repeat,x
sta famistudio_env_ptr,x
.if FAMISTUDIO_USE_DUTYCYCLE_EFFECT
stx tmp_x
ldx chan_idx
lda famistudio_channel_to_dutycycle,x
tax
lda famistudio_duty_cycle,x
ldx tmp_x
.endif
sta famistudio_env_value,x
@pitch_env:
; Pitch envelopes.
ldx chan_idx
.if FAMISTUDIO_USE_VIBRATO
lda famistudio_chn_env_override,x ; Instrument pitch is overriden by vibrato, dont touch!
bmi @no_pitch
.endif
lda famistudio_channel_to_pitch_env, x
bmi @no_pitch
tax
lda #1
sta famistudio_pitch_env_ptr,x ; Reset pitch envelope pointert to 1 (pitch envelope have relative/absolute flag in the first byte)
lda #0
sta famistudio_pitch_env_repeat,x
sta famistudio_pitch_env_value_lo,x
sta famistudio_pitch_env_value_hi,x
iny
lda (intrument_ptr),y
sta famistudio_pitch_env_addr_lo,x
iny
lda (intrument_ptr),y
sta famistudio_pitch_env_addr_hi,x
@no_pitch:
ldx chan_idx
rts
.if FAMISTUDIO_EXP_FDS || FAMISTUDIO_EXP_N163 || FAMISTUDIO_EXP_VRC7
;======================================================================================================================
; FAMISTUDIO_SET_EXP_INSTRUMENT_BASE (internal)
;
; Internal macro to set an expansion instrument for a given channel. Will initialize all instrument envelopes.
;
; [in] x: first envelope index for this channel.
; [in] y: channel index
; [in] a: instrument index.
;======================================================================================================================
.macro famistudio_set_exp_instrument
chan_idx = famistudio_r1
tmp_x = famistudio_r2
ptr = famistudio_ptr0
sty chan_idx
asl ; Instrument number is pre multiplied by 4
asl
tay
lda famistudio_exp_instrument_hi
adc #0 ; Use carry to extend range for 64 instruments
sta ptr+1
lda famistudio_exp_instrument_lo
sta ptr+0
; Volume envelope
lda (ptr),y
sta famistudio_env_addr_lo,x
iny
lda (ptr),y
iny
sta famistudio_env_addr_hi,x
inx
; Arpeggio envelope
.if FAMISTUDIO_USE_ARPEGGIO
stx tmp_x
ldx chan_idx
lda famistudio_chn_env_override,x ; Check if its overriden by arpeggio.
lsr
ldx tmp_x
bcc @read_arpeggio_ptr
iny ; Instrument arpeggio is overriden by arpeggio, dont touch!
jmp @init_envelopes
.endif
@read_arpeggio_ptr:
lda (ptr),y
sta famistudio_env_addr_lo,x
iny
lda (ptr),y
sta famistudio_env_addr_hi,x
jmp @init_envelopes
@init_envelopes:
iny
; Initialize volume + arpeggio envelopes.
lda #1
sta famistudio_env_ptr-1,x ; Reset volume envelope pointer to 1 (volume have releases point in index 0)
lda #0
sta famistudio_env_repeat-1,x
sta famistudio_env_repeat,x
sta famistudio_env_ptr,x
; Pitch envelopes.
ldx chan_idx
.if FAMISTUDIO_USE_VIBRATO
lda famistudio_chn_env_override,x ; Instrument pitch is overriden by vibrato, dont touch!
bpl @pitch_env
iny
iny
bne @pitch_overriden
.endif
@pitch_env:
dex
dex ; Noise + DPCM dont have pitch envelopes
lda #1
sta famistudio_pitch_env_ptr,x ; Reset pitch envelope pointert to 1 (pitch envelope have relative/absolute flag in the first byte)
lda #0
sta famistudio_pitch_env_repeat,x
sta famistudio_pitch_env_value_lo,x
sta famistudio_pitch_env_value_hi,x
lda (ptr),y
sta famistudio_pitch_env_addr_lo,x
iny
lda (ptr),y
sta famistudio_pitch_env_addr_hi,x
iny
@pitch_overriden:
ldx chan_idx
.endm
.endif
.if FAMISTUDIO_EXP_VRC7
;======================================================================================================================
; FAMISTUDIO_SET_VRC7_INSTRUMENT (internal)
;
; Internal function to set a VRC7 instrument for a given channel. Will load custom patch if needed.
;
; [in] x: first envelope index for this channel.
; [in] y: channel index
; [in] a: instrument index.
;======================================================================================================================
famistudio_set_vrc7_instrument:
ptr = famistudio_ptr0
chan_idx = famistudio_r1
famistudio_set_exp_instrument
lda famistudio_chn_inst_changed-FAMISTUDIO_EXPANSION_CH0_IDX,x
beq @done
lda (ptr),y
sta famistudio_chn_vrc7_patch-FAMISTUDIO_VRC7_CH0_IDX, x
bne @done
@read_custom_patch:
ldx #0
iny
iny
@read_patch_loop:
stx FAMISTUDIO_VRC7_REG_SEL
jsr famistudio_vrc7_wait_reg_select
lda (ptr),y
iny
sta FAMISTUDIO_VRC7_REG_WRITE
jsr famistudio_vrc7_wait_reg_write
inx
cpx #8
bne @read_patch_loop
@done:
ldx chan_idx
rts
.endif
.if FAMISTUDIO_EXP_FDS
;======================================================================================================================
; FAMISTUDIO_SET_FDS_INSTRUMENT (internal)
;
; Internal function to set a FDS instrument. Will upload the wave and modulation envelope if needed.
;
; [in] x: first envelope index for this channel.
; [in] y: channel index
; [in] a: instrument index.
;======================================================================================================================
famistudio_set_fds_instrument:
ptr = famistudio_ptr0
wave_ptr = famistudio_ptr1
master_vol = famistudio_r1
tmp_y = famistudio_r2
famistudio_set_exp_instrument
lda #0
sta FAMISTUDIO_FDS_SWEEP_BIAS
lda famistudio_chn_inst_changed-FAMISTUDIO_EXPANSION_CH0_IDX,x
bne @write_fds_wave
iny ; Skip master volume + wave + mod envelope.
iny
iny
iny
iny
jmp @load_mod_param
@write_fds_wave:
lda (ptr),y
sta master_vol
iny
ora #$80
sta FAMISTUDIO_FDS_VOL ; Enable wave RAM write
; FDS Waveform
lda (ptr),y
sta wave_ptr+0
iny
lda (ptr),y
sta wave_ptr+1
iny
sty tmp_y
ldy #0
@wave_loop:
lda (wave_ptr),y
sta FAMISTUDIO_FDS_WAV_START,y
iny
cpy #64
bne @wave_loop
lda #$80
sta FAMISTUDIO_FDS_MOD_HI ; Need to disable modulation before writing.
lda master_vol
sta FAMISTUDIO_FDS_VOL ; Disable RAM write.
lda #0
sta FAMISTUDIO_FDS_SWEEP_BIAS
; FDS Modulation
ldy tmp_y
lda (ptr),y
sta wave_ptr+0
iny
lda (ptr),y
sta wave_ptr+1
iny
sty tmp_y
ldy #0
@mod_loop:
lda (wave_ptr),y
sta FAMISTUDIO_FDS_MOD_TABLE
iny
cpy #32
bne @mod_loop
lda #0
sta famistudio_chn_inst_changed-FAMISTUDIO_EXPANSION_CH0_IDX,x
ldy tmp_y
@load_mod_param:
@check_mod_speed:
bit famistudio_fds_override_flags
bmi @mod_speed_overriden
@load_mod_speed:
lda (ptr),y
sta famistudio_fds_mod_speed+0
iny
lda (ptr),y
sta famistudio_fds_mod_speed+1
jmp @check_mod_depth
@mod_speed_overriden:
iny
@check_mod_depth:
iny
bit famistudio_fds_override_flags
bvs @mod_depth_overriden
@load_mod_depth:
lda (ptr),y
sta famistudio_fds_mod_depth
@mod_depth_overriden:
iny
lda (ptr),y
sta famistudio_fds_mod_delay
ldx #5
rts
.endif
.if FAMISTUDIO_EXP_N163
famistudio_n163_wave_table:
.byte FAMISTUDIO_N163_REG_WAVE - $00
.byte FAMISTUDIO_N163_REG_WAVE - $08
.byte FAMISTUDIO_N163_REG_WAVE - $10
.byte FAMISTUDIO_N163_REG_WAVE - $18
.byte FAMISTUDIO_N163_REG_WAVE - $20
.byte FAMISTUDIO_N163_REG_WAVE - $28
.byte FAMISTUDIO_N163_REG_WAVE - $30
.byte FAMISTUDIO_N163_REG_WAVE - $38
;======================================================================================================================
; FAMISTUDIO_SET_FDS_INSTRUMENT (internal)
;
; Internal function to set a N163 instrument. Will upload the waveform if needed.
;
; [in] x: first envelope index for this channel.
; [in] y: channel index
; [in] a: instrument index.
;======================================================================================================================
famistudio_set_n163_instrument:
ptr = famistudio_ptr0
wave_ptr = famistudio_ptr1
wave_len = famistudio_r0
chan_idx = famistudio_r1
wave_pos = famistudio_r2
famistudio_set_exp_instrument
; Wave position
lda famistudio_chn_inst_changed-FAMISTUDIO_EXPANSION_CH0_IDX,x
beq @done
lda famistudio_n163_wave_table-FAMISTUDIO_N163_CH0_IDX, x
sta FAMISTUDIO_N163_ADDR
lda (ptr),y
sta wave_pos
sta FAMISTUDIO_N163_DATA
iny
; Wave length
lda (ptr),y
sta wave_len
lda #$00 ; 256 - wave length
sec
sbc wave_len
sec
sbc wave_len
sta famistudio_chn_n163_wave_len-FAMISTUDIO_N163_CH0_IDX, x
iny
; N163 wave pointer.
lda (ptr),y
sta wave_ptr+0
iny
lda (ptr),y
sta wave_ptr+1
; N163 wave
lda wave_pos
ora #$80
sta FAMISTUDIO_N163_ADDR
ldy #0
@wave_loop:
lda (wave_ptr),y
sta FAMISTUDIO_N163_DATA
iny
cpy wave_len
bne @wave_loop
@done:
ldx chan_idx
rts
.endif
; Increments 16-bit. (internal)
.macro famistudio_inc_16 addr
inc addr+0
bne ok
inc addr+1
ok:
.endm
; Add 8-bit to a 16-bit (unsigned). (internal)
.macro famistudio_add_16_8 addr, val
clc
lda val
adc addr+0
sta addr+0
bcc ok
inc addr+1
ok:
.endm
;======================================================================================================================
; FAMISTUDIO_CHANNEL_UPDATE (internal)
;
; Advances the song by one frame for a given channel. If a new note or effect(s) are found, they will be processed.
;
; [in] x: channel index
;======================================================================================================================
famistudio_channel_update:
; TODO : This function is an absolute mess:
; - Change all increments of the ptr to "iny" and increment the real pointer once.
; - See if we can unify the old FT2 "special_code" with our "special_code_6x".
tmp_ptr_lo = famistudio_r0
tmp_chan_idx = famistudio_r0
tmp_slide_from = famistudio_r1
tmp_slide_idx = famistudio_r1
tmp_duty_cycle = famistudio_r1
tmp_pitch_hi = famistudio_r1
update_flags = famistudio_r2 ; bit 7 = no attack, bit 6 = has set delayed cut.
slide_delta_lo = famistudio_ptr1_hi
channel_data_ptr = famistudio_ptr0
special_code_jmp_ptr = famistudio_ptr1
tempo_env_ptr = famistudio_ptr1
volume_env_ptr = famistudio_ptr1
lda famistudio_chn_repeat,x
beq @no_repeat
dec famistudio_chn_repeat,x
clc
rts
@no_repeat:
lda #0
sta update_flags
lda famistudio_chn_ptr_lo,x
sta channel_data_ptr+0
lda famistudio_chn_ptr_hi,x
sta channel_data_ptr+1
ldy #0
@read_byte:
lda (channel_data_ptr),y
famistudio_inc_16 channel_data_ptr
@check_regular_note:
cmp #$61
bcs @check_special_code ; $00 to $60 are regular notes, most common case.
jmp @regular_note
@check_special_code:
ora #0
bpl @check_volume_track
jmp @special_code ; Bit 7: 0=note 1=special code
@check_volume_track:
cmp #$70
bcc @special_code_6x
.if FAMISTUDIO_USE_VOLUME_TRACK
@volume_track:
and #$0f
asl
asl
asl
asl
sta famistudio_chn_volume_track,x
jmp @read_byte
.else
brk ; If you hit this, this mean you use the volume track in your songs, but did not enable the "FAMISTUDIO_USE_VOLUME_TRACK" feature.
.endif
@special_code_6x:
stx tmp_chan_idx
and #$0f
tax
lda @famistudio_special_code_jmp_lo-1,x
sta special_code_jmp_ptr+0
lda @famistudio_special_code_jmp_hi-1,x
sta special_code_jmp_ptr+1
ldx tmp_chan_idx
jmp (special_code_jmp_ptr)
.if FAMISTUDIO_EXP_FDS
@special_code_fds_mod_depth:
lda (channel_data_ptr),y
famistudio_inc_16 channel_data_ptr
sta famistudio_fds_mod_depth
lda #$40
ora famistudio_fds_override_flags
sta famistudio_fds_override_flags
jmp @read_byte
@special_code_fds_mod_speed:
lda (channel_data_ptr),y
sta famistudio_fds_mod_speed+0
iny
lda (channel_data_ptr),y
sta famistudio_fds_mod_speed+1
famistudio_add_16_8 channel_data_ptr, #2
lda #$80
ora famistudio_fds_override_flags
sta famistudio_fds_override_flags
dey
jmp @read_byte
.endif
.if FAMISTUDIO_EXP_VRC6
@special_code_vrc6_saw_volume:
lda (channel_data_ptr),y
famistudio_inc_16 channel_data_ptr
sta famistudio_vrc6_saw_volume
jmp @read_byte
.endif
.if FAMISTUDIO_USE_VOLUME_SLIDES
@special_code_volume_slide:
lda (channel_data_ptr),y
iny
sta famistudio_chn_volume_slide_step, x
lda (channel_data_ptr),y
sta famistudio_chn_volume_slide_target, x
famistudio_add_16_8 channel_data_ptr, #2
dey
jmp @read_byte
.endif
.if FAMISTUDIO_USE_PITCH_TRACK
@special_code_fine_pitch:
stx tmp_chan_idx
lda famistudio_channel_to_pitch_env,x
tax
lda (channel_data_ptr),y
famistudio_inc_16 channel_data_ptr
sta famistudio_pitch_env_fine_value,x
ldx tmp_chan_idx
jmp @read_byte
.endif
.if FAMISTUDIO_USE_VIBRATO
@special_code_clear_pitch_override_flag:
lda #$7f
and famistudio_chn_env_override,x
sta famistudio_chn_env_override,x
jmp @read_byte
@special_code_override_pitch_envelope:
lda #$80
ora famistudio_chn_env_override,x
sta famistudio_chn_env_override,x
stx tmp_chan_idx
lda famistudio_channel_to_pitch_env,x
tax
lda (channel_data_ptr),y
sta famistudio_pitch_env_addr_lo,x
iny
lda (channel_data_ptr),y
sta famistudio_pitch_env_addr_hi,x
lda #0
tay
sta famistudio_pitch_env_repeat,x
lda #1
sta famistudio_pitch_env_ptr,x
ldx tmp_chan_idx
famistudio_add_16_8 channel_data_ptr, #2
jmp @read_byte
.endif
.if FAMISTUDIO_USE_ARPEGGIO
@special_code_clear_arpeggio_override_flag:
lda #$fe
and famistudio_chn_env_override,x
sta famistudio_chn_env_override,x
jmp @read_byte
@special_code_override_arpeggio_envelope:
lda #$01
ora famistudio_chn_env_override,x
sta famistudio_chn_env_override,x
stx tmp_chan_idx
lda famistudio_channel_to_arpeggio_env,x
tax
lda (channel_data_ptr),y
sta famistudio_env_addr_lo,x
iny
lda (channel_data_ptr),y
sta famistudio_env_addr_hi,x
lda #0
tay
sta famistudio_env_repeat,x ; Reset the envelope since this might be a no-attack note.
sta famistudio_env_value,x
sta famistudio_env_ptr,x
ldx tmp_chan_idx
famistudio_add_16_8 channel_data_ptr, #2
jmp @read_byte
@special_code_reset_arpeggio:
stx tmp_chan_idx
lda famistudio_channel_to_arpeggio_env,x
tax
lda #0
sta famistudio_env_repeat,x
sta famistudio_env_value,x
sta famistudio_env_ptr,x
ldx tmp_chan_idx
jmp @read_byte
.endif
.if FAMISTUDIO_USE_DUTYCYCLE_EFFECT
@special_code_duty_cycle_effect:
stx tmp_chan_idx
lda famistudio_channel_to_dutycycle,x
tax
lda (channel_data_ptr),y
sta famistudio_duty_cycle,x
sta tmp_duty_cycle
ldx tmp_chan_idx
lda famistudio_channel_to_duty_env,x
tax
lda tmp_duty_cycle
sta famistudio_env_value,x
ldx tmp_chan_idx
famistudio_inc_16 channel_data_ptr
jmp @read_byte
.endif
.if FAMISTUDIO_USE_FAMITRACKER_DELAYED_NOTES_OR_CUTS
@special_code_note_delay:
lda (channel_data_ptr),y
sta famistudio_chn_note_delay,x
famistudio_inc_16 channel_data_ptr
jmp @no_ref
@special_code_cut_delay:
lda #$40
sta update_flags
lda (channel_data_ptr),y
sta famistudio_chn_cut_delay,x
famistudio_inc_16 channel_data_ptr
jmp @read_byte
.elseif !FAMISTUDIO_USE_FAMITRACKER_TEMPO
@special_code_set_tempo_envelope:
; Load and reset the new tempo envelope.
lda (channel_data_ptr),y
sta famistudio_tempo_env_ptr_lo
sta tempo_env_ptr+0
iny
lda (channel_data_ptr),y
sta famistudio_tempo_env_ptr_hi
sta tempo_env_ptr+1
famistudio_add_16_8 channel_data_ptr, #2
jmp @reset_tempo_env
@special_code_reset_tempo_envelope:
lda famistudio_tempo_env_ptr_lo
sta tempo_env_ptr+0
lda famistudio_tempo_env_ptr_hi
sta tempo_env_ptr+1
@reset_tempo_env:
ldy #0
sty famistudio_tempo_env_idx
lda (tempo_env_ptr),y
sta famistudio_tempo_env_counter
jmp @read_byte
.endif
@special_code_disable_attack:
lda #$80
ora update_flags
sta update_flags
jmp @read_byte
.if FAMISTUDIO_USE_SLIDE_NOTES
.if FAMISTUDIO_USE_NOISE_SLIDE_NOTES
@noise_slide:
lda (channel_data_ptr),y ; Read slide step size
iny
sta famistudio_slide_step+FAMISTUDIO_NOISE_SLIDE_INDEX
lda (channel_data_ptr),y ; Read slide note from
iny
sec
sbc (channel_data_ptr),y ; Read slide note to
sta famistudio_slide_pitch_lo+FAMISTUDIO_NOISE_SLIDE_INDEX
bpl @positive_noise_slide
@negative_noise_slide:
; Sign extend.
lda #$ff
bmi @noise_shift
@positive_noise_slide:
lda #$00
@noise_shift:
; Noise slides have 4-bits of fraction.
asl famistudio_slide_pitch_lo+FAMISTUDIO_NOISE_SLIDE_INDEX
rol
asl famistudio_slide_pitch_lo+FAMISTUDIO_NOISE_SLIDE_INDEX
rol
asl famistudio_slide_pitch_lo+FAMISTUDIO_NOISE_SLIDE_INDEX
rol
asl famistudio_slide_pitch_lo+FAMISTUDIO_NOISE_SLIDE_INDEX
rol
sta famistudio_slide_pitch_hi+FAMISTUDIO_NOISE_SLIDE_INDEX
jmp @slide_done_pos
.endif
@special_code_slide:
.if FAMISTUDIO_USE_NOISE_SLIDE_NOTES
cpx #3
beq @noise_slide
.endif
stx tmp_chan_idx
lda famistudio_channel_to_slide,x
tax
lda (channel_data_ptr),y ; Read slide step size
iny
sta famistudio_slide_step,x
lda (channel_data_ptr),y ; Read slide note from
.if FAMISTUDIO_DUAL_SUPPORT
clc
adc famistudio_pal_adjust
.endif
sta tmp_slide_from
iny
lda (channel_data_ptr),y ; Read slide note to
ldy tmp_slide_from ; reload note from
.if FAMISTUDIO_DUAL_SUPPORT
adc famistudio_pal_adjust
.endif
stx tmp_slide_idx ; X contained the slide index.
tax
.ifdef FAMISTUDIO_EXP_NOTE_START
lda tmp_chan_idx
cmp #FAMISTUDIO_EXP_NOTE_START
bcs @note_table_expansion
.endif
sec ; Subtract the pitch of both notes.
lda famistudio_note_table_lsb,y
sbc famistudio_note_table_lsb,x
sta slide_delta_lo
lda famistudio_note_table_msb,y
sbc famistudio_note_table_msb,x
.ifdef FAMISTUDIO_EXP_NOTE_START
jmp @note_table_done
@note_table_expansion:
sec
lda famistudio_exp_note_table_lsb,y
sbc famistudio_exp_note_table_lsb,x
sta slide_delta_lo
lda famistudio_exp_note_table_msb,y
sbc famistudio_exp_note_table_msb,x
@note_table_done:
.endif
ldx tmp_slide_idx ; slide index.
sta famistudio_slide_pitch_hi,x
.if FAMISTUDIO_EXP_N163 || FAMISTUDIO_EXP_VRC7
cpx #3 ; Slide #3 is the first of expansion slides.
bcs @positive_shift
.endif
@negative_shift:
lda slide_delta_lo
asl ; Shift-left, we have 1 bit of fractional slide.
sta famistudio_slide_pitch_lo,x
rol famistudio_slide_pitch_hi,x ; Shift-left, we have 1 bit of fractional slide.
.if FAMISTUDIO_EXP_N163 || FAMISTUDIO_EXP_VRC7
jmp @shift_done
@positive_shift:
lda slide_delta_lo
sta famistudio_slide_pitch_lo,x
ldy #FAMISTUDIO_PITCH_SHIFT
@positive_shift_loop:
lda famistudio_slide_pitch_hi,x
cmp #$80
ror famistudio_slide_pitch_hi,x
ror famistudio_slide_pitch_lo,x
dey
bne @positive_shift_loop
@shift_done:
.endif
ldx tmp_chan_idx
ldy #2
@slide_done_pos:
lda (channel_data_ptr),y ; Re-read the target note (ugly...)
sta famistudio_chn_note,x ; Store note code
famistudio_add_16_8 channel_data_ptr, #3
ldy #0
jmp @check_no_attack
.endif
@regular_note:
sta famistudio_chn_note,x ; Store note code
.if FAMISTUDIO_USE_SLIDE_NOTES
ldy famistudio_channel_to_slide,x ; Clear any previous slide on new node.
bmi @check_no_attack
lda #0
sta famistudio_slide_step,y
.endif
@check_no_attack:
bit update_flags
bmi @no_attack
.if FAMISTUDIO_USE_FAMITRACKER_DELAYED_NOTES_OR_CUTS
; Any note with an attack clears any pending delayed cut, unless it was set during this update (flags bit 6).
bvs @check_stop_note
lda #$ff
sta famistudio_chn_cut_delay,x
.endif
@check_stop_note:
lda famistudio_chn_note,x ; Dont trigger attack on stop notes.
beq @no_attack
.if FAMISTUDIO_EXP_VRC7
cpx #FAMISTUDIO_VRC7_CH0_IDX
bcc @sec_and_done
lda #1
sta famistudio_chn_vrc7_trigger-FAMISTUDIO_VRC7_CH0_IDX,x ; Set trigger flag for VRC7
.endif
@sec_and_done:
sec ; New note flag is set
jmp @done
@no_attack:
.if FAMISTUDIO_CFG_DPCM_SUPPORT
cpx #4
beq @sec_and_done
.endif
@clc_and_done:
clc ; Pretend there is no new note.
jmp @done
@special_code:
and #$7f
lsr a
bcs @set_empty_rows
asl a
asl a
sta famistudio_chn_instrument,x ; Store instrument number*4
.if FAMISTUDIO_EXP_N163 || FAMISTUDIO_EXP_VRC7 || FAMISTUDIO_EXP_FDS
cpx #5
bcc @regular_channel
lda #1
sta famistudio_chn_inst_changed-5, x
@regular_channel:
.endif
jmp @read_byte
@set_speed:
.if !FAMISTUDIO_USE_FAMITRACKER_TEMPO
jmp @invalid_opcode
.else
lda (channel_data_ptr),y
sta famistudio_song_speed
famistudio_inc_16 channel_data_ptr
jmp @read_byte
.endif
@set_loop:
lda (channel_data_ptr),y
sta tmp_ptr_lo
iny
lda (channel_data_ptr),y
sta channel_data_ptr+1
lda tmp_ptr_lo
sta channel_data_ptr+0
dey
jmp @read_byte
@set_empty_rows:
cmp #$3d
beq @set_speed
cmp #$3c
beq @release_note
bcc @set_repeat
cmp #$3e
beq @set_loop
@set_reference:
clc ; Remember return address+3
lda channel_data_ptr+0
adc #3
sta famistudio_chn_return_lo,x
lda channel_data_ptr+1
adc #0
sta famistudio_chn_return_hi,x
lda (channel_data_ptr),y ; Read length of the reference (how many rows)
sta famistudio_chn_ref_len,x
iny
lda (channel_data_ptr),y ; Read 16-bit absolute address of the reference
sta tmp_ptr_lo
iny
lda (channel_data_ptr),y
sta channel_data_ptr+1
lda tmp_ptr_lo
sta channel_data_ptr+0
ldy #0
jmp @read_byte
@release_note:
.if FAMISTUDIO_EXP_VRC7
cpx #FAMISTUDIO_VRC7_CH0_IDX
bcc @apu_channel
lda #$80
sta famistudio_chn_vrc7_trigger-FAMISTUDIO_VRC7_CH0_IDX,x ; Set release flag for VRC7
@apu_channel:
.endif
stx tmp_chan_idx
lda famistudio_channel_to_volume_env,x ; DPCM(5) will never have releases.
tax
lda famistudio_env_addr_lo,x ; Load envelope data address into temp
sta volume_env_ptr+0
lda famistudio_env_addr_hi,x
sta volume_env_ptr+1
ldy #0
lda (volume_env_ptr),y ; Read first byte of the envelope data, this contains the release index.
beq @env_has_no_release
sta famistudio_env_ptr,x
lda #0
sta famistudio_env_repeat,x ; Need to reset envelope repeat to force update.
@env_has_no_release:
ldx tmp_chan_idx
clc
jmp @done
@set_repeat:
sta famistudio_chn_repeat,x ; Set up repeat counter, carry is clear, no new note
@done:
lda famistudio_chn_ref_len,x ; Check reference row counter
beq @no_ref ; If it is zero, there is no reference
dec famistudio_chn_ref_len,x ; Decrease row counter
bne @no_ref
lda famistudio_chn_return_lo,x ; End of a reference, return to previous pointer
sta famistudio_chn_ptr_lo,x
lda famistudio_chn_return_hi,x
sta famistudio_chn_ptr_hi,x
rts
@no_ref:
lda channel_data_ptr+0
sta famistudio_chn_ptr_lo,x
lda channel_data_ptr+1
sta famistudio_chn_ptr_hi,x
rts
@invalid_opcode:
; If you hit this, this mean you either:
; - have fine pitches in your songs, but didnt enable "FAMISTUDIO_USE_PITCH_TRACK"
; - have vibrato effect in your songs, but didnt enable "FAMISTUDIO_USE_VIBRATO"
; - have arpeggiated chords in your songs, but didnt enable "FAMISTUDIO_USE_ARPEGGIO"
; - have slide notes in your songs, but didnt enable "FAMISTUDIO_USE_SLIDE_NOTES"
; - have a duty cycle effect in your songs, but didnt enable "FAMISTUDIO_USE_DUTYCYCLE_EFFECT"
; - have delayed notes/cuts in your songs, but didnt enable "FAMISTUDIO_USE_FAMITRACKER_DELAYED_NOTES_OR_CUTS"
; - have exported a song that uses FamiStudio tempo but have defined "FAMISTUDIO_USE_FAMITRACKER_TEMPO"
; - have exported VRC6 data but didnt define "FAMISTUDIO_EXP_VRC6"
brk
@famistudio_special_code_jmp_lo:
.if FAMISTUDIO_USE_SLIDE_NOTES
.byte <@special_code_slide ; $61
.else
.byte <@invalid_opcode ; $61
.endif
.byte <@special_code_disable_attack ; $62
.if FAMISTUDIO_USE_VIBRATO
.byte <@special_code_override_pitch_envelope ; $63
.byte <@special_code_clear_pitch_override_flag ; $64
.else
.byte <@invalid_opcode ; $63
.byte <@invalid_opcode ; $64
.endif
.if FAMISTUDIO_USE_ARPEGGIO
.byte <@special_code_override_arpeggio_envelope ; $65
.byte <@special_code_clear_arpeggio_override_flag ; $66
.byte <@special_code_reset_arpeggio ; $67
.else
.byte <@invalid_opcode ; $65
.byte <@invalid_opcode ; $66
.byte <@invalid_opcode ; $67
.endif
.if FAMISTUDIO_USE_PITCH_TRACK
.byte <@special_code_fine_pitch ; $68
.else
.byte <@invalid_opcode ; $68
.endif
.if FAMISTUDIO_USE_DUTYCYCLE_EFFECT
.byte <@special_code_duty_cycle_effect ; $69
.else
.byte <@invalid_opcode ; $69
.endif
.if FAMISTUDIO_USE_FAMITRACKER_DELAYED_NOTES_OR_CUTS
.byte <@special_code_note_delay ; $6a
.byte <@special_code_cut_delay ; $6b
.elseif !FAMISTUDIO_USE_FAMITRACKER_TEMPO
.byte <@special_code_set_tempo_envelope ; $6a
.byte <@special_code_reset_tempo_envelope ; $6b
.else
.byte <@invalid_opcode ; $6a
.byte <@invalid_opcode ; $6b
.endif
.if FAMISTUDIO_EXP_FDS
.byte <@special_code_fds_mod_speed ; $6c
.byte <@special_code_fds_mod_depth ; $6d
.elseif FAMISTUDIO_EXP_VRC6
.byte <@special_code_vrc6_saw_volume ; $6c
.byte <@invalid_opcode ; $6d
.else
.byte <@invalid_opcode ; $6c
.byte <@invalid_opcode ; $6d
.endif
.if FAMISTUDIO_USE_VOLUME_SLIDES
.byte <@special_code_volume_slide ; $6e
.else
.byte <@invalid_opcode ; $6e
.endif
@famistudio_special_code_jmp_hi:
.if FAMISTUDIO_USE_SLIDE_NOTES
.byte >@special_code_slide ; $61
.else
.byte >@invalid_opcode ; $61
.endif
.byte >@special_code_disable_attack ; $62
.if FAMISTUDIO_USE_VIBRATO
.byte >@special_code_override_pitch_envelope ; $63
.byte >@special_code_clear_pitch_override_flag ; $64
.else
.byte >@invalid_opcode ; $63
.byte >@invalid_opcode ; $64
.endif
.if FAMISTUDIO_USE_ARPEGGIO
.byte >@special_code_override_arpeggio_envelope ; $64
.byte >@special_code_clear_arpeggio_override_flag ; $66
.byte >@special_code_reset_arpeggio ; $67
.else
.byte >@invalid_opcode ; $65
.byte >@invalid_opcode ; $66
.byte >@invalid_opcode ; $67
.endif
.if FAMISTUDIO_USE_PITCH_TRACK
.byte >@special_code_fine_pitch ; $68
.else
.byte >@invalid_opcode ; $68
.endif
.if FAMISTUDIO_USE_DUTYCYCLE_EFFECT
.byte >@special_code_duty_cycle_effect ; $69
.else
.byte >@invalid_opcode ; $69
.endif
.if FAMISTUDIO_USE_FAMITRACKER_DELAYED_NOTES_OR_CUTS
.byte >@special_code_note_delay ; $6a
.byte >@special_code_cut_delay ; $6b
.elseif !FAMISTUDIO_USE_FAMITRACKER_TEMPO
.byte >@special_code_set_tempo_envelope ; $6a
.byte >@special_code_reset_tempo_envelope ; $6b
.else
.byte >@invalid_opcode ; $6a
.byte >@invalid_opcode ; $6b
.endif
.if FAMISTUDIO_EXP_FDS
.byte >@special_code_fds_mod_speed ; $6c
.byte >@special_code_fds_mod_depth ; $6d
.elseif FAMISTUDIO_EXP_VRC6
.byte >@special_code_vrc6_saw_volume ; $6c
.byte >@invalid_opcode ; $6d
.else
.byte >@invalid_opcode ; $6c
.byte >@invalid_opcode ; $6d
.endif
.if FAMISTUDIO_USE_VOLUME_SLIDES
.byte >@special_code_volume_slide ; $6e
.else
.byte >@invalid_opcode ; $6e
.endif
;======================================================================================================================
; FAMISTUDIO_SAMPLE_STOP (internal)
;
; Stop DPCM sample if it plays
;
; [in] no input params.
;======================================================================================================================
famistudio_sample_stop:
lda #%00001111
sta FAMISTUDIO_APU_SND_CHN
rts
.if FAMISTUDIO_CFG_DPCM_SUPPORT
;======================================================================================================================
; FAMISTUDIO_SAMPLE_PLAY_SFX (public)
;
; Play DPCM sample with higher priority, for sound effects
;
; [in] a: Sample index, 1...63.
;======================================================================================================================
famistudio_sfx_sample_play:
ldx #1
stx famistudio_dpcm_effect
sample_play:
tmp = famistudio_r0
sample_data_ptr = famistudio_ptr0
asl a ; Sample number * 4, offset in the sample table
asl a
clc
adc famistudio_dpcm_list_lo
sta sample_data_ptr+0
lda #0
adc famistudio_dpcm_list_hi
sta sample_data_ptr+1
lda #%00001111 ; Stop DPCM
sta FAMISTUDIO_APU_SND_CHN
ldy #0
lda (sample_data_ptr),y ; Sample offset
sta FAMISTUDIO_APU_DMC_START
iny
lda (sample_data_ptr),y ; Sample length
sta FAMISTUDIO_APU_DMC_LEN
iny
lda (sample_data_ptr),y ; Pitch and loop
sta FAMISTUDIO_APU_DMC_FREQ
iny
lda (sample_data_ptr),y ; Initial DMC counter
sta FAMISTUDIO_APU_DMC_RAW
lda #%00011111 ; Start DMC
sta FAMISTUDIO_APU_SND_CHN
rts
;======================================================================================================================
; FAMISTUDIO_SAMPLE_PLAY_MUSIC (internal)
;
; Play DPCM sample, used by music player, could be used externally. Samples played for music have lower priority than
; samples played by SFX.
;
; [in] a: Sample index, 1...63.
;======================================================================================================================
famistudio_music_sample_play:
ldx famistudio_dpcm_effect
beq sample_play
tax
lda FAMISTUDIO_APU_SND_CHN
and #16
beq @not_busy
rts
@not_busy:
sta famistudio_dpcm_effect
txa
jmp sample_play
.endif
.if FAMISTUDIO_CFG_SFX_SUPPORT
;======================================================================================================================
; FAMISTUDIO_SFX_INIT (public)
;
; Initialize the sound effect player.
;
; [in] x: Sound effect data pointer (lo)
; [in] y: Sound effect data pointer (hi)
;======================================================================================================================
famistudio_sfx_init:
effect_list_ptr = famistudio_ptr0
stx effect_list_ptr+0
sty effect_list_ptr+1
ldy #0
.if FAMISTUDIO_DUAL_SUPPORT
lda famistudio_pal_adjust ; Add 2 to the sound list pointer for PAL
bne @ntsc
iny
iny
@ntsc:
.endif
lda (effect_list_ptr),y
sta famistudio_sfx_addr_lo
iny
lda (effect_list_ptr),y
sta famistudio_sfx_addr_hi
ldx #FAMISTUDIO_SFX_CH0
@set_channels:
jsr famistudio_sfx_clear_channel
txa
clc
adc #FAMISTUDIO_SFX_STRUCT_SIZE
tax
cpx #FAMISTUDIO_SFX_STRUCT_SIZE*FAMISTUDIO_CFG_SFX_STREAMS
bne @set_channels
rts
;======================================================================================================================
; FAMISTUDIO_SFX_CLEAR_CHANNEL (internal)
;
; Clears output buffer of a sound effect.
;
; [in] x: Offset of the sound effect stream.
;======================================================================================================================
famistudio_sfx_clear_channel:
lda #0
sta famistudio_sfx_ptr_hi,x ; This stops the effect
sta famistudio_sfx_repeat,x
sta famistudio_sfx_offset,x
sta famistudio_sfx_buffer+6,x ; Mute triangle
lda #$30
sta famistudio_sfx_buffer+0,x ; Mute pulse1
sta famistudio_sfx_buffer+3,x ; Mute pulse2
sta famistudio_sfx_buffer+9,x ; Mute noise
rts
;======================================================================================================================
; FAMISTUDIO_SFX_PLAY (public)
;
; Plays a sound effect.
;
; [in] a: Sound effect index (0...127)
; [in] x: Offset of sound effect channel, should be FAMISTUDIO_SFX_CH0..FAMISTUDIO_SFX_CH3
;======================================================================================================================
famistudio_sfx_play:
effect_data_ptr = famistudio_ptr0
asl a
tay
jsr famistudio_sfx_clear_channel ; Stops the effect if it plays
lda famistudio_sfx_addr_lo
sta effect_data_ptr+0
lda famistudio_sfx_addr_hi
sta effect_data_ptr+1
lda (effect_data_ptr),y
sta famistudio_sfx_ptr_lo,x
iny
lda (effect_data_ptr),y
sta famistudio_sfx_ptr_hi,x ; This write enables the effect
rts
;======================================================================================================================
; FAMISTUDIO_SFX_UPDATE (internal)
;
; Updates a single sound effect stream.
;
; [in] x: Offset of sound effect channel, should be FAMISTUDIO_SFX_CH0..FAMISTUDIO_SFX_CH3
;======================================================================================================================
famistudio_sfx_update:
tmp = famistudio_r0
tmpx = famistudio_r1
effect_data_ptr = famistudio_ptr0
lda famistudio_sfx_repeat,x ; Check if repeat counter is not zero
beq @no_repeat
dec famistudio_sfx_repeat,x ; Decrement and return
bne @update_buf ; Just mix with output buffer
@no_repeat:
lda famistudio_sfx_ptr_hi,x ; Check if MSB of the pointer is not zero
bne @sfx_active
rts ; Return otherwise, no active effect
@sfx_active:
sta effect_data_ptr+1 ;load effect pointer into temp
lda famistudio_sfx_ptr_lo,x
sta effect_data_ptr+0
ldy famistudio_sfx_offset,x
clc
@read_byte:
lda (effect_data_ptr),y ; Read byte of effect
bmi @get_data ; If bit 7 is set, it is a register write
beq @eof
iny
bne @store_repeat
jsr @inc_sfx
@store_repeat:
sta famistudio_sfx_repeat,x ; If bit 7 is reset, it is number of repeats
tya
sta famistudio_sfx_offset,x
jmp @update_buf
@get_data:
iny
bne @get_data2
jsr @inc_sfx
@get_data2:
stx tmp ; It is a register write
adc tmp ; Get offset in the effect output buffer
tax
lda (effect_data_ptr),y
iny
bne @write_buffer
stx tmpx
ldx tmp
jsr @inc_sfx
ldx tmpx
@write_buffer:
sta famistudio_sfx_buffer-128,x
ldx tmp
jmp @read_byte
@eof:
sta famistudio_sfx_ptr_hi,x ; Mark channel as inactive
@update_buf:
lda famistudio_output_buf ; Compare effect output buffer with main output buffer
and #$0f ; If volume of pulse 1 of effect is higher than that of the main buffer, overwrite the main buffer value with the new one
sta tmp
lda famistudio_sfx_buffer+0,x
and #$0f
cmp tmp
bcc @no_pulse1
lda famistudio_sfx_buffer+0,x
sta famistudio_output_buf+0
lda famistudio_sfx_buffer+1,x
sta famistudio_output_buf+1
lda famistudio_sfx_buffer+2,x
sta famistudio_output_buf+2
@no_pulse1:
lda famistudio_output_buf+3
and #$0f
sta tmp
lda famistudio_sfx_buffer+3,x
and #$0f
cmp tmp
bcc @no_pulse2
lda famistudio_sfx_buffer+3,x
sta famistudio_output_buf+3
lda famistudio_sfx_buffer+4,x
sta famistudio_output_buf+4
lda famistudio_sfx_buffer+5,x
sta famistudio_output_buf+5
@no_pulse2:
lda famistudio_sfx_buffer+6,x ; Overwrite triangle of main output buffer if it is active
beq @no_triangle
sta famistudio_output_buf+6
lda famistudio_sfx_buffer+7,x
sta famistudio_output_buf+7
lda famistudio_sfx_buffer+8,x
sta famistudio_output_buf+8
@no_triangle:
lda famistudio_output_buf+9
and #$0f
sta tmp
lda famistudio_sfx_buffer+9,x
and #$0f
cmp tmp
bcc @no_noise
lda famistudio_sfx_buffer+9,x
sta famistudio_output_buf+9
lda famistudio_sfx_buffer+10,x
sta famistudio_output_buf+10
@no_noise:
rts
@inc_sfx:
inc effect_data_ptr+1
inc famistudio_sfx_ptr_hi,x
rts
.endif
; Dummy envelope used to initialize all channels with silence
famistudio_dummy_envelope:
.byte $c0,$7f,$00,$00
famistudio_dummy_pitch_envelope:
.byte $00,$c0,$7f,$00,$01
; Note tables
famistudio_note_table_lsb:
.if FAMISTUDIO_CFG_PAL_SUPPORT
.byte $00
.byte $68, $b6, $0e, $6f, $d9, $4b, $c6, $48, $d1, $60, $f6, $92 ; Octave 0
.byte $34, $db, $86, $37, $ec, $a5, $62, $23, $e8, $b0, $7b, $49 ; Octave 1
.byte $19, $ed, $c3, $9b, $75, $52, $31, $11, $f3, $d7, $bd, $a4 ; Octave 2
.byte $8c, $76, $61, $4d, $3a, $29, $18, $08, $f9, $eb, $de, $d1 ; Octave 3
.byte $c6, $ba, $b0, $a6, $9d, $94, $8b, $84, $7c, $75, $6e, $68 ; Octave 4
.byte $62, $5d, $57, $52, $4e, $49, $45, $41, $3e, $3a, $37, $34 ; Octave 5
.byte $31, $2e, $2b, $29, $26, $24, $22, $20, $1e, $1d, $1b, $19 ; Octave 6
.byte $18, $16, $15, $14, $13, $12, $11, $10, $0f, $0e, $0d, $0c ; Octave 7
.endif
.if FAMISTUDIO_CFG_NTSC_SUPPORT
.byte $00
.byte $5b, $9c, $e6, $3b, $9a, $01, $72, $ea, $6a, $f1, $7f, $13 ; Octave 0
.byte $ad, $4d, $f3, $9d, $4c, $00, $b8, $74, $34, $f8, $bf, $89 ; Octave 1
.byte $56, $26, $f9, $ce, $a6, $80, $5c, $3a, $1a, $fb, $df, $c4 ; Octave 2
.byte $ab, $93, $7c, $67, $52, $3f, $2d, $1c, $0c, $fd, $ef, $e1 ; Octave 3
.byte $d5, $c9, $bd, $b3, $a9, $9f, $96, $8e, $86, $7e, $77, $70 ; Octave 4
.byte $6a, $64, $5e, $59, $54, $4f, $4b, $46, $42, $3f, $3b, $38 ; Octave 5
.byte $34, $31, $2f, $2c, $29, $27, $25, $23, $21, $1f, $1d, $1b ; Octave 6
.byte $1a, $18, $17, $15, $14, $13, $12, $11, $10, $0f, $0e, $0d ; Octave 7
.endif
famistudio_note_table_msb:
.if FAMISTUDIO_CFG_PAL_SUPPORT
.byte $00
.byte $0c, $0b, $0b, $0a, $09, $09, $08, $08, $07, $07, $06, $06 ; Octave 0
.byte $06, $05, $05, $05, $04, $04, $04, $04, $03, $03, $03, $03 ; Octave 1
.byte $03, $02, $02, $02, $02, $02, $02, $02, $01, $01, $01, $01 ; Octave 2
.byte $01, $01, $01, $01, $01, $01, $01, $01, $00, $00, $00, $00 ; Octave 3
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Octave 4
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Octave 5
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Octave 6
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Octave 7
.endif
.if FAMISTUDIO_CFG_NTSC_SUPPORT
.byte $00
.byte $0d, $0c, $0b, $0b, $0a, $0a, $09, $08, $08, $07, $07, $07 ; Octave 0
.byte $06, $06, $05, $05, $05, $05, $04, $04, $04, $03, $03, $03 ; Octave 1
.byte $03, $03, $02, $02, $02, $02, $02, $02, $02, $01, $01, $01 ; Octave 2
.byte $01, $01, $01, $01, $01, $01, $01, $01, $01, $00, $00, $00 ; Octave 3
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Octave 4
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Octave 5
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Octave 6
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Octave 7
.endif
.if FAMISTUDIO_EXP_VRC6
famistudio_exp_note_table_lsb:
famistudio_saw_note_table_lsb:
.byte $00
.byte $44, $69, $9a, $d6, $1e, $70, $cb, $30, $9e, $13, $91, $16 ; Octave 0
.byte $a2, $34, $cc, $6b, $0e, $b7, $65, $18, $ce, $89, $48, $0a ; Octave 1
.byte $d0, $99, $66, $35, $07, $db, $b2, $8b, $67, $44, $23, $05 ; Octave 2
.byte $e8, $cc, $b2, $9a, $83, $6d, $59, $45, $33, $22, $11, $02 ; Octave 3
.byte $f3, $e6, $d9, $cc, $c1, $b6, $ac, $a2, $99, $90, $88, $80 ; Octave 4
.byte $79, $72, $6c, $66, $60, $5b, $55, $51, $4c, $48, $44, $40 ; Octave 5
.byte $3c, $39, $35, $32, $2f, $2d, $2a, $28, $25, $23, $21, $1f ; Octave 6
.byte $1e, $1c, $1a, $19, $17, $16, $15, $13, $12, $11, $10, $0f ; Octave 7
famistudio_exp_note_table_msb:
famistudio_saw_note_table_msb:
.byte $00
.byte $0f, $0e, $0d, $0c, $0c, $0b, $0a, $0a, $09, $09, $08, $08 ; Octave 0
.byte $07, $07, $06, $06, $06, $05, $05, $05, $04, $04, $04, $04 ; Octave 1
.byte $03, $03, $03, $03, $03, $02, $02, $02, $02, $02, $02, $02 ; Octave 2
.byte $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01 ; Octave 3
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Octave 4
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Octave 5
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Octave 6
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Octave 7
.endif
.if FAMISTUDIO_EXP_VRC7
famistudio_exp_note_table_lsb:
famistudio_vrc7_note_table_lsb:
.byte $00
.byte $ac, $b7, $c2, $cd, $d9, $e6, $f4, $02, $12, $22, $33, $46 ; Octave 0
.byte $58, $6e, $84, $9a, $b2, $cc, $e8, $04, $24, $44, $66, $8c ; Octave 1
.byte $b0, $dc, $08, $34, $64, $98, $d0, $08, $48, $88, $cc, $18 ; Octave 2
.byte $60, $b8, $10, $68, $c8, $30, $a0, $10, $90, $10, $98, $30 ; Octave 3
.byte $c0, $70, $20, $d0, $90, $60, $40, $20, $20, $20, $30, $60 ; Octave 4
.byte $80, $e0, $40, $a0, $20, $c0, $80, $40, $40, $40, $60, $c0 ; Octave 5
.byte $00, $c0, $80, $40, $40, $80, $00, $80, $80, $80, $c0, $80 ; Octave 6
.byte $00, $80, $00, $80, $80, $00, $00, $00, $00, $00, $80, $00 ; Octave 7
famistudio_exp_note_table_msb:
famistudio_vrc7_note_table_msb:
.byte $00
.byte $00, $00, $00, $00, $00, $00, $00, $01, $01, $01, $01, $01 ; Octave 0
.byte $01, $01, $01, $01, $01, $01, $01, $02, $02, $02, $02, $02 ; Octave 1
.byte $02, $02, $03, $03, $03, $03, $03, $04, $04, $04, $04, $05 ; Octave 2
.byte $05, $05, $06, $06, $06, $07, $07, $08, $08, $09, $09, $0a ; Octave 3
.byte $0a, $0b, $0c, $0c, $0d, $0e, $0f, $10, $11, $12, $13, $14 ; Octave 4
.byte $15, $16, $18, $19, $1b, $1c, $1e, $20, $22, $24, $26, $28 ; Octave 5
.byte $2b, $2d, $30, $33, $36, $39, $3d, $40, $44, $48, $4c, $51 ; Octave 6
.byte $56, $5b, $61, $66, $6c, $73, $7a, $81, $89, $91, $99, $a3 ; Octave 7
.endif
.if FAMISTUDIO_EXP_FDS
famistudio_exp_note_table_lsb:
famistudio_fds_note_table_lsb:
.byte $00
.byte $13, $14, $16, $17, $18, $1a, $1b, $1d, $1e, $20, $22, $24 ; Octave 0
.byte $26, $29, $2b, $2e, $30, $33, $36, $39, $3d, $40, $44, $48 ; Octave 1
.byte $4d, $51, $56, $5b, $61, $66, $6c, $73, $7a, $81, $89, $91 ; Octave 2
.byte $99, $a2, $ac, $b6, $c1, $cd, $d9, $e6, $f3, $02, $11, $21 ; Octave 3
.byte $33, $45, $58, $6d, $82, $99, $b2, $cb, $e7, $04, $22, $43 ; Octave 4
.byte $65, $8a, $b0, $d9, $04, $32, $63, $97, $cd, $07, $44, $85 ; Octave 5
.byte $ca, $13, $60, $b2, $09, $65, $c6, $2d, $9b, $0e, $89, $0b ; Octave 6
.byte $94, $26, $c1, $64, $12, $ca, $8c, $5b, $35, $1d, $12, $16 ; Octave 7
famistudio_exp_note_table_msb:
famistudio_fds_note_table_msb:
.byte $00
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Octave 0
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Octave 1
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Octave 2
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $01, $01, $01 ; Octave 3
.byte $01, $01, $01, $01, $01, $01, $01, $01, $01, $02, $02, $02 ; Octave 4
.byte $02, $02, $02, $02, $03, $03, $03, $03, $03, $04, $04, $04 ; Octave 5
.byte $04, $05, $05, $05, $06, $06, $06, $07, $07, $08, $08, $09 ; Octave 6
.byte $09, $0a, $0a, $0b, $0c, $0c, $0d, $0e, $0f, $10, $11, $12 ; Octave 7
.endif
.if FAMISTUDIO_EXP_N163
.if FAMISTUDIO_EXP_N163_CHN_CNT = 1
famistudio_exp_note_table_lsb:
famistudio_n163_note_table_lsb:
.byte $00
.byte $47,$4c,$50,$55,$5a,$5f,$65,$6b,$72,$78,$80,$87 ; Octave 0
.byte $8f,$98,$a1,$aa,$b5,$bf,$cb,$d7,$e4,$f1,$00,$0f ; Octave 1
.byte $1f,$30,$42,$55,$6a,$7f,$96,$ae,$c8,$e3,$00,$1e ; Octave 2
.byte $3e,$60,$85,$ab,$d4,$ff,$2c,$5d,$90,$c6,$00,$3d ; Octave 3
.byte $7d,$c1,$0a,$57,$a8,$fe,$59,$ba,$20,$8d,$00,$7a ; Octave 4
.byte $fb,$83,$14,$ae,$50,$fd,$b3,$74,$41,$1a,$00,$f4 ; Octave 5
.byte $f6,$07,$29,$5c,$a1,$fa,$67,$e9,$83,$35,$01,$e8 ; Octave 6
.byte $ec,$0f,$52,$b8,$43,$f4,$ce,$d3,$06,$6a,$02,$d1 ; Octave 7
famistudio_exp_note_table_msb:
famistudio_n163_note_table_msb:
.byte $00
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ; Octave 0
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01,$01 ; Octave 1
.byte $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$02,$02 ; Octave 2
.byte $02,$02,$02,$02,$02,$02,$03,$03,$03,$03,$04,$04 ; Octave 3
.byte $04,$04,$05,$05,$05,$05,$06,$06,$07,$07,$08,$08 ; Octave 4
.byte $08,$09,$0a,$0a,$0b,$0b,$0c,$0d,$0e,$0f,$10,$10 ; Octave 5
.byte $11,$13,$14,$15,$16,$17,$19,$1a,$1c,$1e,$20,$21 ; Octave 6
.byte $23,$26,$28,$2a,$2d,$2f,$32,$35,$39,$3c,$40,$43 ; Octave 7
.endif
.if FAMISTUDIO_EXP_N163_CHN_CNT = 2
famistudio_exp_note_table_lsb:
famistudio_n163_note_table_lsb:
.byte $00
.byte $8f,$98,$a1,$aa,$b5,$bf,$cb,$d7,$e4,$f1,$00,$0f ; Octave 0
.byte $1f,$30,$42,$55,$6a,$7f,$96,$ae,$c8,$e3,$00,$1e ; Octave 1
.byte $3e,$60,$85,$ab,$d4,$ff,$2c,$5d,$90,$c6,$00,$3d ; Octave 2
.byte $7d,$c1,$0a,$57,$a8,$fe,$59,$ba,$20,$8d,$00,$7a ; Octave 3
.byte $fb,$83,$14,$ae,$50,$fd,$b3,$74,$41,$1a,$00,$f4 ; Octave 4
.byte $f6,$07,$29,$5c,$a1,$fa,$67,$e9,$83,$35,$01,$e8 ; Octave 5
.byte $ec,$0f,$52,$b8,$43,$f4,$ce,$d3,$06,$6a,$02,$d1 ; Octave 6
.byte $d9,$1f,$a5,$71,$86,$e8,$9c,$a7,$0d,$d5,$05,$a2 ; Octave 7
famistudio_exp_note_table_msb:
famistudio_n163_note_table_msb:
.byte $00
.byte $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01,$01 ; Octave 0
.byte $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$02,$02 ; Octave 1
.byte $02,$02,$02,$02,$02,$02,$03,$03,$03,$03,$04,$04 ; Octave 2
.byte $04,$04,$05,$05,$05,$05,$06,$06,$07,$07,$08,$08 ; Octave 3
.byte $08,$09,$0a,$0a,$0b,$0b,$0c,$0d,$0e,$0f,$10,$10 ; Octave 4
.byte $11,$13,$14,$15,$16,$17,$19,$1a,$1c,$1e,$20,$21 ; Octave 5
.byte $23,$26,$28,$2a,$2d,$2f,$32,$35,$39,$3c,$40,$43 ; Octave 6
.byte $47,$4c,$50,$55,$5a,$5f,$65,$6b,$72,$78,$80,$87 ; Octave 7
.endif
.if FAMISTUDIO_EXP_N163_CHN_CNT = 3
famistudio_exp_note_table_lsb:
famistudio_n163_note_table_lsb:
.byte $00
.byte $d7,$e4,$f1,$00,$0f,$1f,$30,$42,$56,$6a,$80,$96 ; Octave 0
.byte $af,$c8,$e3,$00,$1f,$3f,$61,$85,$ac,$d5,$00,$2d ; Octave 1
.byte $5e,$91,$c7,$01,$3e,$7e,$c3,$0b,$58,$aa,$00,$5b ; Octave 2
.byte $bc,$22,$8f,$02,$7c,$fd,$86,$17,$b1,$54,$00,$b7 ; Octave 3
.byte $78,$45,$1f,$05,$f9,$fb,$0d,$2f,$62,$a8,$01,$6e ; Octave 4
.byte $f1,$8b,$3e,$0a,$f2,$f7,$1a,$5e,$c5,$50,$02,$dc ; Octave 5
.byte $e3,$17,$7c,$15,$e4,$ee,$35,$bd,$8a,$a0,$04,$b9 ; Octave 6
.byte $c6,$2e,$f8,$2a,$c9,$dc,$6a,$7a,$14,$40,$08,$73 ; Octave 7
famistudio_exp_note_table_msb:
famistudio_n163_note_table_msb:
.byte $00
.byte $00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$01 ; Octave 0
.byte $01,$01,$01,$02,$02,$02,$02,$02,$02,$02,$03,$03 ; Octave 1
.byte $03,$03,$03,$04,$04,$04,$04,$05,$05,$05,$06,$06 ; Octave 2
.byte $06,$07,$07,$08,$08,$08,$09,$0a,$0a,$0b,$0c,$0c ; Octave 3
.byte $0d,$0e,$0f,$10,$10,$11,$13,$14,$15,$16,$18,$19 ; Octave 4
.byte $1a,$1c,$1e,$20,$21,$23,$26,$28,$2a,$2d,$30,$32 ; Octave 5
.byte $35,$39,$3c,$40,$43,$47,$4c,$50,$55,$5a,$60,$65 ; Octave 6
.byte $6b,$72,$78,$80,$87,$8f,$98,$a1,$ab,$b5,$c0,$cb ; Octave 7
.endif
.if FAMISTUDIO_EXP_N163_CHN_CNT = 4
famistudio_exp_note_table_lsb:
famistudio_n163_note_table_lsb:
.byte $00
.byte $1f,$30,$42,$55,$6a,$7f,$96,$ae,$c8,$e3,$00,$1e ; Octave 0
.byte $3e,$60,$85,$ab,$d4,$ff,$2c,$5d,$90,$c6,$00,$3d ; Octave 1
.byte $7d,$c1,$0a,$57,$a8,$fe,$59,$ba,$20,$8d,$00,$7a ; Octave 2
.byte $fb,$83,$14,$ae,$50,$fd,$b3,$74,$41,$1a,$00,$f4 ; Octave 3
.byte $f6,$07,$29,$5c,$a1,$fa,$67,$e9,$83,$35,$01,$e8 ; Octave 4
.byte $ec,$0f,$52,$b8,$43,$f4,$ce,$d3,$06,$6a,$02,$d1 ; Octave 5
.byte $d9,$1f,$a5,$71,$86,$e8,$9c,$a7,$0d,$d5,$05,$a2 ; Octave 6
.byte $b2,$3e,$4b,$e3,$0c,$d0,$38,$4e,$1b,$ab,$ff,$ff ; Octave 7
famistudio_exp_note_table_msb:
famistudio_n163_note_table_msb:
.byte $00
.byte $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$02,$02 ; Octave 0
.byte $02,$02,$02,$02,$02,$02,$03,$03,$03,$03,$04,$04 ; Octave 1
.byte $04,$04,$05,$05,$05,$05,$06,$06,$07,$07,$08,$08 ; Octave 2
.byte $08,$09,$0a,$0a,$0b,$0b,$0c,$0d,$0e,$0f,$10,$10 ; Octave 3
.byte $11,$13,$14,$15,$16,$17,$19,$1a,$1c,$1e,$20,$21 ; Octave 4
.byte $23,$26,$28,$2a,$2d,$2f,$32,$35,$39,$3c,$40,$43 ; Octave 5
.byte $47,$4c,$50,$55,$5a,$5f,$65,$6b,$72,$78,$80,$87 ; Octave 6
.byte $8f,$98,$a1,$aa,$b5,$bf,$cb,$d7,$e4,$f1,$ff,$ff ; Octave 7
.endif
.if FAMISTUDIO_EXP_N163_CHN_CNT = 5
famistudio_exp_note_table_lsb:
famistudio_n163_note_table_lsb:
.byte $00
.byte $67,$7c,$93,$ab,$c4,$df,$fc,$1a,$3a,$5c,$80,$a6 ; Octave 0
.byte $ce,$f9,$26,$56,$89,$bf,$f8,$34,$74,$b8,$00,$4c ; Octave 1
.byte $9c,$f2,$4c,$ac,$12,$7e,$f0,$69,$e9,$70,$00,$98 ; Octave 2
.byte $39,$e4,$99,$59,$24,$fc,$e0,$d2,$d2,$e1,$00,$31 ; Octave 3
.byte $73,$c9,$33,$b3,$49,$f8,$c0,$a4,$a4,$c2,$01,$62 ; Octave 4
.byte $e7,$93,$67,$67,$93,$f1,$81,$48,$48,$85,$03,$c5 ; Octave 5
.byte $cf,$26,$cf,$ce,$27,$e2,$03,$90,$91,$0b,$06,$8a ; Octave 6
.byte $9f,$4d,$9e,$9c,$4f,$c4,$06,$ff,$ff,$ff,$ff,$ff ; Octave 7
famistudio_exp_note_table_msb:
famistudio_n163_note_table_msb:
.byte $00
.byte $01,$01,$01,$01,$01,$01,$01,$02,$02,$02,$02,$02 ; Octave 0
.byte $02,$02,$03,$03,$03,$03,$03,$04,$04,$04,$05,$05 ; Octave 1
.byte $05,$05,$06,$06,$07,$07,$07,$08,$08,$09,$0a,$0a ; Octave 2
.byte $0b,$0b,$0c,$0d,$0e,$0e,$0f,$10,$11,$12,$14,$15 ; Octave 3
.byte $16,$17,$19,$1a,$1c,$1d,$1f,$21,$23,$25,$28,$2a ; Octave 4
.byte $2c,$2f,$32,$35,$38,$3b,$3f,$43,$47,$4b,$50,$54 ; Octave 5
.byte $59,$5f,$64,$6a,$71,$77,$7f,$86,$8e,$97,$a0,$a9 ; Octave 6
.byte $b3,$be,$c9,$d5,$e2,$ef,$fe,$ff,$ff,$ff,$ff,$ff ; Octave 7
.endif
.if FAMISTUDIO_EXP_N163_CHN_CNT = 6
famistudio_exp_note_table_lsb:
famistudio_n163_note_table_lsb:
.byte $00
.byte $af,$c8,$e3,$00,$1f,$3f,$61,$85,$ac,$d5,$00,$2d ; Octave 0
.byte $5e,$91,$c7,$01,$3e,$7e,$c3,$0b,$58,$aa,$00,$5b ; Octave 1
.byte $bc,$22,$8f,$02,$7c,$fd,$86,$17,$b1,$54,$00,$b7 ; Octave 2
.byte $78,$45,$1f,$05,$f9,$fb,$0d,$2f,$62,$a8,$01,$6e ; Octave 3
.byte $f1,$8b,$3e,$0a,$f2,$f7,$1a,$5e,$c5,$50,$02,$dc ; Octave 4
.byte $e3,$17,$7c,$15,$e4,$ee,$35,$bd,$8a,$a0,$04,$b9 ; Octave 5
.byte $c6,$2e,$f8,$2a,$c9,$dc,$6a,$7a,$14,$40,$08,$73 ; Octave 6
.byte $8c,$5d,$f1,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ; Octave 7
famistudio_exp_note_table_msb:
famistudio_n163_note_table_msb:
.byte $00
.byte $01,$01,$01,$02,$02,$02,$02,$02,$02,$02,$03,$03 ; Octave 0
.byte $03,$03,$03,$04,$04,$04,$04,$05,$05,$05,$06,$06 ; Octave 1
.byte $06,$07,$07,$08,$08,$08,$09,$0a,$0a,$0b,$0c,$0c ; Octave 2
.byte $0d,$0e,$0f,$10,$10,$11,$13,$14,$15,$16,$18,$19 ; Octave 3
.byte $1a,$1c,$1e,$20,$21,$23,$26,$28,$2a,$2d,$30,$32 ; Octave 4
.byte $35,$39,$3c,$40,$43,$47,$4c,$50,$55,$5a,$60,$65 ; Octave 5
.byte $6b,$72,$78,$80,$87,$8f,$98,$a1,$ab,$b5,$c0,$cb ; Octave 6
.byte $d7,$e4,$f1,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ; Octave 7
.endif
.if FAMISTUDIO_EXP_N163_CHN_CNT = 7
famistudio_exp_note_table_lsb:
famistudio_n163_note_table_lsb:
.byte $00
.byte $f6,$14,$34,$56,$79,$9f,$c7,$f1,$1e,$4d,$80,$b5 ; Octave 0
.byte $ed,$29,$69,$ac,$f3,$3e,$8e,$e3,$3c,$9b,$00,$6a ; Octave 1
.byte $db,$53,$d2,$58,$e6,$7d,$1d,$c6,$79,$37,$00,$d5 ; Octave 2
.byte $b7,$a6,$a4,$b0,$cd,$fa,$3a,$8c,$f3,$6e,$01,$ab ; Octave 3
.byte $6f,$4d,$48,$61,$9a,$f5,$74,$19,$e6,$dd,$02,$56 ; Octave 4
.byte $de,$9b,$91,$c3,$35,$eb,$e8,$32,$cc,$bb,$04,$ad ; Octave 5
.byte $bc,$36,$22,$86,$6b,$d6,$d1,$64,$98,$76,$09,$5b ; Octave 6
.byte $79,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ; Octave 7
famistudio_exp_note_table_msb:
famistudio_n163_note_table_msb:
.byte $00
.byte $01,$02,$02,$02,$02,$02,$02,$02,$03,$03,$03,$03 ; Octave 0
.byte $03,$04,$04,$04,$04,$05,$05,$05,$06,$06,$07,$07 ; Octave 1
.byte $07,$08,$08,$09,$09,$0a,$0b,$0b,$0c,$0d,$0e,$0e ; Octave 2
.byte $0f,$10,$11,$12,$13,$14,$16,$17,$18,$1a,$1c,$1d ; Octave 3
.byte $1f,$21,$23,$25,$27,$29,$2c,$2f,$31,$34,$38,$3b ; Octave 4
.byte $3e,$42,$46,$4a,$4f,$53,$58,$5e,$63,$69,$70,$76 ; Octave 5
.byte $7d,$85,$8d,$95,$9e,$a7,$b1,$bc,$c7,$d3,$e0,$ed ; Octave 6
.byte $fb,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ; Octave 7
.endif
.if FAMISTUDIO_EXP_N163_CHN_CNT = 8
famistudio_exp_note_table_lsb:
famistudio_n163_note_table_lsb:
.byte $00
.byte $3e,$60,$85,$ab,$d4,$ff,$2c,$5d,$90,$c6,$00,$3d ; Octave 0
.byte $7d,$c1,$0a,$57,$a8,$fe,$59,$ba,$20,$8d,$00,$7a ; Octave 1
.byte $fb,$83,$14,$ae,$50,$fd,$b3,$74,$41,$1a,$00,$f4 ; Octave 2
.byte $f6,$07,$29,$5c,$a1,$fa,$67,$e9,$83,$35,$01,$e8 ; Octave 3
.byte $ec,$0f,$52,$b8,$43,$f4,$ce,$d3,$06,$6a,$02,$d1 ; Octave 4
.byte $d9,$1f,$a5,$71,$86,$e8,$9c,$a7,$0d,$d5,$05,$a2 ; Octave 5
.byte $b2,$3e,$4b,$e3,$0c,$d0,$38,$4e,$1b,$ab,$ff,$ff ; Octave 6
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ; Octave 7
famistudio_exp_note_table_msb:
famistudio_n163_note_table_msb:
.byte $00
.byte $02,$02,$02,$02,$02,$02,$03,$03,$03,$03,$04,$04 ; Octave 0
.byte $04,$04,$05,$05,$05,$05,$06,$06,$07,$07,$08,$08 ; Octave 1
.byte $08,$09,$0a,$0a,$0b,$0b,$0c,$0d,$0e,$0f,$10,$10 ; Octave 2
.byte $11,$13,$14,$15,$16,$17,$19,$1a,$1c,$1e,$20,$21 ; Octave 3
.byte $23,$26,$28,$2a,$2d,$2f,$32,$35,$39,$3c,$40,$43 ; Octave 4
.byte $47,$4c,$50,$55,$5a,$5f,$65,$6b,$72,$78,$80,$87 ; Octave 5
.byte $8f,$98,$a1,$aa,$b5,$bf,$cb,$d7,$e4,$f1,$ff,$ff ; Octave 6
.byte $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff ; Octave 7
.endif
.endif
; For a given channel, returns the index of the volume envelope.
famistudio_channel_env:
famistudio_channel_to_volume_env:
.byte FAMISTUDIO_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_CH1_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_CH2_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_CH3_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte $ff
.if FAMISTUDIO_EXP_VRC6
.byte FAMISTUDIO_VRC6_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_VRC6_CH1_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_VRC6_CH2_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_VRC7
.byte FAMISTUDIO_VRC7_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_VRC7_CH1_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_VRC7_CH2_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_VRC7_CH3_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_VRC7_CH4_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_VRC7_CH5_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_FDS
.byte FAMISTUDIO_FDS_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_MMC5
.byte FAMISTUDIO_MMC5_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_MMC5_CH1_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_N163
.byte FAMISTUDIO_N163_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_N163_CH1_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_N163_CH2_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_N163_CH3_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_N163_CH4_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_N163_CH5_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_N163_CH6_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_N163_CH7_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_EXP_S5B
.byte FAMISTUDIO_S5B_CH0_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_S5B_CH1_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.byte FAMISTUDIO_S5B_CH2_ENVS+FAMISTUDIO_ENV_VOLUME_OFF
.endif
.if FAMISTUDIO_USE_ARPEGGIO
; For a given channel, returns the index of the arpeggio envelope.
famistudio_channel_to_arpeggio_env:
.byte FAMISTUDIO_CH0_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_CH1_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_CH2_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_CH3_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte $ff
.if FAMISTUDIO_EXP_VRC6
.byte FAMISTUDIO_VRC6_CH0_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_VRC6_CH1_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_VRC6_CH2_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.endif
.if FAMISTUDIO_EXP_VRC7
.byte FAMISTUDIO_VRC7_CH0_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_VRC7_CH1_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_VRC7_CH2_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_VRC7_CH3_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_VRC7_CH4_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_VRC7_CH5_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.endif
.if FAMISTUDIO_EXP_FDS
.byte FAMISTUDIO_FDS_CH0_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.endif
.if FAMISTUDIO_EXP_MMC5
.byte FAMISTUDIO_MMC5_CH0_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_MMC5_CH1_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.endif
.if FAMISTUDIO_EXP_N163
.byte FAMISTUDIO_N163_CH0_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_N163_CH1_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_N163_CH2_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_N163_CH3_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_N163_CH4_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_N163_CH5_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_N163_CH6_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_N163_CH7_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.endif
.if FAMISTUDIO_EXP_S5B
.byte FAMISTUDIO_S5B_CH0_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_S5B_CH1_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.byte FAMISTUDIO_S5B_CH2_ENVS+FAMISTUDIO_ENV_NOTE_OFF
.endif
.endif
.if FAMISTUDIO_USE_SLIDE_NOTES
famistudio_channel_to_slide:
; This table will only be defined if we use noise slides, otherwise identical to "famistudio_channel_to_pitch_env".
.if FAMISTUDIO_USE_NOISE_SLIDE_NOTES
.byte $00
.byte $01
.byte $02
.byte FAMISTUDIO_NOISE_SLIDE_INDEX ; Keep the noise slide at the end so the pitch envelopes/slides are in sync.
.byte $ff ; no slide for DPCM
.if FAMISTUDIO_EXP_VRC6
.byte FAMISTUDIO_VRC6_CH0_PITCH_ENV_IDX
.byte FAMISTUDIO_VRC6_CH1_PITCH_ENV_IDX
.byte FAMISTUDIO_VRC6_CH2_PITCH_ENV_IDX
.endif
.if FAMISTUDIO_EXP_VRC7
.byte FAMISTUDIO_VRC7_CH0_PITCH_ENV_IDX
.byte FAMISTUDIO_VRC7_CH1_PITCH_ENV_IDX
.byte FAMISTUDIO_VRC7_CH2_PITCH_ENV_IDX
.byte FAMISTUDIO_VRC7_CH3_PITCH_ENV_IDX
.byte FAMISTUDIO_VRC7_CH4_PITCH_ENV_IDX
.byte FAMISTUDIO_VRC7_CH5_PITCH_ENV_IDX
.endif
.if FAMISTUDIO_EXP_FDS
.byte FAMISTUDIO_FDS_CH0_PITCH_ENV_IDX
.endif
.if FAMISTUDIO_EXP_MMC5
.byte FAMISTUDIO_MMC5_CH0_PITCH_ENV_IDX
.byte FAMISTUDIO_MMC5_CH1_PITCH_ENV_IDX
.endif
.if FAMISTUDIO_EXP_N163
.byte FAMISTUDIO_N163_CH0_PITCH_ENV_IDX
.byte FAMISTUDIO_N163_CH1_PITCH_ENV_IDX
.byte FAMISTUDIO_N163_CH2_PITCH_ENV_IDX
.byte FAMISTUDIO_N163_CH3_PITCH_ENV_IDX
.byte FAMISTUDIO_N163_CH4_PITCH_ENV_IDX
.byte FAMISTUDIO_N163_CH5_PITCH_ENV_IDX
.byte FAMISTUDIO_N163_CH6_PITCH_ENV_IDX
.byte FAMISTUDIO_N163_CH7_PITCH_ENV_IDX
.endif
.if FAMISTUDIO_EXP_S5B
.byte FAMISTUDIO_S5B_CH0_PITCH_ENV_IDX
.byte FAMISTUDIO_S5B_CH1_PITCH_ENV_IDX
.byte FAMISTUDIO_S5B_CH2_PITCH_ENV_IDX
.endif
.endif
.endif
; For a given channel, returns the index of the pitch envelope.
famistudio_channel_to_pitch_env:
.byte $00
.byte $01
.byte $02
.byte $ff ; no pitch envelopes for noise
.byte $ff ; no pitch envelopes slide for DPCM
.if FAMISTUDIO_EXP_VRC6
.byte FAMISTUDIO_VRC6_CH0_PITCH_ENV_IDX
.byte FAMISTUDIO_VRC6_CH1_PITCH_ENV_IDX
.byte FAMISTUDIO_VRC6_CH2_PITCH_ENV_IDX
.endif
.if FAMISTUDIO_EXP_VRC7
.byte FAMISTUDIO_VRC7_CH0_PITCH_ENV_IDX
.byte FAMISTUDIO_VRC7_CH1_PITCH_ENV_IDX
.byte FAMISTUDIO_VRC7_CH2_PITCH_ENV_IDX
.byte FAMISTUDIO_VRC7_CH3_PITCH_ENV_IDX
.byte FAMISTUDIO_VRC7_CH4_PITCH_ENV_IDX
.byte FAMISTUDIO_VRC7_CH5_PITCH_ENV_IDX
.endif
.if FAMISTUDIO_EXP_FDS
.byte FAMISTUDIO_FDS_CH0_PITCH_ENV_IDX
.endif
.if FAMISTUDIO_EXP_MMC5
.byte FAMISTUDIO_MMC5_CH0_PITCH_ENV_IDX
.byte FAMISTUDIO_MMC5_CH1_PITCH_ENV_IDX
.endif
.if FAMISTUDIO_EXP_N163
.byte FAMISTUDIO_N163_CH0_PITCH_ENV_IDX
.byte FAMISTUDIO_N163_CH1_PITCH_ENV_IDX
.byte FAMISTUDIO_N163_CH2_PITCH_ENV_IDX
.byte FAMISTUDIO_N163_CH3_PITCH_ENV_IDX
.byte FAMISTUDIO_N163_CH4_PITCH_ENV_IDX
.byte FAMISTUDIO_N163_CH5_PITCH_ENV_IDX
.byte FAMISTUDIO_N163_CH6_PITCH_ENV_IDX
.byte FAMISTUDIO_N163_CH7_PITCH_ENV_IDX
.endif
.if FAMISTUDIO_EXP_S5B
.byte FAMISTUDIO_S5B_CH0_PITCH_ENV_IDX
.byte FAMISTUDIO_S5B_CH1_PITCH_ENV_IDX
.byte FAMISTUDIO_S5B_CH2_PITCH_ENV_IDX
.endif
.if FAMISTUDIO_USE_DUTYCYCLE_EFFECT
; For a given channel, returns the index of the duty cycle in the "famistudio_duty_cycle" array.
famistudio_channel_to_dutycycle:
.byte $00
.byte $01
.byte $ff
.byte $02
.byte $ff
.if FAMISTUDIO_EXP_VRC6
.byte FAMISTUDIO_VRC6_CH0_DUTY_IDX
.byte FAMISTUDIO_VRC6_CH1_DUTY_IDX
.byte FAMISTUDIO_VRC6_CH2_DUTY_IDX
.endif
.if FAMISTUDIO_EXP_MMC5
.byte FAMISTUDIO_MMC5_CH0_DUTY_IDX
.byte FAMISTUDIO_MMC5_CH1_DUTY_IDX
.endif
; For a given channel, returns the index of the duty cycle envelope.
famistudio_channel_to_duty_env:
.byte FAMISTUDIO_CH0_ENVS+FAMISTUDIO_ENV_DUTY_OFF
.byte FAMISTUDIO_CH1_ENVS+FAMISTUDIO_ENV_DUTY_OFF
.byte $ff
.byte FAMISTUDIO_CH3_ENVS+FAMISTUDIO_ENV_DUTY_OFF
.byte $ff
.if FAMISTUDIO_EXP_VRC6
.byte FAMISTUDIO_VRC6_CH0_ENVS+FAMISTUDIO_ENV_DUTY_OFF
.byte FAMISTUDIO_VRC6_CH1_ENVS+FAMISTUDIO_ENV_DUTY_OFF
.byte FAMISTUDIO_VRC6_CH2_ENVS+FAMISTUDIO_ENV_DUTY_OFF
.endif
.if FAMISTUDIO_EXP_MMC5
.byte FAMISTUDIO_MMC5_CH0_ENVS+FAMISTUDIO_ENV_DUTY_OFF
.byte FAMISTUDIO_MMC5_CH1_ENVS+FAMISTUDIO_ENV_DUTY_OFF
.endif
.endif
; Duty lookup table.
famistudio_duty_lookup:
.byte $30
.byte $70
.byte $b0
.byte $f0
.if FAMISTUDIO_EXP_VRC6
; Duty lookup table for VRC6.
famistudio_vrc6_duty_lookup:
.byte $00
.byte $10
.byte $20
.byte $30
.byte $40
.byte $50
.byte $60
.byte $70
.endif
.if !FAMISTUDIO_USE_FAMITRACKER_TEMPO
famistudio_tempo_frame_lookup:
.byte $01, $02 ; NTSC -> NTSC, NTSC -> PAL
.byte $00, $01 ; PAL -> NTSC, PAL -> PAL
.endif
.if FAMISTUDIO_CFG_SMOOTH_VIBRATO
; lookup table for the 2 registers we need to set for smooth vibrato.
; Index 0 decrement the hi-period, index 2 increments. Index 1 is unused.
famistudio_smooth_vibrato_period_lo_lookup:
.byte $00, $00, $ff
famistudio_smooth_vibrato_sweep_lookup:
.byte $8f, $00, $87
.endif
.if FAMISTUDIO_USE_VOLUME_TRACK
; Precomputed volume multiplication table (rounded but never to zero unless one of the value is zero).
; Load the 2 volumes in the lo/hi nibble and fetch.
famistudio_volume_table:
.byte $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00
.byte $00, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01
.byte $00, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $01, $02, $02, $02, $02
.byte $00, $01, $01, $01, $01, $01, $01, $01, $02, $02, $02, $02, $02, $03, $03, $03
.byte $00, $01, $01, $01, $01, $01, $02, $02, $02, $02, $03, $03, $03, $03, $04, $04
.byte $00, $01, $01, $01, $01, $02, $02, $02, $03, $03, $03, $04, $04, $04, $05, $05
.byte $00, $01, $01, $01, $02, $02, $02, $03, $03, $04, $04, $04, $05, $05, $06, $06
.byte $00, $01, $01, $01, $02, $02, $03, $03, $04, $04, $05, $05, $06, $06, $07, $07
.byte $00, $01, $01, $02, $02, $03, $03, $04, $04, $05, $05, $06, $06, $07, $07, $08
.byte $00, $01, $01, $02, $02, $03, $04, $04, $05, $05, $06, $07, $07, $08, $08, $09
.byte $00, $01, $01, $02, $03, $03, $04, $05, $05, $06, $07, $07, $08, $09, $09, $0a
.byte $00, $01, $01, $02, $03, $04, $04, $05, $06, $07, $07, $08, $09, $0a, $0a, $0b
.byte $00, $01, $02, $02, $03, $04, $05, $06, $06, $07, $08, $09, $0a, $0a, $0b, $0c
.byte $00, $01, $02, $03, $03, $04, $05, $06, $07, $08, $09, $0a, $0a, $0b, $0c, $0d
.byte $00, $01, $02, $03, $04, $05, $06, $07, $07, $08, $09, $0a, $0b, $0c, $0d, $0e
.byte $00, $01, $02, $03, $04, $05, $06, $07, $08, $09, $0a, $0b, $0c, $0d, $0e, $0f
.endif
| 31.74343 | 196 | 0.655532 | [
"MIT"
] | BleuBleu/FamiStudio | SoundEngine/famistudio_asm6.asm | 158,241 | Assembly |
SECTION code_env
PUBLIC __env_value_sm
EXTERN asm_isspace
__env_value_sm:
; state machine for locating end of value portion of "name = value" pairs
;
; enter : a = current char
; bc = file position
; ix, hl reserved
;
; exit : a = current char
; bc = file position
; ix = next state
; hl = position following last non-whitespace char
;
; success if end of value determined
;
; hl = position following last char in value
; carry reset
;
; continue if end of value not determined
;
; carry set
;
; uses : f, hl, ix
enter_state_0:
ld l,c
ld h,b
ld ix,state_0
state_0:
; end of line indicates last of value string
cp '\n'
ret z
or a
ret z
call asm_isspace
ccf
ret c ; if whitespace
ld l,c
ld h,b
inc hl ; record one past position of non-whitespace char
scf
ret
| 17.25 | 80 | 0.531401 | [
"BSD-2-Clause"
] | ByteProject/Puddle-BuildTools | FictionTools/z88dk/libsrc/_DEVELOPMENT/env/esxdos/z80/__env_value_sm.asm | 1,035 | Assembly |
using System.Reflection;
using System.Runtime.CompilerServices;
using Android.App;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle ("CardViewSample")]
[assembly: AssemblyDescription ("")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("")]
[assembly: AssemblyProduct ("")]
[assembly: AssemblyCopyright ("johnpilczak")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion ("1.0.0")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]
| 35.103448 | 81 | 0.74165 | [
"MIT"
] | CNinnovation/XamarinAug2017 | Lollipop/CardViewSample/CardViewSample/Properties/AssemblyInfo.cs | 1,020 | C# |
//------------------------------------------------------------------------------
// <copyright file="IDataGridEditingService.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
namespace System.Windows.Forms {
using System.Diagnostics;
using System;
/// <include file='doc\IDataGridEditingService.uex' path='docs/doc[@for="IDataGridEditingService"]/*' />
/// <internalonly/>
/// <devdoc>
/// <para>The DataGrid exposes hooks to request editing commands
/// via this interface.</para>
/// </devdoc>
public interface IDataGridEditingService {
/// <include file='doc\IDataGridEditingService.uex' path='docs/doc[@for="IDataGridEditingService.BeginEdit"]/*' />
bool BeginEdit(DataGridColumnStyle gridColumn, int rowNumber);
/// <include file='doc\IDataGridEditingService.uex' path='docs/doc[@for="IDataGridEditingService.EndEdit"]/*' />
bool EndEdit(DataGridColumnStyle gridColumn, int rowNumber, bool shouldAbort);
}
}
| 45.888889 | 123 | 0.541566 | [
"Unlicense"
] | bestbat/Windows-Server | com/netfx/src/framework/winforms/managed/system/winforms/idatagrideditingservice.cs | 1,239 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
namespace kx.Test.Connection
{
[TestFixture]
public class ConnectionSerialisationTests
{
private readonly int _testVersionNumber = 3;
[Test]
public void ConnectionSerialiseThrowsIfInputIsNull()
{
using (var connection = new c(_testVersionNumber))
{
Assert.Throws<ArgumentNullException>(() => connection.Serialize(1, null));
}
}
[Test]
public void ConnectionSerialiseThrowsKExceptionWithInnerExceptionIfSerialisationThrowsException()
{
using (var connection = new c(_testVersionNumber))
{
c.Dict dataRow = new c.Dict(
new[]
{
"sym"
},
new object[]
{
new object[] { null },
});
c.Flip f = new c.Flip(dataRow);
var exception = Assert.Throws<KException>(() => connection.Serialize(1, f));
Assert.NotNull(exception.InnerException);
}
}
[Test]
public void ConnectionSerialiseThrowsIfGuidSerialisationIsNotSupported()
{
using (var connection = new c(2))
{
Assert.Throws<KException>(() => connection.Serialize(1, Guid.NewGuid()));
}
}
[Test]
public void ConnectionSerialiseThrowsIfDateTimeSerialisationIsNotSupported()
{
using (var connection = new c(0))
{
Assert.Throws<KException>(() => connection.Serialize(1, new DateTime(2020, 11, 11, 0, 0, 0, DateTimeKind.Utc)));
}
}
[Test]
public void ConnectionSerialiseThrowsIfTimeSpanSerialisationIsNotSupported()
{
using (var connection = new c(0))
{
Assert.Throws<KException>(() => connection.Serialize(1, new TimeSpan(470000)));
}
}
[Test]
public void ConnectionDeserialiseThrowsIfBufferIsNull()
{
using (var connection = new c(_testVersionNumber))
{
Assert.Throws<ArgumentNullException>(() => connection.Deserialize(null));
}
}
[Test]
public void ConnectionDeserialiseThrowsIfBufferIsException()
{
List<byte> buffer = new List<byte>();
//message length etc
buffer.AddRange(new byte[] { 1, 1, 0, 0, 20, 0, 0, 0 });
//128 to indicate error
buffer.Add(128);
//error message
buffer.AddRange(Encoding.ASCII.GetBytes("KDB+_Error"));
//end of the error message
buffer.Add(0);
using (var connection = new c(_testVersionNumber))
{
Assert.Throws<KException>(() => connection.Deserialize(buffer.ToArray()));
}
}
[Test]
public void ConnectionDeserialiseThrowsExceptionWithExpectedMessage()
{
const string expected = "KDB+_Error";
string errorMessage = null;
List<byte> buffer = new List<byte>();
//message length etc
buffer.AddRange(new byte[] { 1, 1, 0, 0, 20, 0, 0, 0 });
//128 to indicate error
buffer.Add(128);
//error message
buffer.AddRange(Encoding.ASCII.GetBytes(expected));
//end of the error message
buffer.Add(0);
using (var connection = new c(_testVersionNumber))
{
try
{
connection.Deserialize(buffer.ToArray());
}
catch (KException kEx)
{
errorMessage = kEx.Message;
}
Assert.AreEqual(expected, errorMessage);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesBooleanTrueInput()
{
const bool expected = true;
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesBooleanFalseInput()
{
const bool expected = false;
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesGuidInput()
{
Guid expected = Guid.NewGuid();
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesByteInput()
{
const byte expected = 47;
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesShortInput()
{
const short expected = 47;
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesIntInput()
{
const int expected = 47;
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesLongInput()
{
const long expected = 47L;
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesFloatInput()
{
const float expected = 47.14F;
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesDoubleInput()
{
const double expected = 47.14;
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesCharInput()
{
const char expected = 'k';
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesStringInput()
{
const string expected = "Test_Input";
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesDateTimeInput()
{
DateTime expected = new DateTime(2020, 11, 04, 0, 0, 0, DateTimeKind.Utc);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesMonthInput()
{
c.Month expected = new c.Month(47);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesDateInput()
{
c.Date expected = new c.Date(47);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesKTimespanInput()
{
c.KTimespan expected = new c.KTimespan(4700);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesMinuteInput()
{
c.Minute expected = new c.Minute(47);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesSecondInput()
{
c.Second expected = new c.Second(47);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesTimeSpanInput()
{
TimeSpan expected = new TimeSpan(470000);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object result = connection.Deserialize(serialisedData);
Assert.AreEqual(expected, result);
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesDictInput()
{
c.Dict expected = new c.Dict(new string[] { "Key_1" }, new object[] { "Value_1" });
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
c.Dict result = connection.Deserialize(serialisedData) as c.Dict;
Assert.IsNotNull(result);
Assert.IsTrue(Enumerable.SequenceEqual(expected.x as string[], result.x as string[]));
Assert.IsTrue(Enumerable.SequenceEqual(expected.y as object[], result.y as object[]));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesFlipInput()
{
c.Flip expected = new c.Flip(new c.Dict(new string[] { "Key_1" }, new object[] { "Value_1" }));
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
c.Flip result = connection.Deserialize(serialisedData) as c.Flip;
Assert.IsNotNull(result);
Assert.IsTrue(Enumerable.SequenceEqual(expected.x, result.x));
Assert.IsTrue(Enumerable.SequenceEqual(expected.y, result.y));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesObjectArrayInput()
{
object[] expected = CreateTestArray(i => string.Format("Hello_{0}", i), 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
object[] result = connection.Deserialize(serialisedData) as object[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesBooleanArrayInput()
{
bool[] expected = CreateTestArray(i => i % 2 == 0, 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
bool[] result = connection.Deserialize(serialisedData) as bool[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesGuidArrayInput()
{
Guid[] expected = CreateTestArray(i => Guid.NewGuid(), 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
Guid[] result = connection.Deserialize(serialisedData) as Guid[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesByteArrayInput()
{
byte[] expected = CreateTestArray(i => (byte)i, 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
byte[] result = connection.Deserialize(serialisedData) as byte[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesShortArrayInput()
{
short[] expected = CreateTestArray(i => (short)i, 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
short[] result = connection.Deserialize(serialisedData) as short[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesIntArrayInput()
{
int[] expected = CreateTestArray(i => i, 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
int[] result = connection.Deserialize(serialisedData) as int[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesLongArrayInput()
{
long[] expected = CreateTestArray(i => (long)i, 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
long[] result = connection.Deserialize(serialisedData) as long[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesFloatArrayInput()
{
float[] expected = CreateTestArray(i => (float)i / 2, 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
float[] result = connection.Deserialize(serialisedData) as float[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesDoubleArrayInput()
{
double[] expected = CreateTestArray(i => (double)i / 2, 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
double[] result = connection.Deserialize(serialisedData) as double[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesCharArrayInput()
{
char[] expected = CreateTestArray(i => (char)i, 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
char[] result = connection.Deserialize(serialisedData) as char[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesStringArrayInput()
{
string[] expected = CreateTestArray(i => string.Format("Hello_{0}", i), 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
string[] result = connection.Deserialize(serialisedData) as string[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesDateTimeArrayInput()
{
DateTime[] expected = CreateTestArray(i => new DateTime(2020, 11, 11, 0, 0, i, DateTimeKind.Utc), 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
DateTime[] result = connection.Deserialize(serialisedData) as DateTime[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesMonthArrayInput()
{
c.Month[] expected = CreateTestArray(i => new c.Month(i), 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
c.Month[] result = connection.Deserialize(serialisedData) as c.Month[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesDateArrayInput()
{
c.Date[] expected = CreateTestArray(i => new c.Date(new DateTime(2020, 11, 11, 0, 0, i, DateTimeKind.Utc)), 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
c.Date[] result = connection.Deserialize(serialisedData) as c.Date[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesKTimeSpanArrayInput()
{
c.KTimespan[] expected = CreateTestArray(i => new c.KTimespan(i * 100), 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
c.KTimespan[] result = connection.Deserialize(serialisedData) as c.KTimespan[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesMinuteArrayInput()
{
c.Minute[] expected = CreateTestArray(i => new c.Minute(i), 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
c.Minute[] result = connection.Deserialize(serialisedData) as c.Minute[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesSecondArrayInput()
{
c.Second[] expected = CreateTestArray(i => new c.Second(i), 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
c.Second[] result = connection.Deserialize(serialisedData) as c.Second[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesTimeSpanArrayInput()
{
TimeSpan[] expected = CreateTestArray(i => new TimeSpan(i * 10000), 50);
using (var connection = new c(_testVersionNumber))
{
byte[] serialisedData = connection.Serialize(1, expected);
TimeSpan[] result = connection.Deserialize(serialisedData) as TimeSpan[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesObjectArrayInputWithZipEnabled()
{
object[] expected = CreateTestArray(i => string.Format("Hello_{0}", i), 2000);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(1, expected);
object[] result = connection.Deserialize(serialisedData) as object[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesBooleanArrayInputWithZipEnabled()
{
bool[] expected = CreateTestArray(i => i % 2 == 0, 2000);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(0, expected);
bool[] result = connection.Deserialize(serialisedData) as bool[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesGuidArrayInputWithZipEnabled()
{
Guid[] expected = CreateTestArray(i => Guid.NewGuid(), 2000);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(0, expected);
Guid[] result = connection.Deserialize(serialisedData) as Guid[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesByteArrayInputWithZipEnabled()
{
byte[] expected = CreateTestArray(i => (byte)i, 2000);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(0, expected);
byte[] result = connection.Deserialize(serialisedData) as byte[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesShortArrayInputWithZipEnabled()
{
short[] expected = CreateTestArray(i => (short)i, 2000);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(0, expected);
short[] result = connection.Deserialize(serialisedData) as short[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesIntArrayInputWithZipEnabled()
{
int[] expected = CreateTestArray(i => i, 2000);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(0, expected);
int[] result = connection.Deserialize(serialisedData) as int[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesLongArrayInputWithZipEnabled()
{
long[] expected = CreateTestArray(i => (long)i, 2000);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(0, expected);
long[] result = connection.Deserialize(serialisedData) as long[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesFloatArrayInputWithZipEnabled()
{
float[] expected = CreateTestArray(i => (float)i / 2, 50);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(0, expected);
float[] result = connection.Deserialize(serialisedData) as float[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesDoubleArrayInputWithZipEnabled()
{
double[] expected = CreateTestArray(i => (double)i / 2, 2000);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(0, expected);
double[] result = connection.Deserialize(serialisedData) as double[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesCharArrayInputWithZipEnabled()
{
// char serialisation only supports up to 128
char[] expected = CreateTestArray(i =>
{
return (char)Math.Abs(new Random(i).Next(0, 127));
}, 2000);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(0, expected);
char[] result = connection.Deserialize(serialisedData) as char[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesStringArrayInputWithZipEnabled()
{
string[] expected = CreateTestArray(i => string.Format("Hello_{0}", i), 2000);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(0, expected);
string[] result = connection.Deserialize(serialisedData) as string[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesDateTimeArrayInputWithZipEnabled()
{
DateTime[] expected = CreateTestArray(i => new DateTime(2020, 11, 11, 0, 0, i % 60, DateTimeKind.Utc), 2000);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(0, expected);
DateTime[] result = connection.Deserialize(serialisedData) as DateTime[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesMonthArrayInputWithZipEnabled()
{
c.Month[] expected = CreateTestArray(i => new c.Month(i), 2000);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(0, expected);
c.Month[] result = connection.Deserialize(serialisedData) as c.Month[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesDateArrayInputWithZipEnabled()
{
c.Date[] expected = CreateTestArray(i => new c.Date(new DateTime(2020, 11, 11, 0, 0, i % 60, DateTimeKind.Utc)), 2000);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(0, expected);
c.Date[] result = connection.Deserialize(serialisedData) as c.Date[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesKTimeSpanArrayInputWithZipEnabled()
{
c.KTimespan[] expected = CreateTestArray(i => new c.KTimespan(i * 100), 2000);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(0, expected);
c.KTimespan[] result = connection.Deserialize(serialisedData) as c.KTimespan[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesMinuteArrayInputWithZipEnabled()
{
c.Minute[] expected = CreateTestArray(i => new c.Minute(i), 2000);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(0, expected);
c.Minute[] result = connection.Deserialize(serialisedData) as c.Minute[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesSecondArrayInputWithZipEnabled()
{
c.Second[] expected = CreateTestArray(i => new c.Second(i), 2000);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(0, expected);
c.Second[] result = connection.Deserialize(serialisedData) as c.Second[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
[Test]
public void ConnectionSerialisesAndDeserialisesTimeSpanArrayInputWithZipEnabled()
{
TimeSpan[] expected = CreateTestArray(i => new TimeSpan(i * 10000), 2000);
using (var connection = new c(_testVersionNumber))
{
connection.IsZipEnabled = true;
byte[] serialisedData = connection.Serialize(0, expected);
TimeSpan[] result = connection.Deserialize(serialisedData) as TimeSpan[];
Assert.IsTrue(Enumerable.SequenceEqual(expected, result));
}
}
private T[] CreateTestArray<T>(Func<int, T> elementBuilder, int arraySize)
{
T[] array = new T[arraySize];
for (int i = 0; i < arraySize; i++)
{
array[i] = elementBuilder(i);
}
return array;
}
}
}
| 32.758755 | 131 | 0.564616 | [
"Apache-2.0"
] | KxSystems/csharpkdb | kx.Test/Connection/ConnectionSerialisationTests.cs | 33,678 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace NetCore.Models
{
public class Abone
{
public int Id { get; set; }
public string email { get; set; }
}
}
| 17.214286 | 41 | 0.655602 | [
"MIT"
] | salihselimsekerci/E-CommerceNetCoreMVC | Models/Abone.cs | 243 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
namespace Azure.ResourceManager.Management.Models
{
/// <summary> (Optional) The ID of the parent management group used during creation. </summary>
public partial class CreateParentGroupInfo
{
/// <summary> Initializes a new instance of CreateParentGroupInfo. </summary>
public CreateParentGroupInfo()
{
}
/// <summary> The fully qualified ID for the parent management group. For example, /providers/Microsoft.Management/managementGroups/0000000-0000-0000-0000-000000000000. </summary>
public string Id { get; set; }
/// <summary> The name of the parent management group. </summary>
public string Name { get; }
/// <summary> The friendly name of the parent management group. </summary>
public string DisplayName { get; }
}
}
| 36.961538 | 188 | 0.681582 | [
"MIT"
] | OlhaTkachenko/azure-sdk-for-net | sdk/resourcemanager/Azure.ResourceManager/src/Generated/ManagementGroup/Models/CreateParentGroupInfo.cs | 961 | C# |
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace OpenNETCF.Collections.Specialized
{
public class CaseInsensitiveDictionary<T> : IDictionary<string, T>,
ICollection<KeyValuePair<string, T>>,
IEnumerable<KeyValuePair<string, T>>,
IEnumerable
{
internal class CaselessStringComparer : IEqualityComparer<string>
{
public bool Equals(string x, string y)
{
return (string.Compare(x, y, true) == 0);
}
public int GetHashCode(string obj)
{
return obj.GetHashCode();
}
}
private Dictionary<string, T> m_items = new Dictionary<string, T>(new CaselessStringComparer());
public void Add(string key, T value)
{
m_items.Add(key, value);
}
public bool ContainsKey(string key)
{
return m_items.ContainsKey(key);
}
public ICollection<string> Keys
{
get { return m_items.Keys; }
}
public bool Remove(string key)
{
return m_items.Remove(key);
}
public bool TryGetValue(string key, out T value)
{
return m_items.TryGetValue(key, out value);
}
public ICollection<T> Values
{
get { return m_items.Values; }
}
public T this[string key]
{
get { return m_items[key]; }
set { m_items[key] = value; }
}
public void Add(KeyValuePair<string, T> item)
{
m_items.Add(item.Key, item.Value);
}
public void Clear()
{
m_items.Clear();
}
public bool Contains(KeyValuePair<string, T> item)
{
if (!ContainsKey(item.Key)) return false;
foreach (var i in m_items.Values)
{
if (i.Equals(item)) return true;
}
return false;
}
public void CopyTo(KeyValuePair<string, T>[] array, int arrayIndex)
{
int count = array.Length - arrayIndex;
if (count > m_items.Count) count = m_items.Count;
using (var e = m_items.GetEnumerator())
{
for (int i = 0; i < count; i++)
{
array[i] = new KeyValuePair<string, T>(e.Current.Key, e.Current.Value);
e.MoveNext();
}
}
}
public int Count
{
get { return m_items.Count; }
}
public bool IsReadOnly
{
get { return false; }
}
public bool Remove(KeyValuePair<string, T> item)
{
if (!ContainsKey(item.Key)) return false;
return m_items.Remove(item.Key);
}
public IEnumerator<KeyValuePair<string, T>> GetEnumerator()
{
return m_items.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return m_items.GetEnumerator();
}
}
}
| 25.123077 | 104 | 0.490202 | [
"MIT"
] | ctacke/padarn | OpenNETCF.Web/OpenNETCF.Web/Helpers/CaseInsensitiveDictionary.cs | 3,268 | C# |
using Newtonsoft.Json;
using System.IO;
namespace MultiDeviceKeybinds
{
enum InputInterceptionMode
{
Hook = 0,
Interception = 1,
}
class Settings
{
public bool ShowConsole { get; set; } = false;
public InputInterceptionMode InputInterceptionMode { get; set; } = InputInterceptionMode.Hook;
public static Settings Load()
{
string file = Path.Combine(Program.Location, "settings.json");
Settings settings = File.Exists(file) ? JsonConvert.DeserializeObject<Settings>(File.ReadAllText(file)) : new Settings();
return settings;
}
public void Save()
{
string file = Path.Combine(Program.Location, "settings.json");
File.WriteAllText(Path.Combine(Program.Location, "settings.json"), JsonConvert.SerializeObject(this, Formatting.Indented));
}
}
}
| 26.823529 | 135 | 0.628289 | [
"MIT"
] | DorCoMaNdO/MultiDeviceKeybinds | MultiDeviceKeybinds/Settings.cs | 914 | C# |
using UnityEngine;
using RPG.Attributes;
namespace RPG.Combat
{
public class Projectile : MonoBehaviour
{
Health target;
[SerializeField] float speed = 5f;
[SerializeField] bool isHoming = true;
[SerializeField] GameObject hitEffect;
[SerializeField] int maxLifetime;
[SerializeField] GameObject[] destroyOnHit;
[SerializeField] int lifeAfterImpact = 2;
float damage = 0;
GameObject instigator;
private void Start()
{
transform.LookAt(target.GetComponent<CapsuleCollider>().bounds.center, transform.up);
}
private void Update()
{
if (isHoming && !target.isDead())
transform.LookAt(target.GetComponent<CapsuleCollider>().bounds.center, transform.up);
transform.Translate(Vector3.forward * speed * Time.deltaTime);
}
public void SetTarget(Health target, GameObject instigator, float damage)
{
this.target = target;
this.damage = damage;
this.instigator = instigator;
Destroy(gameObject, maxLifetime);
}
private void OnTriggerEnter(Collider other)
{
if (other.GetComponent<Health>() != target) return;
if (target.isDead()) return;
target.TakeDamage(instigator, damage);
if (hitEffect)
{
GameObject hit = Instantiate(hitEffect, transform.position, transform.rotation);
//Destroy(hit);
}
//foreach(GameObject obj in destroyOnHit)
//{
// Destroy(obj);
//}
Destroy(gameObject);
}
}
} | 30.614035 | 97 | 0.56447 | [
"MIT"
] | SabhariShrinivas/Medival-Knight | Assets/Scripts/Combat/Projectile.cs | 1,745 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GIDX.SDK.Models.DocumentLibrary
{
public class Document
{
public string DocumentID { get; set; }
public CategoryType CategoryType { get; set; }
public DocumentStatus DocumentStatus { get; set; }
public string FileName { get; set; }
public int FileSize { get; set; }
public DateTime DateTime { get; set; }
public List<DocumentNote> DocumentNotes { get; set; }
}
}
| 27.95 | 61 | 0.667263 | [
"MIT"
] | TSEVOLLC/GIDX.SDK-csharp | src/GIDX.SDK/Models/DocumentLibrary/Document.cs | 561 | C# |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System;
using System.Collections.Generic;
using System.Management.Automation.Language;
using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic;
#if !CORECLR
using System.ComponentModel.Composition;
#endif
using System.Globalization;
namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules
{
/// <summary>
/// UseCorrectCasing: Check if cmdlet is cased correctly.
/// </summary>
#if !CORECLR
[Export(typeof(IScriptRule))]
#endif
public class UseCorrectCasing : ConfigurableRule
{
/// <summary>
/// AnalyzeScript: Analyze the script to check if cmdlet alias is used.
/// </summary>
public override IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
{
if (ast == null) throw new ArgumentNullException(Strings.NullAstErrorMessage);
IEnumerable<Ast> commandAsts = ast.FindAll(testAst => testAst is CommandAst, true);
// Iterates all CommandAsts and check the command name.
foreach (CommandAst commandAst in commandAsts)
{
string commandName = commandAst.GetCommandName();
// Handles the exception caused by commands like, {& $PLINK $args 2> $TempErrorFile}.
// You can also review the remark section in following document,
// MSDN: CommandAst.GetCommandName Method
if (commandName == null)
{
continue;
}
var commandInfo = Helper.Instance.GetCommandInfo(commandName);
if (commandInfo == null)
{
continue;
}
var shortName = commandInfo.Name;
var fullyqualifiedName = $"{commandInfo.ModuleName}\\{shortName}";
var isFullyQualified = commandName.Equals(fullyqualifiedName, StringComparison.OrdinalIgnoreCase);
var correctlyCasedCommandName = isFullyQualified ? fullyqualifiedName : shortName;
if (!commandName.Equals(correctlyCasedCommandName, StringComparison.Ordinal))
{
yield return new DiagnosticRecord(
string.Format(CultureInfo.CurrentCulture, Strings.UseCorrectCasingError, commandName, shortName),
GetCommandExtent(commandAst),
GetName(),
DiagnosticSeverity.Warning,
fileName,
commandName,
suggestedCorrections: GetCorrectionExtent(commandAst, correctlyCasedCommandName));
}
}
}
/// <summary>
/// For a command like "gci -path c:", returns the extent of "gci" in the command
/// </summary>
private IScriptExtent GetCommandExtent(CommandAst commandAst)
{
var cmdName = commandAst.GetCommandName();
foreach (var cmdElement in commandAst.CommandElements)
{
var stringConstExpressinAst = cmdElement as StringConstantExpressionAst;
if (stringConstExpressinAst != null)
{
if (stringConstExpressinAst.Value.Equals(cmdName))
{
return stringConstExpressinAst.Extent;
}
}
}
return commandAst.Extent;
}
private IEnumerable<CorrectionExtent> GetCorrectionExtent(CommandAst commandAst, string correctlyCaseName)
{
var description = string.Format(
CultureInfo.CurrentCulture,
Strings.UseCorrectCasingDescription,
correctlyCaseName,
correctlyCaseName);
var cmdExtent = GetCommandExtent(commandAst);
var correction = new CorrectionExtent(
cmdExtent.StartLineNumber,
cmdExtent.EndLineNumber,
cmdExtent.StartColumnNumber,
cmdExtent.EndColumnNumber,
correctlyCaseName,
commandAst.Extent.File,
description);
yield return correction;
}
/// <summary>
/// GetName: Retrieves the name of this rule.
/// </summary>
/// <returns>The name of this rule</returns>
public override string GetName()
{
return string.Format(CultureInfo.CurrentCulture, Strings.NameSpaceFormat, GetSourceName(), Strings.UseCorrectCasingName);
}
/// <summary>
/// GetCommonName: Retrieves the common name of this rule.
/// </summary>
/// <returns>The common name of this rule</returns>
public override string GetCommonName()
{
return string.Format(CultureInfo.CurrentCulture, Strings.UseCorrectCasingCommonName);
}
/// <summary>
/// GetDescription: Retrieves the description of this rule.
/// </summary>
/// <returns>The description of this rule</returns>
public override string GetDescription()
{
return string.Format(CultureInfo.CurrentCulture, Strings.UseCorrectCasingDescription);
}
/// <summary>
/// GetSourceType: Retrieves the type of the rule, Builtin, Managed or Module.
/// </summary>
public override SourceType GetSourceType()
{
return SourceType.Builtin;
}
/// <summary>
/// GetSeverity: Retrieves the severity of the rule: error, warning of information.
/// </summary>
/// <returns></returns>
public override RuleSeverity GetSeverity()
{
return RuleSeverity.Information;
}
/// <summary>
/// GetSourceName: Retrieves the name of the module/assembly the rule is from.
/// </summary>
public override string GetSourceName()
{
return string.Format(CultureInfo.CurrentCulture, Strings.SourceName);
}
}
} | 38.310559 | 133 | 0.588684 | [
"MIT"
] | Jaykul/PSScriptAnalyzer | Rules/UseCorrectCasing.cs | 6,170 | C# |
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
// Ported from um/dxcapi.h in the Windows SDK for Windows 10.0.20348.0
// Original source is Copyright © Microsoft. All rights reserved. Licensed under the University of Illinois Open Source License.
using NUnit.Framework;
using System;
using System.Runtime.InteropServices;
using static TerraFX.Interop.Windows;
namespace TerraFX.Interop.UnitTests
{
/// <summary>Provides validation of the <see cref="IDxcCompiler3" /> struct.</summary>
public static unsafe partial class IDxcCompiler3Tests
{
/// <summary>Validates that the <see cref="Guid" /> of the <see cref="IDxcCompiler3" /> struct is correct.</summary>
[Test]
public static void GuidOfTest()
{
Assert.That(typeof(IDxcCompiler3).GUID, Is.EqualTo(IID_IDxcCompiler3));
}
/// <summary>Validates that the <see cref="IDxcCompiler3" /> struct is blittable.</summary>
[Test]
public static void IsBlittableTest()
{
Assert.That(Marshal.SizeOf<IDxcCompiler3>(), Is.EqualTo(sizeof(IDxcCompiler3)));
}
/// <summary>Validates that the <see cref="IDxcCompiler3" /> struct has the right <see cref="LayoutKind" />.</summary>
[Test]
public static void IsLayoutSequentialTest()
{
Assert.That(typeof(IDxcCompiler3).IsLayoutSequential, Is.True);
}
/// <summary>Validates that the <see cref="IDxcCompiler3" /> struct has the correct size.</summary>
[Test]
public static void SizeOfTest()
{
if (Environment.Is64BitProcess)
{
Assert.That(sizeof(IDxcCompiler3), Is.EqualTo(8));
}
else
{
Assert.That(sizeof(IDxcCompiler3), Is.EqualTo(4));
}
}
}
}
| 37.442308 | 145 | 0.635336 | [
"MIT"
] | DaZombieKiller/terrafx.interop.windows | tests/Interop/Windows/um/dxcapi/IDxcCompiler3Tests.cs | 1,949 | C# |
// ReSharper disable InconsistentNaming
using System.Threading;
using System.Threading.Tasks;
using EasyNetQ.Events;
using EasyNetQ.Tests.Mocking;
using EasyNetQ.Topology;
using NUnit.Framework;
using Rhino.Mocks;
namespace EasyNetQ.Tests.ConsumeTests
{
[TestFixture]
public class When_a_consumer_is_cancelled_by_the_broker
{
private MockBuilder mockBuilder;
[SetUp]
public void SetUp()
{
mockBuilder = new MockBuilder();
var queue = new Queue("my_queue", false);
mockBuilder.Bus.Advanced.Consume(queue, (bytes, properties, arg3) => Task.Factory.StartNew(() => { }));
var are = new AutoResetEvent(false);
mockBuilder.EventBus.Subscribe<ConsumerModelDisposedEvent>(x => are.Set());
mockBuilder.Consumers[0].HandleBasicCancel("consumer_tag");
are.WaitOne(500);
}
[Test]
public void Should_dispose_of_the_model()
{
mockBuilder.Consumers[0].Model.AssertWasCalled(x => x.Dispose());
}
}
}
// ReSharper restore InconsistentNaming | 26 | 115 | 0.651163 | [
"MIT"
] | CSGOpenSource/EasyNetQ | Source/EasyNetQ.Tests/ConsumeTests/When_a_consumer_is_cancelled_by_the_broker.cs | 1,120 | C# |
using System;
using System.Data;
using System.Threading.Tasks;
using Dapper;
using DotNetCore.CAP;
using Microsoft.AspNetCore.Mvc;
using MySql.Data.MySqlClient;
namespace Sample.ActiveMQ.MySql.Controllers
{
[Route("api/[controller]")]
public class ValuesController : Controller
{
private readonly ICapPublisher _capBus;
public ValuesController(ICapPublisher capPublisher)
{
_capBus = capPublisher;
}
#region pubblish
[Route("~/without/transaction")]
public async Task<IActionResult> WithoutTransaction(string name = "sample.activemq.mysql")
{
await _capBus.PublishAsync(name, DateTime.Now);
return Ok();
}
[Route("~/adonet/transaction")]
public IActionResult AdonetWithTransaction()
{
using (var connection = new MySqlConnection(AppDbContext.ConnectionString))
{
using (var transaction = connection.BeginTransaction(_capBus, autoCommit: false))
{
//your business code
connection.Execute("insert into test(name) values('test')", transaction: (IDbTransaction)transaction.DbTransaction);
for (int i = 0; i < 5; i++)
{
_capBus.Publish("sample.activemq.mysql", DateTime.Now);
}
transaction.Commit();
}
}
return Ok();
}
[Route("~/ef/transaction")]
public IActionResult EntityFrameworkWithTransaction([FromServices]AppDbContext dbContext)
{
using (var trans = dbContext.Database.BeginTransaction(_capBus, autoCommit: false))
{
dbContext.Persons.Add(new Person() { Name = "ef.transaction" });
for (int i = 0; i < 5; i++)
{
_capBus.Publish("sample.activemq.mysql", DateTime.Now);
}
dbContext.SaveChanges();
trans.Commit();
}
return Ok();
}
#endregion
#region subscribers
[NonAction]
[CapSubscribe("sample.activemq.mysql")]
public bool Subscriber(DateTime time)
{
Console.WriteLine($@"{DateTime.Now}, Subscriber invoked, Sent time:{time}");
return true;
}
[NonAction]
[CapSubscribe("sample.activemq.mysql")]
public bool Subscriber2(DateTime time)
{
Console.WriteLine($@"{DateTime.Now}, Subscriber2 invoked, Sent time:{time}");
return true;
}
[NonAction]
[CapSubscribe("#.activemq.mysql")]
public bool Subscriber3(DateTime time)
{
Console.WriteLine($@"{DateTime.Now}, Subscriber3 invoked, Sent time:{time}");
return true;
}
[NonAction]
[CapSubscribe("sample.activemq.mysql", Group = "another")]
public bool Subscriber4(DateTime time)
{
Console.WriteLine($@"{DateTime.Now}, Subscriber4 invoked, Sent time:{time}");
return true;
}
[NonAction]
[CapSubscribe("a.activemq.mysql", Group = "another")]
public bool Subscriber5(DateTime time)
{
Console.WriteLine($@"{DateTime.Now}, Subscriber5 invoked, Sent time:{time}");
return true;
}
[NonAction]
[CapSubscribe("a.activemq.mysql.1", Group = "another")]
public bool Subscriber6(DateTime time)
{
Console.WriteLine($@"{DateTime.Now}, Subscriber6 invoked, Sent time:{time}");
return true;
}
#endregion
}
}
| 30.359375 | 137 | 0.532681 | [
"MIT"
] | lukazh/Lukaz.CAP.ActiveMQ | sample/Sample.ActiveMQ.MySql/Controllers/ValuesController.cs | 3,888 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;
using Utilidad;
namespace Dato.Modelo
{
[MetadataType(typeof(Tipo.MetaData))]
[DisplayName("Tipo Producto")]
public partial class Tipo
{
private sealed class MetaData
{
[Required, DisplayName("ID"), StringLength(50)]
public int ID { get; set; }
[Required, DisplayName("Codigo"), StringLength(50)]
public String Codigo { get; set; }
[Required, DisplayName("Tipo del Producto"), StringLength(100)]
public String Descripcion { get; set; }
[Required, DisplayName("Estatus")]
public int Estatus { get; set; }
}
#region Metodos Extendidos del Entities Framework
#endregion
}
} | 27.205882 | 76 | 0.605405 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | adolfredo87/Sistema-Alquiler-de-VideoJuego | Alquileres/Dato/Dato.Modelo/Modelo/Entidades/Tipo.cs | 927 | C# |
using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Media;
namespace JulMar.Windows.Extensions
{
/// <summary>
/// Dependency Object extensions
/// </summary>
public static class DependencyObjectExtensions
{
/// <summary>
/// Returns the template element of the given name within the Control.
/// </summary>
public static T FindTemplateName<T>(this Control control, string name) where T : FrameworkElement
{
ControlTemplate template = control.Template;
if (template != null)
{
return template.FindName(name, control) as T;
}
return null;
}
/// <summary>
/// Searches the subtree of an element (including that element)
/// for an element of a particluar type.
/// </summary>
public static T FindElement<T>(this DependencyObject element) where T : FrameworkElement
{
T correctlyTyped = element as T;
if (correctlyTyped != null)
{
return correctlyTyped;
}
if (element != null)
{
int numChildren = VisualTreeHelper.GetChildrenCount(element);
for (int i = 0; i < numChildren; i++)
{
T child = FindElement<T>(VisualTreeHelper.GetChild(element, i) as FrameworkElement);
if (child != null)
{
return child;
}
}
// Popups continue in another window, jump to that tree
Popup popup = element as Popup;
if (popup != null)
{
return FindElement<T>(popup.Child as FrameworkElement);
}
}
return null;
}
/// <summary>
/// This method locates the first visual parent of the given Type.
/// </summary>
/// <typeparam name="T">Type to search for</typeparam>
/// <param name="fe">Framework Element</param>
/// <returns>Visual Parent</returns>
public static T FindVisualParent<T>(this DependencyObject fe) where T : DependencyObject
{
fe = VisualTreeHelper.GetParent(fe);
while (fe != null)
{
var correctlyTyped = fe as T;
if (correctlyTyped != null)
return correctlyTyped;
fe = VisualTreeHelper.GetParent(fe);
}
return null;
}
/// <summary>
/// This method locates the first visual child of the given Type.
/// </summary>
/// <typeparam name="T">Type to search for</typeparam>
/// <param name="fe">Framework Element</param>
/// <returns>Visual Child</returns>
public static T FindVisualChild<T>(this DependencyObject fe) where T : DependencyObject
{
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(fe); i++)
{
DependencyObject dpo = VisualTreeHelper.GetChild(fe, i);
if (dpo == null)
break;
var tChild = dpo as T;
if (tChild != null)
return tChild;
var tdp = FindVisualChild<T>(dpo);
if (tdp != null)
return tdp;
}
return null;
}
/// <summary>
/// A simple iterator method to expose the visual tree to LINQ (parent to child)
/// </summary>
/// <param name="start">Starting root</param>
/// <param name="predicate">Predicate called for each item to provide filter (can be null)</param>
/// <returns>Enumerable list of visuals</returns>
public static IEnumerable<T> EnumerateVisualTree<T>(this DependencyObject start, Predicate<T> predicate) where T : DependencyObject
{
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(start); i++)
{
var child = VisualTreeHelper.GetChild(start, i) as T;
if (child != null && (predicate == null || predicate(child)))
{
yield return child;
foreach (var childOfChild in EnumerateVisualTree(child, predicate))
yield return childOfChild;
}
}
}
/// <summary>
/// A simple iterator method to expose the visual tree to LINQ going backwards (child to parent)
/// </summary>
/// <param name="start">Starting child</param>
/// <param name="predicate">Predicate called for each item to provide filter (can be null)</param>
/// <returns>Enumerable list of visuals</returns>
public static IEnumerable<T> ReverseEnumerateVisualTree<T>(this DependencyObject start, Predicate<T> predicate) where T : DependencyObject
{
for (;;)
{
var parent = VisualTreeHelper.GetParent(start);
if (parent == null)
break;
var tParent = parent as T;
if ((predicate == null || predicate(tParent)))
yield return tParent;
start = parent;
}
}
/// <summary>
/// This enumerates the children of the given starting DPO.
/// </summary>
/// <param name="fe">Start</param>
/// <returns>Collection of children (enumerator)</returns>
public static IEnumerable<DependencyObject> VisualChildren(this DependencyObject fe)
{
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(fe); i++)
yield return VisualTreeHelper.GetChild(fe, i);
}
}
}
| 38.21875 | 147 | 0.517907 | [
"MIT"
] | AsimKhan2019/MVVM-Helpers | Julmar.Wpf.Helpers.2008/trunk/Julmar.Wpf.Helpers/Extensions/DependencyObjectExtensions.cs | 6,117 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Web;
using Glimpse.Core.Extensibility;
using Glimpse.EF;
[assembly: ComVisible(false)]
[assembly: Guid("6F3F9D55-2BE0-47E8-83D2-0F488504CF4A")]
[assembly: AssemblyTitle("Glimpse for EF 4.3 Assembly")]
[assembly: AssemblyDescription("Main extensibility implementations for running Glimpse with EF 4.3.")]
[assembly: AssemblyProduct("Glimpse.EF43")]
[assembly: AssemblyCopyright("© 2012 Nik Molnar & Anthony van der Hoorn")]
[assembly: AssemblyTrademark("Glimpse™")]
// Version is in major.minor.build format to support http://semver.org/
// Keep these three attributes in sync
[assembly: AssemblyVersion("1.3.1")]
[assembly: AssemblyFileVersion("1.3.1")]
[assembly: AssemblyInformationalVersion("1.3.1")] // Used to specify the NuGet version number at build time
[assembly: InternalsVisibleTo("Glimpse.Test.EF")]
[assembly: NuGetPackage]
[assembly: PreApplicationStartMethod(typeof(Initialize), "Start")] | 40.92 | 107 | 0.780059 | [
"Apache-2.0"
] | SeanKilleen/Glimpse | source/Glimpse.EF6.Net45/Properties/AssemblyInfo.cs | 1,028 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.IO;
using System.Security;
using System.Security.Permissions;
using System.Text;
namespace System.Windows.Forms
{
//Sample Guids
// internal const string ComputerFolder = "0AC0837C-BBF8-452A-850D-79D08E667CA7";
// internal const string Favorites = "1777F761-68AD-4D8A-87BD-30B759FA33DD";
// internal const string Documents = "FDD39AD0-238F-46AF-ADB4-6C85480369C7";
// internal const string Profile = "5E6C858F-0E22-4760-9AFE-EA3317B67173";
public class FileDialogCustomPlace
{
private string _path = "";
private Guid _knownFolderGuid = Guid.Empty;
public FileDialogCustomPlace(string path)
{
this.Path = path;
}
public FileDialogCustomPlace(Guid knownFolderGuid)
{
this.KnownFolderGuid = knownFolderGuid;
}
public string Path
{
get
{
if (string.IsNullOrEmpty(this._path))
{
return string.Empty;
}
return this._path;
}
set
{
this._path = value ?? "";
this._knownFolderGuid = Guid.Empty;
}
}
public Guid KnownFolderGuid
{
get
{
return this._knownFolderGuid;
}
set
{
this._path = string.Empty;
this._knownFolderGuid = value;
}
}
public override string ToString()
{
return string.Format(System.Globalization.CultureInfo.CurrentCulture, "{0} Path: {1} KnownFolderGuid: {2}", base.ToString(), this.Path, this.KnownFolderGuid);
}
internal FileDialogNative.IShellItem GetNativePath()
{
// This can throw in a multitude of ways if the path or Guid doesn't correspond
// to an actual filesystem directory.
// The Caller is responsible for handling these situations.
string filePathString;
if (!string.IsNullOrEmpty(_path))
{
filePathString = _path;
}
else
{
int result = Interop.Shell32.SHGetKnownFolderPath(ref _knownFolderGuid, 0, IntPtr.Zero, out filePathString);
if (result == 0)
{
return null;
}
}
return FileDialog.GetShellItemForPath(filePathString);
}
}
} | 30.56044 | 170 | 0.550881 | [
"MIT"
] | DiogoMartinh0/winforms | src/System.Windows.Forms/src/System/Windows/Forms/FileDialogCustomPlace.cs | 2,783 | C# |
using System;
using System.Threading.Tasks;
using CreativeCoders.SmartHal.Kernel.Base.Messages.Channels;
using CreativeCoders.SmartHal.Kernel.Base.Things.Ident;
using JetBrains.Annotations;
namespace CreativeCoders.SmartHal.Drivers.Base
{
[PublicAPI]
public class SimpleThingChannelHandler<T> : ThingChannelHandlerBase
{
private readonly Func<T, bool> _setValue;
public SimpleThingChannelHandler(ThingId thingId, string name, Func<T, bool> setValue) : base(thingId, name)
{
_setValue = setValue;
}
public SimpleThingChannelHandler(ThingId thingId, string name) : this(thingId, name, _ => true)
{
}
protected override Task WriteValueAsync(object value)
{
var targetValue = (T) Convert.ChangeType(value, typeof(T));
if (_setValue(targetValue))
{
SendValueUpdate(targetValue);
}
return Task.CompletedTask;
}
public void SendValueUpdate(T value)
{
Value = value;
MessageHub.SendMessage(new ChannelHandlerValueChangedMessage(ChannelId.ToString(), value));
}
public T Value { get; set; }
}
} | 29.090909 | 116 | 0.613281 | [
"MPL-2.0",
"MPL-2.0-no-copyleft-exception"
] | CreativeCodersTeam/SmartHal | source/Drivers/CreativeCoders.SmartHal.Drivers.Base/SimpleThingChannelHandler.cs | 1,282 | C# |
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.Json.Serialization;
namespace SC.ObjectModel.IO.Json
{
/// <summary>
/// JSON representation of piece.
/// </summary>
public class JsonPiece
{
[JsonPropertyName("id")]
public int ID { get; set; }
[JsonPropertyName("flags")]
public List<JsonFlag> Flags { get; set; }
[JsonPropertyName("cubes")]
public List<JsonCube> Cubes { get; set; }
}
}
| 23.761905 | 49 | 0.619238 | [
"MIT"
] | merschformann/sardine-can | SC.ObjectModel/IO/Json/JsonPiece.cs | 501 | C# |
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using SRNicoNico.Models.NicoNicoViewer;
namespace SRNicoNico.Views.Converter {
[ValueConversion(typeof(double), typeof(double))]
public class SliderValueRoundingConverter : IValueConverter {
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) {
var round = System.Convert.ToDouble(parameter);
var dou = System.Convert.ToDouble(value);
if(dou % round > 0.175) {
dou += dou % round;
} else {
dou -= dou % round;
}
return dou;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) {
return System.Convert.ToDouble(value);
}
}
}
| 23.85 | 105 | 0.640461 | [
"MIT"
] | mrtska/SRNicoNico | SRNicoNico/Views/Converter/SliderValueRoundingConverter.cs | 956 | C# |
using System.Xml.Serialization;
namespace PRIALibraryV24
{
[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.1432")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace = "http://www.w3.org/2000/09/xmldsig#")]
public partial class X509SubjectName_Type
{
private object[] itemsField;
private string[] textField;
/// <remarks/>
public object[] Items
{
get
{
return this.itemsField;
}
set
{
this.itemsField = value;
}
}
/// <remarks/>
[System.Xml.Serialization.XmlTextAttribute()]
public string[] Text
{
get
{
return this.textField;
}
set
{
this.textField = value;
}
}
}
}
| 23.644444 | 97 | 0.522556 | [
"MIT"
] | GSCCCA/gsccca-re-api | src/PRIA Library v2.4/X509SubjectName_Type.cs | 1,066 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Duality;
using Duality.Input;
using Duality.Components;
using Duality.Drawing;
namespace CameraController
{
/// <summary>
/// This class is in control of the example scene. It draws some debug information
/// and makes sure that users can select a camera controller to use, etc.
/// </summary>
public class ExampleSceneController : Component, ICmpUpdatable, ICmpRenderer
{
private GameObject mainCameraObj = null;
private GameObject targetObj = null;
[DontSerialize] private List<ICameraController> cameraControllers = null;
[DontSerialize] private int activeCamController = -1;
[DontSerialize] private FormattedText infoText = null;
[DontSerialize] private FormattedText stateText = null;
[DontSerialize] private bool movementHistoryActive = false;
[DontSerialize] private float movementHistoryTimer = 0.0f;
/// <summary>
/// [GET / SET] The main camera, on which sample camera controllers will be installed.
/// </summary>
public GameObject MainCameraObject
{
get { return this.mainCameraObj; }
set { this.mainCameraObj = value; }
}
/// <summary>
/// [GET / SET] The target object, which sample camera controllers will be configured to follow.
/// </summary>
public GameObject TargetObject
{
get { return this.targetObj; }
set { this.targetObj = value; }
}
/// <summary>
/// [GET / SET] The index of the currently active camera controller.
/// </summary>
public int ActiveCameraController
{
get { return this.activeCamController; }
set
{
// Normalize the index
if (value < -1) value = this.cameraControllers.Count - 1;
if (value >= this.cameraControllers.Count) value = -1;
// Apply the index
this.activeCamController = value;
// Remove the old camera controller
ICameraController oldController = this.mainCameraObj.GetComponent<ICameraController>();
if (oldController != null)
{
this.mainCameraObj.RemoveComponent(oldController as Component);
}
// Add the new camera controller, if one is selected
ICameraController newController = null;
if (this.activeCamController != -1)
{
newController = this.cameraControllers[this.activeCamController];
newController.TargetObject = this.targetObj;
this.mainCameraObj.AddComponent(newController as Component);
}
}
}
void ICmpUpdatable.OnUpdate()
{
// Prepare a list of camera controllers, if we don't already have one
if (this.cameraControllers == null)
{
this.cameraControllers = new List<ICameraController>();
// Use Reflection to get a list of all ICameraController classes
TypeInfo[] availableCameraControllerTypes = DualityApp.GetAvailDualityTypes(typeof(ICameraController)).ToArray();
foreach (TypeInfo camControllerType in availableCameraControllerTypes)
{
// Create an instance of each class
ICameraController camController = camControllerType.CreateInstanceOf() as ICameraController;
if (camController != null)
{
this.cameraControllers.Add(camController);
}
}
}
// Allow the user to select which camera controller to use
if (DualityApp.Keyboard.KeyHit(Key.Number1))
this.ActiveCameraController--;
if (DualityApp.Keyboard.KeyHit(Key.Number2))
this.ActiveCameraController++;
if (DualityApp.Keyboard.KeyHit(Key.M))
this.movementHistoryActive = !this.movementHistoryActive;
// Is there a Gamepad we can use?
GamepadInput gamepad = DualityApp.Gamepads.FirstOrDefault(g => g.IsAvailable);
if (gamepad != null)
{
if (gamepad.ButtonHit(GamepadButton.A))
this.ActiveCameraController--;
if (gamepad.ButtonHit(GamepadButton.B))
this.ActiveCameraController++;
if (gamepad.ButtonHit(GamepadButton.X))
this.movementHistoryActive = !this.movementHistoryActive;
}
// Every 100 ms, draw one visual log entry to document movement
if (this.movementHistoryActive)
{
this.movementHistoryTimer += Time.MillisecondsPerFrame * Time.TimeMult;
if (this.movementHistoryTimer > 100.0f)
{
this.movementHistoryTimer -= 100.0f;
Vector2 targetPos = this.targetObj.Transform.Pos.Xy;
Vector2 cameraPos = this.mainCameraObj.Transform.Pos.Xy;
VisualLogs.Default.DrawPoint(
targetPos.X,
targetPos.Y,
0.0f)
.WithColor(new ColorRgba(255, 128, 0))
.KeepAlive(3000.0f);
VisualLogs.Default.DrawPoint(
cameraPos.X,
cameraPos.Y,
0.0f)
.WithColor(new ColorRgba(0, 255, 0))
.KeepAlive(3000.0f);
}
}
}
void ICmpRenderer.GetCullingInfo(out CullingInfo info)
{
info.Position = Vector3.Zero;
info.Radius = float.MaxValue;
info.Visibility = VisibilityFlag.AllGroups | VisibilityFlag.ScreenOverlay;
}
void ICmpRenderer.Draw(IDrawDevice device)
{
Canvas canvas = new Canvas();
canvas.Begin(device);
Vector2 screenSize = device.TargetSize;
ICameraController activeController = this.mainCameraObj.GetComponent<ICameraController>();
VelocityTracker camTracker = this.mainCameraObj.GetComponent<VelocityTracker>();
Transform camTransform = this.mainCameraObj.Transform;
Transform targetTransform = this.targetObj.Transform;
float camDist = (camTransform.Pos.Xy - targetTransform.Pos.Xy).Length;
string activeControllerName = activeController != null ? activeController.GetType().Name : "None";
activeControllerName = activeControllerName.Replace("CameraController", "");
// Draw the screen center, so we know what exactly our camera controller is pointing at
canvas.State.ColorTint = ColorRgba.Green.WithAlpha(0.5f);
canvas.FillCircle(screenSize.X * 0.5f, screenSize.Y * 0.5f, 8.0f);
// Draw the camera distance around the screen center
canvas.State.ColorTint = ColorRgba.Green.WithAlpha(0.25f);
canvas.DrawCircle(screenSize.X * 0.5f, screenSize.Y * 0.5f, camDist);
// Draw the camera velocity (movement per second) around the screen center
canvas.State.ColorTint = ColorRgba.Green.WithAlpha(0.5f);
canvas.DrawLine(
screenSize.X * 0.5f,
screenSize.Y * 0.5f,
screenSize.X * 0.5f + camTracker.Vel.X / Time.SecondsPerFrame,
screenSize.Y * 0.5f + camTracker.Vel.Y / Time.SecondsPerFrame);
// Draw some info text
if (this.infoText == null)
{
this.infoText = new FormattedText();
this.infoText.MaxWidth = 350;
}
this.infoText.SourceText = string.Format(
"Camera Controller Sample/n/n" +
"Use /c44AAFFFFarrow keys/cFFFFFFFF // /c44AAFFFFleft thumbstick/cFFFFFFFF to move./n" +
"Use /c44AAFFFFnumber keys 1, 2/cFFFFFFFF // /c44AAFFFFbuttons A, B/cFFFFFFFF to select a Camera Controller./n" +
"Use the /c44AAFFFFM key/cFFFFFFFF // /c44AAFFFFbutton X/cFFFFFFFF to toggle movement history./n/n" +
"Active Camera Controller:/n/cFF8800FF{0}/cFFFFFFFF",
activeControllerName);
canvas.State.ColorTint = ColorRgba.White;
canvas.DrawText(this.infoText, 10, 10, 0.0f, null, Alignment.TopLeft, true);
// Draw state information on the current camera controller
if (this.stateText == null) this.stateText = new FormattedText();
this.stateText.SourceText = string.Format(
"Camera Distance: {0:F}/n" +
"Camera Velocity: {1:F}, {2:F}",
camDist,
camTracker.Vel.X,
camTracker.Vel.Y);
canvas.State.ColorTint = ColorRgba.White;
canvas.DrawText(this.stateText, 10, screenSize.Y - 10, 0.0f, null, Alignment.BottomLeft, true);
canvas.End();
}
}
}
| 35.566038 | 118 | 0.71313 | [
"MIT"
] | AdamsLair/duality | Samples/CameraController/ExampleSceneController.cs | 7,542 | C# |
namespace Rssdp.Infrastructure {
/// <summary>
/// Implemented by components that can create a platform specific UDP socket implementation, and wrap it in the cross platform <see cref="IUdpSocket"/> interface.
/// </summary>
public interface ISocketFactory {
/// <summary>
/// Creates a new unicast socket using the specified local port number.
/// </summary>
/// <param name="localPort">The local port to bind to.</param>
/// <returns>A <see cref="IUdpSocket"/> implementation.</returns>
IUdpSocket CreateUdpSocket( int localPort );
/// <summary>
/// Creates a new multicast socket using the specified multicast IP address, multicast time to live and local port.
/// </summary>
/// <param name="multicastTimeToLive">The multicast time to live value. Actually a maximum number of network hops for UDP packets.</param>
/// <param name="localPort">The local port to bind to.</param>
/// <returns>A <see cref="IUdpSocket"/> implementation.</returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming","CA1704:IdentifiersShouldBeSpelledCorrectly",MessageId = "ip",Justification = "IP is a well known and understood abbreviation and the full name is excessive.")]
IUdpSocket CreateUdpMulticastSocket( int multicastTimeToLive,int localPort );
/// <summary>
/// What type of sockets will be created: ipv6 or ipv4
/// </summary>
DeviceNetworkType DeviceNetworkType { get; }
}
} | 51.107143 | 230 | 0.730957 | [
"MIT"
] | matheuskknd/PseudoGingaServer | Src/Rssdp/Src/Infraestructure/ISocketFactory.cs | 1,433 | C# |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.GoogleNative.Healthcare.V1Beta1.Outputs
{
/// <summary>
/// Cloud Healthcare API resource.
/// </summary>
[OutputType]
public sealed class CloudHealthcareSourceResponse
{
/// <summary>
/// Full path of a Cloud Healthcare API resource.
/// </summary>
public readonly string Name;
[OutputConstructor]
private CloudHealthcareSourceResponse(string name)
{
Name = name;
}
}
}
| 25.580645 | 81 | 0.653216 | [
"Apache-2.0"
] | AaronFriel/pulumi-google-native | sdk/dotnet/Healthcare/V1Beta1/Outputs/CloudHealthcareSourceResponse.cs | 793 | C# |
using System;
using FinanceControl.Services.Users.Infrastructure.Logging.Options;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Serilog;
using Serilog.Events;
using Serilog.Sinks.Elasticsearch;
namespace FinanceControl.Services.Users.Infrastructure.Logging
{
public static class LoggingRegistration
{
public static IWebHostBuilder UseLogging(this IWebHostBuilder webHostBuilder, string applicationName = "")
{
return webHostBuilder.UseSerilog((context, loggerConfiguration) =>
{
var options = new LoggerOptions();
context.Configuration.GetSection("logger").Bind(options);
if (!Enum.TryParse<LogEventLevel>(options.Level, true, out var level))
{
level = LogEventLevel.Information;
}
applicationName = string.IsNullOrWhiteSpace(applicationName)
? Environment.GetEnvironmentVariable("APPLICATION_NAME")
: applicationName;
loggerConfiguration.Enrich.FromLogContext()
.MinimumLevel.Is(level)
.Enrich.WithProperty("Environment", context.HostingEnvironment.EnvironmentName)
.Enrich.WithProperty("ApplicationName", applicationName);
Configure(loggerConfiguration, options, level);
});
}
private static void Configure(LoggerConfiguration loggerConfiguration, LoggerOptions options,
LogEventLevel level)
{
var consoleOptions = options.Console ?? new ConsoleOptions();
var fileOptions = options.File ?? new FileOptions();
var elkOptions = options.Elk ?? new ElkOptions();
if (consoleOptions.Enabled)
{
loggerConfiguration.WriteTo.Console();
}
if (fileOptions.Enabled)
{
var path = string.IsNullOrWhiteSpace(fileOptions.Path) ? "logs/logs.txt" : fileOptions.Path;
if (!Enum.TryParse<RollingInterval>(fileOptions.Interval, true, out var interval))
{
interval = RollingInterval.Day;
}
loggerConfiguration.WriteTo.File(path, rollingInterval: interval);
}
if (elkOptions.Enabled)
{
loggerConfiguration.WriteTo.Elasticsearch(new ElasticsearchSinkOptions(new Uri(elkOptions.Url))
{
MinimumLogEventLevel = level,
AutoRegisterTemplate = true,
AutoRegisterTemplateVersion = AutoRegisterTemplateVersion.ESv6,
IndexFormat = string.IsNullOrWhiteSpace(elkOptions.IndexFormat)
? "logstash-{0:yyyy.MM.dd}"
: elkOptions.IndexFormat,
ModifyConnectionSettings = connectionConfiguration =>
elkOptions.BasicAuthEnabled
? connectionConfiguration.BasicAuthentication(elkOptions.Username, elkOptions.Password)
: connectionConfiguration
});
}
}
}
} | 40.6625 | 115 | 0.592991 | [
"MIT"
] | FreshBlast/FinanceControl.Services.Users | src/FinanceControl.Services.Users.Infrastructure/Logging/LoggerRegistration.cs | 3,253 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("ReactiveRTM")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ReactiveRTM")]
[assembly: AssemblyCopyright("Copyright © zoetrope 2011-2013")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)]
// 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です
[assembly: Guid("fe1fe20a-5d1a-4da3-baaa-9b4714633bd0")]
// アセンブリのバージョン情報は、以下の 4 つの値で構成されています:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.2.0.0")]
[assembly: AssemblyFileVersion("0.2.0.0")]
[assembly: InternalsVisibleTo("ReactiveRTM.Test")] | 31.421053 | 64 | 0.726131 | [
"BSD-2-Clause"
] | zoetrope/ReactiveRTM | ReactiveRTM/Properties/AssemblyInfo.cs | 1,719 | C# |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Author: Nuno Fachada
* */
using UnityEngine;
public class VelocityMatchBehaviour : SteeringBehaviour
{
[SerializeField] private float timeToTarget = 0.1f;
// Velocity match behaviour
public override SteeringOutput GetSteering(GameObject target)
{
// Initialize linear and angular forces to zero
Vector2 linear = Vector2.zero;
float angular = 0f; // Not used
// Do I have a target?
if (target != null)
{
// Get the target's rigid body
Rigidbody2D targetRb = target.GetComponent<Rigidbody2D>();
// Get the target's velocity (if its rigid body is not null)
Vector2 targetVelocity =
targetRb != null ? targetRb.velocity : Vector2.zero;
// Acceleration tries to get to the target's velocity
linear = (targetVelocity - Velocity) / timeToTarget;
// Check if acceleration is too fast
if (linear.magnitude > MaxAccel)
{
linear = linear.normalized * MaxAccel;
}
}
// Output the steering
return new SteeringOutput(linear, angular);
}
}
| 30.152174 | 72 | 0.610671 | [
"MPL-2.0"
] | PmaiWoW/AIUnityExamples | MovementDynamic/Assets/Scripts/Behaviours/VelocityMatchBehaviour.cs | 1,387 | C# |
//
// Copyright (c) Autodesk, Inc. All rights reserved.
//
// This computer source code and related instructions and comments are the
// unpublished confidential and proprietary information of Autodesk, Inc.
// and are protected under Federal copyright and state trade secret law.
// They may not be disclosed to, copied or used by any third party without
// the prior written consent of Autodesk, Inc.
//
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Networking;
#if UNITY_EDITOR || !UNITY_WSA
//using ZXing; // https://github.com/micjahn/ZXing.Net
//using ZXing.Common;
//using ZXing.QrCode;
#else
#if UNITY_2017_2_OR_NEWER
using UnityEngine.XR.WSA.WebCam;
#else
using UnityEngine.VR.WSA.WebCam;
#endif
#endif
using SimpleJSON;
namespace Autodesk.Forge.ARKit {
public abstract class QRCodeDecoderBase : MonoBehaviour, IQRCodeDecoderInterface {
#region Interface Enums
public enum CaptureMode {
Photo,
Camera
}
#endregion
#region Fields
public CaptureMode _mode =CaptureMode.Camera ;
public bool _searchUntilFound =false ;
[SerializeField]
public QRDecodedEvent _qrDecoded =new QRDecodedEvent () ;
#endregion
#region Unity APIs
protected virtual void OnEnable () {
InitCamera () ;
}
protected virtual void OnDisable () {
StopCamera () ;
}
protected abstract void Update () ;
#endregion
#region Methods
protected abstract bool InitCamera () ;
protected abstract void StopCamera () ;
protected abstract void ProcessCameraFrame () ;
protected abstract bool ReturnOrLoop (string json, Vector3 position, Quaternion rotation) ;
public void ToggleScan () {
gameObject.SetActive (!gameObject.activeSelf) ;
}
#endregion
}
} | 22.475 | 93 | 0.753059 | [
"MIT"
] | JohnOnSoftware/ARVRToolkit | unity-src/ARVRToolkit/Assets/Forge/Utilities/QRCode/QRCodeDecoderBase.cs | 1,800 | C# |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.AzureNextGen.DataFactory.Latest.Inputs
{
/// <summary>
/// Azure Databricks Delta Lake linked service.
/// </summary>
public sealed class AzureDatabricksDeltaLakeLinkedServiceArgs : Pulumi.ResourceArgs
{
/// <summary>
/// Access token for databricks REST API. Refer to https://docs.azuredatabricks.net/api/latest/authentication.html. Type: string, SecureString or AzureKeyVaultSecretReference.
/// </summary>
[Input("accessToken")]
public InputUnion<Inputs.AzureKeyVaultSecretReferenceArgs, Inputs.SecureStringArgs>? AccessToken { get; set; }
[Input("annotations")]
private InputList<object>? _annotations;
/// <summary>
/// List of tags that can be used for describing the linked service.
/// </summary>
public InputList<object> Annotations
{
get => _annotations ?? (_annotations = new InputList<object>());
set => _annotations = value;
}
/// <summary>
/// The id of an existing interactive cluster that will be used for all runs of this job. Type: string (or Expression with resultType string).
/// </summary>
[Input("clusterId")]
public Input<object>? ClusterId { get; set; }
/// <summary>
/// The integration runtime reference.
/// </summary>
[Input("connectVia")]
public Input<Inputs.IntegrationRuntimeReferenceArgs>? ConnectVia { get; set; }
/// <summary>
/// Linked service description.
/// </summary>
[Input("description")]
public Input<string>? Description { get; set; }
/// <summary>
/// <REGION>.azuredatabricks.net, domain name of your Databricks deployment. Type: string (or Expression with resultType string).
/// </summary>
[Input("domain", required: true)]
public Input<object> Domain { get; set; } = null!;
/// <summary>
/// The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string).
/// </summary>
[Input("encryptedCredential")]
public Input<object>? EncryptedCredential { get; set; }
[Input("parameters")]
private InputMap<Inputs.ParameterSpecificationArgs>? _parameters;
/// <summary>
/// Parameters for linked service.
/// </summary>
public InputMap<Inputs.ParameterSpecificationArgs> Parameters
{
get => _parameters ?? (_parameters = new InputMap<Inputs.ParameterSpecificationArgs>());
set => _parameters = value;
}
/// <summary>
/// Type of linked service.
/// </summary>
[Input("type", required: true)]
public Input<string> Type { get; set; } = null!;
public AzureDatabricksDeltaLakeLinkedServiceArgs()
{
}
}
}
| 37 | 190 | 0.624962 | [
"Apache-2.0"
] | test-wiz-sec/pulumi-azure-nextgen | sdk/dotnet/DataFactory/Latest/Inputs/AzureDatabricksDeltaLakeLinkedServiceArgs.cs | 3,293 | C# |
using System.Collections.Generic;
using OpenDreamRuntime.Objects;
using OpenDreamRuntime.Rendering;
using OpenDreamRuntime.Resources;
using OpenDreamShared.Dream;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Maths;
namespace OpenDreamRuntime {
class AtomManager : IAtomManager {
//TODO: Maybe turn these into a special DreamList, similar to DreamListVars?
public Dictionary<DreamList, DreamObject> OverlaysListToAtom { get; } = new();
public Dictionary<DreamList, DreamObject> UnderlaysListToAtom { get; } = new();
[Dependency] private readonly IEntityManager _entityManager = default!;
private Dictionary<DreamObject, EntityUid> _atomToEntity = new();
private Dictionary<EntityUid, DreamObject> _entityToAtom = new();
public EntityUid CreateAtomEntity(DreamObject atom) {
EntityUid entity = _entityManager.SpawnEntity(null, new MapCoordinates(0, 0, MapId.Nullspace));
DMISpriteComponent sprite = _entityManager.AddComponent<DMISpriteComponent>(entity);
sprite.SetAppearance(CreateAppearanceFromAtom(atom));
if (_entityManager.TryGetComponent(entity, out MetaDataComponent metaData)) {
atom.GetVariable("name").TryGetValueAsString(out string name);
atom.GetVariable("desc").TryGetValueAsString(out string desc);
metaData.EntityName = name;
metaData.EntityDescription = desc;
}
_atomToEntity.Add(atom, entity);
_entityToAtom.Add(entity, atom);
return entity;
}
public EntityUid GetAtomEntity(DreamObject atom)
{
return _atomToEntity.ContainsKey(atom) ? _atomToEntity[atom] : CreateAtomEntity(atom);
}
public DreamObject GetAtomFromEntity(EntityUid entity) {
_entityToAtom.TryGetValue(entity, out DreamObject atom);
return atom;
}
public void DeleteAtomEntity(DreamObject atom) {
EntityUid entity = GetAtomEntity(atom);
_entityToAtom.Remove(entity);
_atomToEntity.Remove(atom);
_entityManager.DeleteEntity(entity);
}
public IconAppearance? GetAppearance(DreamObject atom) {
return _entityManager.GetComponent<DMISpriteComponent>(GetAtomEntity(atom)).Appearance;
}
public void UpdateAppearance(DreamObject atom, Action<IconAppearance> update) {
if (!_entityManager.TryGetComponent<DMISpriteComponent>(GetAtomEntity(atom), out var sprite))
return;
IconAppearance appearance = new IconAppearance(sprite.Appearance);
update(appearance);
sprite.SetAppearance(appearance);
}
public void AnimateAppearance(DreamObject atom, TimeSpan duration, Action<IconAppearance> animate) {
if (!_entityManager.TryGetComponent<DMISpriteComponent>(GetAtomEntity(atom), out var sprite))
return;
IconAppearance appearance = new IconAppearance(sprite.Appearance);
animate(appearance);
// Don't send the updated appearance to clients, they will animate it
sprite.SetAppearance(appearance, dirty: false);
ServerAppearanceSystem appearanceSystem = EntitySystem.Get<ServerAppearanceSystem>();
appearanceSystem.Animate(GetAtomEntity(atom), appearance, duration);
}
public IconAppearance CreateAppearanceFromAtom(DreamObject atom) {
IconAppearance appearance = new IconAppearance();
if (atom.GetVariable("icon").TryGetValueAsDreamResource(out DreamResource icon)) {
appearance.Icon = icon.ResourcePath;
}
if (atom.GetVariable("icon_state").TryGetValueAsString(out string iconState)) {
appearance.IconState = iconState;
}
if (atom.GetVariable("color").TryGetValueAsString(out string color)) {
appearance.SetColor(color);
}
if (atom.GetVariable("dir").TryGetValueAsInteger(out int dir)) {
appearance.Direction = (AtomDirection)dir;
}
if (atom.GetVariable("invisibility").TryGetValueAsInteger(out int invisibility)) {
appearance.Invisibility = invisibility;
}
if (atom.GetVariable("mouse_opacity").TryGetValueAsInteger(out int mouseOpacity)) {
appearance.MouseOpacity = (MouseOpacity)mouseOpacity;
}
atom.GetVariable("pixel_x").TryGetValueAsInteger(out int pixelX);
atom.GetVariable("pixel_y").TryGetValueAsInteger(out int pixelY);
appearance.PixelOffset = new Vector2i(pixelX, pixelY);
if (atom.GetVariable("layer").TryGetValueAsFloat(out float layer)) {
appearance.Layer = layer;
}
return appearance;
}
}
}
| 40.104 | 108 | 0.655695 | [
"MIT"
] | EdgeLordExe/OpenDream | OpenDreamRuntime/AtomManager.cs | 5,015 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("b")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("b")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)]
// このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります
[assembly: Guid("fae854e4-3b9c-4e25-b594-810ee0290c7c")]
// アセンブリのバージョン情報は次の 4 つの値で構成されています:
//
// メジャー バージョン
// マイナー バージョン
// ビルド番号
// Revision
//
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 28.621622 | 57 | 0.739377 | [
"MIT"
] | yu3mars/procon | atcoder/abc/abc004/b/Properties/AssemblyInfo.cs | 1,628 | C# |
namespace SharpFlame
{
partial class frmMain : System.Windows.Forms.Form
{
//Form overrides dispose to clean up the component list.
[System.Diagnostics.DebuggerNonUserCode()]protected override void Dispose(bool disposing)
{
try
{
if (disposing && components != null)
{
components.Dispose();
}
}
finally
{
base.Dispose(disposing);
}
}
//Required by the Windows Form Designer
private System.ComponentModel.Container components = null;
//NOTE: The following procedure is required by the Windows Form Designer
//It can be modified using the Windows Form Designer.
//Do not modify it using the code editor.
[System.Diagnostics.DebuggerStepThrough()]private void InitializeComponent()
{
this.SplitContainer1 = new System.Windows.Forms.SplitContainer();
this.TabControl = new System.Windows.Forms.TabControl();
this.tpTextures = new System.Windows.Forms.TabPage();
this.TableLayoutPanel6 = new System.Windows.Forms.TableLayoutPanel();
this.Panel5 = new System.Windows.Forms.Panel();
this.rdoTextureRemoveTerrain = new System.Windows.Forms.RadioButton();
this.rdoTextureReinterpretTerrain = new System.Windows.Forms.RadioButton();
this.rdoTextureIgnoreTerrain = new System.Windows.Forms.RadioButton();
this.pnlTextureBrush = new System.Windows.Forms.Panel();
this.chkTextureOrientationRandomize = new System.Windows.Forms.CheckBox();
this.btnTextureFlipX = new System.Windows.Forms.Button();
this.btnTextureClockwise = new System.Windows.Forms.Button();
this.btnTextureAnticlockwise = new System.Windows.Forms.Button();
this.chkSetTextureOrientation = new System.Windows.Forms.CheckBox();
this.chkSetTexture = new System.Windows.Forms.CheckBox();
this.Label21 = new System.Windows.Forms.Label();
this.cboTileset = new System.Windows.Forms.ComboBox();
this.Panel6 = new System.Windows.Forms.Panel();
this.cbxTileNumbers = new System.Windows.Forms.CheckBox();
this.cbxTileTypes = new System.Windows.Forms.CheckBox();
this.Label20 = new System.Windows.Forms.Label();
this.cboTileType = new System.Windows.Forms.ComboBox();
this.tpAutoTexture = new System.Windows.Forms.TabPage();
this.Panel15 = new System.Windows.Forms.Panel();
this.cbxFillInside = new System.Windows.Forms.CheckBox();
this.rdoFillCliffIgnore = new System.Windows.Forms.RadioButton();
this.rdoFillCliffStopBefore = new System.Windows.Forms.RadioButton();
this.rdoFillCliffStopAfter = new System.Windows.Forms.RadioButton();
this.rdoCliffTriBrush = new System.Windows.Forms.RadioButton();
this.rdoRoadRemove = new System.Windows.Forms.RadioButton();
this.pnlCliffRemoveBrush = new System.Windows.Forms.Panel();
this.pnlTerrainBrush = new System.Windows.Forms.Panel();
this.cbxInvalidTiles = new System.Windows.Forms.CheckBox();
this.cbxAutoTexSetHeight = new System.Windows.Forms.CheckBox();
this.cbxCliffTris = new System.Windows.Forms.CheckBox();
this.Label29 = new System.Windows.Forms.Label();
this.rdoAutoRoadLine = new System.Windows.Forms.RadioButton();
this.btnAutoTextureRemove = new System.Windows.Forms.Button();
this.btnAutoRoadRemove = new System.Windows.Forms.Button();
this.rdoAutoRoadPlace = new System.Windows.Forms.RadioButton();
this.lstAutoRoad = new System.Windows.Forms.ListBox();
this.rdoAutoTexturePlace = new System.Windows.Forms.RadioButton();
this.rdoAutoTextureFill = new System.Windows.Forms.RadioButton();
this.rdoAutoCliffBrush = new System.Windows.Forms.RadioButton();
this.rdoAutoCliffRemove = new System.Windows.Forms.RadioButton();
this.txtAutoCliffSlope = new System.Windows.Forms.TextBox();
this.Label1 = new System.Windows.Forms.Label();
this.lstAutoTexture = new System.Windows.Forms.ListBox();
this.Label3 = new System.Windows.Forms.Label();
this.tpHeight = new System.Windows.Forms.TabPage();
this.cbxHeightChangeFade = new System.Windows.Forms.CheckBox();
this.pnlHeightSetBrush = new System.Windows.Forms.Panel();
this.btnHeightsMultiplySelection = new System.Windows.Forms.Button();
this.btnHeightOffsetSelection = new System.Windows.Forms.Button();
this.tabHeightSetR = new System.Windows.Forms.TabControl();
this.TabPage25 = new System.Windows.Forms.TabPage();
this.TabPage26 = new System.Windows.Forms.TabPage();
this.TabPage27 = new System.Windows.Forms.TabPage();
this.TabPage28 = new System.Windows.Forms.TabPage();
this.TabPage29 = new System.Windows.Forms.TabPage();
this.TabPage30 = new System.Windows.Forms.TabPage();
this.TabPage31 = new System.Windows.Forms.TabPage();
this.TabPage32 = new System.Windows.Forms.TabPage();
this.tabHeightSetL = new System.Windows.Forms.TabControl();
this.TabPage9 = new System.Windows.Forms.TabPage();
this.TabPage10 = new System.Windows.Forms.TabPage();
this.TabPage11 = new System.Windows.Forms.TabPage();
this.TabPage12 = new System.Windows.Forms.TabPage();
this.TabPage17 = new System.Windows.Forms.TabPage();
this.TabPage18 = new System.Windows.Forms.TabPage();
this.TabPage19 = new System.Windows.Forms.TabPage();
this.TabPage20 = new System.Windows.Forms.TabPage();
this.txtHeightSetR = new System.Windows.Forms.TextBox();
this.Label27 = new System.Windows.Forms.Label();
this.Label10 = new System.Windows.Forms.Label();
this.txtHeightOffset = new System.Windows.Forms.TextBox();
this.Label9 = new System.Windows.Forms.Label();
this.txtHeightMultiply = new System.Windows.Forms.TextBox();
this.txtHeightChangeRate = new System.Windows.Forms.TextBox();
this.Label18 = new System.Windows.Forms.Label();
this.rdoHeightChange = new System.Windows.Forms.RadioButton();
this.Label16 = new System.Windows.Forms.Label();
this.txtSmoothRate = new System.Windows.Forms.TextBox();
this.Label6 = new System.Windows.Forms.Label();
this.rdoHeightSmooth = new System.Windows.Forms.RadioButton();
this.rdoHeightSet = new System.Windows.Forms.RadioButton();
this.txtHeightSetL = new System.Windows.Forms.TextBox();
this.Label5 = new System.Windows.Forms.Label();
this.tpResize = new System.Windows.Forms.TabPage();
this.btnSelResize = new System.Windows.Forms.Button();
this.btnResize = new System.Windows.Forms.Button();
this.txtOffsetY = new System.Windows.Forms.TextBox();
this.Label15 = new System.Windows.Forms.Label();
this.txtOffsetX = new System.Windows.Forms.TextBox();
this.Label14 = new System.Windows.Forms.Label();
this.txtSizeY = new System.Windows.Forms.TextBox();
this.Label13 = new System.Windows.Forms.Label();
this.txtSizeX = new System.Windows.Forms.TextBox();
this.Label12 = new System.Windows.Forms.Label();
this.tpObjects = new System.Windows.Forms.TabPage();
this.TableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.Panel1 = new System.Windows.Forms.Panel();
this.btnPlayerSelectObjects = new System.Windows.Forms.Button();
this.Label44 = new System.Windows.Forms.Label();
this.GroupBox3 = new System.Windows.Forms.GroupBox();
this.rdoObjectPlace = new System.Windows.Forms.RadioButton();
this.rdoObjectLines = new System.Windows.Forms.RadioButton();
this.txtObjectFind = new System.Windows.Forms.TextBox();
this.cbxFootprintRotate = new System.Windows.Forms.CheckBox();
this.txtNewObjectRotation = new System.Windows.Forms.TextBox();
this.Label19 = new System.Windows.Forms.Label();
this.cbxAutoWalls = new System.Windows.Forms.CheckBox();
this.cbxObjectRandomRotation = new System.Windows.Forms.CheckBox();
this.Label32 = new System.Windows.Forms.Label();
this.Label22 = new System.Windows.Forms.Label();
this.Panel2 = new System.Windows.Forms.Panel();
this.btnObjectTypeSelect = new System.Windows.Forms.Button();
this.TabControl1 = new System.Windows.Forms.TabControl();
this.TabPage1 = new System.Windows.Forms.TabPage();
this.dgvFeatures = new System.Windows.Forms.DataGridView();
this.TabPage2 = new System.Windows.Forms.TabPage();
this.dgvStructures = new System.Windows.Forms.DataGridView();
this.TabPage3 = new System.Windows.Forms.TabPage();
this.dgvDroids = new System.Windows.Forms.DataGridView();
this.tpObject = new System.Windows.Forms.TabPage();
this.TableLayoutPanel8 = new System.Windows.Forms.TableLayoutPanel();
this.TableLayoutPanel9 = new System.Windows.Forms.TableLayoutPanel();
this.cboDroidTurret3 = new System.Windows.Forms.ComboBox();
this.cboDroidTurret2 = new System.Windows.Forms.ComboBox();
this.Panel13 = new System.Windows.Forms.Panel();
this.rdoDroidTurret3 = new System.Windows.Forms.RadioButton();
this.cboDroidTurret1 = new System.Windows.Forms.ComboBox();
this.cboDroidPropulsion = new System.Windows.Forms.ComboBox();
this.cboDroidBody = new System.Windows.Forms.ComboBox();
this.cboDroidType = new System.Windows.Forms.ComboBox();
this.Panel12 = new System.Windows.Forms.Panel();
this.rdoDroidTurret0 = new System.Windows.Forms.RadioButton();
this.rdoDroidTurret2 = new System.Windows.Forms.RadioButton();
this.Panel11 = new System.Windows.Forms.Panel();
this.Label39 = new System.Windows.Forms.Label();
this.rdoDroidTurret1 = new System.Windows.Forms.RadioButton();
this.Panel10 = new System.Windows.Forms.Panel();
this.Label38 = new System.Windows.Forms.Label();
this.Panel9 = new System.Windows.Forms.Panel();
this.Label37 = new System.Windows.Forms.Label();
this.Panel8 = new System.Windows.Forms.Panel();
this.Label40 = new System.Windows.Forms.Label();
this.Panel14 = new System.Windows.Forms.Panel();
this.btnFlatSelected = new System.Windows.Forms.Button();
this.btnAlignObjects = new System.Windows.Forms.Button();
this.Label31 = new System.Windows.Forms.Label();
this.Label30 = new System.Windows.Forms.Label();
this.cbxDesignableOnly = new System.Windows.Forms.CheckBox();
this.Label17 = new System.Windows.Forms.Label();
this.txtObjectLabel = new System.Windows.Forms.TextBox();
this.Label35 = new System.Windows.Forms.Label();
this.btnDroidToDesign = new System.Windows.Forms.Button();
this.Label24 = new System.Windows.Forms.Label();
this.lblObjectType = new System.Windows.Forms.Label();
this.Label36 = new System.Windows.Forms.Label();
this.Label23 = new System.Windows.Forms.Label();
this.txtObjectHealth = new System.Windows.Forms.TextBox();
this.txtObjectRotation = new System.Windows.Forms.TextBox();
this.Label34 = new System.Windows.Forms.Label();
this.Label28 = new System.Windows.Forms.Label();
this.txtObjectPriority = new System.Windows.Forms.TextBox();
this.Label25 = new System.Windows.Forms.Label();
this.Label33 = new System.Windows.Forms.Label();
this.txtObjectID = new System.Windows.Forms.TextBox();
this.Label26 = new System.Windows.Forms.Label();
this.tpLabels = new System.Windows.Forms.TabPage();
this.Label11 = new System.Windows.Forms.Label();
this.Label43 = new System.Windows.Forms.Label();
this.Label42 = new System.Windows.Forms.Label();
this.lstScriptAreas = new System.Windows.Forms.ListBox();
this.lstScriptPositions = new System.Windows.Forms.ListBox();
this.btnScriptAreaCreate = new System.Windows.Forms.Button();
this.GroupBox1 = new System.Windows.Forms.GroupBox();
this.txtScriptMarkerLabel = new System.Windows.Forms.TextBox();
this.Label41 = new System.Windows.Forms.Label();
this.btnScriptMarkerRemove = new System.Windows.Forms.Button();
this.Label2 = new System.Windows.Forms.Label();
this.txtScriptMarkerY = new System.Windows.Forms.TextBox();
this.txtScriptMarkerX = new System.Windows.Forms.TextBox();
this.Label7 = new System.Windows.Forms.Label();
this.txtScriptMarkerY2 = new System.Windows.Forms.TextBox();
this.Label4 = new System.Windows.Forms.Label();
this.Label8 = new System.Windows.Forms.Label();
this.txtScriptMarkerX2 = new System.Windows.Forms.TextBox();
this.TableLayoutPanel7 = new System.Windows.Forms.TableLayoutPanel();
this.Panel7 = new System.Windows.Forms.Panel();
this.tsTools = new System.Windows.Forms.ToolStrip();
this.tsbGateways = new System.Windows.Forms.ToolStripButton();
this.tsbDrawAutotexture = new System.Windows.Forms.ToolStripButton();
this.tsbDrawTileOrientation = new System.Windows.Forms.ToolStripButton();
this.tsFile = new System.Windows.Forms.ToolStrip();
this.tsbSave = new System.Windows.Forms.ToolStripButton();
this.tsSelection = new System.Windows.Forms.ToolStrip();
this.ToolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
this.tsbSelection = new System.Windows.Forms.ToolStripButton();
this.tsbSelectionCopy = new System.Windows.Forms.ToolStripButton();
this.tsbSelectionPasteOptions = new System.Windows.Forms.ToolStripDropDownButton();
this.menuRotateUnits = new System.Windows.Forms.ToolStripMenuItem();
this.menuRotateWalls = new System.Windows.Forms.ToolStripMenuItem();
this.menuRotateNothing = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
this.menuSelPasteHeights = new System.Windows.Forms.ToolStripMenuItem();
this.menuSelPasteTextures = new System.Windows.Forms.ToolStripMenuItem();
this.menuSelPasteUnits = new System.Windows.Forms.ToolStripMenuItem();
this.menuSelPasteGateways = new System.Windows.Forms.ToolStripMenuItem();
this.menuSelPasteDeleteUnits = new System.Windows.Forms.ToolStripMenuItem();
this.menuSelPasteDeleteGateways = new System.Windows.Forms.ToolStripMenuItem();
this.tsbSelectionPaste = new System.Windows.Forms.ToolStripButton();
this.tsbSelectionRotateCounterClockwise = new System.Windows.Forms.ToolStripButton();
this.tsbSelectionRotateClockwise = new System.Windows.Forms.ToolStripButton();
this.tsbSelectionFlipX = new System.Windows.Forms.ToolStripButton();
this.tsbSelectionObjects = new System.Windows.Forms.ToolStripButton();
this.tsMinimap = new System.Windows.Forms.ToolStrip();
this.menuMinimap = new System.Windows.Forms.ToolStripDropDownButton();
this.menuMiniShowTex = new System.Windows.Forms.ToolStripMenuItem();
this.menuMiniShowHeight = new System.Windows.Forms.ToolStripMenuItem();
this.menuMiniShowCliffs = new System.Windows.Forms.ToolStripMenuItem();
this.menuMiniShowUnits = new System.Windows.Forms.ToolStripMenuItem();
this.menuMiniShowGateways = new System.Windows.Forms.ToolStripMenuItem();
this.pnlView = new System.Windows.Forms.Panel();
this.menuMain = new System.Windows.Forms.MenuStrip();
this.menuFile = new System.Windows.Forms.ToolStripMenuItem();
this.NewMapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.OpenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
this.SaveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuSaveFMap = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
this.menuSaveFMapQuick = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripSeparator11 = new System.Windows.Forms.ToolStripSeparator();
this.MapLNDToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
this.menuExportMapTileTypes = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.MinimapBMPToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.ToolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem();
this.ImportHeightmapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
this.menuImportTileTypes = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
this.MapWZToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.CloseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuTools = new System.Windows.Forms.ToolStripMenuItem();
this.menuReinterpret = new System.Windows.Forms.ToolStripMenuItem();
this.menuWaterCorrection = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator();
this.menuFlatOil = new System.Windows.Forms.ToolStripMenuItem();
this.menuFlatStructures = new System.Windows.Forms.ToolStripMenuItem();
this.ToolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator();
this.menuGenerator = new System.Windows.Forms.ToolStripMenuItem();
this.menuOptions = new System.Windows.Forms.ToolStripMenuItem();
this.TableLayoutPanel5 = new System.Windows.Forms.TableLayoutPanel();
this.TabPage13 = new System.Windows.Forms.TabPage();
this.TabPage14 = new System.Windows.Forms.TabPage();
this.TabPage15 = new System.Windows.Forms.TabPage();
this.TabPage16 = new System.Windows.Forms.TabPage();
this.TabPage21 = new System.Windows.Forms.TabPage();
this.TabPage22 = new System.Windows.Forms.TabPage();
this.TabPage23 = new System.Windows.Forms.TabPage();
this.TabPage24 = new System.Windows.Forms.TabPage();
((System.ComponentModel.ISupportInitialize)(this.SplitContainer1)).BeginInit();
this.SplitContainer1.Panel1.SuspendLayout();
this.SplitContainer1.Panel2.SuspendLayout();
this.SplitContainer1.SuspendLayout();
this.TabControl.SuspendLayout();
this.tpTextures.SuspendLayout();
this.TableLayoutPanel6.SuspendLayout();
this.Panel5.SuspendLayout();
this.Panel6.SuspendLayout();
this.tpAutoTexture.SuspendLayout();
this.Panel15.SuspendLayout();
this.tpHeight.SuspendLayout();
this.tabHeightSetR.SuspendLayout();
this.tabHeightSetL.SuspendLayout();
this.tpResize.SuspendLayout();
this.tpObjects.SuspendLayout();
this.TableLayoutPanel1.SuspendLayout();
this.Panel1.SuspendLayout();
this.GroupBox3.SuspendLayout();
this.Panel2.SuspendLayout();
this.TabControl1.SuspendLayout();
this.TabPage1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvFeatures)).BeginInit();
this.TabPage2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvStructures)).BeginInit();
this.TabPage3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvDroids)).BeginInit();
this.tpObject.SuspendLayout();
this.TableLayoutPanel8.SuspendLayout();
this.TableLayoutPanel9.SuspendLayout();
this.Panel13.SuspendLayout();
this.Panel12.SuspendLayout();
this.Panel11.SuspendLayout();
this.Panel10.SuspendLayout();
this.Panel9.SuspendLayout();
this.Panel8.SuspendLayout();
this.Panel14.SuspendLayout();
this.tpLabels.SuspendLayout();
this.GroupBox1.SuspendLayout();
this.TableLayoutPanel7.SuspendLayout();
this.Panel7.SuspendLayout();
this.tsTools.SuspendLayout();
this.tsFile.SuspendLayout();
this.tsSelection.SuspendLayout();
this.tsMinimap.SuspendLayout();
this.menuMain.SuspendLayout();
this.TableLayoutPanel5.SuspendLayout();
this.SuspendLayout();
//
// SplitContainer1
//
this.SplitContainer1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.SplitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.SplitContainer1.Location = new System.Drawing.Point(4, 35);
this.SplitContainer1.Margin = new System.Windows.Forms.Padding(4);
this.SplitContainer1.Name = "SplitContainer1";
//
// SplitContainer1.Panel1
//
this.SplitContainer1.Panel1.Controls.Add(this.TabControl);
//
// SplitContainer1.Panel2
//
this.SplitContainer1.Panel2.BackColor = System.Drawing.SystemColors.Control;
this.SplitContainer1.Panel2.Controls.Add(this.TableLayoutPanel7);
this.SplitContainer1.Size = new System.Drawing.Size(1288, 616);
this.SplitContainer1.SplitterDistance = 422;
this.SplitContainer1.TabIndex = 0;
//
// TabControl
//
this.TabControl.Appearance = System.Windows.Forms.TabAppearance.Buttons;
this.TabControl.Controls.Add(this.tpTextures);
this.TabControl.Controls.Add(this.tpAutoTexture);
this.TabControl.Controls.Add(this.tpHeight);
this.TabControl.Controls.Add(this.tpResize);
this.TabControl.Controls.Add(this.tpObjects);
this.TabControl.Controls.Add(this.tpObject);
this.TabControl.Controls.Add(this.tpLabels);
this.TabControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.TabControl.ItemSize = new System.Drawing.Size(72, 22);
this.TabControl.Location = new System.Drawing.Point(0, 0);
this.TabControl.Margin = new System.Windows.Forms.Padding(0);
this.TabControl.Multiline = true;
this.TabControl.Name = "TabControl";
this.TabControl.Padding = new System.Drawing.Point(0, 0);
this.TabControl.SelectedIndex = 0;
this.TabControl.Size = new System.Drawing.Size(418, 612);
this.TabControl.TabIndex = 0;
//
// tpTextures
//
this.tpTextures.Controls.Add(this.TableLayoutPanel6);
this.tpTextures.Location = new System.Drawing.Point(4, 26);
this.tpTextures.Margin = new System.Windows.Forms.Padding(0);
this.tpTextures.Name = "tpTextures";
this.tpTextures.Padding = new System.Windows.Forms.Padding(4);
this.tpTextures.Size = new System.Drawing.Size(410, 582);
this.tpTextures.TabIndex = 0;
this.tpTextures.Text = "Textures";
this.tpTextures.UseVisualStyleBackColor = true;
//
// TableLayoutPanel6
//
this.TableLayoutPanel6.ColumnCount = 1;
this.TableLayoutPanel6.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.TableLayoutPanel6.Controls.Add(this.Panel5, 0, 0);
this.TableLayoutPanel6.Controls.Add(this.Panel6, 0, 2);
this.TableLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.TableLayoutPanel6.Location = new System.Drawing.Point(4, 4);
this.TableLayoutPanel6.Margin = new System.Windows.Forms.Padding(0);
this.TableLayoutPanel6.Name = "TableLayoutPanel6";
this.TableLayoutPanel6.RowCount = 3;
this.TableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 175F));
this.TableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.TableLayoutPanel6.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 79F));
this.TableLayoutPanel6.Size = new System.Drawing.Size(402, 574);
this.TableLayoutPanel6.TabIndex = 8;
//
// Panel5
//
this.Panel5.Controls.Add(this.rdoTextureRemoveTerrain);
this.Panel5.Controls.Add(this.rdoTextureReinterpretTerrain);
this.Panel5.Controls.Add(this.rdoTextureIgnoreTerrain);
this.Panel5.Controls.Add(this.pnlTextureBrush);
this.Panel5.Controls.Add(this.chkTextureOrientationRandomize);
this.Panel5.Controls.Add(this.btnTextureFlipX);
this.Panel5.Controls.Add(this.btnTextureClockwise);
this.Panel5.Controls.Add(this.btnTextureAnticlockwise);
this.Panel5.Controls.Add(this.chkSetTextureOrientation);
this.Panel5.Controls.Add(this.chkSetTexture);
this.Panel5.Controls.Add(this.Label21);
this.Panel5.Controls.Add(this.cboTileset);
this.Panel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.Panel5.Location = new System.Drawing.Point(4, 4);
this.Panel5.Margin = new System.Windows.Forms.Padding(4);
this.Panel5.Name = "Panel5";
this.Panel5.Size = new System.Drawing.Size(394, 167);
this.Panel5.TabIndex = 0;
//
// rdoTextureRemoveTerrain
//
this.rdoTextureRemoveTerrain.AutoSize = true;
this.rdoTextureRemoveTerrain.Location = new System.Drawing.Point(280, 129);
this.rdoTextureRemoveTerrain.Margin = new System.Windows.Forms.Padding(4);
this.rdoTextureRemoveTerrain.Name = "rdoTextureRemoveTerrain";
this.rdoTextureRemoveTerrain.Size = new System.Drawing.Size(103, 18);
this.rdoTextureRemoveTerrain.TabIndex = 48;
this.rdoTextureRemoveTerrain.Text = "Remove Terrain";
this.rdoTextureRemoveTerrain.UseCompatibleTextRendering = true;
this.rdoTextureRemoveTerrain.UseVisualStyleBackColor = true;
//
// rdoTextureReinterpretTerrain
//
this.rdoTextureReinterpretTerrain.AutoSize = true;
this.rdoTextureReinterpretTerrain.Checked = true;
this.rdoTextureReinterpretTerrain.Location = new System.Drawing.Point(280, 109);
this.rdoTextureReinterpretTerrain.Margin = new System.Windows.Forms.Padding(4);
this.rdoTextureReinterpretTerrain.Name = "rdoTextureReinterpretTerrain";
this.rdoTextureReinterpretTerrain.Size = new System.Drawing.Size(78, 18);
this.rdoTextureReinterpretTerrain.TabIndex = 47;
this.rdoTextureReinterpretTerrain.TabStop = true;
this.rdoTextureReinterpretTerrain.Text = "Reinterpret";
this.rdoTextureReinterpretTerrain.UseCompatibleTextRendering = true;
this.rdoTextureReinterpretTerrain.UseVisualStyleBackColor = true;
//
// rdoTextureIgnoreTerrain
//
this.rdoTextureIgnoreTerrain.AutoSize = true;
this.rdoTextureIgnoreTerrain.Location = new System.Drawing.Point(280, 87);
this.rdoTextureIgnoreTerrain.Margin = new System.Windows.Forms.Padding(4);
this.rdoTextureIgnoreTerrain.Name = "rdoTextureIgnoreTerrain";
this.rdoTextureIgnoreTerrain.Size = new System.Drawing.Size(93, 18);
this.rdoTextureIgnoreTerrain.TabIndex = 46;
this.rdoTextureIgnoreTerrain.Text = "Ignore Terrain";
this.rdoTextureIgnoreTerrain.UseCompatibleTextRendering = true;
this.rdoTextureIgnoreTerrain.UseVisualStyleBackColor = true;
//
// pnlTextureBrush
//
this.pnlTextureBrush.Location = new System.Drawing.Point(25, 44);
this.pnlTextureBrush.Name = "pnlTextureBrush";
this.pnlTextureBrush.Size = new System.Drawing.Size(341, 36);
this.pnlTextureBrush.TabIndex = 45;
//
// chkTextureOrientationRandomize
//
this.chkTextureOrientationRandomize.AutoSize = true;
this.chkTextureOrientationRandomize.Location = new System.Drawing.Point(157, 137);
this.chkTextureOrientationRandomize.Margin = new System.Windows.Forms.Padding(4);
this.chkTextureOrientationRandomize.Name = "chkTextureOrientationRandomize";
this.chkTextureOrientationRandomize.Size = new System.Drawing.Size(81, 18);
this.chkTextureOrientationRandomize.TabIndex = 44;
this.chkTextureOrientationRandomize.Text = "Randomize";
this.chkTextureOrientationRandomize.UseCompatibleTextRendering = true;
this.chkTextureOrientationRandomize.UseVisualStyleBackColor = true;
//
// btnTextureFlipX
//
this.btnTextureFlipX.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnTextureFlipX.Location = new System.Drawing.Point(237, 103);
this.btnTextureFlipX.Margin = new System.Windows.Forms.Padding(0);
this.btnTextureFlipX.Name = "btnTextureFlipX";
this.btnTextureFlipX.Size = new System.Drawing.Size(32, 30);
this.btnTextureFlipX.TabIndex = 43;
this.btnTextureFlipX.UseCompatibleTextRendering = true;
this.btnTextureFlipX.UseVisualStyleBackColor = true;
//
// btnTextureClockwise
//
this.btnTextureClockwise.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnTextureClockwise.Location = new System.Drawing.Point(197, 103);
this.btnTextureClockwise.Margin = new System.Windows.Forms.Padding(0);
this.btnTextureClockwise.Name = "btnTextureClockwise";
this.btnTextureClockwise.Size = new System.Drawing.Size(32, 30);
this.btnTextureClockwise.TabIndex = 42;
this.btnTextureClockwise.UseCompatibleTextRendering = true;
this.btnTextureClockwise.UseVisualStyleBackColor = true;
//
// btnTextureAnticlockwise
//
this.btnTextureAnticlockwise.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnTextureAnticlockwise.Location = new System.Drawing.Point(157, 103);
this.btnTextureAnticlockwise.Margin = new System.Windows.Forms.Padding(0);
this.btnTextureAnticlockwise.Name = "btnTextureAnticlockwise";
this.btnTextureAnticlockwise.Size = new System.Drawing.Size(32, 30);
this.btnTextureAnticlockwise.TabIndex = 41;
this.btnTextureAnticlockwise.UseCompatibleTextRendering = true;
this.btnTextureAnticlockwise.UseVisualStyleBackColor = true;
//
// chkSetTextureOrientation
//
this.chkSetTextureOrientation.AutoSize = true;
this.chkSetTextureOrientation.Checked = true;
this.chkSetTextureOrientation.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkSetTextureOrientation.Location = new System.Drawing.Point(25, 110);
this.chkSetTextureOrientation.Margin = new System.Windows.Forms.Padding(4);
this.chkSetTextureOrientation.Name = "chkSetTextureOrientation";
this.chkSetTextureOrientation.Size = new System.Drawing.Size(99, 18);
this.chkSetTextureOrientation.TabIndex = 40;
this.chkSetTextureOrientation.Text = "Set Orientation";
this.chkSetTextureOrientation.UseCompatibleTextRendering = true;
this.chkSetTextureOrientation.UseVisualStyleBackColor = true;
//
// chkSetTexture
//
this.chkSetTexture.AutoSize = true;
this.chkSetTexture.Checked = true;
this.chkSetTexture.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkSetTexture.Location = new System.Drawing.Point(25, 81);
this.chkSetTexture.Margin = new System.Windows.Forms.Padding(4);
this.chkSetTexture.Name = "chkSetTexture";
this.chkSetTexture.Size = new System.Drawing.Size(82, 18);
this.chkSetTexture.TabIndex = 39;
this.chkSetTexture.Text = "Set Texture";
this.chkSetTexture.UseCompatibleTextRendering = true;
this.chkSetTexture.UseVisualStyleBackColor = true;
//
// Label21
//
this.Label21.Location = new System.Drawing.Point(21, 17);
this.Label21.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label21.Name = "Label21";
this.Label21.Size = new System.Drawing.Size(64, 20);
this.Label21.TabIndex = 8;
this.Label21.Text = "Tileset:";
this.Label21.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label21.UseCompatibleTextRendering = true;
//
// cboTileset
//
this.cboTileset.DropDownHeight = 512;
this.cboTileset.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboTileset.DropDownWidth = 384;
this.cboTileset.FormattingEnabled = true;
this.cboTileset.IntegralHeight = false;
this.cboTileset.Items.AddRange(new object[] {
"Arizona",
"Urban",
"Rocky Mountains"});
this.cboTileset.Location = new System.Drawing.Point(103, 16);
this.cboTileset.Margin = new System.Windows.Forms.Padding(4);
this.cboTileset.Name = "cboTileset";
this.cboTileset.Size = new System.Drawing.Size(161, 21);
this.cboTileset.TabIndex = 0;
//
// Panel6
//
this.Panel6.Controls.Add(this.cbxTileNumbers);
this.Panel6.Controls.Add(this.cbxTileTypes);
this.Panel6.Controls.Add(this.Label20);
this.Panel6.Controls.Add(this.cboTileType);
this.Panel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.Panel6.Location = new System.Drawing.Point(4, 499);
this.Panel6.Margin = new System.Windows.Forms.Padding(4);
this.Panel6.Name = "Panel6";
this.Panel6.Size = new System.Drawing.Size(394, 71);
this.Panel6.TabIndex = 2;
//
// cbxTileNumbers
//
this.cbxTileNumbers.Location = new System.Drawing.Point(175, 37);
this.cbxTileNumbers.Margin = new System.Windows.Forms.Padding(4);
this.cbxTileNumbers.Name = "cbxTileNumbers";
this.cbxTileNumbers.Size = new System.Drawing.Size(185, 28);
this.cbxTileNumbers.TabIndex = 3;
this.cbxTileNumbers.Text = "Display Tile Numbers";
this.cbxTileNumbers.UseCompatibleTextRendering = true;
this.cbxTileNumbers.UseVisualStyleBackColor = true;
//
// cbxTileTypes
//
this.cbxTileTypes.Location = new System.Drawing.Point(8, 37);
this.cbxTileTypes.Margin = new System.Windows.Forms.Padding(4);
this.cbxTileTypes.Name = "cbxTileTypes";
this.cbxTileTypes.Size = new System.Drawing.Size(159, 28);
this.cbxTileTypes.TabIndex = 2;
this.cbxTileTypes.Text = "Display Tile Types";
this.cbxTileTypes.UseCompatibleTextRendering = true;
this.cbxTileTypes.UseVisualStyleBackColor = true;
//
// Label20
//
this.Label20.Location = new System.Drawing.Point(4, 6);
this.Label20.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label20.Name = "Label20";
this.Label20.Size = new System.Drawing.Size(91, 26);
this.Label20.TabIndex = 1;
this.Label20.Text = "Tile Type:";
this.Label20.UseCompatibleTextRendering = true;
//
// cboTileType
//
this.cboTileType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cboTileType.Enabled = false;
this.cboTileType.FormattingEnabled = true;
this.cboTileType.Location = new System.Drawing.Point(103, 4);
this.cboTileType.Margin = new System.Windows.Forms.Padding(4);
this.cboTileType.Name = "cboTileType";
this.cboTileType.Size = new System.Drawing.Size(151, 21);
this.cboTileType.TabIndex = 0;
//
// tpAutoTexture
//
this.tpAutoTexture.AutoScroll = true;
this.tpAutoTexture.Controls.Add(this.Panel15);
this.tpAutoTexture.Controls.Add(this.rdoCliffTriBrush);
this.tpAutoTexture.Controls.Add(this.rdoRoadRemove);
this.tpAutoTexture.Controls.Add(this.pnlCliffRemoveBrush);
this.tpAutoTexture.Controls.Add(this.pnlTerrainBrush);
this.tpAutoTexture.Controls.Add(this.cbxInvalidTiles);
this.tpAutoTexture.Controls.Add(this.cbxAutoTexSetHeight);
this.tpAutoTexture.Controls.Add(this.cbxCliffTris);
this.tpAutoTexture.Controls.Add(this.Label29);
this.tpAutoTexture.Controls.Add(this.rdoAutoRoadLine);
this.tpAutoTexture.Controls.Add(this.btnAutoTextureRemove);
this.tpAutoTexture.Controls.Add(this.btnAutoRoadRemove);
this.tpAutoTexture.Controls.Add(this.rdoAutoRoadPlace);
this.tpAutoTexture.Controls.Add(this.lstAutoRoad);
this.tpAutoTexture.Controls.Add(this.rdoAutoTexturePlace);
this.tpAutoTexture.Controls.Add(this.rdoAutoTextureFill);
this.tpAutoTexture.Controls.Add(this.rdoAutoCliffBrush);
this.tpAutoTexture.Controls.Add(this.rdoAutoCliffRemove);
this.tpAutoTexture.Controls.Add(this.txtAutoCliffSlope);
this.tpAutoTexture.Controls.Add(this.Label1);
this.tpAutoTexture.Controls.Add(this.lstAutoTexture);
this.tpAutoTexture.Controls.Add(this.Label3);
this.tpAutoTexture.Location = new System.Drawing.Point(4, 26);
this.tpAutoTexture.Margin = new System.Windows.Forms.Padding(4);
this.tpAutoTexture.Name = "tpAutoTexture";
this.tpAutoTexture.Size = new System.Drawing.Size(410, 582);
this.tpAutoTexture.TabIndex = 2;
this.tpAutoTexture.Text = "Terrain";
this.tpAutoTexture.UseVisualStyleBackColor = true;
//
// Panel15
//
this.Panel15.Controls.Add(this.cbxFillInside);
this.Panel15.Controls.Add(this.rdoFillCliffIgnore);
this.Panel15.Controls.Add(this.rdoFillCliffStopBefore);
this.Panel15.Controls.Add(this.rdoFillCliffStopAfter);
this.Panel15.Location = new System.Drawing.Point(73, 244);
this.Panel15.Name = "Panel15";
this.Panel15.Size = new System.Drawing.Size(313, 81);
this.Panel15.TabIndex = 53;
//
// cbxFillInside
//
this.cbxFillInside.Location = new System.Drawing.Point(135, 4);
this.cbxFillInside.Margin = new System.Windows.Forms.Padding(4);
this.cbxFillInside.Name = "cbxFillInside";
this.cbxFillInside.Size = new System.Drawing.Size(147, 21);
this.cbxFillInside.TabIndex = 54;
this.cbxFillInside.Text = "Stop Before Edge";
this.cbxFillInside.UseCompatibleTextRendering = true;
this.cbxFillInside.UseVisualStyleBackColor = true;
//
// rdoFillCliffIgnore
//
this.rdoFillCliffIgnore.AutoSize = true;
this.rdoFillCliffIgnore.Checked = true;
this.rdoFillCliffIgnore.Location = new System.Drawing.Point(4, 4);
this.rdoFillCliffIgnore.Margin = new System.Windows.Forms.Padding(4);
this.rdoFillCliffIgnore.Name = "rdoFillCliffIgnore";
this.rdoFillCliffIgnore.Size = new System.Drawing.Size(77, 18);
this.rdoFillCliffIgnore.TabIndex = 52;
this.rdoFillCliffIgnore.TabStop = true;
this.rdoFillCliffIgnore.Text = "Ignore Cliff";
this.rdoFillCliffIgnore.UseCompatibleTextRendering = true;
this.rdoFillCliffIgnore.UseVisualStyleBackColor = true;
//
// rdoFillCliffStopBefore
//
this.rdoFillCliffStopBefore.AutoSize = true;
this.rdoFillCliffStopBefore.Location = new System.Drawing.Point(4, 24);
this.rdoFillCliffStopBefore.Margin = new System.Windows.Forms.Padding(4);
this.rdoFillCliffStopBefore.Name = "rdoFillCliffStopBefore";
this.rdoFillCliffStopBefore.Size = new System.Drawing.Size(105, 18);
this.rdoFillCliffStopBefore.TabIndex = 50;
this.rdoFillCliffStopBefore.Text = "Stop Before Cliff";
this.rdoFillCliffStopBefore.UseCompatibleTextRendering = true;
this.rdoFillCliffStopBefore.UseVisualStyleBackColor = true;
//
// rdoFillCliffStopAfter
//
this.rdoFillCliffStopAfter.AutoSize = true;
this.rdoFillCliffStopAfter.Location = new System.Drawing.Point(4, 43);
this.rdoFillCliffStopAfter.Margin = new System.Windows.Forms.Padding(4);
this.rdoFillCliffStopAfter.Name = "rdoFillCliffStopAfter";
this.rdoFillCliffStopAfter.Size = new System.Drawing.Size(95, 18);
this.rdoFillCliffStopAfter.TabIndex = 51;
this.rdoFillCliffStopAfter.Text = "Stop After Cliff";
this.rdoFillCliffStopAfter.UseCompatibleTextRendering = true;
this.rdoFillCliffStopAfter.UseVisualStyleBackColor = true;
//
// rdoCliffTriBrush
//
this.rdoCliffTriBrush.AutoSize = true;
this.rdoCliffTriBrush.Location = new System.Drawing.Point(11, 491);
this.rdoCliffTriBrush.Margin = new System.Windows.Forms.Padding(4);
this.rdoCliffTriBrush.Name = "rdoCliffTriBrush";
this.rdoCliffTriBrush.Size = new System.Drawing.Size(86, 18);
this.rdoCliffTriBrush.TabIndex = 49;
this.rdoCliffTriBrush.Text = "Cliff Triangle";
this.rdoCliffTriBrush.UseCompatibleTextRendering = true;
this.rdoCliffTriBrush.UseVisualStyleBackColor = true;
//
// rdoRoadRemove
//
this.rdoRoadRemove.AutoSize = true;
this.rdoRoadRemove.Location = new System.Drawing.Point(11, 452);
this.rdoRoadRemove.Margin = new System.Windows.Forms.Padding(4);
this.rdoRoadRemove.Name = "rdoRoadRemove";
this.rdoRoadRemove.Size = new System.Drawing.Size(64, 18);
this.rdoRoadRemove.TabIndex = 48;
this.rdoRoadRemove.Text = "Remove";
this.rdoRoadRemove.UseCompatibleTextRendering = true;
this.rdoRoadRemove.UseVisualStyleBackColor = true;
//
// pnlCliffRemoveBrush
//
this.pnlCliffRemoveBrush.Location = new System.Drawing.Point(32, 598);
this.pnlCliffRemoveBrush.Name = "pnlCliffRemoveBrush";
this.pnlCliffRemoveBrush.Size = new System.Drawing.Size(341, 38);
this.pnlCliffRemoveBrush.TabIndex = 47;
//
// pnlTerrainBrush
//
this.pnlTerrainBrush.Location = new System.Drawing.Point(14, 3);
this.pnlTerrainBrush.Name = "pnlTerrainBrush";
this.pnlTerrainBrush.Size = new System.Drawing.Size(341, 38);
this.pnlTerrainBrush.TabIndex = 46;
//
// cbxInvalidTiles
//
this.cbxInvalidTiles.Checked = true;
this.cbxInvalidTiles.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbxInvalidTiles.Location = new System.Drawing.Point(183, 59);
this.cbxInvalidTiles.Margin = new System.Windows.Forms.Padding(4);
this.cbxInvalidTiles.Name = "cbxInvalidTiles";
this.cbxInvalidTiles.Size = new System.Drawing.Size(152, 21);
this.cbxInvalidTiles.TabIndex = 38;
this.cbxInvalidTiles.Text = "Make Invalid Tiles";
this.cbxInvalidTiles.UseCompatibleTextRendering = true;
this.cbxInvalidTiles.UseVisualStyleBackColor = true;
//
// cbxAutoTexSetHeight
//
this.cbxAutoTexSetHeight.Location = new System.Drawing.Point(96, 215);
this.cbxAutoTexSetHeight.Margin = new System.Windows.Forms.Padding(4);
this.cbxAutoTexSetHeight.Name = "cbxAutoTexSetHeight";
this.cbxAutoTexSetHeight.Size = new System.Drawing.Size(127, 21);
this.cbxAutoTexSetHeight.TabIndex = 36;
this.cbxAutoTexSetHeight.Text = "Set Height";
this.cbxAutoTexSetHeight.UseCompatibleTextRendering = true;
this.cbxAutoTexSetHeight.UseVisualStyleBackColor = true;
//
// cbxCliffTris
//
this.cbxCliffTris.Checked = true;
this.cbxCliffTris.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbxCliffTris.Location = new System.Drawing.Point(161, 543);
this.cbxCliffTris.Margin = new System.Windows.Forms.Padding(4);
this.cbxCliffTris.Name = "cbxCliffTris";
this.cbxCliffTris.Size = new System.Drawing.Size(127, 21);
this.cbxCliffTris.TabIndex = 35;
this.cbxCliffTris.Text = "Set Tris";
this.cbxCliffTris.UseCompatibleTextRendering = true;
this.cbxCliffTris.UseVisualStyleBackColor = true;
//
// Label29
//
this.Label29.Location = new System.Drawing.Point(11, 328);
this.Label29.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label29.Name = "Label29";
this.Label29.Size = new System.Drawing.Size(107, 20);
this.Label29.TabIndex = 33;
this.Label29.Text = "Road Type:";
this.Label29.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// rdoAutoRoadLine
//
this.rdoAutoRoadLine.AutoSize = true;
this.rdoAutoRoadLine.Location = new System.Drawing.Point(11, 423);
this.rdoAutoRoadLine.Margin = new System.Windows.Forms.Padding(4);
this.rdoAutoRoadLine.Name = "rdoAutoRoadLine";
this.rdoAutoRoadLine.Size = new System.Drawing.Size(49, 18);
this.rdoAutoRoadLine.TabIndex = 32;
this.rdoAutoRoadLine.Text = "Lines";
this.rdoAutoRoadLine.UseCompatibleTextRendering = true;
this.rdoAutoRoadLine.UseVisualStyleBackColor = true;
//
// btnAutoTextureRemove
//
this.btnAutoTextureRemove.Location = new System.Drawing.Point(178, 177);
this.btnAutoTextureRemove.Margin = new System.Windows.Forms.Padding(4);
this.btnAutoTextureRemove.Name = "btnAutoTextureRemove";
this.btnAutoTextureRemove.Size = new System.Drawing.Size(85, 30);
this.btnAutoTextureRemove.TabIndex = 31;
this.btnAutoTextureRemove.Text = "Erase";
this.btnAutoTextureRemove.UseCompatibleTextRendering = true;
this.btnAutoTextureRemove.UseVisualStyleBackColor = true;
//
// btnAutoRoadRemove
//
this.btnAutoRoadRemove.Location = new System.Drawing.Point(85, 396);
this.btnAutoRoadRemove.Margin = new System.Windows.Forms.Padding(4);
this.btnAutoRoadRemove.Name = "btnAutoRoadRemove";
this.btnAutoRoadRemove.Size = new System.Drawing.Size(85, 30);
this.btnAutoRoadRemove.TabIndex = 30;
this.btnAutoRoadRemove.Text = "Erase";
this.btnAutoRoadRemove.UseCompatibleTextRendering = true;
this.btnAutoRoadRemove.UseVisualStyleBackColor = true;
//
// rdoAutoRoadPlace
//
this.rdoAutoRoadPlace.AutoSize = true;
this.rdoAutoRoadPlace.Location = new System.Drawing.Point(11, 394);
this.rdoAutoRoadPlace.Margin = new System.Windows.Forms.Padding(4);
this.rdoAutoRoadPlace.Name = "rdoAutoRoadPlace";
this.rdoAutoRoadPlace.Size = new System.Drawing.Size(51, 18);
this.rdoAutoRoadPlace.TabIndex = 29;
this.rdoAutoRoadPlace.Text = "Sides";
this.rdoAutoRoadPlace.UseCompatibleTextRendering = true;
this.rdoAutoRoadPlace.UseVisualStyleBackColor = true;
//
// lstAutoRoad
//
this.lstAutoRoad.FormattingEnabled = true;
this.lstAutoRoad.Location = new System.Drawing.Point(11, 350);
this.lstAutoRoad.Margin = new System.Windows.Forms.Padding(4);
this.lstAutoRoad.Name = "lstAutoRoad";
this.lstAutoRoad.ScrollAlwaysVisible = true;
this.lstAutoRoad.Size = new System.Drawing.Size(159, 30);
this.lstAutoRoad.TabIndex = 27;
//
// rdoAutoTexturePlace
//
this.rdoAutoTexturePlace.AutoSize = true;
this.rdoAutoTexturePlace.Location = new System.Drawing.Point(11, 214);
this.rdoAutoTexturePlace.Margin = new System.Windows.Forms.Padding(4);
this.rdoAutoTexturePlace.Name = "rdoAutoTexturePlace";
this.rdoAutoTexturePlace.Size = new System.Drawing.Size(51, 18);
this.rdoAutoTexturePlace.TabIndex = 26;
this.rdoAutoTexturePlace.Text = "Place";
this.rdoAutoTexturePlace.UseCompatibleTextRendering = true;
this.rdoAutoTexturePlace.UseVisualStyleBackColor = true;
//
// rdoAutoTextureFill
//
this.rdoAutoTextureFill.AutoSize = true;
this.rdoAutoTextureFill.Location = new System.Drawing.Point(11, 244);
this.rdoAutoTextureFill.Margin = new System.Windows.Forms.Padding(4);
this.rdoAutoTextureFill.Name = "rdoAutoTextureFill";
this.rdoAutoTextureFill.Size = new System.Drawing.Size(37, 18);
this.rdoAutoTextureFill.TabIndex = 25;
this.rdoAutoTextureFill.Text = "Fill";
this.rdoAutoTextureFill.UseCompatibleTextRendering = true;
this.rdoAutoTextureFill.UseVisualStyleBackColor = true;
//
// rdoAutoCliffBrush
//
this.rdoAutoCliffBrush.AutoSize = true;
this.rdoAutoCliffBrush.Location = new System.Drawing.Point(11, 540);
this.rdoAutoCliffBrush.Margin = new System.Windows.Forms.Padding(4);
this.rdoAutoCliffBrush.Name = "rdoAutoCliffBrush";
this.rdoAutoCliffBrush.Size = new System.Drawing.Size(74, 18);
this.rdoAutoCliffBrush.TabIndex = 22;
this.rdoAutoCliffBrush.Text = "Cliff Brush";
this.rdoAutoCliffBrush.UseCompatibleTextRendering = true;
this.rdoAutoCliffBrush.UseVisualStyleBackColor = true;
//
// rdoAutoCliffRemove
//
this.rdoAutoCliffRemove.AutoSize = true;
this.rdoAutoCliffRemove.Location = new System.Drawing.Point(11, 570);
this.rdoAutoCliffRemove.Margin = new System.Windows.Forms.Padding(4);
this.rdoAutoCliffRemove.Name = "rdoAutoCliffRemove";
this.rdoAutoCliffRemove.Size = new System.Drawing.Size(87, 18);
this.rdoAutoCliffRemove.TabIndex = 21;
this.rdoAutoCliffRemove.Text = "Cliff Remove";
this.rdoAutoCliffRemove.UseCompatibleTextRendering = true;
this.rdoAutoCliffRemove.UseVisualStyleBackColor = true;
//
// txtAutoCliffSlope
//
this.txtAutoCliffSlope.Location = new System.Drawing.Point(117, 516);
this.txtAutoCliffSlope.Margin = new System.Windows.Forms.Padding(4);
this.txtAutoCliffSlope.Name = "txtAutoCliffSlope";
this.txtAutoCliffSlope.Size = new System.Drawing.Size(52, 20);
this.txtAutoCliffSlope.TabIndex = 7;
this.txtAutoCliffSlope.Text = "35";
this.txtAutoCliffSlope.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// Label1
//
this.Label1.Location = new System.Drawing.Point(11, 516);
this.Label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label1.Name = "Label1";
this.Label1.Size = new System.Drawing.Size(96, 20);
this.Label1.TabIndex = 6;
this.Label1.Text = "Cliff Angle";
this.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label1.UseCompatibleTextRendering = true;
//
// lstAutoTexture
//
this.lstAutoTexture.FormattingEnabled = true;
this.lstAutoTexture.Location = new System.Drawing.Point(11, 59);
this.lstAutoTexture.Margin = new System.Windows.Forms.Padding(4);
this.lstAutoTexture.Name = "lstAutoTexture";
this.lstAutoTexture.ScrollAlwaysVisible = true;
this.lstAutoTexture.Size = new System.Drawing.Size(159, 147);
this.lstAutoTexture.TabIndex = 4;
//
// Label3
//
this.Label3.Location = new System.Drawing.Point(11, 39);
this.Label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label3.Name = "Label3";
this.Label3.Size = new System.Drawing.Size(107, 20);
this.Label3.TabIndex = 3;
this.Label3.Text = "Ground Type";
this.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.Label3.UseCompatibleTextRendering = true;
//
// tpHeight
//
this.tpHeight.AutoScroll = true;
this.tpHeight.Controls.Add(this.cbxHeightChangeFade);
this.tpHeight.Controls.Add(this.pnlHeightSetBrush);
this.tpHeight.Controls.Add(this.btnHeightsMultiplySelection);
this.tpHeight.Controls.Add(this.btnHeightOffsetSelection);
this.tpHeight.Controls.Add(this.tabHeightSetR);
this.tpHeight.Controls.Add(this.tabHeightSetL);
this.tpHeight.Controls.Add(this.txtHeightSetR);
this.tpHeight.Controls.Add(this.Label27);
this.tpHeight.Controls.Add(this.Label10);
this.tpHeight.Controls.Add(this.txtHeightOffset);
this.tpHeight.Controls.Add(this.Label9);
this.tpHeight.Controls.Add(this.txtHeightMultiply);
this.tpHeight.Controls.Add(this.txtHeightChangeRate);
this.tpHeight.Controls.Add(this.Label18);
this.tpHeight.Controls.Add(this.rdoHeightChange);
this.tpHeight.Controls.Add(this.Label16);
this.tpHeight.Controls.Add(this.txtSmoothRate);
this.tpHeight.Controls.Add(this.Label6);
this.tpHeight.Controls.Add(this.rdoHeightSmooth);
this.tpHeight.Controls.Add(this.rdoHeightSet);
this.tpHeight.Controls.Add(this.txtHeightSetL);
this.tpHeight.Controls.Add(this.Label5);
this.tpHeight.Location = new System.Drawing.Point(4, 26);
this.tpHeight.Margin = new System.Windows.Forms.Padding(4);
this.tpHeight.Name = "tpHeight";
this.tpHeight.Padding = new System.Windows.Forms.Padding(4);
this.tpHeight.Size = new System.Drawing.Size(410, 582);
this.tpHeight.TabIndex = 1;
this.tpHeight.Text = "Height";
this.tpHeight.UseVisualStyleBackColor = true;
//
// cbxHeightChangeFade
//
this.cbxHeightChangeFade.Checked = true;
this.cbxHeightChangeFade.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbxHeightChangeFade.Location = new System.Drawing.Point(177, 248);
this.cbxHeightChangeFade.Margin = new System.Windows.Forms.Padding(4);
this.cbxHeightChangeFade.Name = "cbxHeightChangeFade";
this.cbxHeightChangeFade.Size = new System.Drawing.Size(152, 21);
this.cbxHeightChangeFade.TabIndex = 47;
this.cbxHeightChangeFade.Text = "Fading";
this.cbxHeightChangeFade.UseCompatibleTextRendering = true;
this.cbxHeightChangeFade.UseVisualStyleBackColor = true;
//
// pnlHeightSetBrush
//
this.pnlHeightSetBrush.Location = new System.Drawing.Point(29, 8);
this.pnlHeightSetBrush.Name = "pnlHeightSetBrush";
this.pnlHeightSetBrush.Size = new System.Drawing.Size(341, 38);
this.pnlHeightSetBrush.TabIndex = 46;
//
// btnHeightsMultiplySelection
//
this.btnHeightsMultiplySelection.Location = new System.Drawing.Point(121, 383);
this.btnHeightsMultiplySelection.Margin = new System.Windows.Forms.Padding(4);
this.btnHeightsMultiplySelection.Name = "btnHeightsMultiplySelection";
this.btnHeightsMultiplySelection.Size = new System.Drawing.Size(75, 30);
this.btnHeightsMultiplySelection.TabIndex = 38;
this.btnHeightsMultiplySelection.Text = "Do";
this.btnHeightsMultiplySelection.UseVisualStyleBackColor = true;
//
// btnHeightOffsetSelection
//
this.btnHeightOffsetSelection.Location = new System.Drawing.Point(121, 452);
this.btnHeightOffsetSelection.Margin = new System.Windows.Forms.Padding(4);
this.btnHeightOffsetSelection.Name = "btnHeightOffsetSelection";
this.btnHeightOffsetSelection.Size = new System.Drawing.Size(75, 30);
this.btnHeightOffsetSelection.TabIndex = 37;
this.btnHeightOffsetSelection.Text = "Do";
this.btnHeightOffsetSelection.UseVisualStyleBackColor = true;
//
// tabHeightSetR
//
this.tabHeightSetR.Appearance = System.Windows.Forms.TabAppearance.Buttons;
this.tabHeightSetR.Controls.Add(this.TabPage25);
this.tabHeightSetR.Controls.Add(this.TabPage26);
this.tabHeightSetR.Controls.Add(this.TabPage27);
this.tabHeightSetR.Controls.Add(this.TabPage28);
this.tabHeightSetR.Controls.Add(this.TabPage29);
this.tabHeightSetR.Controls.Add(this.TabPage30);
this.tabHeightSetR.Controls.Add(this.TabPage31);
this.tabHeightSetR.Controls.Add(this.TabPage32);
this.tabHeightSetR.ItemSize = new System.Drawing.Size(28, 20);
this.tabHeightSetR.Location = new System.Drawing.Point(29, 169);
this.tabHeightSetR.Margin = new System.Windows.Forms.Padding(0);
this.tabHeightSetR.Multiline = true;
this.tabHeightSetR.Name = "tabHeightSetR";
this.tabHeightSetR.Padding = new System.Drawing.Point(0, 0);
this.tabHeightSetR.SelectedIndex = 0;
this.tabHeightSetR.Size = new System.Drawing.Size(439, 25);
this.tabHeightSetR.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
this.tabHeightSetR.TabIndex = 35;
//
// TabPage25
//
this.TabPage25.Location = new System.Drawing.Point(4, 24);
this.TabPage25.Margin = new System.Windows.Forms.Padding(4);
this.TabPage25.Name = "TabPage25";
this.TabPage25.Padding = new System.Windows.Forms.Padding(4);
this.TabPage25.Size = new System.Drawing.Size(431, 0);
this.TabPage25.TabIndex = 0;
this.TabPage25.Text = "1";
this.TabPage25.UseVisualStyleBackColor = true;
//
// TabPage26
//
this.TabPage26.Location = new System.Drawing.Point(4, 24);
this.TabPage26.Margin = new System.Windows.Forms.Padding(4);
this.TabPage26.Name = "TabPage26";
this.TabPage26.Padding = new System.Windows.Forms.Padding(4);
this.TabPage26.Size = new System.Drawing.Size(431, 0);
this.TabPage26.TabIndex = 1;
this.TabPage26.Text = "2";
this.TabPage26.UseVisualStyleBackColor = true;
//
// TabPage27
//
this.TabPage27.Location = new System.Drawing.Point(4, 24);
this.TabPage27.Margin = new System.Windows.Forms.Padding(4);
this.TabPage27.Name = "TabPage27";
this.TabPage27.Size = new System.Drawing.Size(431, 0);
this.TabPage27.TabIndex = 2;
this.TabPage27.Text = "3";
this.TabPage27.UseVisualStyleBackColor = true;
//
// TabPage28
//
this.TabPage28.Location = new System.Drawing.Point(4, 24);
this.TabPage28.Margin = new System.Windows.Forms.Padding(4);
this.TabPage28.Name = "TabPage28";
this.TabPage28.Size = new System.Drawing.Size(431, 0);
this.TabPage28.TabIndex = 3;
this.TabPage28.Text = "4";
this.TabPage28.UseVisualStyleBackColor = true;
//
// TabPage29
//
this.TabPage29.Location = new System.Drawing.Point(4, 24);
this.TabPage29.Margin = new System.Windows.Forms.Padding(4);
this.TabPage29.Name = "TabPage29";
this.TabPage29.Size = new System.Drawing.Size(431, 0);
this.TabPage29.TabIndex = 4;
this.TabPage29.Text = "5";
this.TabPage29.UseVisualStyleBackColor = true;
//
// TabPage30
//
this.TabPage30.Location = new System.Drawing.Point(4, 24);
this.TabPage30.Margin = new System.Windows.Forms.Padding(4);
this.TabPage30.Name = "TabPage30";
this.TabPage30.Size = new System.Drawing.Size(431, 0);
this.TabPage30.TabIndex = 5;
this.TabPage30.Text = "6";
this.TabPage30.UseVisualStyleBackColor = true;
//
// TabPage31
//
this.TabPage31.Location = new System.Drawing.Point(4, 24);
this.TabPage31.Margin = new System.Windows.Forms.Padding(4);
this.TabPage31.Name = "TabPage31";
this.TabPage31.Size = new System.Drawing.Size(431, 0);
this.TabPage31.TabIndex = 6;
this.TabPage31.Text = "7";
this.TabPage31.UseVisualStyleBackColor = true;
//
// TabPage32
//
this.TabPage32.Location = new System.Drawing.Point(4, 24);
this.TabPage32.Margin = new System.Windows.Forms.Padding(4);
this.TabPage32.Name = "TabPage32";
this.TabPage32.Size = new System.Drawing.Size(431, 0);
this.TabPage32.TabIndex = 7;
this.TabPage32.Text = "8";
this.TabPage32.UseVisualStyleBackColor = true;
//
// tabHeightSetL
//
this.tabHeightSetL.Appearance = System.Windows.Forms.TabAppearance.Buttons;
this.tabHeightSetL.Controls.Add(this.TabPage9);
this.tabHeightSetL.Controls.Add(this.TabPage10);
this.tabHeightSetL.Controls.Add(this.TabPage11);
this.tabHeightSetL.Controls.Add(this.TabPage12);
this.tabHeightSetL.Controls.Add(this.TabPage17);
this.tabHeightSetL.Controls.Add(this.TabPage18);
this.tabHeightSetL.Controls.Add(this.TabPage19);
this.tabHeightSetL.Controls.Add(this.TabPage20);
this.tabHeightSetL.ItemSize = new System.Drawing.Size(28, 20);
this.tabHeightSetL.Location = new System.Drawing.Point(29, 107);
this.tabHeightSetL.Margin = new System.Windows.Forms.Padding(0);
this.tabHeightSetL.Multiline = true;
this.tabHeightSetL.Name = "tabHeightSetL";
this.tabHeightSetL.Padding = new System.Drawing.Point(0, 0);
this.tabHeightSetL.SelectedIndex = 0;
this.tabHeightSetL.Size = new System.Drawing.Size(439, 25);
this.tabHeightSetL.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
this.tabHeightSetL.TabIndex = 34;
//
// TabPage9
//
this.TabPage9.Location = new System.Drawing.Point(4, 24);
this.TabPage9.Margin = new System.Windows.Forms.Padding(4);
this.TabPage9.Name = "TabPage9";
this.TabPage9.Padding = new System.Windows.Forms.Padding(4);
this.TabPage9.Size = new System.Drawing.Size(431, 0);
this.TabPage9.TabIndex = 0;
this.TabPage9.Text = "1";
this.TabPage9.UseVisualStyleBackColor = true;
//
// TabPage10
//
this.TabPage10.Location = new System.Drawing.Point(4, 24);
this.TabPage10.Margin = new System.Windows.Forms.Padding(4);
this.TabPage10.Name = "TabPage10";
this.TabPage10.Padding = new System.Windows.Forms.Padding(4);
this.TabPage10.Size = new System.Drawing.Size(431, 0);
this.TabPage10.TabIndex = 1;
this.TabPage10.Text = "2";
this.TabPage10.UseVisualStyleBackColor = true;
//
// TabPage11
//
this.TabPage11.Location = new System.Drawing.Point(4, 24);
this.TabPage11.Margin = new System.Windows.Forms.Padding(4);
this.TabPage11.Name = "TabPage11";
this.TabPage11.Size = new System.Drawing.Size(431, 0);
this.TabPage11.TabIndex = 2;
this.TabPage11.Text = "3";
this.TabPage11.UseVisualStyleBackColor = true;
//
// TabPage12
//
this.TabPage12.Location = new System.Drawing.Point(4, 24);
this.TabPage12.Margin = new System.Windows.Forms.Padding(4);
this.TabPage12.Name = "TabPage12";
this.TabPage12.Size = new System.Drawing.Size(431, 0);
this.TabPage12.TabIndex = 3;
this.TabPage12.Text = "4";
this.TabPage12.UseVisualStyleBackColor = true;
//
// TabPage17
//
this.TabPage17.Location = new System.Drawing.Point(4, 24);
this.TabPage17.Margin = new System.Windows.Forms.Padding(4);
this.TabPage17.Name = "TabPage17";
this.TabPage17.Size = new System.Drawing.Size(431, 0);
this.TabPage17.TabIndex = 4;
this.TabPage17.Text = "5";
this.TabPage17.UseVisualStyleBackColor = true;
//
// TabPage18
//
this.TabPage18.Location = new System.Drawing.Point(4, 24);
this.TabPage18.Margin = new System.Windows.Forms.Padding(4);
this.TabPage18.Name = "TabPage18";
this.TabPage18.Size = new System.Drawing.Size(431, 0);
this.TabPage18.TabIndex = 5;
this.TabPage18.Text = "6";
this.TabPage18.UseVisualStyleBackColor = true;
//
// TabPage19
//
this.TabPage19.Location = new System.Drawing.Point(4, 24);
this.TabPage19.Margin = new System.Windows.Forms.Padding(4);
this.TabPage19.Name = "TabPage19";
this.TabPage19.Size = new System.Drawing.Size(431, 0);
this.TabPage19.TabIndex = 6;
this.TabPage19.Text = "7";
this.TabPage19.UseVisualStyleBackColor = true;
//
// TabPage20
//
this.TabPage20.Location = new System.Drawing.Point(4, 24);
this.TabPage20.Margin = new System.Windows.Forms.Padding(4);
this.TabPage20.Name = "TabPage20";
this.TabPage20.Size = new System.Drawing.Size(431, 0);
this.TabPage20.TabIndex = 7;
this.TabPage20.Text = "8";
this.TabPage20.UseVisualStyleBackColor = true;
//
// txtHeightSetR
//
this.txtHeightSetR.Location = new System.Drawing.Point(121, 140);
this.txtHeightSetR.Margin = new System.Windows.Forms.Padding(4);
this.txtHeightSetR.Name = "txtHeightSetR";
this.txtHeightSetR.Size = new System.Drawing.Size(73, 20);
this.txtHeightSetR.TabIndex = 31;
this.txtHeightSetR.Text = "#";
this.txtHeightSetR.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// Label27
//
this.Label27.Location = new System.Drawing.Point(11, 140);
this.Label27.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label27.Name = "Label27";
this.Label27.Size = new System.Drawing.Size(99, 20);
this.Label27.TabIndex = 30;
this.Label27.Text = "RMB Height";
this.Label27.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label27.UseCompatibleTextRendering = true;
//
// Label10
//
this.Label10.Location = new System.Drawing.Point(15, 431);
this.Label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label10.Name = "Label10";
this.Label10.Size = new System.Drawing.Size(209, 17);
this.Label10.TabIndex = 29;
this.Label10.Text = "Offset Heights of Selection";
this.Label10.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtHeightOffset
//
this.txtHeightOffset.Location = new System.Drawing.Point(19, 455);
this.txtHeightOffset.Margin = new System.Windows.Forms.Padding(4);
this.txtHeightOffset.Name = "txtHeightOffset";
this.txtHeightOffset.Size = new System.Drawing.Size(89, 20);
this.txtHeightOffset.TabIndex = 27;
this.txtHeightOffset.Text = "0";
this.txtHeightOffset.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// Label9
//
this.Label9.Location = new System.Drawing.Point(11, 359);
this.Label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label9.Name = "Label9";
this.Label9.Size = new System.Drawing.Size(209, 20);
this.Label9.TabIndex = 25;
this.Label9.Text = "Multiply Heights of Selection";
this.Label9.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.Label9.UseCompatibleTextRendering = true;
//
// txtHeightMultiply
//
this.txtHeightMultiply.Location = new System.Drawing.Point(19, 386);
this.txtHeightMultiply.Margin = new System.Windows.Forms.Padding(4);
this.txtHeightMultiply.Name = "txtHeightMultiply";
this.txtHeightMultiply.Size = new System.Drawing.Size(89, 20);
this.txtHeightMultiply.TabIndex = 24;
this.txtHeightMultiply.Text = "1";
this.txtHeightMultiply.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// txtHeightChangeRate
//
this.txtHeightChangeRate.Location = new System.Drawing.Point(96, 246);
this.txtHeightChangeRate.Margin = new System.Windows.Forms.Padding(4);
this.txtHeightChangeRate.Name = "txtHeightChangeRate";
this.txtHeightChangeRate.Size = new System.Drawing.Size(73, 20);
this.txtHeightChangeRate.TabIndex = 23;
this.txtHeightChangeRate.Text = "16";
this.txtHeightChangeRate.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// Label18
//
this.Label18.Location = new System.Drawing.Point(11, 246);
this.Label18.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label18.Name = "Label18";
this.Label18.Size = new System.Drawing.Size(75, 20);
this.Label18.TabIndex = 22;
this.Label18.Text = "Rate";
this.Label18.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label18.UseCompatibleTextRendering = true;
//
// rdoHeightChange
//
this.rdoHeightChange.AutoSize = true;
this.rdoHeightChange.Location = new System.Drawing.Point(11, 217);
this.rdoHeightChange.Margin = new System.Windows.Forms.Padding(4);
this.rdoHeightChange.Name = "rdoHeightChange";
this.rdoHeightChange.Size = new System.Drawing.Size(62, 18);
this.rdoHeightChange.TabIndex = 21;
this.rdoHeightChange.Text = "Change";
this.rdoHeightChange.UseCompatibleTextRendering = true;
this.rdoHeightChange.UseVisualStyleBackColor = true;
//
// Label16
//
this.Label16.Location = new System.Drawing.Point(121, 49);
this.Label16.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label16.Name = "Label16";
this.Label16.Size = new System.Drawing.Size(75, 21);
this.Label16.TabIndex = 20;
this.Label16.Text = "(0-255)";
this.Label16.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label16.UseCompatibleTextRendering = true;
//
// txtSmoothRate
//
this.txtSmoothRate.Location = new System.Drawing.Point(100, 311);
this.txtSmoothRate.Margin = new System.Windows.Forms.Padding(4);
this.txtSmoothRate.Name = "txtSmoothRate";
this.txtSmoothRate.Size = new System.Drawing.Size(73, 20);
this.txtSmoothRate.TabIndex = 10;
this.txtSmoothRate.Text = "3";
this.txtSmoothRate.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// Label6
//
this.Label6.Location = new System.Drawing.Point(15, 311);
this.Label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label6.Name = "Label6";
this.Label6.Size = new System.Drawing.Size(75, 20);
this.Label6.TabIndex = 9;
this.Label6.Text = "Rate";
this.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label6.UseCompatibleTextRendering = true;
//
// rdoHeightSmooth
//
this.rdoHeightSmooth.AutoSize = true;
this.rdoHeightSmooth.Location = new System.Drawing.Point(11, 286);
this.rdoHeightSmooth.Margin = new System.Windows.Forms.Padding(4);
this.rdoHeightSmooth.Name = "rdoHeightSmooth";
this.rdoHeightSmooth.Size = new System.Drawing.Size(61, 18);
this.rdoHeightSmooth.TabIndex = 8;
this.rdoHeightSmooth.Text = "Smooth";
this.rdoHeightSmooth.UseCompatibleTextRendering = true;
this.rdoHeightSmooth.UseVisualStyleBackColor = true;
//
// rdoHeightSet
//
this.rdoHeightSet.AutoSize = true;
this.rdoHeightSet.Checked = true;
this.rdoHeightSet.Location = new System.Drawing.Point(11, 49);
this.rdoHeightSet.Margin = new System.Windows.Forms.Padding(4);
this.rdoHeightSet.Name = "rdoHeightSet";
this.rdoHeightSet.Size = new System.Drawing.Size(39, 18);
this.rdoHeightSet.TabIndex = 7;
this.rdoHeightSet.TabStop = true;
this.rdoHeightSet.Text = "Set";
this.rdoHeightSet.UseCompatibleTextRendering = true;
this.rdoHeightSet.UseVisualStyleBackColor = true;
//
// txtHeightSetL
//
this.txtHeightSetL.Location = new System.Drawing.Point(121, 79);
this.txtHeightSetL.Margin = new System.Windows.Forms.Padding(4);
this.txtHeightSetL.Name = "txtHeightSetL";
this.txtHeightSetL.Size = new System.Drawing.Size(73, 20);
this.txtHeightSetL.TabIndex = 6;
this.txtHeightSetL.Text = "#";
this.txtHeightSetL.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// Label5
//
this.Label5.Location = new System.Drawing.Point(11, 79);
this.Label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label5.Name = "Label5";
this.Label5.Size = new System.Drawing.Size(99, 20);
this.Label5.TabIndex = 5;
this.Label5.Text = "LMB Height";
this.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label5.UseCompatibleTextRendering = true;
//
// tpResize
//
this.tpResize.Controls.Add(this.btnSelResize);
this.tpResize.Controls.Add(this.btnResize);
this.tpResize.Controls.Add(this.txtOffsetY);
this.tpResize.Controls.Add(this.Label15);
this.tpResize.Controls.Add(this.txtOffsetX);
this.tpResize.Controls.Add(this.Label14);
this.tpResize.Controls.Add(this.txtSizeY);
this.tpResize.Controls.Add(this.Label13);
this.tpResize.Controls.Add(this.txtSizeX);
this.tpResize.Controls.Add(this.Label12);
this.tpResize.Location = new System.Drawing.Point(4, 26);
this.tpResize.Margin = new System.Windows.Forms.Padding(4);
this.tpResize.Name = "tpResize";
this.tpResize.Size = new System.Drawing.Size(410, 582);
this.tpResize.TabIndex = 4;
this.tpResize.Text = "Resize";
this.tpResize.UseVisualStyleBackColor = true;
//
// btnSelResize
//
this.btnSelResize.Location = new System.Drawing.Point(21, 175);
this.btnSelResize.Margin = new System.Windows.Forms.Padding(4);
this.btnSelResize.Name = "btnSelResize";
this.btnSelResize.Size = new System.Drawing.Size(180, 30);
this.btnSelResize.TabIndex = 17;
this.btnSelResize.Text = "Resize To Selection";
this.btnSelResize.UseCompatibleTextRendering = true;
this.btnSelResize.UseVisualStyleBackColor = true;
//
// btnResize
//
this.btnResize.Location = new System.Drawing.Point(21, 138);
this.btnResize.Margin = new System.Windows.Forms.Padding(4);
this.btnResize.Name = "btnResize";
this.btnResize.Size = new System.Drawing.Size(148, 30);
this.btnResize.TabIndex = 16;
this.btnResize.Text = "Resize";
this.btnResize.UseCompatibleTextRendering = true;
this.btnResize.UseVisualStyleBackColor = true;
//
// txtOffsetY
//
this.txtOffsetY.Location = new System.Drawing.Point(117, 98);
this.txtOffsetY.Margin = new System.Windows.Forms.Padding(4);
this.txtOffsetY.Name = "txtOffsetY";
this.txtOffsetY.Size = new System.Drawing.Size(52, 20);
this.txtOffsetY.TabIndex = 15;
this.txtOffsetY.Text = "0";
//
// Label15
//
this.Label15.Location = new System.Drawing.Point(11, 98);
this.Label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label15.Name = "Label15";
this.Label15.Size = new System.Drawing.Size(96, 20);
this.Label15.TabIndex = 14;
this.Label15.Text = "Offset Y";
this.Label15.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label15.UseCompatibleTextRendering = true;
//
// txtOffsetX
//
this.txtOffsetX.Location = new System.Drawing.Point(117, 69);
this.txtOffsetX.Margin = new System.Windows.Forms.Padding(4);
this.txtOffsetX.Name = "txtOffsetX";
this.txtOffsetX.Size = new System.Drawing.Size(52, 20);
this.txtOffsetX.TabIndex = 13;
this.txtOffsetX.Text = "0";
//
// Label14
//
this.Label14.Location = new System.Drawing.Point(11, 69);
this.Label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label14.Name = "Label14";
this.Label14.Size = new System.Drawing.Size(96, 20);
this.Label14.TabIndex = 12;
this.Label14.Text = "Offset X";
this.Label14.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label14.UseCompatibleTextRendering = true;
//
// txtSizeY
//
this.txtSizeY.Location = new System.Drawing.Point(117, 39);
this.txtSizeY.Margin = new System.Windows.Forms.Padding(4);
this.txtSizeY.Name = "txtSizeY";
this.txtSizeY.Size = new System.Drawing.Size(52, 20);
this.txtSizeY.TabIndex = 11;
this.txtSizeY.Text = "0";
//
// Label13
//
this.Label13.Location = new System.Drawing.Point(11, 39);
this.Label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label13.Name = "Label13";
this.Label13.Size = new System.Drawing.Size(96, 20);
this.Label13.TabIndex = 10;
this.Label13.Text = "Size Y";
this.Label13.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label13.UseCompatibleTextRendering = true;
//
// txtSizeX
//
this.txtSizeX.Location = new System.Drawing.Point(117, 10);
this.txtSizeX.Margin = new System.Windows.Forms.Padding(4);
this.txtSizeX.Name = "txtSizeX";
this.txtSizeX.Size = new System.Drawing.Size(52, 20);
this.txtSizeX.TabIndex = 9;
this.txtSizeX.Text = "0";
//
// Label12
//
this.Label12.Location = new System.Drawing.Point(11, 10);
this.Label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label12.Name = "Label12";
this.Label12.Size = new System.Drawing.Size(96, 20);
this.Label12.TabIndex = 8;
this.Label12.Text = "Size X";
this.Label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label12.UseCompatibleTextRendering = true;
//
// tpObjects
//
this.tpObjects.AutoScroll = true;
this.tpObjects.Controls.Add(this.TableLayoutPanel1);
this.tpObjects.Location = new System.Drawing.Point(4, 26);
this.tpObjects.Margin = new System.Windows.Forms.Padding(4);
this.tpObjects.Name = "tpObjects";
this.tpObjects.Size = new System.Drawing.Size(410, 582);
this.tpObjects.TabIndex = 5;
this.tpObjects.Text = "Place Objects";
this.tpObjects.UseVisualStyleBackColor = true;
//
// TableLayoutPanel1
//
this.TableLayoutPanel1.ColumnCount = 1;
this.TableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.TableLayoutPanel1.Controls.Add(this.Panel1, 0, 0);
this.TableLayoutPanel1.Controls.Add(this.Panel2, 0, 1);
this.TableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.TableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.TableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4);
this.TableLayoutPanel1.Name = "TableLayoutPanel1";
this.TableLayoutPanel1.RowCount = 2;
this.TableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 192F));
this.TableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.TableLayoutPanel1.Size = new System.Drawing.Size(410, 582);
this.TableLayoutPanel1.TabIndex = 16;
//
// Panel1
//
this.Panel1.Controls.Add(this.btnPlayerSelectObjects);
this.Panel1.Controls.Add(this.Label44);
this.Panel1.Controls.Add(this.GroupBox3);
this.Panel1.Controls.Add(this.txtObjectFind);
this.Panel1.Controls.Add(this.cbxFootprintRotate);
this.Panel1.Controls.Add(this.txtNewObjectRotation);
this.Panel1.Controls.Add(this.Label19);
this.Panel1.Controls.Add(this.cbxAutoWalls);
this.Panel1.Controls.Add(this.cbxObjectRandomRotation);
this.Panel1.Controls.Add(this.Label32);
this.Panel1.Controls.Add(this.Label22);
this.Panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.Panel1.Location = new System.Drawing.Point(4, 4);
this.Panel1.Margin = new System.Windows.Forms.Padding(4);
this.Panel1.Name = "Panel1";
this.Panel1.Size = new System.Drawing.Size(402, 184);
this.Panel1.TabIndex = 0;
//
// btnPlayerSelectObjects
//
this.btnPlayerSelectObjects.Location = new System.Drawing.Point(282, 10);
this.btnPlayerSelectObjects.Name = "btnPlayerSelectObjects";
this.btnPlayerSelectObjects.Size = new System.Drawing.Size(111, 35);
this.btnPlayerSelectObjects.TabIndex = 17;
this.btnPlayerSelectObjects.Text = "Select All";
this.btnPlayerSelectObjects.UseCompatibleTextRendering = true;
this.btnPlayerSelectObjects.UseVisualStyleBackColor = true;
//
// Label44
//
this.Label44.Location = new System.Drawing.Point(3, 163);
this.Label44.Name = "Label44";
this.Label44.Size = new System.Drawing.Size(38, 21);
this.Label44.TabIndex = 57;
this.Label44.Text = "Find:";
this.Label44.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label44.UseCompatibleTextRendering = true;
//
// GroupBox3
//
this.GroupBox3.Controls.Add(this.rdoObjectPlace);
this.GroupBox3.Controls.Add(this.rdoObjectLines);
this.GroupBox3.Location = new System.Drawing.Point(282, 51);
this.GroupBox3.Name = "GroupBox3";
this.GroupBox3.Size = new System.Drawing.Size(120, 75);
this.GroupBox3.TabIndex = 56;
this.GroupBox3.TabStop = false;
this.GroupBox3.Text = "Tool";
this.GroupBox3.UseCompatibleTextRendering = true;
//
// rdoObjectPlace
//
this.rdoObjectPlace.AutoSize = true;
this.rdoObjectPlace.Checked = true;
this.rdoObjectPlace.Location = new System.Drawing.Point(7, 22);
this.rdoObjectPlace.Margin = new System.Windows.Forms.Padding(4);
this.rdoObjectPlace.Name = "rdoObjectPlace";
this.rdoObjectPlace.Size = new System.Drawing.Size(51, 18);
this.rdoObjectPlace.TabIndex = 54;
this.rdoObjectPlace.TabStop = true;
this.rdoObjectPlace.Text = "Place";
this.rdoObjectPlace.UseCompatibleTextRendering = true;
this.rdoObjectPlace.UseVisualStyleBackColor = true;
//
// rdoObjectLines
//
this.rdoObjectLines.AutoSize = true;
this.rdoObjectLines.Location = new System.Drawing.Point(7, 47);
this.rdoObjectLines.Margin = new System.Windows.Forms.Padding(4);
this.rdoObjectLines.Name = "rdoObjectLines";
this.rdoObjectLines.Size = new System.Drawing.Size(49, 18);
this.rdoObjectLines.TabIndex = 55;
this.rdoObjectLines.Text = "Lines";
this.rdoObjectLines.UseCompatibleTextRendering = true;
this.rdoObjectLines.UseVisualStyleBackColor = true;
//
// txtObjectFind
//
this.txtObjectFind.Location = new System.Drawing.Point(47, 160);
this.txtObjectFind.Name = "txtObjectFind";
this.txtObjectFind.Size = new System.Drawing.Size(175, 20);
this.txtObjectFind.TabIndex = 53;
//
// cbxFootprintRotate
//
this.cbxFootprintRotate.Location = new System.Drawing.Point(244, 133);
this.cbxFootprintRotate.Margin = new System.Windows.Forms.Padding(4);
this.cbxFootprintRotate.Name = "cbxFootprintRotate";
this.cbxFootprintRotate.Size = new System.Drawing.Size(201, 21);
this.cbxFootprintRotate.TabIndex = 52;
this.cbxFootprintRotate.Text = "Rotate Footprints (3.1+)";
this.cbxFootprintRotate.UseCompatibleTextRendering = true;
this.cbxFootprintRotate.UseVisualStyleBackColor = true;
//
// txtNewObjectRotation
//
this.txtNewObjectRotation.Location = new System.Drawing.Point(85, 122);
this.txtNewObjectRotation.Margin = new System.Windows.Forms.Padding(4);
this.txtNewObjectRotation.Name = "txtNewObjectRotation";
this.txtNewObjectRotation.Size = new System.Drawing.Size(41, 20);
this.txtNewObjectRotation.TabIndex = 51;
this.txtNewObjectRotation.Text = "0";
this.txtNewObjectRotation.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// Label19
//
this.Label19.Location = new System.Drawing.Point(16, 125);
this.Label19.Name = "Label19";
this.Label19.Size = new System.Drawing.Size(62, 21);
this.Label19.TabIndex = 50;
this.Label19.Text = "Rotation:";
this.Label19.UseCompatibleTextRendering = true;
//
// cbxAutoWalls
//
this.cbxAutoWalls.Location = new System.Drawing.Point(244, 161);
this.cbxAutoWalls.Margin = new System.Windows.Forms.Padding(4);
this.cbxAutoWalls.Name = "cbxAutoWalls";
this.cbxAutoWalls.Size = new System.Drawing.Size(152, 21);
this.cbxAutoWalls.TabIndex = 49;
this.cbxAutoWalls.Text = "Automatic Walls";
this.cbxAutoWalls.UseCompatibleTextRendering = true;
this.cbxAutoWalls.UseVisualStyleBackColor = true;
//
// cbxObjectRandomRotation
//
this.cbxObjectRandomRotation.Location = new System.Drawing.Point(134, 124);
this.cbxObjectRandomRotation.Margin = new System.Windows.Forms.Padding(4);
this.cbxObjectRandomRotation.Name = "cbxObjectRandomRotation";
this.cbxObjectRandomRotation.Size = new System.Drawing.Size(89, 21);
this.cbxObjectRandomRotation.TabIndex = 48;
this.cbxObjectRandomRotation.Text = "Random";
this.cbxObjectRandomRotation.UseCompatibleTextRendering = true;
this.cbxObjectRandomRotation.UseVisualStyleBackColor = true;
//
// Label32
//
this.Label32.Location = new System.Drawing.Point(16, 82);
this.Label32.Name = "Label32";
this.Label32.Size = new System.Drawing.Size(219, 38);
this.Label32.TabIndex = 16;
this.Label32.Text = "Players 8 and 9 only work with versions 3.1+";
this.Label32.UseCompatibleTextRendering = true;
//
// Label22
//
this.Label22.Location = new System.Drawing.Point(16, 10);
this.Label22.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label22.Name = "Label22";
this.Label22.Size = new System.Drawing.Size(85, 25);
this.Label22.TabIndex = 14;
this.Label22.Text = "Player";
this.Label22.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.Label22.UseCompatibleTextRendering = true;
//
// Panel2
//
this.Panel2.Controls.Add(this.btnObjectTypeSelect);
this.Panel2.Controls.Add(this.TabControl1);
this.Panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.Panel2.Location = new System.Drawing.Point(3, 195);
this.Panel2.Name = "Panel2";
this.Panel2.Size = new System.Drawing.Size(404, 384);
this.Panel2.TabIndex = 1;
//
// btnObjectTypeSelect
//
this.btnObjectTypeSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnObjectTypeSelect.Location = new System.Drawing.Point(313, 0);
this.btnObjectTypeSelect.Name = "btnObjectTypeSelect";
this.btnObjectTypeSelect.Size = new System.Drawing.Size(90, 28);
this.btnObjectTypeSelect.TabIndex = 58;
this.btnObjectTypeSelect.Text = "Select";
this.btnObjectTypeSelect.UseCompatibleTextRendering = true;
this.btnObjectTypeSelect.UseVisualStyleBackColor = true;
//
// TabControl1
//
this.TabControl1.Appearance = System.Windows.Forms.TabAppearance.Buttons;
this.TabControl1.Controls.Add(this.TabPage1);
this.TabControl1.Controls.Add(this.TabPage2);
this.TabControl1.Controls.Add(this.TabPage3);
this.TabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.TabControl1.Location = new System.Drawing.Point(0, 0);
this.TabControl1.Name = "TabControl1";
this.TabControl1.SelectedIndex = 0;
this.TabControl1.Size = new System.Drawing.Size(404, 384);
this.TabControl1.TabIndex = 0;
//
// TabPage1
//
this.TabPage1.Controls.Add(this.dgvFeatures);
this.TabPage1.Location = new System.Drawing.Point(4, 25);
this.TabPage1.Name = "TabPage1";
this.TabPage1.Size = new System.Drawing.Size(396, 355);
this.TabPage1.TabIndex = 0;
this.TabPage1.Text = "Features";
this.TabPage1.UseVisualStyleBackColor = true;
//
// dgvFeatures
//
this.dgvFeatures.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.dgvFeatures.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvFeatures.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvFeatures.Location = new System.Drawing.Point(0, 0);
this.dgvFeatures.Name = "dgvFeatures";
this.dgvFeatures.ReadOnly = true;
this.dgvFeatures.RowHeadersVisible = false;
this.dgvFeatures.RowTemplate.Height = 24;
this.dgvFeatures.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvFeatures.Size = new System.Drawing.Size(396, 355);
this.dgvFeatures.TabIndex = 0;
//
// TabPage2
//
this.TabPage2.Controls.Add(this.dgvStructures);
this.TabPage2.Location = new System.Drawing.Point(4, 25);
this.TabPage2.Name = "TabPage2";
this.TabPage2.Size = new System.Drawing.Size(396, 330);
this.TabPage2.TabIndex = 1;
this.TabPage2.Text = "Structures";
this.TabPage2.UseVisualStyleBackColor = true;
//
// dgvStructures
//
this.dgvStructures.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.dgvStructures.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvStructures.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvStructures.Location = new System.Drawing.Point(0, 0);
this.dgvStructures.Name = "dgvStructures";
this.dgvStructures.ReadOnly = true;
this.dgvStructures.RowHeadersVisible = false;
this.dgvStructures.RowTemplate.Height = 24;
this.dgvStructures.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvStructures.Size = new System.Drawing.Size(396, 330);
this.dgvStructures.TabIndex = 1;
//
// TabPage3
//
this.TabPage3.Controls.Add(this.dgvDroids);
this.TabPage3.Location = new System.Drawing.Point(4, 25);
this.TabPage3.Name = "TabPage3";
this.TabPage3.Size = new System.Drawing.Size(396, 330);
this.TabPage3.TabIndex = 2;
this.TabPage3.Text = "Droids";
this.TabPage3.UseVisualStyleBackColor = true;
//
// dgvDroids
//
this.dgvDroids.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
this.dgvDroids.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvDroids.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvDroids.Location = new System.Drawing.Point(0, 0);
this.dgvDroids.Name = "dgvDroids";
this.dgvDroids.ReadOnly = true;
this.dgvDroids.RowHeadersVisible = false;
this.dgvDroids.RowTemplate.Height = 24;
this.dgvDroids.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvDroids.Size = new System.Drawing.Size(396, 330);
this.dgvDroids.TabIndex = 1;
//
// tpObject
//
this.tpObject.Controls.Add(this.TableLayoutPanel8);
this.tpObject.Location = new System.Drawing.Point(4, 26);
this.tpObject.Margin = new System.Windows.Forms.Padding(4);
this.tpObject.Name = "tpObject";
this.tpObject.Size = new System.Drawing.Size(410, 582);
this.tpObject.TabIndex = 6;
this.tpObject.Text = "Object";
this.tpObject.UseVisualStyleBackColor = true;
//
// TableLayoutPanel8
//
this.TableLayoutPanel8.ColumnCount = 1;
this.TableLayoutPanel8.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.TableLayoutPanel8.Controls.Add(this.TableLayoutPanel9, 0, 1);
this.TableLayoutPanel8.Controls.Add(this.Panel14, 0, 0);
this.TableLayoutPanel8.Dock = System.Windows.Forms.DockStyle.Fill;
this.TableLayoutPanel8.Location = new System.Drawing.Point(0, 0);
this.TableLayoutPanel8.Name = "TableLayoutPanel8";
this.TableLayoutPanel8.RowCount = 3;
this.TableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 350F));
this.TableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 192F));
this.TableLayoutPanel8.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.TableLayoutPanel8.Size = new System.Drawing.Size(410, 582);
this.TableLayoutPanel8.TabIndex = 55;
//
// TableLayoutPanel9
//
this.TableLayoutPanel9.ColumnCount = 2;
this.TableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 96F));
this.TableLayoutPanel9.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.TableLayoutPanel9.Controls.Add(this.cboDroidTurret3, 1, 5);
this.TableLayoutPanel9.Controls.Add(this.cboDroidTurret2, 1, 4);
this.TableLayoutPanel9.Controls.Add(this.Panel13, 0, 5);
this.TableLayoutPanel9.Controls.Add(this.cboDroidTurret1, 1, 3);
this.TableLayoutPanel9.Controls.Add(this.cboDroidPropulsion, 1, 2);
this.TableLayoutPanel9.Controls.Add(this.cboDroidBody, 1, 1);
this.TableLayoutPanel9.Controls.Add(this.cboDroidType, 1, 0);
this.TableLayoutPanel9.Controls.Add(this.Panel12, 0, 4);
this.TableLayoutPanel9.Controls.Add(this.Panel11, 0, 3);
this.TableLayoutPanel9.Controls.Add(this.Panel10, 0, 2);
this.TableLayoutPanel9.Controls.Add(this.Panel9, 0, 1);
this.TableLayoutPanel9.Controls.Add(this.Panel8, 0, 0);
this.TableLayoutPanel9.Dock = System.Windows.Forms.DockStyle.Fill;
this.TableLayoutPanel9.Location = new System.Drawing.Point(3, 353);
this.TableLayoutPanel9.Name = "TableLayoutPanel9";
this.TableLayoutPanel9.RowCount = 6;
this.TableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66417F));
this.TableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66717F));
this.TableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66717F));
this.TableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66717F));
this.TableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66717F));
this.TableLayoutPanel9.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66717F));
this.TableLayoutPanel9.Size = new System.Drawing.Size(404, 186);
this.TableLayoutPanel9.TabIndex = 0;
//
// cboDroidTurret3
//
this.cboDroidTurret3.Dock = System.Windows.Forms.DockStyle.Fill;
this.cboDroidTurret3.DropDownHeight = 512;
this.cboDroidTurret3.DropDownWidth = 384;
this.cboDroidTurret3.FormattingEnabled = true;
this.cboDroidTurret3.IntegralHeight = false;
this.cboDroidTurret3.Location = new System.Drawing.Point(100, 158);
this.cboDroidTurret3.Margin = new System.Windows.Forms.Padding(4);
this.cboDroidTurret3.Name = "cboDroidTurret3";
this.cboDroidTurret3.Size = new System.Drawing.Size(300, 21);
this.cboDroidTurret3.TabIndex = 48;
//
// cboDroidTurret2
//
this.cboDroidTurret2.Dock = System.Windows.Forms.DockStyle.Fill;
this.cboDroidTurret2.DropDownHeight = 512;
this.cboDroidTurret2.DropDownWidth = 384;
this.cboDroidTurret2.FormattingEnabled = true;
this.cboDroidTurret2.IntegralHeight = false;
this.cboDroidTurret2.Location = new System.Drawing.Point(100, 127);
this.cboDroidTurret2.Margin = new System.Windows.Forms.Padding(4);
this.cboDroidTurret2.Name = "cboDroidTurret2";
this.cboDroidTurret2.Size = new System.Drawing.Size(300, 21);
this.cboDroidTurret2.TabIndex = 47;
//
// Panel13
//
this.Panel13.Controls.Add(this.rdoDroidTurret3);
this.Panel13.Dock = System.Windows.Forms.DockStyle.Fill;
this.Panel13.Location = new System.Drawing.Point(3, 157);
this.Panel13.Name = "Panel13";
this.Panel13.Size = new System.Drawing.Size(90, 26);
this.Panel13.TabIndex = 5;
//
// rdoDroidTurret3
//
this.rdoDroidTurret3.AutoSize = true;
this.rdoDroidTurret3.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.rdoDroidTurret3.Location = new System.Drawing.Point(48, 2);
this.rdoDroidTurret3.Name = "rdoDroidTurret3";
this.rdoDroidTurret3.Size = new System.Drawing.Size(28, 18);
this.rdoDroidTurret3.TabIndex = 51;
this.rdoDroidTurret3.TabStop = true;
this.rdoDroidTurret3.Text = "3";
this.rdoDroidTurret3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.rdoDroidTurret3.UseCompatibleTextRendering = true;
this.rdoDroidTurret3.UseVisualStyleBackColor = true;
//
// cboDroidTurret1
//
this.cboDroidTurret1.Dock = System.Windows.Forms.DockStyle.Fill;
this.cboDroidTurret1.DropDownHeight = 512;
this.cboDroidTurret1.DropDownWidth = 384;
this.cboDroidTurret1.FormattingEnabled = true;
this.cboDroidTurret1.IntegralHeight = false;
this.cboDroidTurret1.Location = new System.Drawing.Point(100, 96);
this.cboDroidTurret1.Margin = new System.Windows.Forms.Padding(4);
this.cboDroidTurret1.Name = "cboDroidTurret1";
this.cboDroidTurret1.Size = new System.Drawing.Size(300, 21);
this.cboDroidTurret1.TabIndex = 45;
//
// cboDroidPropulsion
//
this.cboDroidPropulsion.Dock = System.Windows.Forms.DockStyle.Fill;
this.cboDroidPropulsion.DropDownHeight = 512;
this.cboDroidPropulsion.DropDownWidth = 384;
this.cboDroidPropulsion.FormattingEnabled = true;
this.cboDroidPropulsion.IntegralHeight = false;
this.cboDroidPropulsion.Location = new System.Drawing.Point(100, 65);
this.cboDroidPropulsion.Margin = new System.Windows.Forms.Padding(4);
this.cboDroidPropulsion.Name = "cboDroidPropulsion";
this.cboDroidPropulsion.Size = new System.Drawing.Size(300, 21);
this.cboDroidPropulsion.TabIndex = 43;
//
// cboDroidBody
//
this.cboDroidBody.Dock = System.Windows.Forms.DockStyle.Fill;
this.cboDroidBody.DropDownHeight = 512;
this.cboDroidBody.DropDownWidth = 384;
this.cboDroidBody.FormattingEnabled = true;
this.cboDroidBody.IntegralHeight = false;
this.cboDroidBody.Location = new System.Drawing.Point(100, 34);
this.cboDroidBody.Margin = new System.Windows.Forms.Padding(4);
this.cboDroidBody.Name = "cboDroidBody";
this.cboDroidBody.Size = new System.Drawing.Size(300, 21);
this.cboDroidBody.TabIndex = 41;
//
// cboDroidType
//
this.cboDroidType.Dock = System.Windows.Forms.DockStyle.Fill;
this.cboDroidType.DropDownHeight = 512;
this.cboDroidType.DropDownWidth = 384;
this.cboDroidType.FormattingEnabled = true;
this.cboDroidType.IntegralHeight = false;
this.cboDroidType.Location = new System.Drawing.Point(100, 4);
this.cboDroidType.Margin = new System.Windows.Forms.Padding(4);
this.cboDroidType.Name = "cboDroidType";
this.cboDroidType.Size = new System.Drawing.Size(300, 21);
this.cboDroidType.TabIndex = 52;
//
// Panel12
//
this.Panel12.Controls.Add(this.rdoDroidTurret0);
this.Panel12.Controls.Add(this.rdoDroidTurret2);
this.Panel12.Dock = System.Windows.Forms.DockStyle.Fill;
this.Panel12.Location = new System.Drawing.Point(3, 126);
this.Panel12.Name = "Panel12";
this.Panel12.Size = new System.Drawing.Size(90, 25);
this.Panel12.TabIndex = 4;
//
// rdoDroidTurret0
//
this.rdoDroidTurret0.AutoSize = true;
this.rdoDroidTurret0.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.rdoDroidTurret0.Location = new System.Drawing.Point(7, 1);
this.rdoDroidTurret0.Name = "rdoDroidTurret0";
this.rdoDroidTurret0.Size = new System.Drawing.Size(28, 18);
this.rdoDroidTurret0.TabIndex = 54;
this.rdoDroidTurret0.TabStop = true;
this.rdoDroidTurret0.Text = "0";
this.rdoDroidTurret0.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.rdoDroidTurret0.UseCompatibleTextRendering = true;
this.rdoDroidTurret0.UseVisualStyleBackColor = true;
//
// rdoDroidTurret2
//
this.rdoDroidTurret2.AutoSize = true;
this.rdoDroidTurret2.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.rdoDroidTurret2.Location = new System.Drawing.Point(48, 1);
this.rdoDroidTurret2.Name = "rdoDroidTurret2";
this.rdoDroidTurret2.Size = new System.Drawing.Size(28, 18);
this.rdoDroidTurret2.TabIndex = 50;
this.rdoDroidTurret2.TabStop = true;
this.rdoDroidTurret2.Text = "2";
this.rdoDroidTurret2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.rdoDroidTurret2.UseCompatibleTextRendering = true;
this.rdoDroidTurret2.UseVisualStyleBackColor = true;
//
// Panel11
//
this.Panel11.Controls.Add(this.Label39);
this.Panel11.Controls.Add(this.rdoDroidTurret1);
this.Panel11.Dock = System.Windows.Forms.DockStyle.Fill;
this.Panel11.Location = new System.Drawing.Point(3, 95);
this.Panel11.Name = "Panel11";
this.Panel11.Size = new System.Drawing.Size(90, 25);
this.Panel11.TabIndex = 3;
//
// Label39
//
this.Label39.Location = new System.Drawing.Point(0, 0);
this.Label39.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label39.Name = "Label39";
this.Label39.Size = new System.Drawing.Size(49, 25);
this.Label39.TabIndex = 46;
this.Label39.Text = "Turrets";
this.Label39.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label39.UseCompatibleTextRendering = true;
//
// rdoDroidTurret1
//
this.rdoDroidTurret1.AutoSize = true;
this.rdoDroidTurret1.CheckAlign = System.Drawing.ContentAlignment.MiddleRight;
this.rdoDroidTurret1.Location = new System.Drawing.Point(49, 1);
this.rdoDroidTurret1.Name = "rdoDroidTurret1";
this.rdoDroidTurret1.Size = new System.Drawing.Size(28, 18);
this.rdoDroidTurret1.TabIndex = 49;
this.rdoDroidTurret1.TabStop = true;
this.rdoDroidTurret1.Text = "1";
this.rdoDroidTurret1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.rdoDroidTurret1.UseCompatibleTextRendering = true;
this.rdoDroidTurret1.UseVisualStyleBackColor = true;
//
// Panel10
//
this.Panel10.Controls.Add(this.Label38);
this.Panel10.Dock = System.Windows.Forms.DockStyle.Fill;
this.Panel10.Location = new System.Drawing.Point(3, 64);
this.Panel10.Name = "Panel10";
this.Panel10.Size = new System.Drawing.Size(90, 25);
this.Panel10.TabIndex = 2;
//
// Label38
//
this.Label38.Location = new System.Drawing.Point(7, 1);
this.Label38.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label38.Name = "Label38";
this.Label38.Size = new System.Drawing.Size(75, 25);
this.Label38.TabIndex = 44;
this.Label38.Text = "Propulsion";
this.Label38.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label38.UseCompatibleTextRendering = true;
//
// Panel9
//
this.Panel9.Controls.Add(this.Label37);
this.Panel9.Dock = System.Windows.Forms.DockStyle.Fill;
this.Panel9.Location = new System.Drawing.Point(3, 33);
this.Panel9.Name = "Panel9";
this.Panel9.Size = new System.Drawing.Size(90, 25);
this.Panel9.TabIndex = 1;
//
// Label37
//
this.Label37.Location = new System.Drawing.Point(8, 1);
this.Label37.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label37.Name = "Label37";
this.Label37.Size = new System.Drawing.Size(75, 25);
this.Label37.TabIndex = 42;
this.Label37.Text = "Body";
this.Label37.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label37.UseCompatibleTextRendering = true;
//
// Panel8
//
this.Panel8.Controls.Add(this.Label40);
this.Panel8.Dock = System.Windows.Forms.DockStyle.Fill;
this.Panel8.Location = new System.Drawing.Point(3, 3);
this.Panel8.Name = "Panel8";
this.Panel8.Size = new System.Drawing.Size(90, 24);
this.Panel8.TabIndex = 0;
//
// Label40
//
this.Label40.Location = new System.Drawing.Point(8, 0);
this.Label40.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label40.Name = "Label40";
this.Label40.Size = new System.Drawing.Size(75, 25);
this.Label40.TabIndex = 53;
this.Label40.Text = "Type";
this.Label40.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label40.UseCompatibleTextRendering = true;
//
// Panel14
//
this.Panel14.Controls.Add(this.btnFlatSelected);
this.Panel14.Controls.Add(this.btnAlignObjects);
this.Panel14.Controls.Add(this.Label31);
this.Panel14.Controls.Add(this.Label30);
this.Panel14.Controls.Add(this.cbxDesignableOnly);
this.Panel14.Controls.Add(this.Label17);
this.Panel14.Controls.Add(this.txtObjectLabel);
this.Panel14.Controls.Add(this.Label35);
this.Panel14.Controls.Add(this.btnDroidToDesign);
this.Panel14.Controls.Add(this.Label24);
this.Panel14.Controls.Add(this.lblObjectType);
this.Panel14.Controls.Add(this.Label36);
this.Panel14.Controls.Add(this.Label23);
this.Panel14.Controls.Add(this.txtObjectHealth);
this.Panel14.Controls.Add(this.txtObjectRotation);
this.Panel14.Controls.Add(this.Label34);
this.Panel14.Controls.Add(this.Label28);
this.Panel14.Controls.Add(this.txtObjectPriority);
this.Panel14.Controls.Add(this.Label25);
this.Panel14.Controls.Add(this.Label33);
this.Panel14.Controls.Add(this.txtObjectID);
this.Panel14.Controls.Add(this.Label26);
this.Panel14.Dock = System.Windows.Forms.DockStyle.Fill;
this.Panel14.Location = new System.Drawing.Point(3, 3);
this.Panel14.Name = "Panel14";
this.Panel14.Size = new System.Drawing.Size(404, 344);
this.Panel14.TabIndex = 1;
//
// btnFlatSelected
//
this.btnFlatSelected.Location = new System.Drawing.Point(238, 147);
this.btnFlatSelected.Margin = new System.Windows.Forms.Padding(4);
this.btnFlatSelected.Name = "btnFlatSelected";
this.btnFlatSelected.Size = new System.Drawing.Size(120, 30);
this.btnFlatSelected.TabIndex = 7;
this.btnFlatSelected.Text = "Flatten Terrain";
this.btnFlatSelected.UseCompatibleTextRendering = true;
this.btnFlatSelected.UseVisualStyleBackColor = true;
//
// btnAlignObjects
//
this.btnAlignObjects.Location = new System.Drawing.Point(238, 117);
this.btnAlignObjects.Margin = new System.Windows.Forms.Padding(4);
this.btnAlignObjects.Name = "btnAlignObjects";
this.btnAlignObjects.Size = new System.Drawing.Size(120, 30);
this.btnAlignObjects.TabIndex = 6;
this.btnAlignObjects.Text = "Realign";
this.btnAlignObjects.UseCompatibleTextRendering = true;
this.btnAlignObjects.UseVisualStyleBackColor = true;
//
// Label31
//
this.Label31.Location = new System.Drawing.Point(238, 179);
this.Label31.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label31.Name = "Label31";
this.Label31.Size = new System.Drawing.Size(83, 27);
this.Label31.TabIndex = 46;
this.Label31.Text = "3.1+ only";
this.Label31.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.Label31.UseCompatibleTextRendering = true;
//
// Label30
//
this.Label30.Location = new System.Drawing.Point(153, 213);
this.Label30.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label30.Name = "Label30";
this.Label30.Size = new System.Drawing.Size(88, 27);
this.Label30.TabIndex = 45;
this.Label30.Text = "2.3 only";
this.Label30.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.Label30.UseCompatibleTextRendering = true;
//
// cbxDesignableOnly
//
this.cbxDesignableOnly.AutoSize = true;
this.cbxDesignableOnly.Checked = true;
this.cbxDesignableOnly.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbxDesignableOnly.Location = new System.Drawing.Point(258, 310);
this.cbxDesignableOnly.Name = "cbxDesignableOnly";
this.cbxDesignableOnly.Size = new System.Drawing.Size(112, 18);
this.cbxDesignableOnly.TabIndex = 44;
this.cbxDesignableOnly.Text = "Designables Only";
this.cbxDesignableOnly.UseCompatibleTextRendering = true;
this.cbxDesignableOnly.UseVisualStyleBackColor = true;
//
// Label17
//
this.Label17.Location = new System.Drawing.Point(21, 180);
this.Label17.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label17.Name = "Label17";
this.Label17.Size = new System.Drawing.Size(62, 25);
this.Label17.TabIndex = 43;
this.Label17.Text = "Label:";
this.Label17.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label17.UseCompatibleTextRendering = true;
//
// txtObjectLabel
//
this.txtObjectLabel.Location = new System.Drawing.Point(91, 181);
this.txtObjectLabel.Margin = new System.Windows.Forms.Padding(4);
this.txtObjectLabel.Name = "txtObjectLabel";
this.txtObjectLabel.Size = new System.Drawing.Size(137, 20);
this.txtObjectLabel.TabIndex = 42;
//
// Label35
//
this.Label35.Location = new System.Drawing.Point(153, 243);
this.Label35.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label35.Name = "Label35";
this.Label35.Size = new System.Drawing.Size(88, 27);
this.Label35.TabIndex = 41;
this.Label35.Text = "3.1+ only";
this.Label35.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.Label35.UseCompatibleTextRendering = true;
//
// btnDroidToDesign
//
this.btnDroidToDesign.Location = new System.Drawing.Point(21, 300);
this.btnDroidToDesign.Name = "btnDroidToDesign";
this.btnDroidToDesign.Size = new System.Drawing.Size(231, 31);
this.btnDroidToDesign.TabIndex = 40;
this.btnDroidToDesign.Text = "Convert Templates To Design";
this.btnDroidToDesign.UseCompatibleTextRendering = true;
this.btnDroidToDesign.UseVisualStyleBackColor = true;
//
// Label24
//
this.Label24.Location = new System.Drawing.Point(4, 9);
this.Label24.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label24.Name = "Label24";
this.Label24.Size = new System.Drawing.Size(107, 20);
this.Label24.TabIndex = 18;
this.Label24.Text = "Type:";
this.Label24.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.Label24.UseCompatibleTextRendering = true;
//
// lblObjectType
//
this.lblObjectType.Location = new System.Drawing.Point(4, 29);
this.lblObjectType.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.lblObjectType.Name = "lblObjectType";
this.lblObjectType.Size = new System.Drawing.Size(304, 26);
this.lblObjectType.TabIndex = 20;
this.lblObjectType.Text = "Object Type";
this.lblObjectType.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.lblObjectType.UseCompatibleTextRendering = true;
//
// Label36
//
this.Label36.Location = new System.Drawing.Point(21, 270);
this.Label36.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label36.Name = "Label36";
this.Label36.Size = new System.Drawing.Size(300, 27);
this.Label36.TabIndex = 39;
this.Label36.Text = "Designed droids will only exist in 3.1+";
this.Label36.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.Label36.UseCompatibleTextRendering = true;
//
// Label23
//
this.Label23.Location = new System.Drawing.Point(8, 120);
this.Label23.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label23.Name = "Label23";
this.Label23.Size = new System.Drawing.Size(75, 25);
this.Label23.TabIndex = 21;
this.Label23.Text = "Rotation:";
this.Label23.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label23.UseCompatibleTextRendering = true;
//
// txtObjectHealth
//
this.txtObjectHealth.Location = new System.Drawing.Point(91, 245);
this.txtObjectHealth.Margin = new System.Windows.Forms.Padding(4);
this.txtObjectHealth.Name = "txtObjectHealth";
this.txtObjectHealth.Size = new System.Drawing.Size(54, 20);
this.txtObjectHealth.TabIndex = 37;
this.txtObjectHealth.Text = "#";
this.txtObjectHealth.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// txtObjectRotation
//
this.txtObjectRotation.Location = new System.Drawing.Point(91, 121);
this.txtObjectRotation.Margin = new System.Windows.Forms.Padding(4);
this.txtObjectRotation.Name = "txtObjectRotation";
this.txtObjectRotation.Size = new System.Drawing.Size(41, 20);
this.txtObjectRotation.TabIndex = 25;
this.txtObjectRotation.Text = "#";
this.txtObjectRotation.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// Label34
//
this.Label34.Location = new System.Drawing.Point(20, 244);
this.Label34.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label34.Name = "Label34";
this.Label34.Size = new System.Drawing.Size(63, 25);
this.Label34.TabIndex = 36;
this.Label34.Text = "Health %";
this.Label34.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label34.UseCompatibleTextRendering = true;
//
// Label28
//
this.Label28.Location = new System.Drawing.Point(4, 58);
this.Label28.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label28.Name = "Label28";
this.Label28.Size = new System.Drawing.Size(53, 25);
this.Label28.TabIndex = 28;
this.Label28.Text = "Player:";
this.Label28.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.Label28.UseCompatibleTextRendering = true;
//
// txtObjectPriority
//
this.txtObjectPriority.Location = new System.Drawing.Point(91, 215);
this.txtObjectPriority.Margin = new System.Windows.Forms.Padding(4);
this.txtObjectPriority.Name = "txtObjectPriority";
this.txtObjectPriority.Size = new System.Drawing.Size(54, 20);
this.txtObjectPriority.TabIndex = 35;
this.txtObjectPriority.Text = "#";
this.txtObjectPriority.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// Label25
//
this.Label25.Location = new System.Drawing.Point(47, 150);
this.Label25.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label25.Name = "Label25";
this.Label25.Size = new System.Drawing.Size(36, 25);
this.Label25.TabIndex = 30;
this.Label25.Text = "ID:";
this.Label25.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label25.UseCompatibleTextRendering = true;
//
// Label33
//
this.Label33.Location = new System.Drawing.Point(20, 214);
this.Label33.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label33.Name = "Label33";
this.Label33.Size = new System.Drawing.Size(63, 25);
this.Label33.TabIndex = 34;
this.Label33.Text = "Priority:";
this.Label33.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.Label33.UseCompatibleTextRendering = true;
//
// txtObjectID
//
this.txtObjectID.Location = new System.Drawing.Point(91, 151);
this.txtObjectID.Margin = new System.Windows.Forms.Padding(4);
this.txtObjectID.Name = "txtObjectID";
this.txtObjectID.Size = new System.Drawing.Size(80, 20);
this.txtObjectID.TabIndex = 31;
this.txtObjectID.Text = "#";
this.txtObjectID.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// Label26
//
this.Label26.Location = new System.Drawing.Point(140, 120);
this.Label26.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label26.Name = "Label26";
this.Label26.Size = new System.Drawing.Size(88, 25);
this.Label26.TabIndex = 33;
this.Label26.Text = "(0-359)";
this.Label26.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.Label26.UseCompatibleTextRendering = true;
//
// tpLabels
//
this.tpLabels.Controls.Add(this.Label11);
this.tpLabels.Controls.Add(this.Label43);
this.tpLabels.Controls.Add(this.Label42);
this.tpLabels.Controls.Add(this.lstScriptAreas);
this.tpLabels.Controls.Add(this.lstScriptPositions);
this.tpLabels.Controls.Add(this.btnScriptAreaCreate);
this.tpLabels.Controls.Add(this.GroupBox1);
this.tpLabels.Location = new System.Drawing.Point(4, 26);
this.tpLabels.Name = "tpLabels";
this.tpLabels.Size = new System.Drawing.Size(410, 582);
this.tpLabels.TabIndex = 7;
this.tpLabels.Text = "Labels";
this.tpLabels.UseVisualStyleBackColor = true;
//
// Label11
//
this.Label11.Location = new System.Drawing.Point(238, 11);
this.Label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label11.Name = "Label11";
this.Label11.Size = new System.Drawing.Size(142, 55);
this.Label11.TabIndex = 53;
this.Label11.Text = "Hold P and click to make positions.";
this.Label11.UseCompatibleTextRendering = true;
//
// Label43
//
this.Label43.AutoSize = true;
this.Label43.Location = new System.Drawing.Point(203, 66);
this.Label43.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label43.Name = "Label43";
this.Label43.Size = new System.Drawing.Size(37, 17);
this.Label43.TabIndex = 52;
this.Label43.Text = "Areas:";
this.Label43.UseCompatibleTextRendering = true;
//
// Label42
//
this.Label42.AutoSize = true;
this.Label42.Location = new System.Drawing.Point(18, 66);
this.Label42.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label42.Name = "Label42";
this.Label42.Size = new System.Drawing.Size(53, 17);
this.Label42.TabIndex = 51;
this.Label42.Text = "Positions:";
this.Label42.UseCompatibleTextRendering = true;
//
// lstScriptAreas
//
this.lstScriptAreas.FormattingEnabled = true;
this.lstScriptAreas.Location = new System.Drawing.Point(202, 89);
this.lstScriptAreas.Name = "lstScriptAreas";
this.lstScriptAreas.Size = new System.Drawing.Size(178, 147);
this.lstScriptAreas.TabIndex = 47;
//
// lstScriptPositions
//
this.lstScriptPositions.FormattingEnabled = true;
this.lstScriptPositions.Location = new System.Drawing.Point(18, 89);
this.lstScriptPositions.Name = "lstScriptPositions";
this.lstScriptPositions.Size = new System.Drawing.Size(178, 147);
this.lstScriptPositions.TabIndex = 46;
//
// btnScriptAreaCreate
//
this.btnScriptAreaCreate.Location = new System.Drawing.Point(18, 20);
this.btnScriptAreaCreate.Name = "btnScriptAreaCreate";
this.btnScriptAreaCreate.Size = new System.Drawing.Size(201, 31);
this.btnScriptAreaCreate.TabIndex = 45;
this.btnScriptAreaCreate.Text = "Create Area From Selection";
this.btnScriptAreaCreate.UseCompatibleTextRendering = true;
this.btnScriptAreaCreate.UseVisualStyleBackColor = true;
//
// GroupBox1
//
this.GroupBox1.Controls.Add(this.txtScriptMarkerLabel);
this.GroupBox1.Controls.Add(this.Label41);
this.GroupBox1.Controls.Add(this.btnScriptMarkerRemove);
this.GroupBox1.Controls.Add(this.Label2);
this.GroupBox1.Controls.Add(this.txtScriptMarkerY);
this.GroupBox1.Controls.Add(this.txtScriptMarkerX);
this.GroupBox1.Controls.Add(this.Label7);
this.GroupBox1.Controls.Add(this.txtScriptMarkerY2);
this.GroupBox1.Controls.Add(this.Label4);
this.GroupBox1.Controls.Add(this.Label8);
this.GroupBox1.Controls.Add(this.txtScriptMarkerX2);
this.GroupBox1.Location = new System.Drawing.Point(18, 243);
this.GroupBox1.Name = "GroupBox1";
this.GroupBox1.Size = new System.Drawing.Size(178, 231);
this.GroupBox1.TabIndex = 44;
this.GroupBox1.TabStop = false;
this.GroupBox1.Text = "Selected Marker";
this.GroupBox1.UseCompatibleTextRendering = true;
//
// txtScriptMarkerLabel
//
this.txtScriptMarkerLabel.Location = new System.Drawing.Point(56, 32);
this.txtScriptMarkerLabel.Margin = new System.Windows.Forms.Padding(4);
this.txtScriptMarkerLabel.Name = "txtScriptMarkerLabel";
this.txtScriptMarkerLabel.Size = new System.Drawing.Size(96, 20);
this.txtScriptMarkerLabel.TabIndex = 50;
//
// Label41
//
this.Label41.AutoSize = true;
this.Label41.Location = new System.Drawing.Point(7, 35);
this.Label41.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label41.Name = "Label41";
this.Label41.Size = new System.Drawing.Size(35, 17);
this.Label41.TabIndex = 49;
this.Label41.Text = "Label:";
this.Label41.UseCompatibleTextRendering = true;
//
// btnScriptMarkerRemove
//
this.btnScriptMarkerRemove.Location = new System.Drawing.Point(10, 185);
this.btnScriptMarkerRemove.Name = "btnScriptMarkerRemove";
this.btnScriptMarkerRemove.Size = new System.Drawing.Size(142, 31);
this.btnScriptMarkerRemove.TabIndex = 48;
this.btnScriptMarkerRemove.Text = "Remove";
this.btnScriptMarkerRemove.UseCompatibleTextRendering = true;
this.btnScriptMarkerRemove.UseVisualStyleBackColor = true;
//
// Label2
//
this.Label2.AutoSize = true;
this.Label2.Location = new System.Drawing.Point(22, 66);
this.Label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label2.Name = "Label2";
this.Label2.Size = new System.Drawing.Size(13, 17);
this.Label2.TabIndex = 33;
this.Label2.Text = "x:";
this.Label2.UseCompatibleTextRendering = true;
//
// txtScriptMarkerY
//
this.txtScriptMarkerY.Location = new System.Drawing.Point(91, 87);
this.txtScriptMarkerY.Margin = new System.Windows.Forms.Padding(4);
this.txtScriptMarkerY.Name = "txtScriptMarkerY";
this.txtScriptMarkerY.Size = new System.Drawing.Size(61, 20);
this.txtScriptMarkerY.TabIndex = 34;
//
// txtScriptMarkerX
//
this.txtScriptMarkerX.Location = new System.Drawing.Point(22, 87);
this.txtScriptMarkerX.Margin = new System.Windows.Forms.Padding(4);
this.txtScriptMarkerX.Name = "txtScriptMarkerX";
this.txtScriptMarkerX.Size = new System.Drawing.Size(61, 20);
this.txtScriptMarkerX.TabIndex = 32;
//
// Label7
//
this.Label7.AutoSize = true;
this.Label7.Location = new System.Drawing.Point(91, 66);
this.Label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label7.Name = "Label7";
this.Label7.Size = new System.Drawing.Size(13, 17);
this.Label7.TabIndex = 35;
this.Label7.Text = "y:";
this.Label7.UseCompatibleTextRendering = true;
//
// txtScriptMarkerY2
//
this.txtScriptMarkerY2.Location = new System.Drawing.Point(91, 143);
this.txtScriptMarkerY2.Margin = new System.Windows.Forms.Padding(4);
this.txtScriptMarkerY2.Name = "txtScriptMarkerY2";
this.txtScriptMarkerY2.Size = new System.Drawing.Size(61, 20);
this.txtScriptMarkerY2.TabIndex = 38;
//
// Label4
//
this.Label4.AutoSize = true;
this.Label4.Location = new System.Drawing.Point(91, 122);
this.Label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label4.Name = "Label4";
this.Label4.Size = new System.Drawing.Size(19, 17);
this.Label4.TabIndex = 39;
this.Label4.Text = "y2:";
this.Label4.UseCompatibleTextRendering = true;
//
// Label8
//
this.Label8.AutoSize = true;
this.Label8.Location = new System.Drawing.Point(22, 122);
this.Label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.Label8.Name = "Label8";
this.Label8.Size = new System.Drawing.Size(19, 17);
this.Label8.TabIndex = 37;
this.Label8.Text = "x2:";
this.Label8.UseCompatibleTextRendering = true;
//
// txtScriptMarkerX2
//
this.txtScriptMarkerX2.Location = new System.Drawing.Point(22, 143);
this.txtScriptMarkerX2.Margin = new System.Windows.Forms.Padding(4);
this.txtScriptMarkerX2.Name = "txtScriptMarkerX2";
this.txtScriptMarkerX2.Size = new System.Drawing.Size(61, 20);
this.txtScriptMarkerX2.TabIndex = 36;
//
// TableLayoutPanel7
//
this.TableLayoutPanel7.ColumnCount = 1;
this.TableLayoutPanel7.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.TableLayoutPanel7.Controls.Add(this.Panel7, 0, 0);
this.TableLayoutPanel7.Controls.Add(this.pnlView, 0, 1);
this.TableLayoutPanel7.Dock = System.Windows.Forms.DockStyle.Fill;
this.TableLayoutPanel7.Location = new System.Drawing.Point(0, 0);
this.TableLayoutPanel7.Margin = new System.Windows.Forms.Padding(4);
this.TableLayoutPanel7.Name = "TableLayoutPanel7";
this.TableLayoutPanel7.RowCount = 2;
this.TableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.TableLayoutPanel7.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.TableLayoutPanel7.Size = new System.Drawing.Size(858, 612);
this.TableLayoutPanel7.TabIndex = 2;
//
// Panel7
//
this.Panel7.Controls.Add(this.tsTools);
this.Panel7.Controls.Add(this.tsFile);
this.Panel7.Controls.Add(this.tsSelection);
this.Panel7.Controls.Add(this.tsMinimap);
this.Panel7.Dock = System.Windows.Forms.DockStyle.Fill;
this.Panel7.Location = new System.Drawing.Point(0, 0);
this.Panel7.Margin = new System.Windows.Forms.Padding(0);
this.Panel7.Name = "Panel7";
this.Panel7.Size = new System.Drawing.Size(858, 30);
this.Panel7.TabIndex = 0;
//
// tsTools
//
this.tsTools.Dock = System.Windows.Forms.DockStyle.None;
this.tsTools.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.tsTools.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbGateways,
this.tsbDrawAutotexture,
this.tsbDrawTileOrientation});
this.tsTools.Location = new System.Drawing.Point(372, 2);
this.tsTools.Name = "tsTools";
this.tsTools.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
this.tsTools.Size = new System.Drawing.Size(72, 25);
this.tsTools.TabIndex = 2;
//
// tsbGateways
//
this.tsbGateways.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbGateways.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbGateways.Name = "tsbGateways";
this.tsbGateways.Size = new System.Drawing.Size(23, 22);
this.tsbGateways.Text = "Gateways";
//
// tsbDrawAutotexture
//
this.tsbDrawAutotexture.CheckOnClick = true;
this.tsbDrawAutotexture.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbDrawAutotexture.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbDrawAutotexture.Name = "tsbDrawAutotexture";
this.tsbDrawAutotexture.Size = new System.Drawing.Size(23, 22);
this.tsbDrawAutotexture.Text = "Display Painted Texture Markers";
//
// tsbDrawTileOrientation
//
this.tsbDrawTileOrientation.CheckOnClick = true;
this.tsbDrawTileOrientation.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbDrawTileOrientation.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbDrawTileOrientation.Name = "tsbDrawTileOrientation";
this.tsbDrawTileOrientation.Size = new System.Drawing.Size(23, 22);
this.tsbDrawTileOrientation.Text = "Display Texture Orientations";
//
// tsFile
//
this.tsFile.Dock = System.Windows.Forms.DockStyle.None;
this.tsFile.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.tsFile.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.tsbSave});
this.tsFile.Location = new System.Drawing.Point(453, 2);
this.tsFile.Name = "tsFile";
this.tsFile.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
this.tsFile.Size = new System.Drawing.Size(26, 25);
this.tsFile.TabIndex = 3;
//
// tsbSave
//
this.tsbSave.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbSave.Enabled = false;
this.tsbSave.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbSave.Name = "tsbSave";
this.tsbSave.Size = new System.Drawing.Size(23, 22);
//
// tsSelection
//
this.tsSelection.Dock = System.Windows.Forms.DockStyle.None;
this.tsSelection.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.tsSelection.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ToolStripLabel1,
this.tsbSelection,
this.tsbSelectionCopy,
this.tsbSelectionPasteOptions,
this.tsbSelectionPaste,
this.tsbSelectionRotateCounterClockwise,
this.tsbSelectionRotateClockwise,
this.tsbSelectionFlipX,
this.tsbSelectionObjects});
this.tsSelection.Location = new System.Drawing.Point(98, 0);
this.tsSelection.Name = "tsSelection";
this.tsSelection.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
this.tsSelection.Size = new System.Drawing.Size(231, 25);
this.tsSelection.TabIndex = 0;
this.tsSelection.Text = "ToolStrip1";
//
// ToolStripLabel1
//
this.ToolStripLabel1.Name = "ToolStripLabel1";
this.ToolStripLabel1.Size = new System.Drawing.Size(54, 22);
this.ToolStripLabel1.Text = "Selection:";
//
// tsbSelection
//
this.tsbSelection.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbSelection.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbSelection.Name = "tsbSelection";
this.tsbSelection.Size = new System.Drawing.Size(23, 22);
this.tsbSelection.Text = "Selection Tool";
//
// tsbSelectionCopy
//
this.tsbSelectionCopy.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbSelectionCopy.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbSelectionCopy.Name = "tsbSelectionCopy";
this.tsbSelectionCopy.Size = new System.Drawing.Size(23, 22);
this.tsbSelectionCopy.Text = "Copy Selection";
//
// tsbSelectionPasteOptions
//
this.tsbSelectionPasteOptions.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbSelectionPasteOptions.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuRotateUnits,
this.menuRotateWalls,
this.menuRotateNothing,
this.ToolStripSeparator10,
this.menuSelPasteHeights,
this.menuSelPasteTextures,
this.menuSelPasteUnits,
this.menuSelPasteGateways,
this.menuSelPasteDeleteUnits,
this.menuSelPasteDeleteGateways});
this.tsbSelectionPasteOptions.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbSelectionPasteOptions.Name = "tsbSelectionPasteOptions";
this.tsbSelectionPasteOptions.Size = new System.Drawing.Size(13, 22);
this.tsbSelectionPasteOptions.Text = "Paste Options";
//
// menuRotateUnits
//
this.menuRotateUnits.Name = "menuRotateUnits";
this.menuRotateUnits.Size = new System.Drawing.Size(196, 22);
this.menuRotateUnits.Text = "Rotate All Objects";
//
// menuRotateWalls
//
this.menuRotateWalls.Checked = true;
this.menuRotateWalls.CheckState = System.Windows.Forms.CheckState.Checked;
this.menuRotateWalls.Name = "menuRotateWalls";
this.menuRotateWalls.Size = new System.Drawing.Size(196, 22);
this.menuRotateWalls.Text = "Rotate Walls Only";
//
// menuRotateNothing
//
this.menuRotateNothing.Name = "menuRotateNothing";
this.menuRotateNothing.Size = new System.Drawing.Size(196, 22);
this.menuRotateNothing.Text = "No Object Rotation";
//
// ToolStripSeparator10
//
this.ToolStripSeparator10.Name = "ToolStripSeparator10";
this.ToolStripSeparator10.Size = new System.Drawing.Size(193, 6);
//
// menuSelPasteHeights
//
this.menuSelPasteHeights.Checked = true;
this.menuSelPasteHeights.CheckOnClick = true;
this.menuSelPasteHeights.CheckState = System.Windows.Forms.CheckState.Checked;
this.menuSelPasteHeights.Name = "menuSelPasteHeights";
this.menuSelPasteHeights.Size = new System.Drawing.Size(196, 22);
this.menuSelPasteHeights.Text = "Paste Heights";
//
// menuSelPasteTextures
//
this.menuSelPasteTextures.Checked = true;
this.menuSelPasteTextures.CheckOnClick = true;
this.menuSelPasteTextures.CheckState = System.Windows.Forms.CheckState.Checked;
this.menuSelPasteTextures.Name = "menuSelPasteTextures";
this.menuSelPasteTextures.Size = new System.Drawing.Size(196, 22);
this.menuSelPasteTextures.Text = "Paste Textures";
//
// menuSelPasteUnits
//
this.menuSelPasteUnits.CheckOnClick = true;
this.menuSelPasteUnits.Name = "menuSelPasteUnits";
this.menuSelPasteUnits.Size = new System.Drawing.Size(196, 22);
this.menuSelPasteUnits.Text = "Paste Objects";
//
// menuSelPasteGateways
//
this.menuSelPasteGateways.CheckOnClick = true;
this.menuSelPasteGateways.Name = "menuSelPasteGateways";
this.menuSelPasteGateways.Size = new System.Drawing.Size(196, 22);
this.menuSelPasteGateways.Text = "Paste Gateways";
//
// menuSelPasteDeleteUnits
//
this.menuSelPasteDeleteUnits.CheckOnClick = true;
this.menuSelPasteDeleteUnits.Name = "menuSelPasteDeleteUnits";
this.menuSelPasteDeleteUnits.Size = new System.Drawing.Size(196, 22);
this.menuSelPasteDeleteUnits.Text = "Delete Existing Objects";
//
// menuSelPasteDeleteGateways
//
this.menuSelPasteDeleteGateways.CheckOnClick = true;
this.menuSelPasteDeleteGateways.Name = "menuSelPasteDeleteGateways";
this.menuSelPasteDeleteGateways.Size = new System.Drawing.Size(196, 22);
this.menuSelPasteDeleteGateways.Text = "Delete Existing Gateways";
//
// tsbSelectionPaste
//
this.tsbSelectionPaste.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbSelectionPaste.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbSelectionPaste.Name = "tsbSelectionPaste";
this.tsbSelectionPaste.Size = new System.Drawing.Size(23, 22);
this.tsbSelectionPaste.Text = "Paste To Selection";
//
// tsbSelectionRotateCounterClockwise
//
this.tsbSelectionRotateCounterClockwise.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbSelectionRotateCounterClockwise.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbSelectionRotateCounterClockwise.Name = "tsbSelectionRotateCounterClockwise";
this.tsbSelectionRotateCounterClockwise.Size = new System.Drawing.Size(23, 22);
this.tsbSelectionRotateCounterClockwise.Text = "Rotate Copy Counter Clockwise";
//
// tsbSelectionRotateClockwise
//
this.tsbSelectionRotateClockwise.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbSelectionRotateClockwise.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbSelectionRotateClockwise.Name = "tsbSelectionRotateClockwise";
this.tsbSelectionRotateClockwise.Size = new System.Drawing.Size(23, 22);
this.tsbSelectionRotateClockwise.Text = "Rotate Copy Clockwise";
//
// tsbSelectionFlipX
//
this.tsbSelectionFlipX.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbSelectionFlipX.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbSelectionFlipX.Name = "tsbSelectionFlipX";
this.tsbSelectionFlipX.Size = new System.Drawing.Size(23, 22);
this.tsbSelectionFlipX.Text = "Flip Copy Horizontally";
//
// tsbSelectionObjects
//
this.tsbSelectionObjects.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.tsbSelectionObjects.ImageTransparentColor = System.Drawing.Color.Magenta;
this.tsbSelectionObjects.Name = "tsbSelectionObjects";
this.tsbSelectionObjects.Size = new System.Drawing.Size(23, 22);
this.tsbSelectionObjects.Text = "Select Objects";
//
// tsMinimap
//
this.tsMinimap.Dock = System.Windows.Forms.DockStyle.None;
this.tsMinimap.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
this.tsMinimap.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuMinimap});
this.tsMinimap.Location = new System.Drawing.Point(0, 0);
this.tsMinimap.Name = "tsMinimap";
this.tsMinimap.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
this.tsMinimap.Size = new System.Drawing.Size(61, 25);
this.tsMinimap.TabIndex = 1;
//
// menuMinimap
//
this.menuMinimap.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.menuMinimap.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuMiniShowTex,
this.menuMiniShowHeight,
this.menuMiniShowCliffs,
this.menuMiniShowUnits,
this.menuMiniShowGateways});
this.menuMinimap.ImageTransparentColor = System.Drawing.Color.Magenta;
this.menuMinimap.Name = "menuMinimap";
this.menuMinimap.Size = new System.Drawing.Size(58, 22);
this.menuMinimap.Text = "Minimap";
//
// menuMiniShowTex
//
this.menuMiniShowTex.Checked = true;
this.menuMiniShowTex.CheckOnClick = true;
this.menuMiniShowTex.CheckState = System.Windows.Forms.CheckState.Checked;
this.menuMiniShowTex.Name = "menuMiniShowTex";
this.menuMiniShowTex.Size = new System.Drawing.Size(151, 22);
this.menuMiniShowTex.Text = "Show Textures";
//
// menuMiniShowHeight
//
this.menuMiniShowHeight.Checked = true;
this.menuMiniShowHeight.CheckOnClick = true;
this.menuMiniShowHeight.CheckState = System.Windows.Forms.CheckState.Checked;
this.menuMiniShowHeight.Name = "menuMiniShowHeight";
this.menuMiniShowHeight.Size = new System.Drawing.Size(151, 22);
this.menuMiniShowHeight.Text = "Show Heights";
//
// menuMiniShowCliffs
//
this.menuMiniShowCliffs.CheckOnClick = true;
this.menuMiniShowCliffs.Name = "menuMiniShowCliffs";
this.menuMiniShowCliffs.Size = new System.Drawing.Size(151, 22);
this.menuMiniShowCliffs.Text = "Show Cliffs";
//
// menuMiniShowUnits
//
this.menuMiniShowUnits.Checked = true;
this.menuMiniShowUnits.CheckOnClick = true;
this.menuMiniShowUnits.CheckState = System.Windows.Forms.CheckState.Checked;
this.menuMiniShowUnits.Name = "menuMiniShowUnits";
this.menuMiniShowUnits.Size = new System.Drawing.Size(151, 22);
this.menuMiniShowUnits.Text = "Show Objects";
//
// menuMiniShowGateways
//
this.menuMiniShowGateways.CheckOnClick = true;
this.menuMiniShowGateways.Name = "menuMiniShowGateways";
this.menuMiniShowGateways.Size = new System.Drawing.Size(151, 22);
this.menuMiniShowGateways.Text = "Show Gateways";
//
// pnlView
//
this.pnlView.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlView.Location = new System.Drawing.Point(0, 30);
this.pnlView.Margin = new System.Windows.Forms.Padding(0);
this.pnlView.Name = "pnlView";
this.pnlView.Size = new System.Drawing.Size(858, 582);
this.pnlView.TabIndex = 1;
//
// menuMain
//
this.menuMain.Dock = System.Windows.Forms.DockStyle.Fill;
this.menuMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuFile,
this.menuTools,
this.menuOptions});
this.menuMain.Location = new System.Drawing.Point(0, 0);
this.menuMain.Name = "menuMain";
this.menuMain.Padding = new System.Windows.Forms.Padding(8, 2, 0, 2);
this.menuMain.RenderMode = System.Windows.Forms.ToolStripRenderMode.System;
this.menuMain.Size = new System.Drawing.Size(1296, 31);
this.menuMain.TabIndex = 0;
this.menuMain.Text = "MenuStrip1";
//
// menuFile
//
this.menuFile.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.NewMapToolStripMenuItem,
this.ToolStripSeparator3,
this.OpenToolStripMenuItem,
this.ToolStripSeparator2,
this.SaveToolStripMenuItem,
this.ToolStripSeparator1,
this.ToolStripMenuItem4,
this.ToolStripMenuItem2,
this.MapWZToolStripMenuItem,
this.ToolStripSeparator4,
this.CloseToolStripMenuItem});
this.menuFile.Name = "menuFile";
this.menuFile.Size = new System.Drawing.Size(35, 27);
this.menuFile.Text = "File";
//
// NewMapToolStripMenuItem
//
this.NewMapToolStripMenuItem.Name = "NewMapToolStripMenuItem";
this.NewMapToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.NewMapToolStripMenuItem.Text = "New Map";
//
// ToolStripSeparator3
//
this.ToolStripSeparator3.Name = "ToolStripSeparator3";
this.ToolStripSeparator3.Size = new System.Drawing.Size(143, 6);
//
// OpenToolStripMenuItem
//
this.OpenToolStripMenuItem.Name = "OpenToolStripMenuItem";
this.OpenToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.OpenToolStripMenuItem.Text = "Open...";
//
// ToolStripSeparator2
//
this.ToolStripSeparator2.Name = "ToolStripSeparator2";
this.ToolStripSeparator2.Size = new System.Drawing.Size(143, 6);
//
// SaveToolStripMenuItem
//
this.SaveToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuSaveFMap,
this.ToolStripSeparator7,
this.menuSaveFMapQuick,
this.ToolStripSeparator11,
this.MapLNDToolStripMenuItem,
this.ToolStripSeparator6,
this.menuExportMapTileTypes,
this.ToolStripMenuItem1,
this.MinimapBMPToolStripMenuItem,
this.ToolStripMenuItem3});
this.SaveToolStripMenuItem.Name = "SaveToolStripMenuItem";
this.SaveToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.SaveToolStripMenuItem.Text = "Save";
//
// menuSaveFMap
//
this.menuSaveFMap.Name = "menuSaveFMap";
this.menuSaveFMap.Size = new System.Drawing.Size(172, 22);
this.menuSaveFMap.Text = "Map fmap...";
//
// ToolStripSeparator7
//
this.ToolStripSeparator7.Name = "ToolStripSeparator7";
this.ToolStripSeparator7.Size = new System.Drawing.Size(169, 6);
//
// menuSaveFMapQuick
//
this.menuSaveFMapQuick.Name = "menuSaveFMapQuick";
this.menuSaveFMapQuick.Size = new System.Drawing.Size(172, 22);
this.menuSaveFMapQuick.Text = "Quick Save fmap";
//
// ToolStripSeparator11
//
this.ToolStripSeparator11.Name = "ToolStripSeparator11";
this.ToolStripSeparator11.Size = new System.Drawing.Size(169, 6);
//
// MapLNDToolStripMenuItem
//
this.MapLNDToolStripMenuItem.Name = "MapLNDToolStripMenuItem";
this.MapLNDToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
this.MapLNDToolStripMenuItem.Text = "Export Map LND...";
//
// ToolStripSeparator6
//
this.ToolStripSeparator6.Name = "ToolStripSeparator6";
this.ToolStripSeparator6.Size = new System.Drawing.Size(169, 6);
//
// menuExportMapTileTypes
//
this.menuExportMapTileTypes.Name = "menuExportMapTileTypes";
this.menuExportMapTileTypes.Size = new System.Drawing.Size(172, 22);
this.menuExportMapTileTypes.Text = "Export Tile Types...";
//
// ToolStripMenuItem1
//
this.ToolStripMenuItem1.Name = "ToolStripMenuItem1";
this.ToolStripMenuItem1.Size = new System.Drawing.Size(169, 6);
//
// MinimapBMPToolStripMenuItem
//
this.MinimapBMPToolStripMenuItem.Name = "MinimapBMPToolStripMenuItem";
this.MinimapBMPToolStripMenuItem.Size = new System.Drawing.Size(172, 22);
this.MinimapBMPToolStripMenuItem.Text = "Minimap Bitmap...";
//
// ToolStripMenuItem3
//
this.ToolStripMenuItem3.Name = "ToolStripMenuItem3";
this.ToolStripMenuItem3.Size = new System.Drawing.Size(172, 22);
this.ToolStripMenuItem3.Text = "Heightmap Bitmap...";
//
// ToolStripSeparator1
//
this.ToolStripSeparator1.Name = "ToolStripSeparator1";
this.ToolStripSeparator1.Size = new System.Drawing.Size(143, 6);
//
// ToolStripMenuItem4
//
this.ToolStripMenuItem4.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.ImportHeightmapToolStripMenuItem,
this.ToolStripSeparator8,
this.menuImportTileTypes});
this.ToolStripMenuItem4.Name = "ToolStripMenuItem4";
this.ToolStripMenuItem4.Size = new System.Drawing.Size(146, 22);
this.ToolStripMenuItem4.Text = "Import";
//
// ImportHeightmapToolStripMenuItem
//
this.ImportHeightmapToolStripMenuItem.Name = "ImportHeightmapToolStripMenuItem";
this.ImportHeightmapToolStripMenuItem.Size = new System.Drawing.Size(137, 22);
this.ImportHeightmapToolStripMenuItem.Text = "Heightmap...";
//
// ToolStripSeparator8
//
this.ToolStripSeparator8.Name = "ToolStripSeparator8";
this.ToolStripSeparator8.Size = new System.Drawing.Size(134, 6);
//
// menuImportTileTypes
//
this.menuImportTileTypes.Name = "menuImportTileTypes";
this.menuImportTileTypes.Size = new System.Drawing.Size(137, 22);
this.menuImportTileTypes.Text = "Tile Types...";
//
// ToolStripMenuItem2
//
this.ToolStripMenuItem2.Name = "ToolStripMenuItem2";
this.ToolStripMenuItem2.Size = new System.Drawing.Size(143, 6);
//
// MapWZToolStripMenuItem
//
this.MapWZToolStripMenuItem.Name = "MapWZToolStripMenuItem";
this.MapWZToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.MapWZToolStripMenuItem.Text = "Compile Map...";
//
// ToolStripSeparator4
//
this.ToolStripSeparator4.Name = "ToolStripSeparator4";
this.ToolStripSeparator4.Size = new System.Drawing.Size(143, 6);
//
// CloseToolStripMenuItem
//
this.CloseToolStripMenuItem.Name = "CloseToolStripMenuItem";
this.CloseToolStripMenuItem.Size = new System.Drawing.Size(146, 22);
this.CloseToolStripMenuItem.Text = "Quit";
//
// menuTools
//
this.menuTools.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.menuReinterpret,
this.menuWaterCorrection,
this.ToolStripSeparator9,
this.menuFlatOil,
this.menuFlatStructures,
this.ToolStripSeparator12,
this.menuGenerator});
this.menuTools.Name = "menuTools";
this.menuTools.Size = new System.Drawing.Size(44, 27);
this.menuTools.Text = "Tools";
//
// menuReinterpret
//
this.menuReinterpret.Name = "menuReinterpret";
this.menuReinterpret.Size = new System.Drawing.Size(198, 22);
this.menuReinterpret.Text = "Reinterpret Terrain";
//
// menuWaterCorrection
//
this.menuWaterCorrection.Name = "menuWaterCorrection";
this.menuWaterCorrection.Size = new System.Drawing.Size(198, 22);
this.menuWaterCorrection.Text = "Water Triangle Correction";
//
// ToolStripSeparator9
//
this.ToolStripSeparator9.Name = "ToolStripSeparator9";
this.ToolStripSeparator9.Size = new System.Drawing.Size(195, 6);
//
// menuFlatOil
//
this.menuFlatOil.Name = "menuFlatOil";
this.menuFlatOil.Size = new System.Drawing.Size(198, 22);
this.menuFlatOil.Text = "Flatten Under Oils";
//
// menuFlatStructures
//
this.menuFlatStructures.Name = "menuFlatStructures";
this.menuFlatStructures.Size = new System.Drawing.Size(198, 22);
this.menuFlatStructures.Text = "Flatten Under Structures";
//
// ToolStripSeparator12
//
this.ToolStripSeparator12.Name = "ToolStripSeparator12";
this.ToolStripSeparator12.Size = new System.Drawing.Size(195, 6);
//
// menuGenerator
//
this.menuGenerator.Name = "menuGenerator";
this.menuGenerator.Size = new System.Drawing.Size(198, 22);
this.menuGenerator.Text = "Generator...";
//
// menuOptions
//
this.menuOptions.Name = "menuOptions";
this.menuOptions.Size = new System.Drawing.Size(68, 27);
this.menuOptions.Text = "Options...";
//
// TableLayoutPanel5
//
this.TableLayoutPanel5.ColumnCount = 1;
this.TableLayoutPanel5.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.TableLayoutPanel5.Controls.Add(this.menuMain, 0, 0);
this.TableLayoutPanel5.Controls.Add(this.SplitContainer1, 0, 1);
this.TableLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.TableLayoutPanel5.Location = new System.Drawing.Point(0, 0);
this.TableLayoutPanel5.Margin = new System.Windows.Forms.Padding(4);
this.TableLayoutPanel5.Name = "TableLayoutPanel5";
this.TableLayoutPanel5.RowCount = 2;
this.TableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 31F));
this.TableLayoutPanel5.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.TableLayoutPanel5.Size = new System.Drawing.Size(1296, 655);
this.TableLayoutPanel5.TabIndex = 1;
//
// TabPage13
//
this.TabPage13.Location = new System.Drawing.Point(4, 24);
this.TabPage13.Name = "TabPage13";
this.TabPage13.Padding = new System.Windows.Forms.Padding(3);
this.TabPage13.Size = new System.Drawing.Size(193, 0);
this.TabPage13.TabIndex = 0;
this.TabPage13.Text = "1";
this.TabPage13.UseVisualStyleBackColor = true;
//
// TabPage14
//
this.TabPage14.Location = new System.Drawing.Point(4, 24);
this.TabPage14.Name = "TabPage14";
this.TabPage14.Padding = new System.Windows.Forms.Padding(3);
this.TabPage14.Size = new System.Drawing.Size(193, 0);
this.TabPage14.TabIndex = 1;
this.TabPage14.Text = "2";
this.TabPage14.UseVisualStyleBackColor = true;
//
// TabPage15
//
this.TabPage15.Location = new System.Drawing.Point(4, 24);
this.TabPage15.Name = "TabPage15";
this.TabPage15.Size = new System.Drawing.Size(193, 0);
this.TabPage15.TabIndex = 2;
this.TabPage15.Text = "3";
this.TabPage15.UseVisualStyleBackColor = true;
//
// TabPage16
//
this.TabPage16.Location = new System.Drawing.Point(4, 24);
this.TabPage16.Name = "TabPage16";
this.TabPage16.Size = new System.Drawing.Size(193, 0);
this.TabPage16.TabIndex = 3;
this.TabPage16.Text = "4";
this.TabPage16.UseVisualStyleBackColor = true;
//
// TabPage21
//
this.TabPage21.Location = new System.Drawing.Point(4, 24);
this.TabPage21.Name = "TabPage21";
this.TabPage21.Size = new System.Drawing.Size(193, 0);
this.TabPage21.TabIndex = 4;
this.TabPage21.Text = "5";
this.TabPage21.UseVisualStyleBackColor = true;
//
// TabPage22
//
this.TabPage22.Location = new System.Drawing.Point(4, 24);
this.TabPage22.Name = "TabPage22";
this.TabPage22.Size = new System.Drawing.Size(193, 0);
this.TabPage22.TabIndex = 5;
this.TabPage22.Text = "6";
this.TabPage22.UseVisualStyleBackColor = true;
//
// TabPage23
//
this.TabPage23.Location = new System.Drawing.Point(4, 24);
this.TabPage23.Name = "TabPage23";
this.TabPage23.Size = new System.Drawing.Size(193, 0);
this.TabPage23.TabIndex = 6;
this.TabPage23.Text = "7";
this.TabPage23.UseVisualStyleBackColor = true;
//
// TabPage24
//
this.TabPage24.Location = new System.Drawing.Point(4, 24);
this.TabPage24.Name = "TabPage24";
this.TabPage24.Size = new System.Drawing.Size(193, 0);
this.TabPage24.TabIndex = 7;
this.TabPage24.Text = "8";
this.TabPage24.UseVisualStyleBackColor = true;
//
// frmMain
//
this.AllowDrop = true;
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1296, 655);
this.Controls.Add(this.TableLayoutPanel5);
this.MainMenuStrip = this.menuMain;
this.Margin = new System.Windows.Forms.Padding(4);
this.Name = "frmMain";
this.WindowState = System.Windows.Forms.FormWindowState.Minimized;
this.SplitContainer1.Panel1.ResumeLayout(false);
this.SplitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.SplitContainer1)).EndInit();
this.SplitContainer1.ResumeLayout(false);
this.TabControl.ResumeLayout(false);
this.tpTextures.ResumeLayout(false);
this.TableLayoutPanel6.ResumeLayout(false);
this.Panel5.ResumeLayout(false);
this.Panel5.PerformLayout();
this.Panel6.ResumeLayout(false);
this.tpAutoTexture.ResumeLayout(false);
this.tpAutoTexture.PerformLayout();
this.Panel15.ResumeLayout(false);
this.Panel15.PerformLayout();
this.tpHeight.ResumeLayout(false);
this.tpHeight.PerformLayout();
this.tabHeightSetR.ResumeLayout(false);
this.tabHeightSetL.ResumeLayout(false);
this.tpResize.ResumeLayout(false);
this.tpResize.PerformLayout();
this.tpObjects.ResumeLayout(false);
this.TableLayoutPanel1.ResumeLayout(false);
this.Panel1.ResumeLayout(false);
this.Panel1.PerformLayout();
this.GroupBox3.ResumeLayout(false);
this.GroupBox3.PerformLayout();
this.Panel2.ResumeLayout(false);
this.TabControl1.ResumeLayout(false);
this.TabPage1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvFeatures)).EndInit();
this.TabPage2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvStructures)).EndInit();
this.TabPage3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvDroids)).EndInit();
this.tpObject.ResumeLayout(false);
this.TableLayoutPanel8.ResumeLayout(false);
this.TableLayoutPanel9.ResumeLayout(false);
this.Panel13.ResumeLayout(false);
this.Panel13.PerformLayout();
this.Panel12.ResumeLayout(false);
this.Panel12.PerformLayout();
this.Panel11.ResumeLayout(false);
this.Panel11.PerformLayout();
this.Panel10.ResumeLayout(false);
this.Panel9.ResumeLayout(false);
this.Panel8.ResumeLayout(false);
this.Panel14.ResumeLayout(false);
this.Panel14.PerformLayout();
this.tpLabels.ResumeLayout(false);
this.tpLabels.PerformLayout();
this.GroupBox1.ResumeLayout(false);
this.GroupBox1.PerformLayout();
this.TableLayoutPanel7.ResumeLayout(false);
this.Panel7.ResumeLayout(false);
this.Panel7.PerformLayout();
this.tsTools.ResumeLayout(false);
this.tsTools.PerformLayout();
this.tsFile.ResumeLayout(false);
this.tsFile.PerformLayout();
this.tsSelection.ResumeLayout(false);
this.tsSelection.PerformLayout();
this.tsMinimap.ResumeLayout(false);
this.tsMinimap.PerformLayout();
this.menuMain.ResumeLayout(false);
this.menuMain.PerformLayout();
this.TableLayoutPanel5.ResumeLayout(false);
this.TableLayoutPanel5.PerformLayout();
this.ResumeLayout(false);
}
public System.Windows.Forms.SplitContainer SplitContainer1;
public System.Windows.Forms.TabPage tpTextures;
public System.Windows.Forms.TabPage tpHeight;
public System.Windows.Forms.TabPage tpAutoTexture;
public System.Windows.Forms.ListBox lstAutoTexture;
public System.Windows.Forms.Label Label3;
public System.Windows.Forms.ComboBox cboTileset;
public System.Windows.Forms.TextBox txtAutoCliffSlope;
public System.Windows.Forms.Label Label1;
public System.Windows.Forms.TextBox txtHeightSetL;
public System.Windows.Forms.Label Label5;
public System.Windows.Forms.TextBox txtSmoothRate;
public System.Windows.Forms.Label Label6;
public System.Windows.Forms.RadioButton rdoHeightSmooth;
public System.Windows.Forms.RadioButton rdoHeightSet;
public System.Windows.Forms.TabPage tpResize;
public System.Windows.Forms.TextBox txtOffsetY;
public System.Windows.Forms.Label Label15;
public System.Windows.Forms.TextBox txtOffsetX;
public System.Windows.Forms.Label Label14;
public System.Windows.Forms.TextBox txtSizeY;
public System.Windows.Forms.Label Label13;
public System.Windows.Forms.TextBox txtSizeX;
public System.Windows.Forms.Label Label12;
public System.Windows.Forms.Button btnResize;
public System.Windows.Forms.Label Label16;
public System.Windows.Forms.RadioButton rdoAutoCliffRemove;
public System.Windows.Forms.RadioButton rdoAutoCliffBrush;
public System.Windows.Forms.ToolStripMenuItem HeightmapBMPToolStripMenuItem;
public System.Windows.Forms.RadioButton rdoAutoTextureFill;
public System.Windows.Forms.TextBox txtHeightChangeRate;
public System.Windows.Forms.Label Label18;
public System.Windows.Forms.RadioButton rdoHeightChange;
public System.Windows.Forms.Label Label10;
public System.Windows.Forms.TextBox txtHeightOffset;
public System.Windows.Forms.Label Label9;
public System.Windows.Forms.TextBox txtHeightMultiply;
public System.Windows.Forms.RadioButton rdoAutoTexturePlace;
public System.Windows.Forms.RadioButton rdoAutoRoadPlace;
public System.Windows.Forms.ListBox lstAutoRoad;
public System.Windows.Forms.Button btnAutoRoadRemove;
public System.Windows.Forms.Button btnAutoTextureRemove;
public System.Windows.Forms.MenuStrip menuMain;
public System.Windows.Forms.ToolStripMenuItem menuFile;
public System.Windows.Forms.ToolStripMenuItem NewMapToolStripMenuItem;
public System.Windows.Forms.ToolStripMenuItem OpenToolStripMenuItem;
public System.Windows.Forms.ToolStripMenuItem SaveToolStripMenuItem;
public System.Windows.Forms.ToolStripMenuItem MapLNDToolStripMenuItem;
public System.Windows.Forms.ToolStripMenuItem menuSaveFMap;
public System.Windows.Forms.ToolStripSeparator ToolStripMenuItem1;
public System.Windows.Forms.ToolStripMenuItem MinimapBMPToolStripMenuItem;
public System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem3;
public System.Windows.Forms.ToolStripSeparator ToolStripMenuItem2;
public System.Windows.Forms.ToolStripMenuItem CloseToolStripMenuItem;
public System.Windows.Forms.TabPage tpObjects;
public System.Windows.Forms.Label Label22;
public System.Windows.Forms.TabPage tpObject;
public System.Windows.Forms.Label lblObjectType;
public System.Windows.Forms.Label Label24;
public System.Windows.Forms.TextBox txtObjectRotation;
public System.Windows.Forms.Label Label23;
public System.Windows.Forms.Label Label28;
public System.Windows.Forms.RadioButton rdoAutoRoadLine;
public System.Windows.Forms.Label Label29;
public System.Windows.Forms.TableLayoutPanel TableLayoutPanel1;
public System.Windows.Forms.ToolStripSeparator ToolStripSeparator3;
public System.Windows.Forms.ToolStripSeparator ToolStripSeparator2;
public System.Windows.Forms.ToolStripSeparator ToolStripSeparator1;
public System.Windows.Forms.ToolStripMenuItem MapWZToolStripMenuItem;
public System.Windows.Forms.ToolStripSeparator ToolStripSeparator4;
public System.Windows.Forms.ToolStripMenuItem menuOptions;
public System.Windows.Forms.Button btnSelResize;
public System.Windows.Forms.ToolStrip tsSelection;
public System.Windows.Forms.ToolStripLabel ToolStripLabel1;
public System.Windows.Forms.ToolStripButton tsbSelection;
public System.Windows.Forms.ToolStripButton tsbSelectionCopy;
public System.Windows.Forms.ToolStripDropDownButton tsbSelectionPasteOptions;
public System.Windows.Forms.ToolStripMenuItem menuSelPasteHeights;
public System.Windows.Forms.ToolStripMenuItem menuSelPasteTextures;
public System.Windows.Forms.ToolStripMenuItem menuSelPasteUnits;
public System.Windows.Forms.ToolStripMenuItem menuSelPasteDeleteUnits;
public System.Windows.Forms.ToolStripButton tsbSelectionPaste;
public System.Windows.Forms.ToolStripButton tsbSelectionRotateCounterClockwise;
public System.Windows.Forms.ToolStripButton tsbSelectionRotateClockwise;
public System.Windows.Forms.ToolStrip tsMinimap;
public System.Windows.Forms.ToolStripDropDownButton menuMinimap;
public System.Windows.Forms.ToolStripMenuItem menuMiniShowTex;
public System.Windows.Forms.ToolStripMenuItem menuMiniShowHeight;
public System.Windows.Forms.ToolStripMenuItem menuMiniShowUnits;
public System.Windows.Forms.TableLayoutPanel TableLayoutPanel5;
public System.Windows.Forms.ToolStripMenuItem menuMiniShowGateways;
public System.Windows.Forms.ToolStrip tsTools;
public System.Windows.Forms.ToolStripButton tsbGateways;
public System.Windows.Forms.TableLayoutPanel TableLayoutPanel6;
public System.Windows.Forms.Panel Panel5;
public System.Windows.Forms.Panel Panel6;
public System.Windows.Forms.Label Label20;
public System.Windows.Forms.ComboBox cboTileType;
public System.Windows.Forms.CheckBox cbxTileTypes;
public System.Windows.Forms.ToolStripSeparator ToolStripSeparator6;
public System.Windows.Forms.ToolStripMenuItem menuExportMapTileTypes;
public System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem4;
public System.Windows.Forms.ToolStripMenuItem ImportHeightmapToolStripMenuItem;
public System.Windows.Forms.ToolStripMenuItem menuImportTileTypes;
public System.Windows.Forms.CheckBox cbxCliffTris;
public System.Windows.Forms.ToolStrip tsFile;
public System.Windows.Forms.ToolStripButton tsbSave;
public System.Windows.Forms.Label Label21;
public System.Windows.Forms.Panel Panel1;
public System.Windows.Forms.CheckBox cbxAutoTexSetHeight;
public System.Windows.Forms.TextBox txtObjectID;
public System.Windows.Forms.Label Label25;
public System.Windows.Forms.TableLayoutPanel TableLayoutPanel7;
public System.Windows.Forms.Panel Panel7;
public System.Windows.Forms.Panel pnlView;
public System.Windows.Forms.Label Label26;
public System.Windows.Forms.TextBox txtHeightSetR;
public System.Windows.Forms.Label Label27;
public System.Windows.Forms.TabControl tabHeightSetL;
public System.Windows.Forms.TabPage TabPage9;
public System.Windows.Forms.TabPage TabPage10;
public System.Windows.Forms.TabPage TabPage11;
public System.Windows.Forms.TabPage TabPage12;
public System.Windows.Forms.TabControl tabHeightSetR;
public System.Windows.Forms.TabPage TabPage25;
public System.Windows.Forms.TabPage TabPage26;
public System.Windows.Forms.TabPage TabPage27;
public System.Windows.Forms.TabPage TabPage28;
public System.Windows.Forms.TabPage TabPage29;
public System.Windows.Forms.TabPage TabPage30;
public System.Windows.Forms.TabPage TabPage31;
public System.Windows.Forms.TabPage TabPage32;
public System.Windows.Forms.TabPage TabPage17;
public System.Windows.Forms.TabPage TabPage18;
public System.Windows.Forms.TabPage TabPage19;
public System.Windows.Forms.TabPage TabPage20;
public System.Windows.Forms.TabPage TabPage13;
public System.Windows.Forms.TabPage TabPage14;
public System.Windows.Forms.TabPage TabPage15;
public System.Windows.Forms.TabPage TabPage16;
public System.Windows.Forms.TabPage TabPage21;
public System.Windows.Forms.TabPage TabPage22;
public System.Windows.Forms.TabPage TabPage23;
public System.Windows.Forms.TabPage TabPage24;
private System.Windows.Forms.TabControl TabControl;
public System.Windows.Forms.ToolStripButton tsbSelectionObjects;
public System.Windows.Forms.ToolStripButton tsbDrawAutotexture;
public System.Windows.Forms.ToolStripButton tsbSelectionFlipX;
public System.Windows.Forms.Button btnHeightOffsetSelection;
public System.Windows.Forms.Button btnHeightsMultiplySelection;
public System.Windows.Forms.ToolStripButton tsbDrawTileOrientation;
public System.Windows.Forms.CheckBox chkTextureOrientationRandomize;
public System.Windows.Forms.Button btnTextureFlipX;
public System.Windows.Forms.Button btnTextureAnticlockwise;
public System.Windows.Forms.CheckBox chkSetTextureOrientation;
public System.Windows.Forms.CheckBox chkSetTexture;
public System.Windows.Forms.CheckBox cbxTileNumbers;
public System.Windows.Forms.Label Label32;
public System.Windows.Forms.TextBox txtObjectPriority;
public System.Windows.Forms.Label Label33;
public System.Windows.Forms.ToolStripMenuItem menuRotateUnits;
public System.Windows.Forms.ToolStripSeparator ToolStripSeparator10;
public System.Windows.Forms.ToolStripMenuItem menuSelPasteGateways;
public System.Windows.Forms.ToolStripMenuItem menuSelPasteDeleteGateways;
public System.Windows.Forms.ToolStripMenuItem menuMiniShowCliffs;
public System.Windows.Forms.CheckBox cbxInvalidTiles;
public System.Windows.Forms.ToolStripMenuItem menuRotateWalls;
public System.Windows.Forms.ToolStripMenuItem menuRotateNothing;
public System.Windows.Forms.TextBox txtObjectHealth;
public System.Windows.Forms.Label Label34;
public System.Windows.Forms.Label Label39;
public System.Windows.Forms.ComboBox cboDroidTurret1;
public System.Windows.Forms.Label Label38;
public System.Windows.Forms.ComboBox cboDroidPropulsion;
public System.Windows.Forms.Label Label37;
public System.Windows.Forms.ComboBox cboDroidBody;
public System.Windows.Forms.Button btnDroidToDesign;
public System.Windows.Forms.Label Label36;
public System.Windows.Forms.ComboBox cboDroidTurret3;
public System.Windows.Forms.ComboBox cboDroidTurret2;
public System.Windows.Forms.RadioButton rdoDroidTurret3;
public System.Windows.Forms.RadioButton rdoDroidTurret2;
public System.Windows.Forms.RadioButton rdoDroidTurret1;
public System.Windows.Forms.Label Label40;
public System.Windows.Forms.ComboBox cboDroidType;
public System.Windows.Forms.RadioButton rdoDroidTurret0;
public System.Windows.Forms.TableLayoutPanel TableLayoutPanel8;
public System.Windows.Forms.TableLayoutPanel TableLayoutPanel9;
public System.Windows.Forms.Panel Panel13;
public System.Windows.Forms.Panel Panel12;
public System.Windows.Forms.Panel Panel11;
public System.Windows.Forms.Panel Panel10;
public System.Windows.Forms.Panel Panel9;
public System.Windows.Forms.Panel Panel8;
public System.Windows.Forms.Panel Panel14;
public System.Windows.Forms.Label Label35;
public System.Windows.Forms.Panel pnlTextureBrush;
public System.Windows.Forms.Panel pnlCliffRemoveBrush;
public System.Windows.Forms.Panel pnlTerrainBrush;
public System.Windows.Forms.Panel pnlHeightSetBrush;
public System.Windows.Forms.RadioButton rdoRoadRemove;
public System.Windows.Forms.RadioButton rdoTextureRemoveTerrain;
public System.Windows.Forms.RadioButton rdoTextureReinterpretTerrain;
public System.Windows.Forms.RadioButton rdoTextureIgnoreTerrain;
public System.Windows.Forms.CheckBox cbxHeightChangeFade;
public System.Windows.Forms.Button btnPlayerSelectObjects;
public System.Windows.Forms.CheckBox cbxObjectRandomRotation;
public System.Windows.Forms.ToolStripSeparator ToolStripSeparator11;
public System.Windows.Forms.RadioButton rdoCliffTriBrush;
public System.Windows.Forms.Button btnTextureClockwise;
public System.Windows.Forms.RadioButton rdoFillCliffIgnore;
public System.Windows.Forms.RadioButton rdoFillCliffStopAfter;
public System.Windows.Forms.RadioButton rdoFillCliffStopBefore;
internal System.Windows.Forms.Panel Panel15;
internal System.Windows.Forms.ToolStripSeparator ToolStripSeparator8;
internal System.Windows.Forms.TabPage tpLabels;
internal System.Windows.Forms.GroupBox GroupBox1;
public System.Windows.Forms.Label Label2;
public System.Windows.Forms.TextBox txtScriptMarkerY;
public System.Windows.Forms.TextBox txtScriptMarkerX;
public System.Windows.Forms.Label Label7;
public System.Windows.Forms.TextBox txtScriptMarkerY2;
public System.Windows.Forms.Label Label4;
public System.Windows.Forms.Label Label8;
public System.Windows.Forms.TextBox txtScriptMarkerX2;
public System.Windows.Forms.CheckBox cbxFillInside;
public System.Windows.Forms.Button btnScriptAreaCreate;
internal System.Windows.Forms.ListBox lstScriptAreas;
internal System.Windows.Forms.ListBox lstScriptPositions;
public System.Windows.Forms.Button btnScriptMarkerRemove;
public System.Windows.Forms.TextBox txtScriptMarkerLabel;
public System.Windows.Forms.Label Label41;
public System.Windows.Forms.Label Label43;
public System.Windows.Forms.Label Label42;
public System.Windows.Forms.Label Label11;
public System.Windows.Forms.TextBox txtObjectLabel;
public System.Windows.Forms.Label Label17;
public System.Windows.Forms.Button btnAlignObjects;
public System.Windows.Forms.Button btnFlatSelected;
internal System.Windows.Forms.TabControl TabControl1;
internal System.Windows.Forms.TabPage TabPage1;
internal System.Windows.Forms.TabPage TabPage2;
internal System.Windows.Forms.TabPage TabPage3;
public System.Windows.Forms.CheckBox cbxAutoWalls;
public System.Windows.Forms.TextBox txtNewObjectRotation;
public System.Windows.Forms.Label Label19;
internal System.Windows.Forms.CheckBox cbxDesignableOnly;
public System.Windows.Forms.Label Label31;
public System.Windows.Forms.Label Label30;
public System.Windows.Forms.CheckBox cbxFootprintRotate;
internal System.Windows.Forms.TextBox txtObjectFind;
internal System.Windows.Forms.ToolStripMenuItem menuSaveFMapQuick;
internal System.Windows.Forms.ToolStripSeparator ToolStripSeparator7;
public System.Windows.Forms.RadioButton rdoObjectPlace;
public System.Windows.Forms.RadioButton rdoObjectLines;
internal System.Windows.Forms.GroupBox GroupBox3;
internal System.Windows.Forms.DataGridView dgvFeatures;
internal System.Windows.Forms.DataGridView dgvStructures;
internal System.Windows.Forms.DataGridView dgvDroids;
public System.Windows.Forms.Label Label44;
internal System.Windows.Forms.ToolStripMenuItem menuTools;
internal System.Windows.Forms.ToolStripMenuItem menuReinterpret;
internal System.Windows.Forms.ToolStripMenuItem menuWaterCorrection;
internal System.Windows.Forms.ToolStripSeparator ToolStripSeparator9;
internal System.Windows.Forms.ToolStripMenuItem menuGenerator;
internal System.Windows.Forms.ToolStripMenuItem menuFlatOil;
internal System.Windows.Forms.ToolStripMenuItem menuFlatStructures;
internal System.Windows.Forms.ToolStripSeparator ToolStripSeparator12;
internal System.Windows.Forms.Panel Panel2;
public System.Windows.Forms.Button btnObjectTypeSelect;
}
}
| 54.341079 | 168 | 0.619345 | [
"MIT"
] | Warzone2100/SharpFlame | source/SharpFlame/frmMain.Designer.cs | 196,443 | C# |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Threading;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Structure;
namespace Microsoft.CodeAnalysis.CSharp.Structure
{
internal class MethodDeclarationStructureProvider : AbstractSyntaxNodeStructureProvider<MethodDeclarationSyntax>
{
protected override void CollectBlockSpans(
MethodDeclarationSyntax methodDeclaration,
ArrayBuilder<BlockSpan> spans,
bool isMetadataAsSource,
OptionSet options,
CancellationToken cancellationToken)
{
CSharpStructureHelpers.CollectCommentBlockSpans(methodDeclaration, spans, isMetadataAsSource);
// fault tolerance
if (methodDeclaration.Body == null ||
methodDeclaration.Body.OpenBraceToken.IsMissing ||
methodDeclaration.Body.CloseBraceToken.IsMissing)
{
return;
}
SyntaxNodeOrToken current = methodDeclaration;
var nextSibling = current.GetNextSibling();
// Check IsNode to compress blank lines after this node if it is the last child of the parent.
var compressEmptyLines = !nextSibling.IsNode || nextSibling.IsKind(SyntaxKind.MethodDeclaration);
spans.AddIfNotNull(CSharpStructureHelpers.CreateBlockSpan(
methodDeclaration,
methodDeclaration.ParameterList.GetLastToken(includeZeroWidth: true),
compressEmptyLines: compressEmptyLines,
autoCollapse: true,
type: BlockTypes.Member,
isCollapsible: true));
}
}
}
| 40.375 | 116 | 0.682147 | [
"MIT"
] | BertanAygun/roslyn | src/Features/CSharp/Portable/Structure/Providers/MethodDeclarationStructureProvider.cs | 1,940 | C# |
// Copyright Epic Games, Inc. All Rights Reserved.
// This file is automatically generated. Changes to this file may be overwritten.
namespace Epic.OnlineServices.AntiCheatCommon
{
public class RegisterEventParamDef : ISettable
{
/// <summary>
/// Parameter name. Allowed characters are 0-9, A-Z, a-z, '_', '-', '.'
/// </summary>
public string ParamName { get; set; }
/// <summary>
/// Parameter type
/// </summary>
public AntiCheatCommonEventParamType ParamType { get; set; }
internal void Set(RegisterEventParamDefInternal? other)
{
if (other != null)
{
ParamName = other.Value.ParamName;
ParamType = other.Value.ParamType;
}
}
public void Set(object other)
{
Set(other as RegisterEventParamDefInternal?);
}
}
[System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)]
internal struct RegisterEventParamDefInternal : ISettable, System.IDisposable
{
private System.IntPtr m_ParamName;
private AntiCheatCommonEventParamType m_ParamType;
public string ParamName
{
get
{
string value;
Helper.TryMarshalGet(m_ParamName, out value);
return value;
}
set
{
Helper.TryMarshalSet(ref m_ParamName, value);
}
}
public AntiCheatCommonEventParamType ParamType
{
get
{
return m_ParamType;
}
set
{
m_ParamType = value;
}
}
public void Set(RegisterEventParamDef other)
{
if (other != null)
{
ParamName = other.ParamName;
ParamType = other.ParamType;
}
}
public void Set(object other)
{
Set(other as RegisterEventParamDef);
}
public void Dispose()
{
Helper.TryMarshalDispose(ref m_ParamName);
}
}
} | 20.965116 | 111 | 0.651692 | [
"MIT"
] | YanaPIIDXer/EpicOnlineServicesTest | Assets/EOSSDK/Generated/AntiCheatCommon/RegisterEventParamDef.cs | 1,803 | C# |
using System.Diagnostics;
using System.Runtime.CompilerServices;
using static System.Math;
namespace InstrumentedLibrary
{
/// <summary>
///
/// </summary>
public static class EllipseConicSectionPolynomialAngleTests
{
/// <summary>
/// Calculates a conic section polynomial that represents the provided angled ellipse.
/// </summary>
/// <param name="h">The center X coordinate.</param>
/// <param name="k">The center Y coordinate.</param>
/// <param name="a">The width of the ellipse.</param>
/// <param name="b">The angle of the ellipse in pi radians.</param>
/// <param name="angle">The angle.</param>
/// <returns></returns>
[DebuggerStepThrough]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static (double a, double b, double c, double d, double e, double f) EllipseConicSectionPolynomial(double h, double k, double a, double b, double angle) => EllipseConicSectionPolynomialTests.EllipseConicSectionPolynomial(h, k, a, b, Cos(angle), Sin(angle));
}
}
| 40.518519 | 271 | 0.659049 | [
"MIT"
] | Shkyrockett/CSharpSpeed | InstrumentedLibrary/Geometry/CurvePolynomials/EllipseConicSectionPolynomialAngleTests.cs | 1,096 | C# |
// --------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
// --------------------------------------------------------------------------------------------
namespace Microsoft.Oryx.BuildScriptGenerator.DotNetCore
{
public static class DotNetCoreConstants
{
public const string LanguageName = "dotnet";
public const string CSharpProjectFileExtension = "csproj";
public const string FSharpProjectFileExtension = "fsproj";
public const string GlobalJsonFileName = "global.json";
public const string NetCoreApp10 = "netcoreapp1.0";
public const string NetCoreApp11 = "netcoreapp1.1";
public const string NetCoreApp20 = "netcoreapp2.0";
public const string NetCoreApp21 = "netcoreapp2.1";
public const string NetCoreApp22 = "netcoreapp2.2";
public const string NetCoreApp30 = "netcoreapp3.0";
public const string OryxOutputPublishDirectory = "oryx_publish_output";
public const string AspNetCorePackageReference = "Microsoft.AspNetCore";
public const string AspNetCoreAllPackageReference = "Microsoft.AspNetCore.All";
public const string AspNetCoreAppPackageReference = "Microsoft.AspNetCore.App";
public const string ProjectFileLanguageDetectorProperty = "ProjectFile";
public const string WebSdkName = "Microsoft.NET.Sdk.Web";
public const string ProjectSdkAttributeValueXPathExpression = "string(/Project/@Sdk)";
public const string ProjectSdkElementNameAttributeValueXPathExpression = "string(/Project/Sdk/@Name)";
public const string TargetFrameworkElementXPathExpression = "/Project/PropertyGroup/TargetFramework";
public const string DefaultMSBuildConfiguration = "Release";
}
} | 52.108108 | 111 | 0.649378 | [
"MIT"
] | JasonRShaver/Oryx | src/BuildScriptGenerator/DotNetCore/DotnetCoreConstants.cs | 1,894 | C# |
using System;
using System.IO;
using Microsoft.Extensions.Configuration;
using Serilog;
using Serilog.Exceptions;
namespace CognitiveServicesTemplate.Api.WebApi.Configuration
{
public static class ConfigurationExtension
{
public static IConfiguration LoadConfiguration()
{
return new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json", optional: true)
.AddEnvironmentVariables()
.Build();
}
public static ILogger LoadLogger(IConfiguration configuration)
{
var loggerConf = new LoggerConfiguration()
.Enrich.FromLogContext()
.Enrich.WithExceptionDetails()
.WriteTo.Console();
if (Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Development")
{
loggerConf.MinimumLevel.Debug();
}
else
{
loggerConf.MinimumLevel.Information();
}
return loggerConf.CreateLogger();
}
}
} | 33.4 | 144 | 0.598802 | [
"MIT"
] | ElGuayaba/cognitive-services-template | src/CognitiveServicesTemplate.Api.WebApi/Configuration/ConfigurationExtension.cs | 1,336 | C# |
using Meadow;
using Meadow.Devices;
using Meadow.Foundation;
using Meadow.Foundation.Leds;
using Meadow.Foundation.Sensors.Buttons;
using Meadow.Hardware;
using System;
using System.Collections.Generic;
using System.Threading;
namespace Sensors.Buttons.PushButton_Sample
{
public class MeadowApp : App<F7Micro, MeadowApp>
{
RgbPwmLed led;
PushButton pushButton;
List<PushButton> pushButtons;
public MeadowApp()
{
Console.WriteLine("Initializing...");
//TestSinglePort();
TestMultiplePorts();
Console.WriteLine("PushButton(s) ready!!!");
}
void TestSinglePort()
{
led = new RgbPwmLed(
Device,
Device.Pins.D12,
Device.Pins.D11,
Device.Pins.D10);
led.SetColor(Color.Red);
//var interruptPort = Device.CreateDigitalInputPort(
// pin: Device.Pins.MOSI,
// resistorMode: ResistorMode.PullUp, 20);
//pushButton = new PushButton(interruptPort);
//pushButton = new PushButton(
// device: Device,
// inputPin: Device.Pins.MOSI,
// resistor: ResistorMode.PullUp);
//var interruptPort = Device.CreateDigitalInputPort(
// pin: Device.Pins.D02,
// resistorMode: ResistorMode.PullDown, 20);
//pushButton = new PushButton(interruptPort);
//pushButton = new PushButton(
// device: Device,
// inputPin: Device.Pins.D02,
// resistor: ResistorMode.PullDown);
var interruptPort = Device.CreateDigitalInputPort(
pin: Device.Pins.D03,
resistorMode: ResistorMode.Disabled);
pushButton = new PushButton(interruptPort);
//pushButton = new PushButton(
// device: Device,
// inputPin: Device.Pins.D03,
// resistor: ResistorMode.Disabled);
//var interruptPort = Device.CreateDigitalInputPort(
// pin: Device.Pins.D04,
// resistorMode: ResistorMode.Disabled);
//pushButton = new PushButton(interruptPort);
//pushButton = new PushButton(
// device: Device,
// inputPin: Device.Pins.D04,
// resistor: ResistorMode.Disabled);
if (pushButton.DigitalIn.InterruptMode == InterruptMode.EdgeRising ||
pushButton.DigitalIn.InterruptMode == InterruptMode.EdgeFalling)
{
pushButton.Clicked += PushButtonClicked;
}
if (pushButton.DigitalIn.InterruptMode == InterruptMode.EdgeBoth)
{
pushButton.PressStarted += PushButtonPressStarted;
pushButton.PressEnded += PushButtonPressEnded;
pushButton.LongPressClicked += PushButtonLongPressClicked;
}
led.SetColor(Color.Green);
}
void TestMultiplePorts()
{
led = new RgbPwmLed(
Device,
Device.Pins.OnboardLedRed,
Device.Pins.OnboardLedGreen,
Device.Pins.OnboardLedBlue);
led.SetColor(Color.Red);
// Important note: You can only use on Push Button per Group Set (GSXX)
pushButtons = new List<PushButton>
{
//new PushButton(Device, Device.Pins.A04, ResistorMode.PullUp), // <- GS00
new PushButton(Device, Device.Pins.D06, ResistorMode.PullUp), // <- GS00
//new PushButton(Device, Device.Pins.A05, ResistorMode.PullUp), // <- GS01
new PushButton(Device, Device.Pins.D09, ResistorMode.PullUp), // <- GS01
//new PushButton(Device, Device.Pins.A02, ResistorMode.PullUp), // <- GS03
new PushButton(Device, Device.Pins.D14, ResistorMode.PullUp), // <- GS03
//new PushButton(Device, Device.Pins.D15, ResistorMode.PullUp) // <- GS03
new PushButton(Device, Device.Pins.A00, ResistorMode.PullUp), // <- GS04
//new PushButton(Device, Device.Pins.A01, ResistorMode.PullUp), // <- GS05
new PushButton(Device, Device.Pins.MOSI,ResistorMode.PullUp), // <- GS05
new PushButton(Device, Device.Pins.D02, ResistorMode.PullUp), // <- GS06
//new PushButton(Device, Device.Pins.D08, ResistorMode.PullUp), // <- GS06
//new PushButton(Device, Device.Pins.A03, ResistorMode.PullUp), // <- GS07
new PushButton(Device, Device.Pins.D05, ResistorMode.PullUp), // <- GS07
//new PushButton(Device, Device.Pins.D07, ResistorMode.PullUp), // <- GS07
new PushButton(Device, Device.Pins.D03, ResistorMode.PullUp), // <- GS08
new PushButton(Device, Device.Pins.D00, ResistorMode.PullUp), // <- GS09
//new PushButton(Device, Device.Pins.D04, ResistorMode.PullUp), // <- GS09
//new PushButton(Device, Device.Pins.D11, ResistorMode.PullUp), // <- GS09
new PushButton(Device, Device.Pins.MISO, ResistorMode.PullUp), // <- GS11
new PushButton(Device, Device.Pins.D12, ResistorMode.PullUp), // <- GS14
new PushButton(Device, Device.Pins.D13, ResistorMode.PullUp), // <- GS15
};
for (int i = 0; i < pushButtons.Count; i++)
{
if (pushButtons[i].DigitalIn.InterruptMode == InterruptMode.EdgeRising ||
pushButtons[i].DigitalIn.InterruptMode == InterruptMode.EdgeFalling)
{
pushButtons[i].Clicked += PushButtonClicked;
}
if (pushButtons[i].DigitalIn.InterruptMode == InterruptMode.EdgeBoth)
{
pushButtons[i].PressStarted += PushButtonPressStarted;
pushButtons[i].PressEnded += PushButtonPressEnded;
pushButtons[i].LongPressClicked += PushButtonLongPressClicked;
}
}
led.SetColor(Color.Green);
}
void PushButtonClicked(object sender, EventArgs e)
{
Console.WriteLine($"PushButton Clicked!");
led.SetColor(Color.Magenta);
Thread.Sleep(100);
led.SetColor(Color.Green);
}
void PushButtonPressStarted(object sender, EventArgs e)
{
Console.WriteLine($"PushButton PressStarted!");
led.SetColor(Color.Red);
}
void PushButtonPressEnded(object sender, EventArgs e)
{
Console.WriteLine($"PushButton PressEnded!");
led.SetColor(Color.Green);
}
void PushButtonLongPressClicked(object sender, EventArgs e)
{
Console.WriteLine($"PushButton Clicked!");
led.SetColor(Color.Blue);
Thread.Sleep(100);
led.SetColor(Color.Green);
}
}
} | 39.940217 | 113 | 0.547285 | [
"Apache-2.0"
] | SebaWnek/Meadow.Foundation | Source/Meadow.Foundation.Core.Samples/Sensors.Buttons.PushButton_Sample/MeadowApp.cs | 7,351 | C# |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class EnemyController : MonoBehaviour
{
public float StartSpeed = 9f;
[HideInInspector]
public float Speed;
public float StartHealth = 119;
private float _currentHealth;
public int Worth = 50;
public GameObject DeathEffect;
public bool IsDead;
[Header("Unity Stuff")]
public Image HealthBar;
void Start()
{
_currentHealth = StartHealth;
Speed = StartSpeed;
}
void Update()
{
if (IsDead) { Die();}
}
public void TakeDamage(float amount)
{
_currentHealth -= amount;
HealthBar.fillAmount = _currentHealth / StartHealth;
if (_currentHealth <= 0)
{
IsDead = true;
}
}
public void Slow(float slowAmount)
{
Speed = StartSpeed * (1f - slowAmount);
}
private void Die()
{
WaveSpawner.EnemiesAlive--;
PlayerStats.Money += Worth;
var effect = Instantiate(DeathEffect, transform.position, Quaternion.identity);
Destroy(effect, 5f);
Destroy(this.gameObject);
}
}
| 20.639344 | 88 | 0.581414 | [
"MIT"
] | HunterOnToss/Unity_TD_Simple | Assets/_Scripts/Controllers/EnemyController.cs | 1,261 | C# |
using Explicit_Interfaces.Models;
using Explicit_Interfaces.Models.Contracts;
using System;
namespace Explicit_Interfaces.Common
{
public class Engine
{
public void Run()
{
string input;
while ((input = Console.ReadLine()) != "End")
{
string[] tokens = input.Split();
string name = tokens[0];
string country = tokens[1];
int age = int.Parse(tokens[2]);
Citizen citizen = new Citizen(name, country, age);
IPerson person = citizen;
Console.WriteLine(person.GetName());
IResident resident = citizen;
Console.WriteLine(resident.GetName());
}
}
}
}
| 26.758621 | 66 | 0.521907 | [
"MIT"
] | GeorgiGradev/CSharp_OOP | 06. Interfaces and Abstraction - Exercise/09.ExplicitInterfaces/Common/Engine.cs | 778 | C# |
using System;
using System.Collections;
using System.Device.Gpio;
using nanoFramework.UI;
using nanoFramework.UI.Input;
using nanoFramework.UI.Threading;
using nanoFramework.Presentation;
namespace Tetris
{
/// <summary>
/// Uses the hardware provider to get the pins for handling button input.
/// </summary>
public sealed class GPIOButtonInputProvider
{
public readonly Dispatcher Dispatcher;
//private ButtonPad[] buttons;
private ArrayList buttons;
private DispatcherOperationCallback callback;
private InputProviderSite site;
private PresentationSource source;
private readonly GpioController Gpio = new GpioController();
/// <summary>
/// Maps GPIOs to Buttons that can be processed by
/// nanoFramework.Presentation.
/// </summary>
/// <param name="source"></param>
public GPIOButtonInputProvider(PresentationSource source)
{
// Set the input source.
this.source = source;
// Register our object as an input source with the input manager and
// get back an InputProviderSite object which forwards the input
// report to the input manager, which then places the input in the
// staging area.
site = InputManager.CurrentInputManager.RegisterInputProvider(this);
// Create a delegate that refers to the InputProviderSite object's
// ReportInput method.
callback = new DispatcherOperationCallback(delegate (object report)
{
InputReportArgs args = (InputReportArgs)report;
return site.ReportInput(args.Device, args.Report);
});
Dispatcher = Dispatcher.CurrentDispatcher;
this.buttons = new ArrayList();
}
/// <summary>
/// Add a GPIO pin as a specific Button
/// </summary>
/// <param name="gpioPinNumber">GPIO pin number</param>
/// <param name="button">Button that this pin represents</param>
/// <param name="internalPullup">If true will enable the internal pull up on pin ( SetDriveMode = InputPullUp )
public void AddButton(int gpioPinNumber, Button button, bool internalPullup)
{
GpioPin pin = Gpio.OpenPin(gpioPinNumber);
pin.SetPinMode(internalPullup ? PinMode.InputPullUp : PinMode.Input);
pin.DebounceTimeout = new TimeSpan(0, 0, 0, 0, 50);
this.buttons.Add(new ButtonPad(this, button, pin));
}
/// <summary>
/// Represents a button pad on the emulated device, containing five
/// buttons for user input.
/// </summary>
internal class ButtonPad : IDisposable
{
private readonly Button button;
private readonly GPIOButtonInputProvider sink;
private readonly ButtonDevice buttonDevice = InputManager.CurrentInputManager.ButtonDevice;
/// <summary>
/// Constructs a ButtonPad object that handles the
/// hardware's button interrupts.
/// </summary>
/// <param name="sink"></param>
/// <param name="button"></param>
/// <param name="pin"></param>
public ButtonPad(GPIOButtonInputProvider sink, Button button, GpioPin pin)
{
this.sink = sink;
this.button = button;
pin.ValueChanged += Pin_ValueChanged;
}
private void Pin_ValueChanged(object sender, PinValueChangedEventArgs e)
{
RawButtonActions action = (e.ChangeType == PinEventTypes.Falling) ? RawButtonActions.ButtonUp : RawButtonActions.ButtonDown;
// Create a time, should be from the pin_ValueChanged event.
DateTime time = DateTime.UtcNow;
RawButtonInputReport report = new RawButtonInputReport(sink.source, time, button, action);
// Queue the button press to the input provider site.
sink.Dispatcher.BeginInvoke(sink.callback, new InputReportArgs(buttonDevice, report));
}
protected virtual void Dispose(bool disposing)
{
if (disposing)
{
}
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
}
}
}
| 29.669291 | 128 | 0.715764 | [
"MIT"
] | fluent-software/Samples | samples/Graphics/Tetris/GpioButtonInputProvider.cs | 3,768 | C# |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ConsoleApplication5")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ConsoleApplication5")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6e0d48c2-d19c-4e5f-9663-d9bda9c4f31b")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| 38.135135 | 84 | 0.747697 | [
"MIT"
] | 6e3veR6k/codewars-csharp | resources/csharp-professional-materials/15 - AsyncAwait/AsyncAwait/ConsoleApplication5/Properties/AssemblyInfo.cs | 1,414 | C# |
using System.Net;
using System.Net.Http.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Testing;
using NUnit.Framework;
namespace Stackage.Aws.Lambda.FakeRuntime.Tests.ControllerTests
{
public class FunctionsControllerTests
{
[TestCase("foo")]
[TestCase("ResponseRequest")]
[TestCase("RunDry")]
public async Task invocations_endpoint_returns_bad_request_for_invalid_invocation_types(string invocationType)
{
using var webApplicationFactory = new WebApplicationFactory<FakeRuntimeStartup>();
using var httpClient = webApplicationFactory.CreateClient();
var content = JsonContent.Create(new {foo = "bar"});
content.Headers.Add("X-Amz-Invocation-Type", invocationType);
var response = await httpClient.PostAsync("/2015-03-31/functions/my-function/invocations", content);
Assert.That(response.StatusCode, Is.EqualTo(HttpStatusCode.BadRequest));
}
}
}
| 34.607143 | 116 | 0.728586 | [
"MIT"
] | concilify/stackage-aws-lambda-nuget | package/Stackage.Aws.Lambda.FakeRuntime.Tests/ControllerTests/FunctionsControllerTests.cs | 969 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
public partial class Plataformas : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindData();
}
}
private DataTable GetData(SqlCommand cmd, SqlConnection con)
{
DataTable dt = new DataTable();
SqlDataAdapter sda = new SqlDataAdapter();
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
con.Open();
sda.SelectCommand = cmd;
sda.Fill(dt);
return dt;
}
private void BindData()
{
SqlConnection conexion = new SqlConnection("Data Source=LAPTOP-2V9EL9OT\\SQLEXPRESS;Initial Catalog=Fase2;Integrated Security=True");
SqlCommand cmd = new SqlCommand("Select * from Plataforma");
GridView1.DataSource = GetData(cmd, conexion);
GridView1.DataBind();
}
protected void datagrid_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView gv = (GridView)sender;
gv.PageIndex = e.NewPageIndex;
BindData();
}
protected void DeleteCustomer(object sender, EventArgs e)
{
LinkButton lnkRemove = (LinkButton)sender;
SqlConnection conexion = new SqlConnection("Data Source=LAPTOP-2V9EL9OT\\SQLEXPRESS;Initial Catalog=Fase2;Integrated Security=True");
SqlCommand foranea = new SqlCommand();
foranea.CommandType = CommandType.Text;
foranea.CommandText = "delete from Software_Plataforma where idplataforma=@id_Plataforma; select * from Software_Plataforma";
foranea.Parameters.Add("@id_Plataforma", SqlDbType.VarChar).Value = lnkRemove.CommandArgument;
foranea.Connection = conexion;
conexion.Open();
foranea.ExecuteNonQuery();
foranea.Connection.Close();
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "delete from Plataforma where " +
"id_Plataforma=@id_Plataforma;" +
"select * from Plataforma";
cmd.Parameters.Add("@id_Plataforma", SqlDbType.VarChar).Value
= lnkRemove.CommandArgument;
GridView1.DataSource = GetData(cmd, conexion);
GridView1.DataBind();
}
protected void EditCustomer(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
BindData();
}
protected void CancelEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
BindData();
}
protected void UpdateCustomer(object sender, GridViewUpdateEventArgs e)
{
int id = Convert.ToInt32(((Label)GridView1.Rows[e.RowIndex].FindControl("lblPlataforma")).Text);
string tipo = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("txttipo")).Text;
SqlConnection conexion = new SqlConnection("Data Source=LAPTOP-2V9EL9OT\\SQLEXPRESS;Initial Catalog=Fase2;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "UPDATE Plataforma Set tipo=@tipo where id_Plataforma=@id_Plataforma;" +
"select * from Plataforma";
cmd.Parameters.Add("@id_Plataforma", SqlDbType.Int).Value = id;
cmd.Parameters.Add("@tipo", SqlDbType.VarChar).Value = tipo;
GridView1.EditIndex = -1;
GridView1.DataSource = GetData(cmd, conexion);
GridView1.DataBind();
}
protected void boton_guardar_Click(object sender, EventArgs e)
{
String Tipo = tipo.Text;
SqlConnection conexion = new SqlConnection("Data Source=LAPTOP-2V9EL9OT\\SQLEXPRESS;Initial Catalog=Fase2;Integrated Security=True");
conexion.Open();
SqlCommand cmd = new SqlCommand("INSERT INTO Plataforma(tipo) VALUES('" + Tipo + "')", conexion);
try
{
cmd.ExecuteNonQuery();
Response.Redirect("Plataformas.aspx");
}
catch (SqlException ee)
{
string script = "alert(\"Error al Guardar\");";
ScriptManager.RegisterStartupScript(this, GetType(),
"ServerControlScript", script, true);
conexion.Close();
}
}
protected void Crear_Click(object sender, EventArgs e)
{
div_mostrar.Visible = true;
}
} | 36 | 141 | 0.653333 | [
"MIT"
] | wolfghost9898/Proyectos | IPC2/IPC FASE II/Plataformas.aspx.cs | 4,502 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BTM.Database;
using BTM.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace BTM.WebAPI.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class AwardInfoController : ControllerBase
{
private ApplicationDbContext _context;
public AwardInfoController(ApplicationDbContext context)
{
_context = context;
}
[HttpGet("awardtypes")]
public IEnumerable<AwardType> Get()
{
return _context.AwardTypes.AsNoTracking().AsEnumerable();
}
[HttpGet("awardshows")]
public IEnumerable<AwardShow> GetShows()
{
return _context.AwardShows.AsNoTracking().AsEnumerable();
}
}
} | 24.916667 | 69 | 0.665552 | [
"MIT"
] | TheDoomKing/BTM | BTM.WebAPI/Controllers/AwardInfoController.cs | 899 | C# |
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.36400
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ASP
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
#line 3 "..\..\Views\Dossier\Links.cshtml"
using Kesco.Persons.Web.Models.Dossier;
#line default
#line hidden
#line 2 "..\..\Views\Dossier\Links.cshtml"
using Kesco.Web.Mvc;
#line default
#line hidden
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Dossier/Links.cshtml")]
public partial class _Views_Dossier_Links_cshtml : Kesco.Persons.Web.SiteViewPage<Kesco.Persons.Web.Models.Dossier.DossierSectionContext>
{
public _Views_Dossier_Links_cshtml()
{
}
public override void Execute()
{
#line 4 "..\..\Views\Dossier\Links.cshtml"
int personID = Model.ViewModel.Model.PersonID;
string url = Model.Section.GetURL(Model.ViewModel.Model.PersonID);
var sectionID = Model.Section.ID.ToString();
var currentAccess = Model.AccessGranted;
var items = Model.ViewModel.GetContextItems(cxti => cxti.TabID == Model.Section.ID);
if (items.Count == 0) {Html.DossierClientSideScript_HideSection(Model.Section.ID);}
/* Ищем в URL параметр hideOldVer, пишем его в сессию. Требуется для скрытия кнопки "Открыть в старой версии" */
string hideOldVerRequest = HttpContext.Current.Request["hideOldVer"];
var hideOldVerSession = HttpContext.Current.Session["hideOldVer"];
string hideOldVer = "false";
if (!String.IsNullOrEmpty(hideOldVerRequest))
{
HttpContext.Current.Session["hideOldVer"] = hideOldVer = hideOldVerRequest;
}
else if (hideOldVerSession != null)
{
hideOldVer = hideOldVerSession.ToString();
}
Html.DossierClientSideScript_EditLink(sectionID, url);
#line default
#line hidden
WriteLiteral("\r\n");
#line 28 "..\..\Views\Dossier\Links.cshtml"
foreach (var item in items) {
#line default
#line hidden
WriteLiteral("\t<tr class=\"hoverable dsl");
#line 29 "..\..\Views\Dossier\Links.cshtml"
Write(sectionID);
#line default
#line hidden
WriteLiteral("\">\r\n\t\t<td colspan=\"2\" style=\"padding-left: 20px;\">\r\n");
#line 31 "..\..\Views\Dossier\Links.cshtml"
if (currentAccess > 0) {
#line default
#line hidden
WriteLiteral("\t\t\t<a href=\"javascript: void(0);\"\r\n\t\t\t\tonclick=\"dossierEditLink_");
#line 33 "..\..\Views\Dossier\Links.cshtml"
Write(sectionID);
#line default
#line hidden
WriteLiteral("(");
#line 33 "..\..\Views\Dossier\Links.cshtml"
Write(item.ID);
#line default
#line hidden
WriteLiteral(", ");
#line 33 "..\..\Views\Dossier\Links.cshtml"
Write(sectionID);
#line default
#line hidden
WriteLiteral(", ");
#line 33 "..\..\Views\Dossier\Links.cshtml"
Write(hideOldVer);
#line default
#line hidden
WriteLiteral(");\"\r\n\t\t\t\ttitle=\"");
#line 34 "..\..\Views\Dossier\Links.cshtml"
Write(Kesco.Web.Mvc.UI.Controls.Localization.Resources.GUI_Menu_Edit_Edit);
#line default
#line hidden
WriteLiteral("\">\r\n\t\t\t\t<span class=\"ui-icon ui-icon-pencil text-ui-icon\"></span>\r\n\t\t\t</a>\r\n");
#line 37 "..\..\Views\Dossier\Links.cshtml"
}
#line default
#line hidden
WriteLiteral("\t\t\t");
#line 38 "..\..\Views\Dossier\Links.cshtml"
Write(Html.DisplayFor(m => item.LinkID, "PersonStatic", new {
TooltipPositionMy = "middle left", TooltipPositionAt = "middle right",
InitialLabel = HL(item.LinkText)
}));
#line default
#line hidden
WriteLiteral(" \r\n\t\t\t");
#line 42 "..\..\Views\Dossier\Links.cshtml"
Write(Html.Raw(HL(item.Label)));
#line default
#line hidden
WriteLiteral("\r\n\t\t</td>\r\n\t\t<td class=\"changed\">\r\n\t\t\t");
#line 45 "..\..\Views\Dossier\Links.cshtml"
Write(Html.DisplayFor(m => item.ChangedBy, "EmployeeStatic", new {
TooltipPositionMy = "middle right", TooltipPositionAt = "middle left",
InitialLabel = item.ChangedByFIO }));
#line default
#line hidden
WriteLiteral(" \r\n\t\t\t<span>");
#line 48 "..\..\Views\Dossier\Links.cshtml"
Write(item.ChangedDate);
#line default
#line hidden
WriteLiteral("</span>\r\n\t\t</td>\r\n\t</tr>\r\n");
#line 51 "..\..\Views\Dossier\Links.cshtml"
}
#line default
#line hidden
}
}
}
#pragma warning restore 1591
| 26.205128 | 141 | 0.53604 | [
"MIT"
] | Kesco-m/Kesco.App.Web.MVC.Persons | Kesco.Persons.Web/Views/Dossier/Links.generated.cs | 6,207 | C# |
namespace ODriveClientLibrary
{
using System;
using System.Threading;
using ODriveClientLibrary.Utilities;
internal class Request
{
public ushort EncodedSequenceNumber { get; private set; }
public ushort SequenceNumber { get; private set; }
public ushort EncodedEndpointID { get; private set; }
public ushort EndpointID { get; private set; }
public ushort ExpectedResponseSize { get; private set; }
public bool RequestACK { get; private set; }
public ushort Signature { get; private set; }
public CancellationToken CancellationToken { get; private set; }
public WireBuffer Body { get; private set; }
public Action<Response> ResponseCallback { get; private set; }
public Request(
ushort sequenceNumber,
ushort endpointID,
ushort expectedResponseSize,
bool requestACK,
Func<WireBuffer> populateBody,
Action<Response> responseCallback,
ushort signature,
CancellationToken cancellationToken)
{
// NOTE: Regarding the 0x80 value, see https://github.com/madcowswe/ODrive/blob/eb07260c3ea57e74c59432fd036b275b608d85d0/Firmware/fibre/python/fibre/protocol.py#L276
SequenceNumber = sequenceNumber;
EncodedSequenceNumber = (ushort)(sequenceNumber | 0x80);
EndpointID = endpointID;
EncodedEndpointID = (ushort)(requestACK ? endpointID | 0x8000 : endpointID);
ExpectedResponseSize = expectedResponseSize;
RequestACK = requestACK;
Body = populateBody.Invoke();
ResponseCallback = responseCallback;
Signature = signature;
CancellationToken = cancellationToken;
if (Body == null)
{
Body = new WireBuffer(0);
}
}
public byte[] ToByteArray()
{
var outputBuffer = new WireBuffer(Body.Data.Length + 8);
// For general protocol doc this is written against, see https://github.com/madcowswe/ODrive/blob/1294ddff1dd0619e9f098ce12ca0936670a5b405/docs/protocol.md
// Bytes 0, 1 Sequence number, MSB = 0
// Bytes 2, 3 Endpoint ID
// Bytes 4, 5 Expected response size
// Bytes 6 to N-3 Payload
// Bytes N-2, N-1 signature, depends on endpoint
outputBuffer
.Write(EncodedSequenceNumber)
.Write(EncodedEndpointID)
.Write(ExpectedResponseSize)
.Write(Body.Data)
.Write(Signature);
return outputBuffer.Data;
}
}
}
| 39.197183 | 178 | 0.592885 | [
"MIT"
] | metanoic/ODriveClientLibrary | ODriveClientLibrary/Request.cs | 2,785 | C# |
using System;
using System.Linq;
namespace _08Needles
{
public class Needles
{
public static void Main(string[] args)
{
string tokens = Console.ReadLine();
int[] numbers = Console.ReadLine().Split().Select(int.Parse).ToArray();
int[] needles = Console.ReadLine().Split().Select(int.Parse).ToArray();
for (int i = 0; i < needles.Length; i++)
{
int zeroes = 0;
bool isFound = false;
for (int j = 0; j < numbers.Length; j++)
{
if (needles[i] <= numbers[j])
{
Console.Write(j - zeroes + " ");
isFound = true;
break;
}
if (numbers[j] == 0)
{
zeroes++;
}
else
{
zeroes = 0;
}
}
if (!isFound)
{
Console.Write(numbers.Length - zeroes + " ");
}
}
Console.WriteLine();
}
}
}
// namespace Needles
// {
// using System;
// using System.Collections.Generic;
// using System.Linq;
// public class Needles
// {
// static void Main(string[] args)
// {
// int[] arguments = Console.ReadLine().Split().Select(int.Parse).ToArray();
// int collectionCount = arguments[0];
// int numbersToInsertCount = arguments[1];
// int[] collection = Console.ReadLine().Split().Select(int.Parse).ToArray();
// int[] numbersToInsert = Console.ReadLine().Split().Select(int.Parse).ToArray();
// List<int> indexes = new List<int>();
// for (int num = 0; num < numbersToInsertCount; num++)
// {
// bool solutionFount = false;
// for (int current = 0; current < collectionCount; current++)
// {
// if (collection[current] != 0 && collection[current] >= numbersToInsert[num])
// {
// int index = RetraseIndex(current, collection);
// indexes.Add(index);
// solutionFount = true;
// break;
// }
// }
// if (!solutionFount)
// {
// int index = RetraseIndex(collectionCount, collection);
// indexes.Add(index);
// }
// }
// Console.WriteLine(string.Join(" ", indexes));
// }
// private static int RetraseIndex(int index, int[] collection)
// {
// while (index > 0 && collection[index - 1] == 0)
// {
// index--;
// }
// return index;
// }
// }
// }
| 30.227723 | 99 | 0.401572 | [
"MIT"
] | Supbads/Softuni-Education | 06 Algorithms 04.16/Homework/3. Sorting-and-Searching-Algorithms-Lab-Skeleton/Needles/Needles.cs | 3,055 | C# |
using System.Collections.Generic;
using SFML.Audio;
namespace SimpleX.Managers
{
public class AudioManager
{
private List<Sound> _sounds;
private Music _music;
public AudioManager()
{
_sounds = new List<Sound>();
}
public void PlaySound(string path)
{
var a = new Sound();
a.SoundBuffer = new SoundBuffer(path);
a.Loop = false;
a.Play();
_sounds.Add(a);
}
public void PlayMusic(string path)
{
_music = new Music(path);
_music.Loop = true;
_music.Play();
}
public void PauseAll()
{
_sounds.ForEach((audio => audio.Pause()));
_music.Pause();
}
public void ResumeAll(){
_sounds.ForEach((audio => audio.Play()));
_music.Pause();
}
public void DisposeAll()
{
_sounds.ForEach((audio => audio.Dispose()));
_sounds.Clear();
}
public void Update()
{
for(int i=_sounds.Count - 1; i > -1; i--)
{
var audio = _sounds[i];
if (audio!=null && audio.Status== SoundStatus.Stopped)
{
audio.Dispose();
_sounds.RemoveAt(i);
}
}
}
}
} | 22.149254 | 70 | 0.429919 | [
"Unlicense"
] | yCatDev/SimpleX | SimpleX/Managers/AudioManager.cs | 1,486 | C# |
using System.Linq;
using Microsoft.Bot.Schema;
namespace GaryPretty.Bot.Builder.Dialogs.Location
{
/// <summary>
/// Extensions for <see cref="Place"/>
/// </summary>
public static class Extensions
{
/// <summary>
/// Gets the postal address.
/// </summary>
/// <param name="place">The place.</param>
/// <returns>The <see cref="PostalAddress"/> if available, null otherwise.</returns>
public static PostalAddress GetPostalAddress(this Place place)
{
if (place.Address != null)
{
return (PostalAddress)place.Address;
}
return null;
}
/// <summary>
/// Gets the geo coordinates.
/// </summary>
/// <param name="place">The place.</param>
/// <returns>The <see cref="GeoCoordinates"/> if available, null otherwise.</returns>
public static GeoCoordinates GetGeoCoordinates(this Place place)
{
if (place.Geo != null)
{
return (GeoCoordinates)place.Geo;
}
return null;
}
internal static string GetFormattedAddress(this Bing.Location location, string separator)
{
if (location?.Address == null)
{
return null;
}
return string.Join(separator, new[]
{
location.Address.AddressLine,
location.Address.Locality,
location.Address.AdminDistrict,
location.Address.PostalCode,
location.Address.CountryRegion
}.Where(x => !string.IsNullOrEmpty(x)));
}
}
}
| 29.118644 | 97 | 0.529686 | [
"MIT"
] | garypretty/botbuilder-dotnet-extensions | libraries/GaryPretty.Bot.Builder.Dialogs.Location/Extensions.cs | 1,720 | C# |
using System;
using System.Collections.Generic;
namespace Nucleo.Context.Services
{
public abstract class BaseInlineServiceDictionary : IServiceDictionary
{
private Dictionary<string, object> _items = null;
#region " Properties "
public int Count
{
get { return this.Items.Count; }
}
protected Dictionary<string, object> Items
{
get
{
if (_items == null)
_items = new Dictionary<string, object>();
return _items;
}
}
public object this[string key]
{
get
{
if (this.Items.ContainsKey(key))
return this.Items[key];
else
return null;
}
set
{
if (this.Items.ContainsKey(key))
this.Items[key] = value;
else
this.Items.Add(key, value);
}
}
#endregion
#region " Methods "
public void Add(string key, object value)
{
this.Items.Add(key, value);
}
public bool Contains(string key)
{
return this.Items.ContainsKey(key);
}
public object Get(string key)
{
return this.Items[key];
}
public object Get(int index)
{
string key = "";
return this.Get(key);
}
public void Remove(string key)
{
this.Items.Remove(key);
}
public void RemoveAt(int index)
{
string key = "";
this.Items.Remove(key);
}
#endregion
}
}
| 14.41573 | 71 | 0.623539 | [
"MIT"
] | brianmains/Nucleo.NET | src_wip/Nucleo.Core/Context/Services/BaseInlineServiceDictionary.cs | 1,285 | C# |
// *****************************************************************************
//
// © Component Factory Pty Ltd 2012. All rights reserved.
// The software and associated documentation supplied hereunder are the
// proprietary information of Component Factory Pty Ltd, 17/267 Nepean Hwy,
// Seaford, Vic 3198, Australia and are supplied subject to licence terms.
//
// Version 4.4.0.0 www.ComponentFactory.com
// *****************************************************************************
using System;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Diagnostics;
namespace ComponentFactory.Krypton.Toolkit
{
/// <summary>
/// Extends the ViewComposite by applying a docking style for each child.
/// </summary>
public class ViewLayoutDocker : ViewComposite
{
#region Instance Fields
private VisualOrientation _orientation;
private ViewDockStyleLookup _childDocking;
private Rectangle _fillRectangle;
private PaletteDrawBorders _maxBorderEdges;
private bool _preferredSizeAll;
private bool _removeChildBorders;
private bool _ignoreRightToLeftLayout;
private Padding _padding;
private object _tag;
#endregion
#region Identity
/// <summary>
/// Initialize a new instance of the ViewLayoutDocker class.
/// </summary>
public ViewLayoutDocker()
{
// Create child to dock style lookup
_childDocking = new ViewDockStyleLookup();
// Default state
_fillRectangle = Rectangle.Empty;
_orientation = VisualOrientation.Top;
_maxBorderEdges = PaletteDrawBorders.All;
_preferredSizeAll = false;
_removeChildBorders = false;
_ignoreRightToLeftLayout = false;
_padding = Padding.Empty;
}
/// <summary>
/// Obtains the String representation of this instance.
/// </summary>
/// <returns>User readable name of the instance.</returns>
public override string ToString()
{
// Return the class name and instance identifier
return "ViewLayoutDocker:" + Id + " " + _childDocking.Count.ToString();
}
#endregion
#region IgnoreRightToLeftLayout
/// <summary>
/// Gets and sets if the RightToLeftLayout ability is used.
/// </summary>
public bool IgnoreRightToLeftLayout
{
get { return _ignoreRightToLeftLayout; }
set { _ignoreRightToLeftLayout = value; }
}
#endregion
#region Orientation
/// <summary>
/// Gets and sets the visual orientation.
/// </summary>
public VisualOrientation Orientation
{
get { return _orientation; }
set { _orientation = value; }
}
#endregion
#region Padding
/// <summary>
/// Gets and sets the padding around the edges.
/// </summary>
public Padding Padding
{
get { return _padding; }
set { _padding = value; }
}
#endregion
#region MaxBorderEdges
/// <summary>
/// Gets and sets the maximum edges allowed.
/// </summary>
public PaletteDrawBorders MaxBorderEdges
{
get { return _maxBorderEdges; }
set { _maxBorderEdges = value; }
}
#endregion
#region RemoveChildBorders
/// <summary>
/// Gets and sets a value indicating if borders for docking edged children should be removed to prevent double borders.
/// </summary>
public bool RemoveChildBorders
{
get { return _removeChildBorders; }
set { _removeChildBorders = value; }
}
#endregion
#region PreferredSizeAll
/// <summary>
/// Gets and sets a value indicating if calculating the preferred size should include visible and invisible children.
/// </summary>
public bool PreferredSizeAll
{
get { return _preferredSizeAll; }
set { _preferredSizeAll = value; }
}
#endregion
#region FillRect
/// <summary>
/// Gets the fill rectangle left after positioning all children.
/// </summary>
public Rectangle FillRectangle
{
get { return _fillRectangle; }
}
#endregion
#region Dock
/// <summary>
/// Gets the dock setting for the provided child instance.
/// </summary>
/// <param name="child">Child view element.</param>
/// <returns>Docking setting.</returns>
public ViewDockStyle GetDock(ViewBase child)
{
Debug.Assert(child != null);
// Does this element exist in the lookup?
if (!_childDocking.ContainsKey(child))
{
// No, so add with a default value
_childDocking.Add(child, ViewDockStyle.Top);
}
return _childDocking[child];
}
/// <summary>
/// Sets the dock setting for the provided child instance.
/// </summary>
/// <param name="child">Child view element.</param>
/// <param name="dock">ViewDockStyle setting.</param>
public void SetDock(ViewBase child, ViewDockStyle dock)
{
Debug.Assert(child != null);
// If the lookup is not already defined
if (!_childDocking.ContainsKey(child))
{
// Then just add the value
_childDocking.Add(child, dock);
}
else
{
// Overwrite the existing value
_childDocking[child] = dock;
}
}
#endregion
#region Collection
/// <summary>
/// Append a view to the collection.
/// </summary>
/// <param name="item">ViewBase reference.</param>
/// <param name="dock">DockStyle setting.</param>
public void Add(ViewBase item, ViewDockStyle dock)
{
// Add the child to the view
Add(item);
// Set the initial docking for the new element
SetDock(item, dock);
}
#endregion
#region Tag
/// <summary>
/// Gets and sets data with the view.
/// </summary>
public object Tag
{
get { return _tag; }
set { _tag = value; }
}
#endregion
#region Layout
/// <summary>
/// Discover the preferred size of the element.
/// </summary>
/// <param name="context">Layout context.</param>
public override Size GetPreferredSize(ViewLayoutContext context)
{
Debug.Assert(context != null);
// Create new lookup that only contains entries for current child items
ViewDockStyleLookup newChildDocking = new ViewDockStyleLookup();
// Remember the original display rectangle provided
Rectangle originalRect = context.DisplayRectangle;
Rectangle displayRect = context.DisplayRectangle;
// Accumulate the size that must be provided by docking edges and then filler
Size preferredSize = Size.Empty;
// Track the minimize size needed to satisfy the docking edges only
Size minimumSize = Size.Empty;
PaletteDrawBorders leftEdges = PaletteDrawBorders.All;
PaletteDrawBorders rightEdges = PaletteDrawBorders.All;
PaletteDrawBorders topEdges = PaletteDrawBorders.All;
PaletteDrawBorders bottomEdges = PaletteDrawBorders.All;
PaletteDrawBorders fillEdges = PaletteDrawBorders.All;
// Check for edge docking children
foreach (ViewBase child in this.Reverse())
{
// Add into the valid child lookup
ViewDockStyle dockStyle = GetDock(child);
newChildDocking.Add(child, dockStyle);
// Only position visible children that are not 'fill'
if ((child.Visible || PreferredSizeAll) && (GetDock(child) != ViewDockStyle.Fill))
{
// Prevent children from showing adjacent borders that are not needed
UpdateChildBorders(child, context, ref leftEdges, ref rightEdges,
ref topEdges, ref bottomEdges, ref fillEdges);
// Update with latest calculated display rectangle
context.DisplayRectangle = displayRect;
// Get the preferred size of the child
Size childSize = child.GetPreferredSize(context);
// Apply size requests from edge docking children
switch (OrientateDock(dockStyle))
{
case ViewDockStyle.Top:
preferredSize.Height += childSize.Height;
displayRect.Y += childSize.Height;
displayRect.Height -= childSize.Height;
if (minimumSize.Width < childSize.Width)
minimumSize.Width = childSize.Width;
break;
case ViewDockStyle.Bottom:
preferredSize.Height += childSize.Height;
displayRect.Height -= childSize.Height;
if (minimumSize.Width < childSize.Width)
minimumSize.Width = childSize.Width;
break;
case ViewDockStyle.Left:
preferredSize.Width += childSize.Width;
displayRect.X += childSize.Width;
displayRect.Width -= childSize.Width;
if (minimumSize.Height < childSize.Height)
minimumSize.Height = childSize.Height;
break;
case ViewDockStyle.Right:
preferredSize.Width += childSize.Width;
displayRect.Width -= childSize.Width;
if (minimumSize.Height < childSize.Height)
minimumSize.Height = childSize.Height;
break;
}
}
}
// Check for the fill child last
foreach (ViewBase child in this.Reverse())
{
// Only interested in a visible 'fill' child
if ((child.Visible || PreferredSizeAll) && (GetDock(child) == ViewDockStyle.Fill))
{
// Prevent children from showing adjacent borders that are not needed
UpdateChildBorders(child, context, ref leftEdges, ref rightEdges,
ref topEdges, ref bottomEdges, ref fillEdges);
// Update with latest calculated display rectangle
context.DisplayRectangle = displayRect;
// Get the preferred size of the child
Size childSize = child.GetPreferredSize(context);
preferredSize.Width += childSize.Width;
preferredSize.Height += childSize.Height;
// There can only be one filler!
break;
}
}
// Use updated lookup
_childDocking = newChildDocking;
// Put back the original display rect
context.DisplayRectangle = originalRect;
// Enforce the minimum values from the other docking edge sizes
preferredSize.Width = Math.Max(preferredSize.Width, minimumSize.Width);
preferredSize.Height = Math.Max(preferredSize.Height, minimumSize.Height);
// Apply the padding request
switch (Orientation)
{
case VisualOrientation.Top:
case VisualOrientation.Bottom:
preferredSize.Width += Padding.Horizontal;
preferredSize.Height += Padding.Vertical;
break;
case VisualOrientation.Left:
case VisualOrientation.Right:
preferredSize.Width += Padding.Vertical;
preferredSize.Height += Padding.Horizontal;
break;
}
// Allow the preferred size to be modified before being used
return UpdatePreferredSize(preferredSize);
}
/// <summary>
/// Perform a layout of the elements.
/// </summary>
/// <param name="context">Layout context.</param>
public override void Layout(ViewLayoutContext context)
{
Debug.Assert(context != null);
// We take on all the available display area
ClientRectangle = context.DisplayRectangle;
// Space available for children begins with our space
Rectangle fillerRect = ClientRectangle;
// Apply the padding against the rect
switch (Orientation)
{
case VisualOrientation.Top:
fillerRect.X += Padding.Left;
fillerRect.Y += Padding.Top;
fillerRect.Width -= Padding.Horizontal;
fillerRect.Height -= Padding.Vertical;
break;
case VisualOrientation.Bottom:
fillerRect.X += Padding.Right;
fillerRect.Y += Padding.Bottom;
fillerRect.Width -= Padding.Horizontal;
fillerRect.Height -= Padding.Vertical;
break;
case VisualOrientation.Left:
fillerRect.X += Padding.Top;
fillerRect.Y += Padding.Right;
fillerRect.Width -= Padding.Vertical;
fillerRect.Height -= Padding.Horizontal;
break;
case VisualOrientation.Right:
fillerRect.X += Padding.Bottom;
fillerRect.Y += Padding.Left;
fillerRect.Width -= Padding.Vertical;
fillerRect.Height -= Padding.Horizontal;
break;
}
// By default all the children need to draw all their borders
PaletteDrawBorders leftEdges = PaletteDrawBorders.All;
PaletteDrawBorders rightEdges = PaletteDrawBorders.All;
PaletteDrawBorders topEdges = PaletteDrawBorders.All;
PaletteDrawBorders bottomEdges = PaletteDrawBorders.All;
PaletteDrawBorders fillEdges = PaletteDrawBorders.All;
// Position all except the filler
foreach (ViewBase child in this.Reverse())
{
// Only position visible children that are not 'fill'
if (child.Visible && (GetDock(child) != ViewDockStyle.Fill))
{
// Prevent children from showing adjacent borders that are not needed
UpdateChildBorders(child, context, ref leftEdges, ref rightEdges,
ref topEdges, ref bottomEdges, ref fillEdges);
// Provide the available space left over
context.DisplayRectangle = fillerRect;
// Get the preferred size of the child
Size childSize = child.GetPreferredSize(context);
// Position the child inside the available space
switch (CalculateDock(OrientateDock(GetDock(child)), context.Control))
{
case ViewDockStyle.Top:
context.DisplayRectangle = new Rectangle(fillerRect.X, fillerRect.Y, fillerRect.Width, childSize.Height);
fillerRect.Height -= childSize.Height;
fillerRect.Y += childSize.Height;
break;
case ViewDockStyle.Bottom:
context.DisplayRectangle = new Rectangle(fillerRect.X, fillerRect.Bottom - childSize.Height, fillerRect.Width, childSize.Height);
fillerRect.Height -= childSize.Height;
break;
case ViewDockStyle.Left:
context.DisplayRectangle = new Rectangle(fillerRect.X, fillerRect.Y, childSize.Width, fillerRect.Height);
fillerRect.Width -= childSize.Width;
fillerRect.X += childSize.Width;
break;
case ViewDockStyle.Right:
context.DisplayRectangle = new Rectangle(fillerRect.Right - childSize.Width, fillerRect.Y, childSize.Width, fillerRect.Height);
fillerRect.Width -= childSize.Width;
break;
}
// Layout child in the provided space
child.Layout(context);
}
}
// Allow the filler rectangle to be modified before being used
fillerRect = UpdateFillerRect(fillerRect, context.Control);
// Position any filler last
foreach (ViewBase child in this.Reverse())
{
// Only position visible children
if (child.Visible && (GetDock(child) == ViewDockStyle.Fill))
{
// Prevent children from showing adjacent borders that are not needed
UpdateChildBorders(child, context, ref leftEdges, ref rightEdges,
ref topEdges, ref bottomEdges, ref fillEdges);
// Give the filler the remaining space
context.DisplayRectangle = fillerRect;
// Layout child in the provided space
child.Layout(context);
}
}
// Put back the original display value now we have finished
context.DisplayRectangle = ClientRectangle;
// Remember the filler size
_fillRectangle = fillerRect;
}
#endregion
#region Protected Virtual
/// <summary>
/// Allow the preferred size calculated by GetPreferredSize to be modified before use.
/// </summary>
/// <param name="preferredSize">Original preferred size value.</param>
/// <returns>Modified size.</returns>
protected virtual Size UpdatePreferredSize(Size preferredSize)
{
return preferredSize;
}
/// <summary>
/// Allow the filler rectangle calculated by Layout to be modified before use.
/// </summary>
/// <param name="fillerRect">Original filler rectangle.</param>
/// <param name="control">Owning control instance.</param>
/// <returns>Modified rectangle.</returns>
protected virtual Rectangle UpdateFillerRect(Rectangle fillerRect,
Control control)
{
return fillerRect;
}
#endregion
#region Implementation
/// <summary>
/// Find the actual docking to apply for the specified RightToLeft setting.
/// </summary>
/// <param name="ds">Docking style.</param>
/// <param name="control">Control for which the setting is needed.</param>
/// <returns>Calculated docking to actual use.</returns>
protected ViewDockStyle CalculateDock(ViewDockStyle ds, Control control)
{
if (IgnoreRightToLeftLayout)
return ds;
else
{
// Do we need to adjust to reflect right to left layout?
if (CommonHelper.GetRightToLeftLayout(control) && (control.RightToLeft == RightToLeft.Yes))
{
// Only need to invert the left and right sides
switch (ds)
{
case ViewDockStyle.Left:
ds = ViewDockStyle.Right;
break;
case ViewDockStyle.Right:
ds = ViewDockStyle.Left;
break;
}
}
}
return ds;
}
/// <summary>
/// Update the incoming dock style to reflect our orientation.
/// </summary>
/// <param name="style">Incoming dock style.</param>
/// <returns>Orientation adjusted dock style.</returns>
protected ViewDockStyle OrientateDock(ViewDockStyle style)
{
switch (Orientation)
{
case VisualOrientation.Top:
// Nothing to do, as top is the standard setting
break;
case VisualOrientation.Left:
switch (style)
{
case ViewDockStyle.Top:
return ViewDockStyle.Left;
case ViewDockStyle.Left:
return ViewDockStyle.Bottom;
case ViewDockStyle.Right:
return ViewDockStyle.Top;
case ViewDockStyle.Bottom:
return ViewDockStyle.Right;
}
break;
case VisualOrientation.Right:
switch (style)
{
case ViewDockStyle.Top:
return ViewDockStyle.Right;
case ViewDockStyle.Left:
return ViewDockStyle.Top;
case ViewDockStyle.Right:
return ViewDockStyle.Bottom;
case ViewDockStyle.Bottom:
return ViewDockStyle.Left;
}
break;
case VisualOrientation.Bottom:
switch (style)
{
case ViewDockStyle.Top:
return ViewDockStyle.Bottom;
case ViewDockStyle.Left:
return ViewDockStyle.Right;
case ViewDockStyle.Right:
return ViewDockStyle.Left;
case ViewDockStyle.Bottom:
return ViewDockStyle.Top;
}
break;
default:
// Should never happen!
Debug.Assert(false);
break;
}
// No change required
return style;
}
private void UpdateChildBorders(ViewBase child,
ViewLayoutContext context,
ref PaletteDrawBorders leftEdges,
ref PaletteDrawBorders rightEdges,
ref PaletteDrawBorders topEdges,
ref PaletteDrawBorders bottomEdges,
ref PaletteDrawBorders fillEdges)
{
// Do we need to calculate if the child should remove any borders?
if (RemoveChildBorders)
{
// Check if the view is a canvas
ViewDrawCanvas childCanvas = child as ViewDrawCanvas;
// Docking edge determines calculation
switch (CalculateDock(GetDock(child), context.Control))
{
case ViewDockStyle.Fill:
if (childCanvas != null)
childCanvas.MaxBorderEdges = CommonHelper.ReverseOrientateDrawBorders(fillEdges, childCanvas.Orientation);
else
{
ViewLayoutDocker layoutDocker = child as ViewLayoutDocker;
if (layoutDocker != null)
{
foreach (ViewBase layoutChild in layoutDocker)
{
childCanvas = layoutChild as ViewDrawCanvas;
if (childCanvas != null)
childCanvas.MaxBorderEdges = CommonHelper.ReverseOrientateDrawBorders(fillEdges, childCanvas.Orientation);
}
}
}
break;
case ViewDockStyle.Top:
if (childCanvas != null)
childCanvas.MaxBorderEdges = CommonHelper.ReverseOrientateDrawBorders(topEdges, childCanvas.Orientation);
// Remove top edges from subsequent children
leftEdges &= PaletteDrawBorders.BottomLeftRight;
rightEdges &= PaletteDrawBorders.BottomLeftRight;
topEdges &= PaletteDrawBorders.BottomLeftRight;
fillEdges &= PaletteDrawBorders.BottomLeftRight;
break;
case ViewDockStyle.Bottom:
if (childCanvas != null)
childCanvas.MaxBorderEdges = CommonHelper.ReverseOrientateDrawBorders(bottomEdges, childCanvas.Orientation);
// Remove bottom edges from subsequent children
leftEdges &= PaletteDrawBorders.TopLeftRight;
rightEdges &= PaletteDrawBorders.TopLeftRight;
bottomEdges &= PaletteDrawBorders.TopLeftRight;
fillEdges &= PaletteDrawBorders.TopLeftRight;
break;
case ViewDockStyle.Left:
if (childCanvas != null)
childCanvas.MaxBorderEdges = CommonHelper.ReverseOrientateDrawBorders(leftEdges, childCanvas.Orientation);
// Remove left edges from subsequent children
topEdges &= PaletteDrawBorders.TopBottomRight;
bottomEdges &= PaletteDrawBorders.TopBottomRight;
leftEdges &= PaletteDrawBorders.TopBottomRight;
fillEdges &= PaletteDrawBorders.TopBottomRight;
break;
case ViewDockStyle.Right:
if (childCanvas != null)
childCanvas.MaxBorderEdges = CommonHelper.ReverseOrientateDrawBorders(rightEdges, childCanvas.Orientation);
// Remove right edges from subsequent children
topEdges &= PaletteDrawBorders.TopBottomLeft;
bottomEdges &= PaletteDrawBorders.TopBottomLeft;
rightEdges &= PaletteDrawBorders.TopBottomLeft;
fillEdges &= PaletteDrawBorders.TopBottomLeft;
break;
}
}
}
#endregion
}
}
| 39.724702 | 146 | 0.539801 | [
"BSD-3-Clause"
] | ElektroStudios/Krypton | Source/Krypton Components/ComponentFactory.Krypton.Toolkit/View Layout/ViewLayoutDocker.cs | 26,698 | C# |
/*
* Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the workmail-2017-10-01.normal.json service model.
*/
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;
using Amazon.WorkMail.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;
namespace Amazon.WorkMail.Model.Internal.MarshallTransformations
{
/// <summary>
/// Response Unmarshaller for UntagResource operation
/// </summary>
public class UntagResourceResponseUnmarshaller : JsonResponseUnmarshaller
{
/// <summary>
/// Unmarshaller the response from the service to the response class.
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
{
UntagResourceResponse response = new UntagResourceResponse();
return response;
}
/// <summary>
/// Unmarshaller error response to exception.
/// </summary>
/// <param name="context"></param>
/// <param name="innerException"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
{
var errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
errorResponse.InnerException = innerException;
errorResponse.StatusCode = statusCode;
var responseBodyBytes = context.GetResponseBodyBytes();
using (var streamCopy = new MemoryStream(responseBodyBytes))
using (var contextCopy = new JsonUnmarshallerContext(streamCopy, false, null))
{
if (errorResponse.Code != null && errorResponse.Code.Equals("ResourceNotFoundException"))
{
return ResourceNotFoundExceptionUnmarshaller.Instance.Unmarshall(contextCopy, errorResponse);
}
}
return new AmazonWorkMailException(errorResponse.Message, errorResponse.InnerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, errorResponse.StatusCode);
}
private static UntagResourceResponseUnmarshaller _instance = new UntagResourceResponseUnmarshaller();
internal static UntagResourceResponseUnmarshaller GetInstance()
{
return _instance;
}
/// <summary>
/// Gets the singleton.
/// </summary>
public static UntagResourceResponseUnmarshaller Instance
{
get
{
return _instance;
}
}
}
} | 36.151515 | 191 | 0.669181 | [
"Apache-2.0"
] | DetlefGolze/aws-sdk-net | sdk/src/Services/WorkMail/Generated/Model/Internal/MarshallTransformations/UntagResourceResponseUnmarshaller.cs | 3,579 | C# |
using AngleSharp.Dom;
using AngleSharp.Dom.Html;
using AngleSharp.Parser.Html;
using Microsoft.SharePoint.Client;
using SharePointPnP.Modernization.Framework.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using OfficeDevPnP.Core.Pages;
using SharePointPnP.Modernization.Framework.Functions;
using SharePointPnP.Modernization.Framework.Telemetry;
using SharePointPnP.Modernization.Framework.Extensions;
namespace SharePointPnP.Modernization.Framework.Transform
{
/// <summary>
/// Translates wiki text parts in to a list of real and fake web parts
/// </summary>
public class WikiHtmlTransformator: BaseTransform
{
private HtmlParser parser;
private ClientContext sourceContext;
private ClientSidePage page;
private Dictionary<string, string> mappingProperties;
private BuiltIn builtInFunctions;
#region Construction
/// <summary>
/// Default constructor
/// </summary>
public WikiHtmlTransformator(ClientContext sourceContext, ClientSidePage page, BaseTransformationInformation basePageTransformationInformation, IList<ILogObserver> logObservers = null)
{
//Register any existing observers
if (logObservers != null)
{
foreach (var observer in logObservers)
{
base.RegisterObserver(observer);
}
}
this.sourceContext = sourceContext;
this.page = page;
this.mappingProperties = basePageTransformationInformation.MappingProperties;
// Instantiate BuiltIn functions class
this.builtInFunctions = new BuiltIn(basePageTransformationInformation, this.page.Context, this.sourceContext, this.page, base.RegisteredLogObservers);
// Instantiate the AngleSharp Html parser
parser = new HtmlParser(new HtmlParserOptions() { IsEmbedded = true });
}
#endregion
/// <summary>
/// Replaces embedded images and iframes with respective "fake" image and video web parts. Depending on the
/// image/iframe position in the html the wiki text is broken up in multiple wiki text parts intermixed
/// with image and/or video parts. Later on these web parts will be transformed to client side web parts
/// </summary>
/// <param name="wikiPageWebParts">List of web parts on the page</param>
/// <returns>Updated list of web parts</returns>
public List<WebPartEntity> TransformPlusSplit(List<WebPartEntity> wikiPageWebParts, bool handleWikiImagesAndVideos, bool addTableListImageAsImageWebPart)
{
List<WebPartEntity> updatedWebParts = new List<WebPartEntity>(wikiPageWebParts.Count + 10);
List<WebPartEntity> replacedWebParts = new List<WebPartEntity>(10);
// Counters used for breaking up wiki text and placing images in between the broken wiki text fragments
int lastRow = 1;
int lastColum = 1;
int extraWebPartCounter = 1;
// first ensure there's a big gap in the ordering to allow insertion
foreach (var wp in wikiPageWebParts)
{
wp.Order = wp.Order * 1000;
}
// Counters used for placing web parts at the end of the page (e.g. image was defined inside a table)
int lastRow2 = 1;
int lastColum2 = 1;
int extraWebPartCounter2 = 1;
int splitCounter = 1;
var lastWebPart2 = wikiPageWebParts.OrderByDescending(p => p.Row).ThenByDescending(p => p.Column).ThenByDescending(p => p.Order).FirstOrDefault();
if (lastWebPart2 != null)
{
lastRow2 = lastWebPart2.Row;
lastColum2 = lastWebPart2.Column;
extraWebPartCounter2 = lastWebPart2.Order + 100;
}
// iterate over all parts found on the wiki page
foreach (var wp in wikiPageWebParts)
{
string htmlToParse = "";
if (wp.Type == WebParts.WikiText)
{
htmlToParse = wp.Properties["Text"];
}
else if (wp.Type.GetTypeShort() == WebParts.ContentEditor.GetTypeShort())
{
string fileContents = "";
if (wp.Properties.ContainsKey("ContentLink") && !string.IsNullOrEmpty(wp.Properties["ContentLink"]) && !wp.Properties["ContentLink"].ToLower().EndsWith(".aspx"))
{
// Load file contents
fileContents = this.builtInFunctions.LoadContentFromFile(wp.Properties["ContentLink"]);
}
// Run the same selector as we're running from the default mapping file
var selectorResult = this.builtInFunctions.ContentEmbedSelectorContentLink((wp.Properties.ContainsKey("ContentLink") ? wp.Properties["ContentLink"] : null), (wp.Properties.ContainsKey("Content") ? wp.Properties["Content"] : null), fileContents, this.mappingProperties[Constants.UseCommunityScriptEditorMappingProperty]);
if (selectorResult.Equals("NonASPXLinkNoScript", StringComparison.InvariantCultureIgnoreCase) ||
selectorResult.Equals("ContentNoScript", StringComparison.InvariantCultureIgnoreCase))
{
if (!string.IsNullOrEmpty(fileContents))
{
htmlToParse = fileContents;
}
else
{
htmlToParse = wp.Properties["Content"];
}
// Is there a need to add the web part title as content?
htmlToParse = IncludeWebPartTitle(htmlToParse, wp.Properties);
}
}
if (!string.IsNullOrEmpty(htmlToParse))
{
// Reset the replaced web parts list
replacedWebParts = new List<WebPartEntity>(10);
// Parse the html
using (var document = this.parser.Parse(htmlToParse))
{
// Check if this text requires special handling due to embedded images or iframes...
var images = document.QuerySelectorAll("img");
var iframes = document.QuerySelectorAll("iframe");
var elementsToHandle = images.Union(iframes);
// No special handling needed, so skip this wiki text part
if (!elementsToHandle.Any())
{
if (wp.Type == WebParts.ContentEditor)
{
// Since we've already read (and possible extended) the content let's 'rewrite' the web part properties
if (wp.Properties.ContainsKey("ContentLink"))
{
wp.Properties["ContentLink"] = "";
}
if (!wp.Properties.ContainsKey("Content"))
{
wp.Properties.Add("Content", htmlToParse);
}
else
{
wp.Properties["Content"] = htmlToParse;
}
}
updatedWebParts.Add(wp);
continue;
}
// Right, we've found a wiki text part with images or iframes...
lastRow = wp.Row;
lastColum = wp.Column;
extraWebPartCounter = wp.Order;
// Iterate over each each element, need to check each element to ensure we create the
// replacement web parts in the right order
foreach (var element in document.All)
{
Dictionary<string, string> props = new Dictionary<string, string>();
// Img elements might require splitting of wiki text
if (element is IHtmlImageElement)
{
bool split = true;
bool inUnSplitableElement = InUnSplitableElement(element);
// Only split if the image was not living in a table or list
if (handleWikiImagesAndVideos && !inUnSplitableElement)
{
// Get the current html tree from this element up and add as text part
props.Add("Title", "Wiki text");
props.Add("Text", $"SplitPart{splitCounter}");
splitCounter++;
replacedWebParts.Add(new WebPartEntity()
{
Type = WebParts.WikiText,
Title = "Wiki text",
Row = lastRow,
Column = lastColum,
Order = extraWebPartCounter,
Properties = props
});
extraWebPartCounter++;
}
else
{
split = false;
}
// Check if this image tag is wrapped inside an Anchor
string anchorTag = null;
string captionHtml = "";
if (element.ParentElement != null && element.ParentElement.TagName.Equals("A", StringComparison.InvariantCultureIgnoreCase))
{
if (element.ParentElement.HasAttribute("href"))
{
anchorTag = element.ParentElement.GetAttribute("href");
}
if (!string.IsNullOrEmpty(element.ParentElement.TextContent))
{
captionHtml = element.ParentElement.TextContent;
}
}
// Fill properties of the image web part
props = new Dictionary<string, string>();
if ((element as IHtmlImageElement).Source != null)
{
props.Add("Title", "Image in wiki text");
props.Add("Description", "");
props.Add("ImageUrl", (element as IHtmlImageElement).Source.Replace("about://", ""));
props.Add("Width", (element as IHtmlImageElement).DisplayWidth.ToString());
props.Add("Height", (element as IHtmlImageElement).DisplayHeight.ToString());
props.Add("Anchor", anchorTag ?? "");
props.Add("Caption", captionHtml ?? "");
}
var alt = (element as IElement).Attributes.Where(p => p.Name.Equals("alt", StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
if (alt != null)
{
props.Add("AlternativeText", alt.Value.CleanForJSON());
}
if (!inUnSplitableElement || addTableListImageAsImageWebPart)
{
// Add image part
replacedWebParts.Add(new WebPartEntity()
{
Type = WebParts.WikiImage,
Title = "Image in wiki text",
Row = split ? lastRow : lastRow2,
Column = split ? lastColum : lastColum2,
Order = split ? extraWebPartCounter : extraWebPartCounter2,
Properties = props
});
}
if (split)
{
// replace img or img nested in A with "splitter"
var splitter = document.CreateElement("span");
splitter.ClassName = "split";
if (element.ParentElement != null)
{
if (element.ParentElement.TagName.Equals("A", StringComparison.InvariantCultureIgnoreCase))
{
element.ParentElement.ParentElement.ReplaceChild(splitter, element.ParentElement);
}
else
{
element.ParentElement.ReplaceChild(splitter, element);
}
}
extraWebPartCounter++;
}
else
{
extraWebPartCounter2++;
}
}
// IFrame elements might require splitting of wiki text
else if (element is IHtmlInlineFrameElement)
{
bool split = true;
bool inUnSplitableElement = InUnSplitableElement(element);
// Only split if the iframe was not living in a table or list
if (handleWikiImagesAndVideos && !inUnSplitableElement)
{
// Get the current html tree from this element up and add as text part
props.Add("Title", "Wiki text");
props.Add("Text", $"SplitPart{splitCounter}");
splitCounter++;
replacedWebParts.Add(new WebPartEntity()
{
Type = WebParts.WikiText,
Title = "Wiki text",
Row = lastRow,
Column = lastColum,
Order = extraWebPartCounter,
Properties = props
});
extraWebPartCounter++;
}
else
{
split = false;
}
// Fill properties of the video web part
props = new Dictionary<string, string>();
if ((element as IHtmlInlineFrameElement).Source != null)
{
props.Add("Title", "Video in wiki text");
props.Add("Description", "");
props.Add("IFrameEmbed", (element as IElement).OuterHtml);
props.Add("Source", (element as IHtmlInlineFrameElement).Source);
}
var allowFullScreen = (element as IElement).Attributes.Where(p => p.Name.Equals("allowfullscreen", StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
if (allowFullScreen != null)
{
bool.TryParse(allowFullScreen.Value, out bool val);
props.Add("AllowFullScreen", val.ToString());
}
var size = (element as IElement).Attributes.Where(p => p.Name.Equals("width", StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
if (size != null)
{
props.Add("Width", size.Value.ToString());
}
size = (element as IElement).Attributes.Where(p => p.Name.Equals("height", StringComparison.InvariantCultureIgnoreCase)).FirstOrDefault();
if (size != null)
{
props.Add("Height", size.Value.ToString());
}
// Add video part, in contrast with the image we're always adding the video as a separate web part as the modern text editor strips out embedded videos
replacedWebParts.Add(new WebPartEntity()
{
Type = WebParts.WikiVideo,
Title = "Video in wiki text",
Row = split ? lastRow : lastRow2,
Column = split ? lastColum : lastColum2,
Order = split ? extraWebPartCounter : extraWebPartCounter2,
Properties = props
});
if (split)
{
// replace img or img nested in A with "splitter"
var splitter = document.CreateElement("span");
splitter.ClassName = "split";
if (element.ParentElement != null)
{
element.ParentElement.ReplaceChild(splitter, element);
}
extraWebPartCounter++;
}
else
{
extraWebPartCounter2++;
}
}
}
Dictionary<string, string> props2 = new Dictionary<string, string>();
props2.Add("Title", "Wiki text");
props2.Add("Text", $"SplitPart{splitCounter}");
splitCounter++;
replacedWebParts.Add(new WebPartEntity()
{
Type = WebParts.WikiText,
Title = "Wiki text",
Row = lastRow,
Column = lastColum,
Order = extraWebPartCounter,
Properties = props2
});
extraWebPartCounter++;
// Fix up WikiText parts
// Step 1: get the html now that we've replaced img/iframe tags with a span
string preppedWikiText = "";
if (document.DocumentElement.Children.Count() > 1)
{
preppedWikiText = document.DocumentElement.Children[1].InnerHtml;
}
// Step 2: split the html text in parts based upon the span we added
string[] splitText = preppedWikiText.Split(new string[] { "<span class=\"split\"></span>" }, StringSplitOptions.RemoveEmptyEntries);
// Step 3: use AngleSharp to construct valid html from each part and link it back to the WikiText placeholder web part
foreach(var replacedWebPart in replacedWebParts.ToList())
{
if (replacedWebPart.Type == WebParts.WikiText)
{
if (Int32.TryParse(replacedWebPart.Properties["Text"].Replace("SplitPart", ""), out int index))
{
index = index - 1;
if (splitText.Length >= index + 1)
{
using (var docTemp = parser.Parse(splitText[index]))
{
if (docTemp.DocumentElement.Children.Count() > 1)
{
// Remove empty DIV's as that's a net result of the splitting
StripEmptyDivAndPfromHtmlTree(docTemp.DocumentElement.Children[1]);
string updatedText = docTemp.DocumentElement.Children[1].InnerHtml;
replacedWebPart.Properties["Text"] = updatedText;
}
}
}
else
{
// no text part for this web part, so delete it. This happens when there was no content anymore below the last img/iframe tag
replacedWebParts.Remove(replacedWebPart);
}
}
}
}
// reset counter for next wiki zone
splitCounter = 1;
// Insert into updated web parts list
updatedWebParts.AddRange(replacedWebParts);
}
}
else
{
// Not a text editor web part, so we simply retain it
updatedWebParts.Add(wp);
}
}
// Return the collection of "split" web parts
return updatedWebParts;
}
#region Helper methods
private string IncludeWebPartTitle(string htmlContent, Dictionary<string,string> webPartProperties)
{
if (webPartProperties.ContainsKey("ChromeType") && webPartProperties["ChromeType"] != null)
{
string chromeType = webPartProperties["ChromeType"].ToString();
// Add header for all but the chrometype = none and chrometype = border only
if (chromeType != "2" && chromeType != "4")
{
// Only add a header if there a title set
if (webPartProperties.ContainsKey("Title") && webPartProperties["Title"] != null)
{
htmlContent = $"<H2>{webPartProperties["Title"].ToString()}</H2><div>{htmlContent}</div>";
}
}
}
return htmlContent;
}
private void StripEmptyDivAndPfromHtmlTree(IElement newWikiTextHtmlFragment)
{
var divs = newWikiTextHtmlFragment.QuerySelectorAll("div");
var ps = newWikiTextHtmlFragment.QuerySelectorAll("p");
var list = divs.Union(ps);
if (list.Any())
{
foreach (var el in list)
{
if (!el.HasChildNodes)
{
el.Remove();
}
}
}
}
private bool InUnSplitableElement(INode node)
{
IElement start = null;
if (!(node is IElement))
{
start = node.ParentElement;
}
else
{
start = node as IElement;
}
bool unSplitableElementFound = false;
while (!unSplitableElementFound)
{
if (start.TagName == "TD" || start.TagName == "TR" || start.TagName == "TBODY" || // table
start.TagName == "LI" || start.TagName == "UL" || start.TagName == "OL") // lists
{
return true;
}
else
{
start = start.ParentElement;
}
if (start == null)
{
return false;
}
}
return false;
}
#endregion
}
}
| 49.96929 | 340 | 0.428094 | [
"MIT"
] | KoenZomers/sp-dev-modernization | Tools/SharePoint.Modernization/SharePointPnP.Modernization.Framework/Transform/WikiHtmlTransformator.cs | 26,036 | C# |
namespace MoreTerra.Structures
{
using System;
public class TileType
{
public const Byte Dirt = 0;
public const Byte Stone = 1;
public const Byte Grass = 2;
public const Byte Plants = 3;
public const Byte Torch = 4;
public const Byte Trees = 5;
public const Byte Iron = 6;
public const Byte Copper = 7;
public const Byte Gold = 8;
public const Byte Silver = 9;
public const Byte Door = 10;
public const Byte DoorOpen = 11;
public const Byte Heart = 12;
public const Byte Bottles = 13;
public const Byte Table = 14;
public const Byte Chair = 15;
public const Byte Anvil = 16;
public const Byte Furnace = 17;
public const Byte CraftingTable = 18;
public const Byte WoodenPlatform = 19;
public const Byte PlantsDecorative = 20;
public const Byte Chest = 21;
public const Byte Demonite = 22;
public const Byte CorruptionGrass = 23;
public const Byte CorruptionPlants = 24;
public const Byte Ebonstone = 25;
public const Byte Altar = 26;
public const Byte Sunflower = 27;
public const Byte Pot = 28;
public const Byte PiggyBank = 29;
public const Byte BlockWood = 30;
public const Byte ShadowOrb = 31;
public const Byte CorruptionVines = 32;
public const Byte Candle = 33;
public const Byte ChandlerCopper = 34;
public const Byte ChandlerSilver = 35;
public const Byte ChandlerGold = 36;
public const Byte Meteorite = 37; // Credit Vib Rib
public const Byte BlockStone = 38;
public const Byte BlockRedStone = 39;
public const Byte Clay = 40;
public const Byte BlockBlueStone = 41;
public const Byte LightGlobe = 42;
public const Byte BlockGreenStone = 43;
public const Byte BlockPinkStone = 44;
public const Byte BlockGold = 45;
public const Byte BlockSilver = 46;
public const Byte BlockCopper = 47;
public const Byte Spikes = 48;
public const Byte CandleBlue = 49;
public const Byte Books = 50;
public const Byte Web = 51;
public const Byte Vines = 52;
public const Byte Sand = 53;
public const Byte Glass = 54;
public const Byte Sign = 55;
public const Byte Obsidian = 56;
public const Byte Ash = 57; // Credit Infinite Monkeys
public const Byte Hellstone = 58; // Credit Vib Rib
public const Byte Mud = 59;
public const Byte UndergroundJungleGrass = 60;
public const Byte UndergroundJunglePlants = 61;
public const Byte UndergroundJungleVines = 62;
public const Byte Sapphire = 63;
public const Byte Ruby = 64;
public const Byte Emerald = 65;
public const Byte Topaz = 66;
public const Byte Amethyst = 67;
public const Byte Diamond = 68;
public const Byte UndergroundJungleThorns = 69; // Credit Dr VideoGames 0031
public const Byte UndergroundMushroomGrass = 70;
public const Byte UndergroundMushroomPlants = 71;
public const Byte UndergroundMushroomTrees = 72;
public const Byte Plants2 = 73;
public const Byte Plants3 = 74;
public const Byte BlockObsidian = 75;
public const Byte BlockHellstone = 76;
public const Byte Hellforge = 77;
public const Byte DecorativePot = 78;
public const Byte Bed = 79;
public const Byte Cactus = 80;
public const Byte Coral = 81;
public const Byte HerbImmature = 82;
public const Byte HerbMature = 83;
public const Byte HerbBlooming = 84;
public const Byte Tombstone = 85;
public const Byte Loom = 86;
public const Byte Piano = 87;
public const Byte Dresser = 88;
public const Byte Bench = 89;
public const Byte Bathtub = 90;
public const Byte Banner = 91;
public const Byte Lamppost = 92;
public const Byte Tikitorch = 93;
public const Byte Keg = 94;
public const Byte ChineseLamp = 95;
public const Byte CookingPot = 96;
public const Byte Safe = 97;
public const Byte SkullCandle = 98;
public const Byte Trashcan = 99;
public const Byte Candleabra = 100;
public const Byte Bookcase = 101;
public const Byte Throne = 102;
public const Byte Plate = 103;
public const Byte Clock = 104;
public const Byte Statue = 105;
public const Byte Sawmill = 106;
public const Byte Unknown = 228;
// Additional non-tile types, here to shrink things into a byte.
public const Byte Processed = 229;
public const Byte Water = 230;
public const Byte Lava = 231;
public const Byte BackgroundSky = 232;
public const Byte BackgroundDirt = 233;
public const Byte BackgroundCave = 234;
public const Byte BackgroundHell = 235;
public const Byte WallStone = 236;
public const Byte WallDirt = 237;
public const Byte WallEbonstone = 238;
public const Byte WallWood = 239;
public const Byte WallGreyBrick = 240;
public const Byte WallRedBrick = 241;
public const Byte WallBlueBrick = 242;
public const Byte WallGreenBrick = 243;
public const Byte WallPinkBrick = 244;
public const Byte WallGoldBrick = 245;
public const Byte WallSilverBrick = 246;
public const Byte WallCopperBrick = 247;
public const Byte WallHellstone = 248;
public const Byte WallObsidianBrick = 249;
public const Byte WallMud = 250;
public const Byte WallDirtSafe = 251;
public const Byte WallBlueSafe = 252;
public const Byte WallGreenSafe = 253;
public const Byte WallPinkSafe = 254;
public const Byte WallObsidian = 255;
public static String[] typeStrings;
public static void Initialize()
{
typeStrings = new String[256];
typeStrings[TileType.Dirt] = "Dirt";
typeStrings[TileType.Stone] = "Stone";
typeStrings[TileType.Grass] = "Grass";
typeStrings[TileType.Plants] = "Plants";
typeStrings[TileType.Torch] = "Torch";
typeStrings[TileType.Trees] = "Trees";
typeStrings[TileType.Iron] = "Iron";
typeStrings[TileType.Copper] = "Copper";
typeStrings[TileType.Gold] = "Gold";
typeStrings[TileType.Silver] = "Silver";
typeStrings[TileType.Door] = "Door";
typeStrings[TileType.DoorOpen] = "DoorOpen";
typeStrings[TileType.Heart] = "Heart";
typeStrings[TileType.Bottles] = "Bottles";
typeStrings[TileType.Table] = "Table";
typeStrings[TileType.Chair] = "Chair";
typeStrings[TileType.Anvil] = "Anvil";
typeStrings[TileType.Furnace] = "Furnace";
typeStrings[TileType.CraftingTable] = "CraftingTable";
typeStrings[TileType.WoodenPlatform] = "WoodenPlatform";
typeStrings[TileType.PlantsDecorative] = "PlantsDecorative";
typeStrings[TileType.Chest] = "Chest";
typeStrings[TileType.Demonite] = "Demonite";
typeStrings[TileType.CorruptionGrass] = "CorruptionGrass";
typeStrings[TileType.CorruptionPlants] = "CorruptionPlants";
typeStrings[TileType.Ebonstone] = "Ebonstone";
typeStrings[TileType.Altar] = "Altar";
typeStrings[TileType.Sunflower] = "Sunflower";
typeStrings[TileType.Pot] = "Pot";
typeStrings[TileType.PiggyBank] = "PiggyBank";
typeStrings[TileType.BlockWood] = "BlockWood";
typeStrings[TileType.ShadowOrb] = "ShadowOrb";
typeStrings[TileType.CorruptionVines] = "CorruptionVines";
typeStrings[TileType.Candle] = "Candle";
typeStrings[TileType.ChandlerCopper] = "ChandlerCopper";
typeStrings[TileType.ChandlerSilver] = "ChandlerSilver";
typeStrings[TileType.ChandlerGold] = "ChandlerGold";
typeStrings[TileType.Meteorite] = "Meteorite";
typeStrings[TileType.BlockStone] = "BlockStone";
typeStrings[TileType.BlockRedStone] = "BlockRedStone";
typeStrings[TileType.Clay] = "Clay";
typeStrings[TileType.BlockBlueStone] = "BlockBlueStone";
typeStrings[TileType.LightGlobe] = "LightGlobe";
typeStrings[TileType.BlockGreenStone] = "BlockGreenStone";
typeStrings[TileType.BlockPinkStone] = "BlockPinkStone";
typeStrings[TileType.BlockGold] = "BlockGold";
typeStrings[TileType.BlockSilver] = "BlockSilver";
typeStrings[TileType.BlockCopper] = "BlockCopper";
typeStrings[TileType.Spikes] = "Spikes";
typeStrings[TileType.CandleBlue] = "CandleBlue";
typeStrings[TileType.Books] = "Books";
typeStrings[TileType.Web] = "Web";
typeStrings[TileType.Vines] = "Vines";
typeStrings[TileType.Sand] = "Sand";
typeStrings[TileType.Glass] = "Glass";
typeStrings[TileType.Sign] = "Sign";
typeStrings[TileType.Obsidian] = "Obsidian";
typeStrings[TileType.Ash] = "Ash";
typeStrings[TileType.Hellstone] = "Hellstone";
typeStrings[TileType.Mud] = "Mud";
typeStrings[TileType.UndergroundJungleGrass] = "UndergroundJungleGrass";
typeStrings[TileType.UndergroundJunglePlants] = "UndergroundJunglePlants";
typeStrings[TileType.UndergroundJungleVines] = "UndergroundJungleVines";
typeStrings[TileType.Sapphire] = "Sapphire";
typeStrings[TileType.Ruby] = "Ruby";
typeStrings[TileType.Emerald] = "Emerald";
typeStrings[TileType.Topaz] = "Topaz";
typeStrings[TileType.Amethyst] = "Amethyst";
typeStrings[TileType.Diamond] = "Diamond";
typeStrings[TileType.UndergroundJungleThorns] = "UndergroundJungleThorns";
typeStrings[TileType.UndergroundMushroomGrass] = "UndergroundMushroomGrass";
typeStrings[TileType.UndergroundMushroomPlants] = "UndergroundMushroomPlants";
typeStrings[TileType.UndergroundMushroomTrees] = "UndergroundMushroomTrees";
typeStrings[TileType.Plants2] = "Plants2";
typeStrings[TileType.Plants3] = "Plants3";
typeStrings[TileType.BlockObsidian] = "BlockObsidian";
typeStrings[TileType.BlockHellstone] = "BlockHellstone";
typeStrings[TileType.Hellforge] = "Hellforge";
typeStrings[TileType.DecorativePot] = "DecorativePot";
typeStrings[TileType.Bed] = "Bed";
typeStrings[TileType.Cactus] = "Cactus";
typeStrings[TileType.Coral] = "Coral";
typeStrings[TileType.HerbImmature] = "HerbImmature";
typeStrings[TileType.HerbMature] = "HerbMature";
typeStrings[TileType.HerbBlooming] = "HerbBlooming";
typeStrings[TileType.Tombstone] = "Tombstone";
typeStrings[TileType.Loom] = "Loom";
typeStrings[TileType.Piano] = "Piano";
typeStrings[TileType.Dresser] = "Dresser";
typeStrings[TileType.Bench] = "Bench";
typeStrings[TileType.Bathtub] = "Bathtub";
typeStrings[TileType.Banner] = "Banner";
typeStrings[TileType.Lamppost] = "Lamppost";
typeStrings[TileType.Tikitorch] = "Tikitorch";
typeStrings[TileType.Keg] = "Keg";
typeStrings[TileType.ChineseLamp] = "ChineseLamp";
typeStrings[TileType.CookingPot] = "CookingPot";
typeStrings[TileType.Safe] = "Safe";
typeStrings[TileType.SkullCandle] = "SkullCandle";
typeStrings[TileType.Trashcan] = "Trashcan";
typeStrings[TileType.Candleabra] = "Candleabra";
typeStrings[TileType.Bookcase] = "Bookcase";
typeStrings[TileType.Throne] = "Throne";
typeStrings[TileType.Plate] = "Plate";
typeStrings[TileType.Clock] = "Clock";
typeStrings[TileType.Statue] = "Statue";
typeStrings[TileType.Sawmill] = "Sawmill";
typeStrings[TileType.Unknown] = "Unknown";
typeStrings[TileType.Processed] = "Processed";
typeStrings[TileType.Water] = "Water";
typeStrings[TileType.Lava] = "Lava";
typeStrings[TileType.BackgroundSky] = "BackgroundSky";
typeStrings[TileType.BackgroundDirt] = "BackgroundDirt";
typeStrings[TileType.BackgroundCave] = "BackgroundCave";
typeStrings[TileType.BackgroundHell] = "BackgroundHell";
typeStrings[TileType.WallStone] = "WallStone";
typeStrings[TileType.WallDirt] = "WallDirt";
typeStrings[TileType.WallEbonstone] = "WallEbonstone";
typeStrings[TileType.WallWood] = "WallWood";
typeStrings[TileType.WallGreyBrick] = "WallGreyBrick";
typeStrings[TileType.WallRedBrick] = "WallRedBrick";
typeStrings[TileType.WallBlueBrick] = "WallBlueBrick";
typeStrings[TileType.WallGreenBrick] = "WallGreenBrick";
typeStrings[TileType.WallPinkBrick] = "WallPinkBrick";
typeStrings[TileType.WallGoldBrick] = "WallGoldBrick";
typeStrings[TileType.WallSilverBrick] = "WallSilverBrick";
typeStrings[TileType.WallCopperBrick] = "WallCopperBrick";
typeStrings[TileType.WallHellstone] = "WallHellstone";
typeStrings[TileType.WallObsidianBrick] = "WallObsidianBrick";
typeStrings[TileType.WallMud] = "WallMud";
typeStrings[TileType.WallDirtSafe] = "WallDirtSafe";
typeStrings[TileType.WallBlueSafe] = "WallBlueSafe";
typeStrings[TileType.WallGreenSafe] = "WallGreenSafe";
typeStrings[TileType.WallPinkSafe] = "WallPinkSafe";
typeStrings[TileType.WallObsidian] = "WallObsidian";
}
}
}
| 40.95625 | 85 | 0.683351 | [
"MIT"
] | UzayAnil/MoreTerra | WorldView/Structures/TileType.cs | 13,108 | C# |
using Valheim.DropThat.Caches;
using Valheim.DropThat.Core;
using Valheim.DropThat.Drop.CharacterDropSystem.Caches;
namespace Valheim.DropThat.Drop.CharacterDropSystem.Conditions
{
internal class ConditionLevel : ICondition
{
private static ConditionLevel _instance;
public static ConditionLevel Instance => _instance ??= new();
public bool ShouldFilter(CharacterDrop.Drop drop, DropExtended dropExtended, CharacterDrop characterDrop)
{
var character = CharacterCache.GetCharacter(characterDrop);
int minLevel = dropExtended.Config.ConditionMinLevel.Value;
if (minLevel >= 0 && character is not null)
{
if (character.GetLevel() < minLevel)
{
Log.LogTrace($"{nameof(dropExtended.Config.ConditionMinLevel)}: Disabling drop {drop.m_prefab.name} due to level {character.GetLevel()} being below limit {minLevel}.");
return true;
}
}
int maxLevel = dropExtended.Config.ConditionMaxLevel.Value;
if (maxLevel >= 0 && character is not null)
{
if (character.GetLevel() > maxLevel)
{
Log.LogTrace($"{nameof(dropExtended.Config.ConditionMaxLevel)}: Disabling drop {drop.m_prefab.name} due to level {character.GetLevel()} being above limit {maxLevel}.");
return true;
}
}
return false;
}
}
}
| 35.72093 | 188 | 0.602865 | [
"Unlicense"
] | ASharpPen/Valheim.DropThat | Valheim.DropThat/Drop/CharacterDropSystem/Conditions/ConditionLevel.cs | 1,538 | C# |
//
// Copyright (c) 2010-2018 Antmicro
//
// This file is licensed under the MIT License.
// Full license text is available in 'licenses/MIT.txt'.
//
using System;
using System.Collections.Generic;
using System.Linq;
namespace Antmicro.Renode.Peripherals.Wireless.IEEE802_15_4
{
public class Address
{
public Address(AddressingMode mode)
{
if(mode != AddressingMode.ShortAddress && mode != AddressingMode.ExtendedAddress)
{
throw new ArgumentException("Unsupported addressing mode");
}
Bytes = new byte[mode.GetBytesLength()];
}
public Address(ArraySegment<byte> source)
{
if(source.Count != 2 && source.Count != 8)
{
throw new ArgumentException("Unsupported address length");
}
Bytes = source;
}
public Address(byte[] source)
{
if(source.Length != 2 && source.Length != 8)
{
throw new ArgumentException("Unsupported address length");
}
Bytes = source;
}
public void SetByte(byte value, int offset)
{
if(offset < 0 || offset >= Bytes.Count)
{
throw new ArgumentOutOfRangeException();
}
Bytes[offset] = value;
}
public override int GetHashCode()
{
return Bytes.GetHashCode();
}
public override bool Equals(object obj)
{
var objAsAddress = obj as Address;
if(objAsAddress == null)
{
return false;
}
return objAsAddress.Bytes.SequenceEqual(Bytes);
}
public ulong GetValue()
{
switch(Bytes.Count)
{
case 2:
return (ulong)BitConverter.ToUInt16(Bytes.ToArray(), 0);
case 8:
return BitConverter.ToUInt64(Bytes.ToArray(), 0);
default:
throw new ArgumentException();
}
}
public IList<byte> Bytes { get; private set; }
public bool IsShortBroadcast { get { return Bytes.Count == 2 && Bytes.All(x => x == 0xFF); } }
}
}
| 25.910112 | 102 | 0.51301 | [
"MIT"
] | UPBIoT/renode-iot | src/Infrastructure/src/Emulator/Peripherals/Peripherals/Wireless/IEEE802_15_4/Address.cs | 2,306 | C# |
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
namespace Study.WebServices.Models
{
[Serializable]
public class AccountModel : ConfigurationElement
{
[ConfigurationProperty("Id", IsRequired = true)]
public Guid Id
{
get { return Guid.Parse(this["Id"].ToString()); }
set { this["Id"] = value; }
}
[ConfigurationProperty("Name", IsRequired = true)]
public string Name
{
get { return this["Name"].ToString(); }
set { this["Name"] = value; }
}
[ConfigurationProperty("UserName", IsRequired = true)]
public string UserName
{
get { return this["UserName"].ToString(); }
set { this["UserName"] = value; }
}
[ConfigurationProperty("Password", IsRequired = true)]
public string Password
{
get { return this["Password"].ToString(); }
set { this["Password"] = value; }
}
[ConfigurationProperty("Enable", IsRequired = true)]
public bool Enable
{
get { return bool.Parse(this["Enable"].ToString()); }
set { this["Enable"] = value; }
}
[ConfigurationProperty("CreatedBy", IsRequired = true)]
public string CreatedBy
{
get { return this["CreatedBy"].ToString(); }
set { this["CreatedBy"] = value; }
}
[ConfigurationProperty("CreatedAt", IsRequired = true)]
public DateTime CreatedAt
{
get { return DateTime.Parse(this["CreatedAt"].ToString()); }
set { this["CreatedAt"] = value; }
}
[ConfigurationProperty("ModifiedBy", IsRequired = true)]
public string ModifiedBy
{
get { return this["ModifiedBy"].ToString(); }
set { this["ModifiedBy"] = value; }
}
[ConfigurationProperty("ModifiedAt", IsRequired = true)]
public DateTime ModifiedAt
{
get { return DateTime.Parse(this["ModifiedAt"].ToString()); }
set { this["ModifiedAt"] = value; }
}
[ConfigurationProperty("SortOrder", IsRequired = true)]
public int SortOrder
{
get { return int.Parse(this["SortOrder"].ToString()); }
set { this["SortOrder"] = value; }
}
public AccountModel()
{
Id = Guid.NewGuid();
Enable = true;
CreatedAt = DateTime.Now;
ModifiedAt = CreatedAt;
}
}
} | 29.277778 | 73 | 0.534345 | [
"Apache-2.0"
] | yuanrui/Examples | Study.WebServices/Models/Account.cs | 2,637 | C# |
using System;
using System.Collections.Generic;
using System.Xml.Linq;
using System.Linq;
namespace FittingPlacer
{
public class Furnisher
{
// Data members
protected List<FittingType> fittingTypes;
protected List<FittingModel> fittingModels;
protected List<FaceType> faceTypes;
public const string DefaultSemanticsFilePath = "FittingDatabase.xml";
private bool hasSemanticsLoaded = false;
private FaceType wallFaceType = new FaceType("wall");
private FaceType doorFaceType = new FaceType("door");
private FaceType windowFaceType = new FaceType("window");
// Constructor
public Furnisher(String semanticsFilePath = DefaultSemanticsFilePath)
{
LoadFittingSemantics(semanticsFilePath);
}
// Methods
/// <summary>Load fitting semantics from XML file to memory</summary>
public void LoadFittingSemantics(String semanticsFilePath = DefaultSemanticsFilePath)
{
// Add default face types
faceTypes = new List<FaceType>();
faceTypes.Add(wallFaceType);
faceTypes.Add(doorFaceType);
faceTypes.Add(windowFaceType);
// Open semantics XML document file
XDocument doc = XDocument.Load(semanticsFilePath);
// Load face types
List<Tuple<XElement, FaceType>> xFaceTypeRelations = new List<Tuple<XElement, FaceType>>();
foreach (XElement xFaceType in doc.Element("fitting_database").Element("face_types").Elements("face_type"))
{
faceTypes.Add(new FaceType(
xFaceType.Element("face_type_id").Value
));
// Save spatial relation elements
if (xFaceType.Element("relations") != null)
{
foreach (XElement xSpatialRelation in xFaceType.Element("relations").Elements("relation"))
{
xFaceTypeRelations.Add(new Tuple<XElement, FaceType>(xSpatialRelation, faceTypes[faceTypes.Count - 1]));
}
}
}
// Load face relations
foreach (Tuple<XElement, FaceType> xFaceTypeRelationTuple in xFaceTypeRelations)
{
XElement xFaceTypeRelation = xFaceTypeRelationTuple.Item1;
FaceType relatedFaceType = faceTypes.Find(faceTypeEvaluated => faceTypeEvaluated.Id == xFaceTypeRelation.Element("support_face_type_id").Value);
xFaceTypeRelationTuple.Item2.AddRelation(
new SpatialRelation(
relatedFaceType,
(float)(double)xFaceTypeRelation.Element("distance")
)
);
}
// Load fitting types
fittingTypes = new List<FittingType>();
foreach (XElement xFittingType in doc.Element("fitting_database").Element("fitting_types").Elements("fitting_type"))
{
// Create and add fitting type
FittingType fittingType = new FittingType(xFittingType.Element("fitting_type_id").Value);
fittingTypes.Add(fittingType);
// Save face elements
foreach (XElement xFace in xFittingType.Element("faces").Elements("face"))
{
// Parse and cast facing enum
Facing facing;
Enum.TryParse<Facing>(xFace.Element("facing").Value, true, out facing);
fittingType.AddFace(
new Face(
facing,
faceTypes.Find(faceTypeEvaluated => faceTypeEvaluated.Id == xFace.Element("face_type_id").Value)
)
);
}
}
// Load fitting models
fittingModels = new List<FittingModel>();
foreach (XElement xFittingModel in doc.Element("fitting_database").Element("fitting_models").Elements("fitting_model"))
{
// Parse fitting type and find reference
string typeId = xFittingModel.Element("fitting_type_id").Value;
FittingType fittingType = fittingTypes.Find(fittingTypeEvaluated => fittingTypeEvaluated.Id == typeId);
// Create fitting model with parsed values
FittingModel fittingModel = new FittingModel(
xFittingModel.Element("fitting_model_id").Value,
fittingType,
(float)(double)xFittingModel.Element("bounding_box").Element("width"),
(float)(double)xFittingModel.Element("bounding_box").Element("depth"),
(float)(double)xFittingModel.Element("bounding_box").Element("height")
);
// Add clearance areas
foreach (XElement xClearanceArea in xFittingModel.Element("clearance_areas").Elements("clearance_area"))
{
if ((double)xClearanceArea.Element("perpendicular_length") > 0)
{
// Parse and cast facing enum
Facing facing;
Enum.TryParse<Facing>(xClearanceArea.Element("side").Value, true, out facing);
fittingModel.AddClearanceArea(facing, (float)(double)xClearanceArea.Element("perpendicular_length"));
}
}
// Add fitting model
fittingModels.Add(fittingModel);
}
hasSemanticsLoaded = true;
}
/// <summary>Generate fitting layout and return the fittings' placements</summary>
public FittingPlacement[] GeneratePlacements(Room room, List<string> fittingsToPlace, int randomizationSeed = 0)
{
// Find fitting models in database
List<FittingModel> fittingModelsToPlace = new List<FittingModel>();
foreach (string fittingToPlace in fittingsToPlace)
{
fittingModelsToPlace.Add(fittingModels.Find(evalued => evalued.Id == fittingToPlace));
}
// Generate layout
FittingLayout generatedFittingLayout = GenerateFittingLayout(room, fittingModelsToPlace, randomizationSeed);
List<Fitting> placedFittings = generatedFittingLayout.PlacedFittings;
// Copy Fitting information to FittingPlacement objects
FittingPlacement[] fittingPlacements = new FittingPlacement[placedFittings.Count];
int i = 0;
foreach (Fitting placedFitting in placedFittings)
{
fittingPlacements[i] = new FittingPlacement(placedFitting.Position.X, placedFitting.Position.Y, placedFitting.Orientation, new RepresentationObject(placedFitting.FittingModel.Id, placedFitting.FittingModel.FittingType.Id));
i++;
}
return fittingPlacements;
}
/// <summary>Generate fitting layout and return the fittings' placements</summary>
public FittingPlacement[] GeneratePlacements(float width, float depth, float height, List<string> fittingsToPlace, int randomizationSeed = 0)
{
return GeneratePlacements(new Room(width, depth, height), fittingsToPlace, randomizationSeed);
}
/// <summary>Generate fitting layout consisting of the fittings and their placements</summary>
private FittingLayout GenerateFittingLayout(Room room, List<FittingModel> fittingModelsToBePlaced, int randomizationSeed = 0)
{
// Make sure fitting semantics are loaded
if (!hasSemanticsLoaded)
{
LoadFittingSemantics(DefaultSemanticsFilePath);
}
// Start a Random instance
Random globalRandom;
if (randomizationSeed == 0)
{
// Base randomization on time seed, if no seed given
globalRandom = new Random();
}
else
{
globalRandom = new Random(randomizationSeed);
}
// Solve placements
// Register fittings and their faces
List<Fitting> fittingsToBePlaced = new List<Fitting>();
List<ParticularFace> fittingsFaces = new List<ParticularFace>();
foreach (FittingModel fittingModelToBePlaced in fittingModelsToBePlaced)
{
Fitting fittingToBePlaced = new Fitting(fittingModelToBePlaced);
fittingsToBePlaced.Add(fittingToBePlaced);
foreach (ParticularFace fittingFace in fittingToBePlaced.Faces)
{
fittingsFaces.Add(fittingFace);
}
}
// Assign attacher faces to compatible support faces
// List to be filled with up to one face with wall relation per fitting, that is selected to be satisfied
List<Tuple<ParticularFace, SpatialRelation>> selectedAttacherFacesAndWallRelations = new List<Tuple<ParticularFace, SpatialRelation>>();
foreach (Fitting fittingToBePlaced in fittingsToBePlaced)
{
// List to be filled with faces with fitting relations that can be satisfied
List<Tuple<ParticularFace, ParticularFace, SpatialRelation>> attacherFacesAndSupportFacesAndRelations = new List<Tuple<ParticularFace, ParticularFace, SpatialRelation>>();
int fittingRelationCount = 0;
// List to be filled with faces with wall relations
List<Tuple<ParticularFace, SpatialRelation>> attacherFacesAndWallRelations = new List<Tuple<ParticularFace, SpatialRelation>>();
// Go through every relation in the fitting's faces, and register satisfiable ones
foreach (ParticularFace aFace in fittingToBePlaced.Faces)
{
foreach (SpatialRelation relation in aFace.Face.Type.SpatialRelations)
{
if (relation.SupportFaceType == wallFaceType || relation.SupportFaceType == doorFaceType || relation.SupportFaceType == windowFaceType)
{
if (relation.SupportFaceType == wallFaceType)
{
// Register wall related face
attacherFacesAndWallRelations.Add(new Tuple<ParticularFace, SpatialRelation>(aFace, relation));
}
}
else
{
fittingRelationCount++;
// Register found support faces
List<ParticularFace> supportFaces = new List<ParticularFace>();
foreach (ParticularFace sFace in fittingsFaces)
{
if (sFace.Face.Type == relation.SupportFaceType)
{
supportFaces.Add(sFace);
}
}
// Assign support faces to fulfill relation
if (supportFaces.Count > 0)
{
// Pick a random support face as the default and check if there are less occupied ones
int startIndex = globalRandom.Next() % supportFaces.Count;
ParticularFace minOccupiedSupportFace = supportFaces[startIndex];
foreach (ParticularFace supportFace in supportFaces)
{
if (supportFace.ReservedLength < minOccupiedSupportFace.ReservedLength)
{
minOccupiedSupportFace = supportFace;
}
}
if (minOccupiedSupportFace.CanAttachFace(aFace, relation))
{
// Register face pair that satisfies relation
attacherFacesAndSupportFacesAndRelations.Add(new Tuple<ParticularFace, ParticularFace, SpatialRelation>(aFace, minOccupiedSupportFace, relation));
}
else
{
// Pick a random support face as the default and check if there are freer ones
startIndex = globalRandom.Next() % supportFaces.Count;
ParticularFace mostFreeSupportFace = supportFaces[startIndex];
foreach (ParticularFace supportFace in supportFaces)
{
if (supportFace.SideLength - supportFace.ReservedLength > mostFreeSupportFace.SideLength - mostFreeSupportFace.ReservedLength)
{
mostFreeSupportFace = supportFace;
}
}
if (mostFreeSupportFace.CanAttachFace(aFace, relation))
{
// Register face pair that satisfies relation
attacherFacesAndSupportFacesAndRelations.Add(new Tuple<ParticularFace, ParticularFace, SpatialRelation>(aFace, mostFreeSupportFace, relation));
}
}
}
}
}
}
// Assign one fitting attacher face to its support face
if (attacherFacesAndSupportFacesAndRelations.Count() > 0)
{
// Pick only one fitting relation to fulfill per fitting
int pickedIndex = globalRandom.Next() % attacherFacesAndSupportFacesAndRelations.Count;
Tuple<ParticularFace, ParticularFace, SpatialRelation> attacherFaceAndSupportFaceAndRelation = attacherFacesAndSupportFacesAndRelations[pickedIndex];
attacherFaceAndSupportFaceAndRelation.Item2.AttachFace(attacherFaceAndSupportFaceAndRelation.Item1, attacherFaceAndSupportFaceAndRelation.Item3);
}
else if (fittingRelationCount > 0)
{
Console.WriteLine("No fitting support face with capacity could be found for a {0} {1}. ", fittingToBePlaced.FittingModel.Id, fittingToBePlaced.FittingModel.FittingType.Id);
}
// Pick only one wall relation to fulfill per fitting
if (attacherFacesAndWallRelations.Count > 0)
{
int selectedIndex = globalRandom.Next() % attacherFacesAndWallRelations.Count;
selectedAttacherFacesAndWallRelations.Add(attacherFacesAndWallRelations[selectedIndex]);
}
}
// Place attacher faces (and their fittings with them) in relation to support faces, in grouping placement units
foreach (ParticularFace sFace in fittingsFaces)
{
foreach (Tuple<ParticularFace, SpatialRelation> aFaceAndRelation in sFace.attacherFacesAndRelations)
{
ParticularFace aFace = aFaceAndRelation.Item1;
SpatialRelation relation = aFaceAndRelation.Item2;
// Rotate objects to match faces
aFace.RotateToFace(sFace.Direction);
// Move objects to match face distance
aFace.TranslateToDistanceFromFace(relation.Distance, sFace);
// Merge placement units
sFace.Fitting.PlacementUnit.AbsorbPlacementUnit(aFace.Fitting.PlacementUnit);
}
}
// Register wall-attacher faces to placement units
foreach (Tuple<ParticularFace, SpatialRelation> attacherFaceAndWallRelation in selectedAttacherFacesAndWallRelations)
{
attacherFaceAndWallRelation.Item1.Fitting.PlacementUnit.AddWallConstraint(attacherFaceAndWallRelation.Item1, attacherFaceAndWallRelation.Item2.Distance);
}
// Register all consolidated placement units
List<PlacementUnit> placementUnits = new List<PlacementUnit>();
foreach (Fitting fitting in fittingsToBePlaced)
{
if (!placementUnits.Contains(fitting.PlacementUnit))
{
placementUnits.Add(fitting.PlacementUnit);
}
}
// Set placement domains for the placement units
foreach (PlacementUnit placementUnit in placementUnits)
{
// Set placement domain
placementUnit.SetDomain(room);
// Shuffle placement domain
placementUnit.ShuffleDomain(globalRandom);
}
// Test placements for all placement units
if (!TestPlacements(ref placementUnits, room.Clone()))
{
// No possible fitting layout could be found
Console.WriteLine("No possible fitting layout could be found. ");
return (new FittingLayout(room, new List<Fitting>()));
}
// Return finished list of placed fittings
return (new FittingLayout(room, fittingsToBePlaced));
}
/// <summary>Tries to rotate and set positions for placement units in a way so they fit the room</summary>
/// <param name="placementUnits">List of placement unit to place in room</param>
/// <param name="room">Room to place placement units in</param>
/// <returns>Whether there were any possible arrangement of the placement units in the room</returns>
private bool TestPlacements(ref List<PlacementUnit> placementUnits, Room room)
{
return TestPlacementRecursive(ref placementUnits, 0, ref room);
}
/// <summary>Tries to fit placement units in list -- from indexToTest to the end of the list -- in the room</summary>
/// <param name="placementUnits">List of placement unit to place in room</param>
/// <param name="indexToTest">List index of placement unit to try to fit in room</param>
/// <param name="room">Room to place placement units in</param>
/// <returns>
/// Whether there were any possible arrangement of the placement units
/// at indexToTest in list and subsequent placement units in list
/// </returns>
private bool TestPlacementRecursive(ref List<PlacementUnit> placementUnits, int indexToTest, ref Room room)
{
if (indexToTest >= placementUnits.Count)
{
// Print the room grid of obstruction values
//Console.WriteLine(room);
// All placement units in placementUnits have been tested
return true;
}
else
{
PlacementUnit placementUnit = placementUnits[indexToTest];
// Test if placements in domains are possible
foreach (Tuple<Vector2D, int> positionAndRotation in placementUnit.positionsAndRotationsDomain)
{
// Place placement unit only if possible and then move on to test next unit
if (placementUnit.TryFitAt(positionAndRotation, ref room))
{
// Move on to the subsequent placement unit, and test if any placements in its domain fit
bool couldNextUnitBePlaced = TestPlacementRecursive(ref placementUnits, indexToTest + 1, ref room);
if (couldNextUnitBePlaced)
{
return true;
}
else
{
// Move back placementUnit to default placement and unregister placement
placementUnit.Unplace(positionAndRotation, ref room);
}
}
}
// No placements fit for this and all subsequent placement units
return false;
}
}
}
}
| 48.494172 | 239 | 0.562873 | [
"CC0-1.0",
"MIT"
] | david-dot/FittingPlacer | Main/Furnisher.cs | 20,804 | C# |
/* ***************************************************************************
* This file is part of SharpNEAT - Evolution of Neural Networks.
*
* Copyright 2004-2020 Colin Green ([email protected])
*
* SharpNEAT is free software; you can redistribute it and/or modify
* it under the terms of The MIT License (MIT).
*
* You should have received a copy of the MIT License
* along with SharpNEAT; if not, see https://opensource.org/licenses/MIT.
*/
using System;
using System.Collections.Generic;
using Redzen.Random;
using SharpNeat.Evaluation;
namespace SharpNeat.EvolutionAlgorithm
{
/// <summary>
/// A population of genomes.
/// </summary>
/// <typeparam name="TGenome">Genome type.</typeparam>
public abstract class Population<TGenome> where TGenome : IGenome
{
#region Auto Properties
/// <summary>
/// The list of genomes that make up the population.
/// </summary>
public List<TGenome> GenomeList { get; }
/// <summary>
/// Gets the current best genome.
/// </summary>
/// <remarks>
/// Note. If the evolution algorithm has not yet been initialised then this will simply return the genome at index zero in the population.
/// </remarks>
public TGenome BestGenome => this.GenomeList[this.Stats.BestGenomeIndex];
/// <summary>
/// The number of genomes in the population.
/// </summary>
/// <remarks>
/// This value is set and fixed to be the length of <see cref="GenomeList"/> at construction time.
/// During certain phases of the evolution algorithm the length of <see cref="GenomeList"/> will vary and therefore it may not match
/// <see cref="PopulationSize"/> at any given point in time, thus this property is the definitive source of the population size.
/// </remarks>
public int PopulationSize { get; }
/// <summary>
/// Population statistics.
/// </summary>
public PopulationStatistics Stats { get; }
#endregion
#region Constructor
/// <summary>
/// Construct the population with the provided list of genomes that make up the initial population.
/// </summary>
/// <param name="genomeList"></param>
public Population(List<TGenome> genomeList)
{
this.GenomeList = genomeList ?? throw new ArgumentNullException(nameof(genomeList));
if(genomeList.Count == 0) {
throw new ArgumentException("Empty genome list. The initial population cannot be empty.", nameof(genomeList));
}
this.PopulationSize = genomeList.Count;
this.Stats = CreatePopulatonStats();
}
#endregion
#region Public Methods
/// <summary>
/// Update the population statistics.
/// </summary>
/// <param name="fitnessComparer">A genome fitness comparer.</param>
/// <param name="rng">Random source.</param>
public abstract void UpdateStats(IComparer<FitnessInfo> fitnessComparer, IRandomSource rng);
#endregion
#region Protected Methods
/// <summary>
/// Create a new population statistics object.
/// </summary>
/// <returns>A new instance of <see cref="Stats"/>.</returns>
protected virtual PopulationStatistics CreatePopulatonStats()
{
return new PopulationStatistics();
}
#endregion
}
}
| 34.930693 | 146 | 0.606859 | [
"MIT"
] | sohrabsaran/sharpneat-refactor | src/SharpNeat/EvolutionAlgorithm/Population.cs | 3,530 | C# |
// Copyright (c) <2018>
// This file is subject to the MIT License as seen in the trunk of this repository
// Maintained by: <Kristian Kjems> <[email protected]>
using UnityEngine;
using UnityEditor;
using System;
using System.Collections.Generic;
namespace UVC
{
using Logging;
using UserInterface;
[InitializeOnLoad]
public class VCSettings
{
static VCSettings()
{
vcEnabled = EditorPrefs.GetBool("VCSSettings/vcEnabled", false);
lockScenes = EditorPrefs.GetBool("VCSSettings/lockScenes", true);
lockAssets = EditorPrefs.GetBool("VCSSettings/lockAssets", true);
sceneviewGUI = EditorPrefs.GetBool("VCSSettings/sceneviewGUI", true);
prefabGUI = EditorPrefs.GetBool("VCSSettings/prefabGUI", true);
materialGUI = EditorPrefs.GetBool("VCSSettings/materialGUI", true);
hierarchyIcons = EditorPrefs.GetBool("VCSSettings/hierarchyIcons", true);
hierarchyReflectionMode = (EReflectionLevel)EditorPrefs.GetInt("VCSSettings/hierarchyReflectionMode", (int)EReflectionLevel.Remote);
projectIcons = EditorPrefs.GetBool("VCSSettings/projectIcons", true);
projectReflectionMode = (EReflectionLevel)EditorPrefs.GetInt("VCSSettings/projectReflectionMode", (int)EReflectionLevel.Local);
bugReport = EditorPrefs.GetBool("VCSSettings/bugReport", true);
analytics = EditorPrefs.GetBool("VCSSettings/analytics", true);
bugReportMode = (EBugReportMode)EditorPrefs.GetInt("VCSSettings/bugReportMode", (int)EBugReportMode.Manual);
Logging = EditorPrefs.GetBool("VCSSettings/logging", false); // using Logging property instead of field by intention
lockScenesFilter = EditorPrefs.GetString("VCSSettings/lockScenesFilter");
lockPrefabsFilter = EditorPrefs.GetString("VCSSettings/lockPrefabsFilter");
autoCloseAfterSuccess = EditorPrefs.GetBool("VCSSettings/autoCloseAfterSuccess", true);
includeDepedenciesAsDefault = EditorPrefs.GetBool("VCSSettings/includeDepedenciesAsDefault", false);
requireLockBeforeCommit = EditorPrefs.GetBool("VCSSettings/requireLockBeforeCommit", false);
selectiveCommit = EditorPrefs.GetBool("VCSSettings/selectiveCommit", true);
saveStrategy = (ESaveAssetsStrategy)EditorPrefs.GetInt("VCSSettings/saveStrategy", (int)ESaveAssetsStrategy.Unity);
versionControlBackend = (EVersionControlBackend)EditorPrefs.GetInt("VCSSettings/versionControlBackend", (int)EVersionControlBackend.None);
handleFileMove = (EHandleFileMove)EditorPrefs.GetInt("VCSSettings/handleFileMove", (int)EHandleFileMove.TeamLicense);
mergeToolPath = EditorPrefs.GetString("VCSSettings/mergetoolpath", mergeTools[0].pathMerge);
mergeToolArgs = EditorPrefs.GetString("VCSSettings/mergetoolargs", mergeTools[0].argumentsMerge);
diffToolPath = EditorPrefs.GetString("VCSSettings/difftoolpath", mergeTools[0].pathDiff);
diffToolArgs = EditorPrefs.GetString("VCSSettings/difftoolargs", mergeTools[0].argumentsDiff);
mergeToolIndex = EditorPrefs.GetInt("VCSSettings/mergeToolIndex", 0);
OnSettingsChanged();
EditorApplication.quitting += () =>
{
EditorPrefs.SetBool("VCSSettings/vcEnabled", vcEnabled);
EditorPrefs.SetBool("VCSSettings/lockScenes", lockScenes);
EditorPrefs.SetBool("VCSSettings/lockAssets", lockAssets);
EditorPrefs.SetBool("VCSSettings/sceneviewGUI", sceneviewGUI);
EditorPrefs.SetBool("VCSSettings/prefabGUI", prefabGUI);
EditorPrefs.SetBool("VCSSettings/materialGUI", materialGUI);
EditorPrefs.SetBool("VCSSettings/hierarchyIcons", hierarchyIcons);
EditorPrefs.SetInt("VCSSettings/hierarchyReflectionMode", (int)hierarchyReflectionMode);
EditorPrefs.SetBool("VCSSettings/projectIcons", projectIcons);
EditorPrefs.SetInt("VCSSettings/projectReflectionMode", (int)projectReflectionMode);
EditorPrefs.SetBool("VCSSettings/bugReport", bugReport);
EditorPrefs.SetBool("VCSSettings/analytics", analytics);
EditorPrefs.SetInt("VCSSettings/bugReportMode", (int)bugReportMode);
EditorPrefs.SetBool("VCSSettings/logging", logging);
EditorPrefs.SetString("VCSSettings/lockScenesFilter", lockScenesFilter);
EditorPrefs.SetString("VCSSettings/lockPrefabsFilter", lockPrefabsFilter);
EditorPrefs.SetBool("VCSSettings/autoCloseAfterSuccess", autoCloseAfterSuccess);
EditorPrefs.SetBool("VCSSettings/includeDepedenciesAsDefault", includeDepedenciesAsDefault);
EditorPrefs.SetBool("VCSSettings/requireLockBeforeCommit", requireLockBeforeCommit);
EditorPrefs.SetBool("VCSSettings/selectiveCommit", selectiveCommit);
EditorPrefs.SetInt("VCSSettings/saveStrategy", (int)saveStrategy);
EditorPrefs.SetInt("VCSSettings/versionControlBackend", (int)versionControlBackend);
EditorPrefs.SetInt("VCSSettings/handleFileMove", (int)handleFileMove);
EditorPrefs.SetString("VCSSettings/mergetoolpath", mergeToolPath);
EditorPrefs.SetString("VCSSettings/mergetoolargs", mergeToolArgs);
EditorPrefs.SetString("VCSSettings/difftoolpath", diffToolPath );
EditorPrefs.SetString("VCSSettings/difftoolargs", diffToolArgs );
EditorPrefs.SetInt("VCSSettings/mergeToolIndex", mergeToolIndex);
};
}
public enum EBugReportMode { Automatic, Manual }
public enum EReflectionLevel { Local, Remote }
public enum EVersionControlBackend { None, Svn/*P4_DISABLED, P4_Beta*/ }
public enum ESaveAssetsStrategy { Unity, VersionControl, User }
public enum EHandleFileMove { None, TeamLicense }
public static event Action SettingChanged;
private static bool vcEnabled = true;
public static bool VCEnabled
{
get { return vcEnabled; }
set
{
if (vcEnabled != value)
{
if (value)
{
if (VCUtility.UserSelectedVersionControlSystem())
{
vcEnabled = true;
VCCommands.Instance.Start();
}
}
else
{
vcEnabled = false;
VCCommands.Instance.Stop();
}
}
OnSettingsChanged();
}
}
private static void OnSettingsChanged()
{
if (SettingChanged != null) SettingChanged();
}
private static EVersionControlBackend versionControlBackend;
public static EVersionControlBackend VersionControlBackend
{
get { return versionControlBackend; }
set {
if (versionControlBackend != value)
{
if (value == EVersionControlBackend.None) VCSettings.VCEnabled = false;
string errors = "";
Action<string> addToErrors = err => errors += "\n" + err;
DebugLog.combinedShorthandCallback += addToErrors;
if (VersionControlFactory.CreateVersionControlCommands(value))
{
versionControlBackend = value;
OnSettingsChanged();
}
else
{
var dialog = CustomDialogs.CreateMessageDialog("Version Control Selection failed", "Unable to initialize '" + value + "'\n\n" + errors, MessageType.Error);
dialog.AddButton("OK", () => dialog.Close());
dialog.ShowUtility();
}
DebugLog.combinedShorthandCallback -= addToErrors;
}
}
}
private static bool lockScenes;
public static bool LockScenes { get { return lockScenes; } set { if (lockScenes != value) { lockScenes = value; OnSettingsChanged(); } } }
private static bool lockAssets;
public static bool LockAssets { get { return lockAssets; } set { if (lockAssets != value) { lockAssets = value; OnSettingsChanged(); } } }
private static bool sceneviewGUI;
public static bool SceneviewGUI { get { return sceneviewGUI; } set { if (sceneviewGUI != value) { sceneviewGUI = value; OnSettingsChanged(); } } }
private static bool prefabGUI;
public static bool PrefabGUI { get { return prefabGUI; } set { if (prefabGUI != value) { prefabGUI = value; OnSettingsChanged(); } } }
private static bool materialGUI;
public static bool MaterialGUI { get { return materialGUI; } set { if (materialGUI != value) { materialGUI = value; OnSettingsChanged(); } } }
private static bool hierarchyIcons;
public static bool HierarchyIcons { get { return hierarchyIcons; } set { if (hierarchyIcons != value) { hierarchyIcons = value; OnSettingsChanged(); } } }
private static EReflectionLevel hierarchyReflectionMode;
public static EReflectionLevel HierarchyReflectionMode { get { return hierarchyReflectionMode; } set { if (hierarchyReflectionMode != value) { hierarchyReflectionMode = value; } } }
private static bool projectIcons;
public static bool ProjectIcons { get { return projectIcons; } set { if (projectIcons != value) { projectIcons = value; OnSettingsChanged(); } } }
private static EReflectionLevel projectReflectionMode;
public static EReflectionLevel ProjectReflectionMode { get { return projectReflectionMode; } set { if (projectReflectionMode != value) { projectReflectionMode = value; } } }
private static bool bugReport;
public static bool BugReport { get { return bugReport; } set { if (bugReport != value) { bugReport = value; OnSettingsChanged(); } } }
private static bool analytics;
public static bool Analytics { get { return analytics; } set { if (analytics != value) { analytics = value; OnSettingsChanged(); } } }
private static EBugReportMode bugReportMode;
public static EBugReportMode BugReportMode { get { return bugReportMode; } set { if (bugReportMode != value) { bugReportMode = value; } } }
private static string lockScenesFilter;
public static string LockScenesFilter { get { return lockScenesFilter; } set { if (lockScenesFilter != value) { lockScenesFilter = value.TrimStart(new[] { ' ', '/' }); } } }
private static string lockPrefabsFilter;
public static string LockPrefabsFilter { get { return lockPrefabsFilter; } set { if (lockPrefabsFilter != value) { lockPrefabsFilter = value.TrimStart(new[] { ' ', '/' }); } } }
private static bool autoCloseAfterSuccess;
public static bool AutoCloseAfterSuccess { get { return autoCloseAfterSuccess; } set { if (autoCloseAfterSuccess != value) { autoCloseAfterSuccess = value; OnSettingsChanged(); } } }
private static bool includeDepedenciesAsDefault;
public static bool IncludeDepedenciesAsDefault { get { return includeDepedenciesAsDefault; } set { if (includeDepedenciesAsDefault != value) { includeDepedenciesAsDefault = value; OnSettingsChanged(); } } }
private static bool requireLockBeforeCommit;
public static bool RequireLockBeforeCommit { get { return requireLockBeforeCommit; } set { if (requireLockBeforeCommit != value) { requireLockBeforeCommit = value; OnSettingsChanged(); } } }
private static bool selectiveCommit;
public static bool SelectiveCommit { get { return selectiveCommit; } set { if (selectiveCommit != value) { selectiveCommit = value; OnSettingsChanged(); } } }
private static ESaveAssetsStrategy saveStrategy;
public static ESaveAssetsStrategy SaveStrategy { get { return saveStrategy; } set { if (saveStrategy != value) { saveStrategy = value; OnSettingsChanged(); } } }
private static EHandleFileMove handleFileMove;
public static EHandleFileMove HandleFileMove { get { return handleFileMove; } set { if (handleFileMove != value) { handleFileMove = value; OnSettingsChanged(); } } }
private static string mergeToolPath;
public static string MergetoolPath { get { return mergeToolPath; } set { if(mergeToolPath != value) { mergeToolPath = value; OnSettingsChanged(); } } }
private static string mergeToolArgs;
public static string MergetoolArgs { get { return mergeToolArgs; } set { if(mergeToolArgs != value) { mergeToolArgs = value; OnSettingsChanged(); } } }
private static string diffToolPath;
public static string DifftoolPath { get { return diffToolPath; } set { if(diffToolPath != value) { diffToolPath = value; OnSettingsChanged(); } } }
private static string diffToolArgs;
public static string DifftoolArgs { get { return diffToolArgs; } set { if(diffToolArgs != value) { diffToolArgs = value; OnSettingsChanged(); } } }
private static int mergeToolIndex;
public static int MergeToolIndex { get { return mergeToolIndex; } set { if(mergeToolIndex != value) { mergeToolIndex = value; OnSettingsChanged(); } } }
public struct MergeTool
{
public string name;
public string pathDiff;
public string pathMerge;
public string argumentsDiff;
public string argumentsMerge;
}
public static List<MergeTool> mergeTools = new List<MergeTool>
{
#if UNITY_EDITOR_OSX
new MergeTool
{
name = "Apple File Merge",
pathDiff = "/Applications/Xcode.app/Contents/Applications/FileMerge.app/Contents/MacOS/FileMerge",
pathMerge = "/Applications/Xcode.app/Contents/Applications/FileMerge.app/Contents/MacOS/FileMerge",
argumentsDiff = "-left '[theirs]' -right '[yours]'",
argumentsMerge = "-left '[theirs]' -right '[yours]' -ancestor '[base]' -merge '[merge]'"
},
new MergeTool
{
name = "P4Merge",
pathDiff = "/Applications/p4merge.app/Contents/MacOS/p4merge",
pathMerge = "/Applications/p4merge.app/Contents/MacOS/p4merge",
argumentsDiff = "'[theirs]' '[yours]'",
argumentsMerge = "'[base]' '[theirs]' '[yours]' '[merge]'"
},
new MergeTool
{
name = "Beyond Compare 4",
pathDiff = "/Applications/Beyond Compare.app/Contents/MacOS/bcomp",
pathMerge = "/Applications/Beyond Compare.app/Contents/MacOS/bcomp",
argumentsDiff = "'[theirs]' '[yours]'",
argumentsMerge = "'[theirs]' '[yours]' '[base]' '[merge]'"
},
new MergeTool
{
name = "Semantic Merge (P4 diff)",
pathDiff = "/Applications/p4merge.app/Contents/MacOS/p4merge",
pathMerge = "/Applications/semanticmerge.app/Contents/MacOS/semanticmerge",
argumentsDiff = "'[theirs]' '[yours]'",
argumentsMerge = "'[yours]' '[theirs]' '[base]' '[merge]' " +
"--nolangwarn -emt=\"/Applications/p4merge.app/Contents/MacOS/p4merge '[base]' '[theirs]' '[yours]' '[merge]'\""
}
#endif
#if UNITY_EDITOR_WIN
new MergeTool
{
name = "Tortoise Merge",
pathDiff = "C:/Program Files/TortoiseSVN/bin/TortoiseMerge.exe",
pathMerge = "C:/Program Files/TortoiseSVN/bin/TortoiseMerge.exe",
argumentsDiff = "\"[theirs]\" \"[yours]\"",
argumentsMerge = "/base:\"[base]\" /theirs:\"[theirs]\" /mine:\"[yours]\" /merged:\"[merge]\""
},
new MergeTool
{
name = "P4Merge",
pathDiff = "C:/Program Files/Perforce/p4merge.exe",
pathMerge = "C:/Program Files/Perforce/p4merge.exe",
argumentsDiff = "\"[theirs]\" \"[yours]\"",
argumentsMerge = "\"[base]\" \"[theirs]\" \"[yours]\" \"[merge]\""
},
new MergeTool
{
name = "Beyond Compare 4",
pathDiff = "C:/Program Files/Beyond Compare 4/BComp.exe",
pathMerge = "C:/Program Files/Beyond Compare 4/BComp.exe",
argumentsDiff = "\"[theirs]\" \"[yours]\"",
argumentsMerge = "\"[theirs]\" \"[yours]\" \"[base]\" \"[merge]\""
},
new MergeTool
{
name = "Semantic Merge (P4 diff)",
pathDiff = "~/AppData/Local/semanticmerge/semanticmergetool.exe",
pathMerge = "~/AppData/Local/semanticmerge/semanticmergetool.exe",
argumentsDiff = "-s=\"[theirs]\" -d=\"[yours]\"",
argumentsMerge = "\"[yours]\" \"[theirs]\" \"[base]\" \"[merge]\" --nolangwarn"
}
#endif
#if UNITY_EDITOR_LINUX
new MergeTool
{
name = "Semantic Merge (P4 diff)",
pathDiff = "/usr/local/bin/p4merge",
pathMerge = "/usr/local/bin/p4merge",
argumentsDiff = "\"[theirs]\" \"[yours]\"",
argumentsMerge = "\"[base]\" \"[theirs]\" \"[yours]\" \"[merge]\""
}
#endif
};
public static bool Logging
{
get { return logging; }
set
{
if (logging != value)
{
// D.writeErrorCallback is always shown from VCExceptionHandler
logging = value;
if (logging)
{
DebugLog.writeLogCallback += Debug.Log;
DebugLog.writeWarningCallback += Debug.LogWarning;
}
else
{
if (DebugLog.writeLogCallback != null) DebugLog.writeLogCallback -= Debug.Log;
if (DebugLog.writeWarningCallback != null) DebugLog.writeWarningCallback -= Debug.LogWarning;
}
}
}
}
private static bool logging;
}
}
| 54.505682 | 215 | 0.596894 | [
"MIT"
] | Olliebrown/uversioncontrol | Editor/UVC.UnityVersionControl/API/VCSettings.cs | 19,186 | C# |
using CodeProbe.HealthChecks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Test.CodeProbe.HealthChecks.utility
{
public class TestHealtCheckFail : AbstractHealthCheck
{
public TestHealtCheckFail(string name)
:base(name)
{
}
public override int Severity
{
get { return 10; }
}
public override bool? Check()
{
return false;
}
}
}
| 18 | 57 | 0.589286 | [
"MIT"
] | aliaslab-1984/CodeProbe | test/Test.CodeProbe.HealthChecks/utility/TestHealtCheckFail.cs | 506 | C# |
using System;
using System.ComponentModel;
using System.IO;
using System.Xml;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Threading;
using ICSharpCode.AvalonEdit;
using ICSharpCode.AvalonEdit.Folding;
using ICSharpCode.AvalonEdit.Highlighting;
using ICSharpCode.AvalonEdit.Highlighting.Xshd;
using Rubik.Toolkit.Utils;
namespace Rubik.Theme.Extension.Controls
{
[TemplatePart(Name = TextEditorTemplateName, Type = typeof(TextEditor))]
public class LiveXaml : Control
{
private static readonly Type _typeofSelf = typeof(LiveXaml);
private const string TextEditorTemplateName = "PART_TextEditor";
private TextEditor _partTextEditor = null;
private FoldingManager _foldingManager = null;
private XmlFoldingStrategy _foldingStrategy = null;
private DispatcherTimer _timer = null;
private bool _disabledTimer = false;
private static RoutedCommand _openXamlCommand = null;
private static RoutedCommand _saveXamlCommand = null;
private static RoutedCommand _resetXamlCommand = null;
private static RoutedCommand _copyXamlCommand = null;
private static RoutedCommand _parseXamlCommand = null;
private static RoutedCommand _horSplitCommand = null;
private static RoutedCommand _verSplitCommand = null;
public string Text
{
get
{
if (_partTextEditor != null)
return _partTextEditor.Text;
return string.Empty;
}
set
{
if (_partTextEditor != null)
{
_disabledTimer = true;
_partTextEditor.Text = value;
}
}
}
static LiveXaml()
{
InitializeCommands();
DefaultStyleKeyProperty.OverrideMetadata(_typeofSelf, new FrameworkPropertyMetadata(_typeofSelf));
}
public LiveXaml()
{
_foldingStrategy = new XmlFoldingStrategy() { ShowAttributesWhenFolded = true };
_timer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(Math.Max(1, Delay)) };
_timer.Tick += _timer_Tick;
}
#region Command
private static void InitializeCommands()
{
_openXamlCommand = new RoutedCommand("OpenXaml", _typeofSelf);
_saveXamlCommand = new RoutedCommand("SaveXaml", _typeofSelf);
_resetXamlCommand = new RoutedCommand("ResetXaml", _typeofSelf);
_copyXamlCommand = new RoutedCommand("CopyXaml", _typeofSelf);
_parseXamlCommand = new RoutedCommand("ParseXaml", _typeofSelf);
_horSplitCommand = new RoutedCommand("HorSplit", _typeofSelf);
_verSplitCommand = new RoutedCommand("VerSplit", _typeofSelf);
CommandManager.RegisterClassCommandBinding(_typeofSelf, new CommandBinding(_openXamlCommand, OnOpenXamlCommand));
CommandManager.RegisterClassCommandBinding(_typeofSelf, new CommandBinding(_saveXamlCommand, OnSaveXamlCommand));
CommandManager.RegisterClassCommandBinding(_typeofSelf, new CommandBinding(_resetXamlCommand, OnResetXamlCommand));
CommandManager.RegisterClassCommandBinding(_typeofSelf, new CommandBinding(_copyXamlCommand, OnCopyXamlCommand));
CommandManager.RegisterClassCommandBinding(_typeofSelf, new CommandBinding(_parseXamlCommand, OnParseXamlCommand));
CommandManager.RegisterClassCommandBinding(_typeofSelf, new CommandBinding(_horSplitCommand, OnHorSplitCommand));
CommandManager.RegisterClassCommandBinding(_typeofSelf, new CommandBinding(_verSplitCommand, OnVerSplitCommand));
}
public static RoutedCommand OpenXamlCommand
{
get { return _openXamlCommand; }
}
public static RoutedCommand SaveXamlCommand
{
get { return _saveXamlCommand; }
}
public static RoutedCommand ResetXamlCommand
{
get { return _resetXamlCommand; }
}
public static RoutedCommand CopyXamlCommand
{
get { return _copyXamlCommand; }
}
public static RoutedCommand ParseXamlCommand
{
get { return _parseXamlCommand; }
}
public static RoutedCommand HorSplitCommand
{
get { return _horSplitCommand; }
}
public static RoutedCommand VerSplitCommand
{
get { return _verSplitCommand; }
}
private async static void OnOpenXamlCommand(object sender, RoutedEventArgs e)
{
var fileName = DialogUtil.ShowOpenFileDialog("XAML|*.xaml");
if (string.IsNullOrEmpty(fileName) || !File.Exists(fileName))
return;
var ctrl = sender as LiveXaml;
using (var fs = new FileStream(fileName, FileMode.Open, FileAccess.Read))
{
using (var sr = new StreamReader(fs, Encoding.UTF8))
{
ctrl.Text = await sr.ReadToEndAsync();
}
}
}
private async static void OnSaveXamlCommand(object sender, RoutedEventArgs e)
{
var fileName = DialogUtil.ShowSaveFileDialog("MyXaml.xaml", "XAML|*.xaml");
if (string.IsNullOrEmpty(fileName))
return;
var ctrl = sender as LiveXaml;
using (var fs = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.Read))
{
using (var sw = new StreamWriter(fs, Encoding.UTF8))
{
await sw.WriteAsync(ctrl.Text);
}
}
}
private static void OnResetXamlCommand(object sender, RoutedEventArgs e)
{
var ctrl = sender as LiveXaml;
if (ctrl.ResetXaml != null)
ctrl.Text = ctrl.ResetXaml();
}
private static void OnCopyXamlCommand(object sender, RoutedEventArgs e)
{
var ctrl = sender as LiveXaml;
Clipboard.SetText(ctrl.Text);
}
private static void OnParseXamlCommand(object sender, RoutedEventArgs e)
{
var ctrl = sender as LiveXaml;
ctrl.ParseXaml(ctrl.Text);
}
private static void OnHorSplitCommand(object sender, RoutedEventArgs e)
{
var ctrl = sender as LiveXaml;
ctrl.HorSplit();
}
private static void OnVerSplitCommand(object sender, RoutedEventArgs e)
{
var ctrl = sender as LiveXaml;
ctrl.VerSplit();
}
#endregion
#region Property
private static readonly DependencyPropertyKey ContainerAnglePropertyKey = DependencyProperty.RegisterReadOnly("ContainerAngle", typeof(double), _typeofSelf, new PropertyMetadata(0d));
public static readonly DependencyProperty ContainerAngleProperty = ContainerAnglePropertyKey.DependencyProperty;
public double ContainerAngle
{
get { return (double)GetValue(ContainerAngleProperty); }
}
private static readonly DependencyPropertyKey ControlPanelAnglePropertyKey = DependencyProperty.RegisterReadOnly("ControlPanelAngle", typeof(double), _typeofSelf, new PropertyMetadata(0d));
public static readonly DependencyProperty ControlPanelAngleProperty = ControlPanelAnglePropertyKey.DependencyProperty;
public double ControlPanelAngle
{
get { return (double)GetValue(ControlPanelAngleProperty); }
}
private static readonly DependencyPropertyKey SplitterCursorSourcePropertyKey = DependencyProperty.RegisterReadOnly("SplitterCursorSource", typeof(string), _typeofSelf, new PropertyMetadata(@"/Rubik.Toolkit;component/Assets/Cursors/Splitter_ud.cur"));
public static readonly DependencyProperty SplitterCursorSourceProperty = SplitterCursorSourcePropertyKey.DependencyProperty;
public string SplitterCursorSource
{
get { return (string)GetValue(SplitterCursorSourceProperty); }
}
private static readonly DependencyPropertyKey PanelAnglePropertyKey = DependencyProperty.RegisterReadOnly("PanelAngle", typeof(double), _typeofSelf, new PropertyMetadata(0d));
public static readonly DependencyProperty PanelAngleProperty = PanelAnglePropertyKey.DependencyProperty;
public double PanelAngle
{
get { return (double)GetValue(PanelAngleProperty); }
}
private static readonly DependencyPropertyKey HorSplitAnglePropertyKey = DependencyProperty.RegisterReadOnly("HorSplitAngle", typeof(double), _typeofSelf, new PropertyMetadata(0d));
public static readonly DependencyProperty HorSplitAngleProperty = HorSplitAnglePropertyKey.DependencyProperty;
public double HorSplitAngle
{
get { return (double)GetValue(HorSplitAngleProperty); }
}
private static readonly DependencyPropertyKey VerSplitAnglePropertyKey = DependencyProperty.RegisterReadOnly("VerSplitAngle", typeof(double), _typeofSelf, new PropertyMetadata(0d));
public static readonly DependencyProperty VerSplitAngleProperty = VerSplitAnglePropertyKey.DependencyProperty;
public double VerSplitAngle
{
get { return (double)GetValue(VerSplitAngleProperty); }
}
private static readonly DependencyPropertyKey ContentPropertyKey = DependencyProperty.RegisterReadOnly("Content", typeof(object), _typeofSelf, new PropertyMetadata(null));
public static readonly DependencyProperty ContentProperty = ContentPropertyKey.DependencyProperty;
public object Content
{
get { return GetValue(ContentProperty); }
}
public static readonly DependencyProperty LineNumbersForegroundProperty = DependencyProperty.Register("LineNumbersForeground", typeof(Brush), _typeofSelf, new PropertyMetadata(Brushes.Black));
public Brush LineNumbersForeground
{
get { return (Brush)GetValue(LineNumbersForegroundProperty); }
set { SetValue(LineNumbersForegroundProperty, value); }
}
public static readonly DependencyProperty LineNumbersBackgroundProperty = DependencyProperty.Register("LineNumbersBackground", typeof(Brush), _typeofSelf, new PropertyMetadata(Brushes.Transparent));
public Brush LineNumbersBackground
{
get { return (Brush)GetValue(LineNumbersBackgroundProperty); }
set { SetValue(LineNumbersBackgroundProperty, value); }
}
public static readonly DependencyProperty SyntaxHighlightingProperty = DependencyProperty.Register("SyntaxHighlighting", typeof(IHighlightingDefinition), _typeofSelf);
[TypeConverter(typeof(HighlightingDefinitionTypeConverter))]
public IHighlightingDefinition SyntaxHighlighting
{
get { return (IHighlightingDefinition)GetValue(SyntaxHighlightingProperty); }
set { SetValue(SyntaxHighlightingProperty, value); }
}
public static readonly DependencyProperty AllowFoldingProperty = DependencyProperty.Register("AllowFolding", typeof(bool), _typeofSelf, new PropertyMetadata(true, OnAllowFoldingPropertyChanged));
public bool AllowFolding
{
get { return (bool)GetValue(AllowFoldingProperty); }
set { SetValue(AllowFoldingProperty, value); }
}
private static void OnAllowFoldingPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctrl = d as LiveXaml;
var allowFolding = (bool)e.NewValue;
if (allowFolding)
ctrl.InstallFolding();
else
ctrl.UninstallFolding();
}
public static readonly DependencyProperty AutoParseProperty = DependencyProperty.Register("AutoParse", typeof(bool), _typeofSelf, new PropertyMetadata(false));
public bool AutoParse
{
get { return (bool)GetValue(AutoParseProperty); }
set { SetValue(AutoParseProperty, value); }
}
public static readonly DependencyProperty LinePositionProperty = DependencyProperty.Register("LinePosition", typeof(int), _typeofSelf, new PropertyMetadata(OnLinePositionPropertyChanged));
public int LinePosition
{
get { return (int)GetValue(LinePositionProperty); }
set { SetValue(LinePositionProperty, value); }
}
private static void OnLinePositionPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctrl = d as LiveXaml;
var pos = (int)e.NewValue;
ctrl._partTextEditor.TextArea.Caret.Column = pos;
}
public static readonly DependencyProperty LineNumberProperty = DependencyProperty.Register("LineNumber", typeof(int), _typeofSelf, new PropertyMetadata(OnLineNumberPropertyChanged));
public int LineNumber
{
get { return (int)GetValue(LineNumberProperty); }
set { SetValue(LineNumberProperty, value); }
}
private static void OnLineNumberPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctrl = d as LiveXaml;
var line = (int)e.NewValue;
ctrl._partTextEditor.TextArea.Caret.Line = line;
}
public static readonly DependencyProperty WordWrapProperty = TextEditor.WordWrapProperty.AddOwner(_typeofSelf);
public bool WordWrap
{
get { return (bool)GetValue(WordWrapProperty); }
set { SetValue(WordWrapProperty, value); }
}
public static readonly DependencyProperty ShowLineNumbersProperty = TextEditor.ShowLineNumbersProperty.AddOwner(_typeofSelf);
public bool ShowLineNumbers
{
get { return (bool)GetValue(ShowLineNumbersProperty); }
set { SetValue(ShowLineNumbersProperty, value); }
}
public static readonly DependencyProperty IsReadOnlyProperty = TextEditor.IsReadOnlyProperty.AddOwner(_typeofSelf);
public bool IsReadOnly
{
get { return (bool)GetValue(IsReadOnlyProperty); }
set { SetValue(IsReadOnlyProperty, value); }
}
public static readonly DependencyProperty DelayProperty = DependencyProperty.Register("Delay", typeof(double), _typeofSelf, new PropertyMetadata(1d, OnDelayPropertyChanged));
public double Delay
{
get { return (double)GetValue(DelayProperty); }
set { SetValue(DelayProperty, value); }
}
private static void OnDelayPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctrl = d as LiveXaml;
var delay = (double)e.NewValue;
if (ctrl._timer != null)
ctrl._timer.Interval = TimeSpan.FromSeconds(Math.Max(1, delay));
}
public static readonly DependencyProperty RestXamlProperty = DependencyProperty.Register("ResetXaml", typeof(Func<string>), _typeofSelf);
public Func<string> ResetXaml
{
get { return (Func<string>)GetValue(RestXamlProperty); }
set { SetValue(RestXamlProperty, value); }
}
#endregion
#region Override
protected override void OnGotFocus(RoutedEventArgs e)
{
base.OnGotFocus(e);
if (Focusable && _partTextEditor != null)
_partTextEditor.Focus();
}
protected override void OnPreviewKeyDown(KeyEventArgs e)
{
base.OnKeyDown(e);
switch (e.Key)
{
case Key.Left:
{
if (_partTextEditor.SelectionLength < 2 || Keyboard.Modifiers != ModifierKeys.None)
return;
_partTextEditor.TextArea.Caret.Offset = _partTextEditor.SelectionStart + 1;
break;
}
case Key.Right:
{
if (_partTextEditor.SelectionLength < 2 || Keyboard.Modifiers != ModifierKeys.None)
return;
_partTextEditor.TextArea.Caret.Offset = _partTextEditor.SelectionStart + _partTextEditor.SelectionLength - 1;
break;
}
}
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
_partTextEditor = GetTemplateChild(TextEditorTemplateName) as TextEditor;
if (_partTextEditor != null)
{
_partTextEditor.TextChanged += _partTextEditor_TextChanged;
_partTextEditor.TextArea.TextEntered += TextArea_TextEntered;
_partTextEditor.TextArea.Caret.PositionChanged += Caret_PositionChanged;
DataObject.AddPastingHandler(_partTextEditor, _partTextEditor_Pasting);
_partTextEditor.Options = new TextEditorOptions { ConvertTabsToSpaces = true };
_partTextEditor.TextArea.SelectionCornerRadius = 0;
_partTextEditor.TextArea.SelectionBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FFADD6FF"));
_partTextEditor.TextArea.SelectionBorder = null;
_partTextEditor.TextArea.SelectionForeground = null;
}
}
#endregion
#region Event
private void _timer_Tick(object sender, EventArgs e)
{
_timer.Stop();
if (AutoParse)
ParseXaml(Text);
}
private void _partTextEditor_TextChanged(object sender, EventArgs e)
{
RefreshFoldings();
//ParseXaml(Text);
if (_disabledTimer)
{
_disabledTimer = false;
return;
}
if (_timer != null)
{
_timer.Stop();
_timer.Start();
}
}
private void _partTextEditor_Pasting(object sender, DataObjectPastingEventArgs e)
{
//for invoke DelayArrivedEvent
_disabledTimer = false;
}
private void Caret_PositionChanged(object sender, EventArgs e)
{
if (_partTextEditor == null)
return;
LineNumber = _partTextEditor.TextArea.Caret.Location.Line;
LinePosition = _partTextEditor.TextArea.Caret.Location.Column;
}
private void TextArea_TextEntered(object sender, TextCompositionEventArgs e)
{
if (IsReadOnly)
return;
var offset = _partTextEditor.TextArea.Caret.Offset;
switch (e.Text)
{
case "{":
{
InsertText("}");
break;
}
case "=": //get values
{
if (!IsEvenQuoteInElement(offset - 2))
break;
InsertText("\"\"");
break;
}
case "\"": //get values
{
InsertText("\"");
break;
}
case ">": // auto add </XXX>
{
if (FindPreviousNonSpaceChars(offset - 1, 2) == "/>")
break;
var element = GetElement(offset - 2);
if (!string.IsNullOrEmpty(element))
{
var insertStr = $"</{element}>";
InsertText(insertStr, true, insertStr.Length);
}
break;
}
case "/":
{
if (FindPreviousNonSpaceChars(offset - 1, 2) == "</")
{
var parentOffset = -1;
var parentElement = GetParentElement(offset - 3, ref parentOffset);
if (!string.IsNullOrEmpty(parentElement))
InsertText($"{parentElement}>");
}
break;
}
case "\n": // auto align or insert one space line
DealBreak();
break;
}
}
#endregion
#region IntelliSense
private string FindPreviousNonSpaceChars(int startOffset, int charLength = 1, int minOffset = 0)
{
var foundChars = string.Empty;
while (startOffset >= minOffset)
{
var curChar = _partTextEditor.Text[startOffset];
if (!char.IsWhiteSpace(curChar))
{
foundChars += curChar;
if (foundChars.Length == charLength)
break;
}
startOffset--;
}
if (string.IsNullOrEmpty(foundChars) || foundChars.Length == 1)
return foundChars;
return new string(foundChars.Reverse().ToArray());
}
private string FindNextNonSpaceChars(int startOffset, int charLength = 1, int maxOffset = -1)
{
var foundChars = string.Empty;
var length = maxOffset < 0 ? _partTextEditor.Text.Length : (maxOffset + 1);
while (startOffset < length)
{
var curChar = _partTextEditor.Text[startOffset];
if (!char.IsWhiteSpace(curChar))
{
foundChars += curChar;
if (foundChars.Length == charLength)
break;
}
startOffset++;
}
return foundChars;
}
private string GetParentElement(int startOffset, ref int parentOffset)
{
var foundEnd = false;
var ignoreNextEndCount = 0;
for (int i = startOffset; i >= 0; i--)
{
var curChar = _partTextEditor.Text[i];
if (curChar == '>' && i > 0 && FindPreviousNonSpaceChars(i - 1) != "/")
{
foundEnd = true;
continue;
}
if (curChar == '/' && i > 0 && FindPreviousNonSpaceChars(i - 1) == "<")
{
foundEnd = false;
ignoreNextEndCount++;
continue;
}
if (curChar == '<' && foundEnd)
{
if (ignoreNextEndCount > 0)
{
foundEnd = false;
ignoreNextEndCount--;
continue;
}
parentOffset = i;
var element = "";
for (int j = i + 1; j <= startOffset; j++)
{
curChar = _partTextEditor.Text[j];
var isLetterOrPoint = char.IsLetter(curChar) || curChar == '.';
if (!string.IsNullOrEmpty(element) && !isLetterOrPoint)
return element;
if (isLetterOrPoint)
element += curChar;
}
if (!string.IsNullOrEmpty(element))
return element;
}
}
return null;
}
private string GetElementInFrontOfSymbol(int startOffset)
{
var element = "";
for (int i = startOffset; i >= 0; i--)
{
var curChar = _partTextEditor.Text[i];
var isLetter = char.IsLetter(curChar);
if (!string.IsNullOrEmpty(element) && !isLetter)
return new string(element.Reverse().ToArray());
if (isLetter)
element += curChar;
}
return element;
}
private Tuple<string, string> GetElementAndAttributeInFrontOfSymbol(int startOffset)
{
var finishAttribute = false;
var attribute = "";
var element = "";
for (int i = startOffset; i >= 0; i--)
{
var curChar = _partTextEditor.Text[i];
//attribute
var isLetter = char.IsLetter(curChar);
if (!string.IsNullOrEmpty(attribute) && !isLetter && !finishAttribute)
{
finishAttribute = true;
attribute = new string(attribute.Reverse().ToArray());
}
if (isLetter && !finishAttribute)
attribute += curChar;
//element
if (curChar == '>')
break;
if (curChar == '/' && i > 0 && FindPreviousNonSpaceChars(i - 1) == "<")
break;
if (curChar == '<')
{
for (int j = i + 1; j <= startOffset; j++)
{
curChar = _partTextEditor.Text[j];
var isLetterOrPoint = char.IsLetter(curChar) || curChar == '.';
if (!string.IsNullOrEmpty(element) && !isLetterOrPoint)
break;
if (isLetterOrPoint)
element += curChar;
}
}
}
return new Tuple<string, string>(element, attribute);
}
private string GetElement(int startOffset)
{
for (int i = startOffset; i >= 0; i--)
{
var curChar = _partTextEditor.Text[i];
if (curChar == '>')
return null;
if (curChar == '/' && i > 0 && FindPreviousNonSpaceChars(i - 1) == "<")
return null;
if (curChar == '<')
{
var element = "";
for (int j = i + 1; j <= startOffset; j++)
{
curChar = _partTextEditor.Text[j];
var isLetterOrPoint = char.IsLetter(curChar) || curChar == '.';
if (!string.IsNullOrEmpty(element) && !isLetterOrPoint)
return element;
if (isLetterOrPoint)
element += curChar;
}
if (!string.IsNullOrEmpty(element))
return element;
}
}
return null;
}
private void FormatIndentInElement(string lastLineText)
{
if (string.IsNullOrWhiteSpace(lastLineText))
return;
var curOffset = _partTextEditor.TextArea.Caret.Offset;
for (int i = 0; i < lastLineText.Length; i++)
{
var curChar = lastLineText[i];
if (char.IsWhiteSpace(curChar))
continue;
if (curChar == '<')
{
var startOffset = i;
var foundSpace = false;
for (int j = i + 1; j < lastLineText.Length; j++)
{
curChar = lastLineText[j];
var isWhiteSpace = char.IsWhiteSpace(curChar);
if (!isWhiteSpace)
{
if (!foundSpace)
continue;
else
{
startOffset = j;
break;
}
}
else
{
foundSpace = true;
}
}
if (startOffset == i)
_partTextEditor.Document.Insert(curOffset, string.Join("", Enumerable.Repeat(" ", 4)));
else
_partTextEditor.Document.Insert(curOffset, string.Join("", Enumerable.Repeat(" ", startOffset - i)));
}
break;
}
}
private void DealBreak()
{
var docLine = _partTextEditor.Document.GetLineByNumber(_partTextEditor.TextArea.Caret.Line - 1);
if (docLine == null)
return;
var lineText = _partTextEditor.Document.GetText(docLine.Offset, docLine.Length);
if (string.IsNullOrWhiteSpace(lineText))
return;
var curOffset = _partTextEditor.TextArea.Caret.Offset;
if (curOffset == 0)
return;
var element = GetElement(curOffset - 1);
if (!string.IsNullOrEmpty(element))
{
FormatIndentInElement(lineText);
return;
}
var parentOffset = -1;
var parentElement = GetParentElement(curOffset - 1, ref parentOffset);
if (!string.IsNullOrEmpty(parentElement))
{
var parentColumn = _partTextEditor.Document.GetLocation(parentOffset).Column;
var curColumn = _partTextEditor.TextArea.Caret.Column;
var targetColumn = parentColumn + 4;
if (targetColumn > curColumn)
_partTextEditor.Document.Insert(curOffset, string.Join("", Enumerable.Repeat(" ", targetColumn - curColumn)));
else if (targetColumn < curColumn)
_partTextEditor.TextArea.Caret.Offset -= (curColumn - targetColumn);
curOffset = _partTextEditor.TextArea.Caret.Offset;
var thisLine = _partTextEditor.Document.GetLineByOffset(curOffset);
if (FindNextNonSpaceChars(curOffset, 2, thisLine.EndOffset) == "</")
{
_partTextEditor.Document.Insert(curOffset, "\n" + (parentColumn > 0 ? string.Join("", Enumerable.Repeat(" ", parentColumn - 1)) : ""));
_partTextEditor.TextArea.Caret.Offset = curOffset;
}
}
}
private bool IsEvenQuoteInElement(int startOffset)
{
var quoteCount = 0;
for (int i = startOffset; i >= 0; i--)
{
var curChar = _partTextEditor.Text[i];
if (curChar == '>')
return false;
if (curChar == '/' && i > 0 && FindPreviousNonSpaceChars(i - 1) == "<")
return false;
if (curChar == '\"')
quoteCount++;
if (curChar == '<')
return quoteCount % 2 == 0;
}
return false;
}
#endregion
#region Func
public void LoadSyntaxHighlighting(string fileName)
{
if (!File.Exists(fileName) || _partTextEditor == null)
return;
using (var fs = new FileStream(fileName, FileMode.Open, FileAccess.Read))
{
using (var reader = new XmlTextReader(fs))
{
_partTextEditor.SyntaxHighlighting = HighlightingLoader.Load(reader, HighlightingManager.Instance);
}
}
}
public void Dispose()
{
if (_timer != null)
{
_timer.Stop();
_timer.Tick -= _timer_Tick;
_timer = null;
}
UninstallFolding();
UnsubscribeEvents();
}
private void InsertText(string text, bool caretFallBack = true, int fallbackLength = 1)
{
_partTextEditor.TextArea.Document.Insert(_partTextEditor.TextArea.Caret.Offset, text);
if (caretFallBack)
_partTextEditor.TextArea.Caret.Column -= fallbackLength;
}
private void UnsubscribeEvents()
{
if (_partTextEditor != null)
{
_partTextEditor.TextChanged -= _partTextEditor_TextChanged;
_partTextEditor.TextArea.TextEntered -= TextArea_TextEntered;
_partTextEditor.TextArea.Caret.PositionChanged -= Caret_PositionChanged;
DataObject.RemovePastingHandler(_partTextEditor, _partTextEditor_Pasting);
}
}
private void RefreshFoldings()
{
if (_partTextEditor == null || !AllowFolding)
return;
InstallFolding();
_foldingStrategy.UpdateFoldings(_foldingManager, _partTextEditor.Document);
}
private void InstallFolding()
{
if (_foldingManager != null || _partTextEditor == null)
return;
_foldingManager = FoldingManager.Install(_partTextEditor.TextArea);
}
private void UninstallFolding()
{
if (_foldingManager != null)
{
FoldingManager.Uninstall(_foldingManager);
_foldingManager = null;
}
}
private void ParseXaml(string xaml)
{
if (string.IsNullOrWhiteSpace(xaml))
{
ShowLocalText("Error: No XAML!");
return;
}
try
{
SetValue(ContentPropertyKey, XamlReader.Parse(xaml));
}
catch (Exception ex)
{
ShowLocalText("Error: " + ex.Message);
}
}
private void ShowLocalText(string text, double fontSize = 14d)
{
SetValue(ContentPropertyKey, new TextBlock
{
Text = text,
Margin = new Thickness(5),
FontSize = fontSize,
TextWrapping = TextWrapping.Wrap,
Foreground = Brushes.DarkSlateGray,
FontWeight = FontWeights.Medium,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
});
}
private void HorSplit()
{
SetValue(ContainerAnglePropertyKey, 0d);
SetValue(ControlPanelAnglePropertyKey, 0d);
SetValue(PanelAnglePropertyKey, 0d);
SetValue(HorSplitAnglePropertyKey, 0d);
SetValue(VerSplitAnglePropertyKey, 0d);
SetValue(SplitterCursorSourcePropertyKey, @"/Rubik.Toolkit;component/Assets/Cursors/Splitter_ud.cur");
}
private void VerSplit()
{
SetValue(ContainerAnglePropertyKey, -90d);
SetValue(ControlPanelAnglePropertyKey, 180d);
SetValue(PanelAnglePropertyKey, 90d);
SetValue(HorSplitAnglePropertyKey, 90d);
SetValue(VerSplitAnglePropertyKey, 90d);
SetValue(SplitterCursorSourcePropertyKey, @"/Rubik.Toolkit;component/Assets/Cursors/Splitter_lr.cur");
}
#endregion
}
}
| 35.721834 | 259 | 0.550811 | [
"MIT"
] | huangjia2107/Rubik | src/Rubik.Theme.Extension/Controls/LiveXaml.cs | 35,831 | C# |
using MBBSEmu.Converters;
using MBBSEmu.Module;
using MBBSEmu.Resources;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using Xunit;
namespace MBBSEmu.Tests.Module
{
/// <summary>
/// Tests Proper Deserialization of a Modules Configuration JSON File
/// </summary>
public class ModuleConfigFile_Tests : TestBase
{
[Fact]
public void Module_Single_NoPatch()
{
var options = new JsonSerializerOptions
{
Converters = { new JsonBooleanConverter() }
};
var resourceManager = ResourceManager.GetTestResourceManager();
var jsonToDeserialize = resourceManager.GetString("MBBSEmu.Tests.Assets.Module_Single_NoPatch.json");
var result = JsonSerializer.Deserialize<ModuleConfigurationFile>(jsonToDeserialize, options);
Assert.NotNull(result);
Assert.Single(result.Modules);
var module = result.Modules[0];
Assert.Equal("MBBSEMU", module.ModuleIdentifier);
Assert.Equal(@"c:\dos\modules\mbbsemu\", module.ModulePath);
Assert.True(module.ModuleEnabled);
Assert.Null(module.MenuOptionKey);
Assert.Null(module.Patches);
}
[Fact]
public void Module_Single_Patch()
{
var options = new JsonSerializerOptions
{
Converters = { new JsonBooleanConverter(), new JsonStringEnumConverter() }
};
var resourceManager = ResourceManager.GetTestResourceManager();
var jsonToDeserialize = resourceManager.GetString("MBBSEmu.Tests.Assets.Module_Single_Patch.json");
var result = JsonSerializer.Deserialize<ModuleConfigurationFile>(jsonToDeserialize, options);
Assert.NotNull(result);
Assert.Single(result.Modules);
var module = result.Modules[0];
Assert.Equal("MBBSEMU", module.ModuleIdentifier);
Assert.Equal(@"c:\dos\modules\mbbsemu\", module.ModulePath);
Assert.False(module.ModuleEnabled);
Assert.Null(module.MenuOptionKey);
Assert.Single(module.Patches);
var patch = module.Patches.First();
Assert.Equal("Test Patch 1", patch.Name);
Assert.Equal("Patch 1 for a Unit Test", patch.Description);
Assert.Equal((uint)200, patch.AbsoluteOffset);
Assert.Equal(ModulePatch.EnumModulePatchType.Hex, patch.PatchType);
Assert.Equal("000102030405", patch.Patch);
Assert.Equal(new byte[] { 0, 1, 2, 3, 4, 5 }, patch.GetBytes().ToArray());
}
[Fact]
public void Module_Multiple_NoPatch()
{
var options = new JsonSerializerOptions
{
Converters = { new JsonBooleanConverter() }
};
var resourceManager = ResourceManager.GetTestResourceManager();
var jsonToDeserialize = resourceManager.GetString("MBBSEmu.Tests.Assets.Module_Multiple_NoPatch.json");
var result = JsonSerializer.Deserialize<ModuleConfigurationFile>(jsonToDeserialize, options);
Assert.NotNull(result);
Assert.Equal(2, result.Modules.Count);
var module1 = result.Modules[0];
Assert.Equal("MBBSEMU", module1.ModuleIdentifier);
Assert.Equal(@"c:\dos\modules\mbbsemu\", module1.ModulePath);
Assert.True(module1.ModuleEnabled);
Assert.Null(module1.MenuOptionKey);
Assert.Null(module1.Patches);
var module2 = result.Modules[1];
Assert.Equal("MBBSEMU2", module2.ModuleIdentifier);
Assert.Equal(@"c:\dos\modules\mbbsemu2\", module2.ModulePath);
Assert.False(module2.ModuleEnabled);
Assert.Equal("A", module2.MenuOptionKey);
Assert.Null(module2.Patches);
}
[Fact]
public void Module_Multiple_Patch()
{
var options = new JsonSerializerOptions
{
Converters = { new JsonBooleanConverter(), new JsonStringEnumConverter() }
};
var resourceManager = ResourceManager.GetTestResourceManager();
var jsonToDeserialize = resourceManager.GetString("MBBSEmu.Tests.Assets.Module_Multiple_Patch.json");
var result = JsonSerializer.Deserialize<ModuleConfigurationFile>(jsonToDeserialize, options);
Assert.NotNull(result);
Assert.Equal(2, result.Modules.Count);
var module1 = result.Modules[0];
Assert.Equal("MBBSEMU", module1.ModuleIdentifier);
Assert.Equal(@"c:\dos\modules\mbbsemu\", module1.ModulePath);
Assert.True(module1.ModuleEnabled);
Assert.Equal("1", module1.MenuOptionKey);
Assert.Single(module1.Patches);
var patch = module1.Patches.First();
Assert.Equal("Test Patch 1", patch.Name);
Assert.Equal("Patch 1 for a Unit Test", patch.Description);
Assert.Equal((uint)200, patch.AbsoluteOffset);
Assert.Equal(ModulePatch.EnumModulePatchType.Hex, patch.PatchType);
Assert.Equal("000102030405", patch.Patch);
Assert.Equal(new byte[] { 0, 1, 2, 3, 4, 5 }, patch.GetBytes().ToArray());
var module2 = result.Modules[1];
Assert.Equal("MBBSEMU2", module2.ModuleIdentifier);
Assert.Equal(@"c:\dos\modules\mbbsemu2\", module2.ModulePath);
Assert.False(module2.ModuleEnabled);
Assert.Null(module2.MenuOptionKey);
Assert.Single(module2.Patches);
var patch2 = module2.Patches.First();
Assert.Equal("Test Patch 2", patch2.Name);
Assert.Equal("Patch 2 for a Unit Test", patch2.Description);
Assert.Equal((uint)100, patch2.AbsoluteOffset);
Assert.Equal(ModulePatch.EnumModulePatchType.Text, patch2.PatchType);
Assert.Equal("TEST PATCH", patch2.Patch);
Assert.Equal(Encoding.ASCII.GetBytes("TEST PATCH"), patch2.GetBytes().ToArray());
}
}
}
| 40.496732 | 115 | 0.620884 | [
"MIT"
] | ftoledo/MBBSEmu | MBBSEmu.Tests/Module/ModuleConfigFile_Tests.cs | 6,198 | C# |
// OsmSharp - OpenStreetMap (OSM) SDK
// Copyright (C) 2013 Abelshausen Ben
//
// This file is part of OsmSharp.
//
// OsmSharp is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.
//
// OsmSharp is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with OsmSharp. If not, see <http://www.gnu.org/licenses/>.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OsmSharp.Osm;
namespace OsmSharp.Osm.Streams.ChangeSets
{
/// <summary>
/// A changeset filter.
/// </summary>
public abstract class DataProcessorChangeSetFilter : DataProcessorChangeSetSource
{
/// <summary>
/// The source.
/// </summary>
private DataProcessorChangeSetSource _source;
/// <summary>
/// Creates a new data processor changeset filter.
/// </summary>
protected DataProcessorChangeSetFilter()
{
}
/// <summary>
/// The source this filter is filtering from.
/// </summary>
protected DataProcessorChangeSetSource Source
{
get
{
return _source;
}
}
/// <summary>
/// Initializes the filter.
/// </summary>
public abstract override void Initialize();
/// <summary>
/// Moves to the next changeset.
/// </summary>
/// <returns></returns>
public abstract override bool MoveNext();
/// <summary>
/// Returns the current changeset.
/// </summary>
/// <returns></returns>
public abstract override ChangeSet Current();
/// <summary>
/// Registers a changeset source.
/// </summary>
/// <param name="source"></param>
public void RegisterSource(DataProcessorChangeSetSource source)
{
_source = source;
}
}
}
| 28.621951 | 85 | 0.606306 | [
"Apache-2.0"
] | fakit/OSM-AutoCAD | Mustern/core-releases-v1.3/OsmSharp.Osm/Streams/ChangeSets/DataProcessorChangeSetFilter.cs | 2,349 | C# |
using System;
using System.Collections.Generic;
using System.IO;
using Exceptionless.Dependency;
using Exceptionless.Extensions;
using Exceptionless.Models;
using Exceptionless.Utility;
namespace Exceptionless.Storage {
public class FolderObjectStorage : IObjectStorage {
private readonly object _lockObject = new object();
private readonly IDependencyResolver _resolver;
public FolderObjectStorage(IDependencyResolver resolver, string folder) {
_resolver = resolver;
folder = PathHelper.ExpandPath(folder);
if (!Path.IsPathRooted(folder))
folder = Path.GetFullPath(folder);
if (!folder.EndsWith(Path.DirectorySeparatorChar.ToString()) && !folder.EndsWith(Path.AltDirectorySeparatorChar.ToString()))
folder += Path.DirectorySeparatorChar;
Folder = folder;
if (!Directory.Exists(folder))
Directory.CreateDirectory(folder);
}
public string Folder { get; set; }
public T GetObject<T>(string path) where T : class {
if (String.IsNullOrEmpty(path))
throw new ArgumentNullException("path");
try {
using (var reader = File.OpenRead(Path.Combine(Folder, path))) {
return _resolver.GetStorageSerializer().Deserialize<T>(reader);
}
} catch (Exception ex) {
_resolver.GetLog().Error(ex.Message, exception: ex);
return null;
}
}
public ObjectInfo GetObjectInfo(string path) {
var info = new System.IO.FileInfo(path);
if (!info.Exists)
return null;
return new ObjectInfo {
Path = path.Replace(Folder, String.Empty),
Created = info.CreationTime,
Modified = info.LastWriteTime
};
}
public bool Exists(string path) {
return File.Exists(Path.Combine(Folder, path));
}
public bool SaveObject<T>(string path, T value) where T : class {
if (String.IsNullOrEmpty(path))
throw new ArgumentNullException("path");
try {
string directory = Path.GetDirectoryName(Path.Combine(Folder, path));
if (!Directory.Exists(directory))
Directory.CreateDirectory(directory);
using (var writer = File.Open(Path.Combine(Folder, path), FileMode.Create)) {
_resolver.GetStorageSerializer().Serialize(value, writer);
}
} catch (Exception ex) {
_resolver.GetLog().Error(ex.Message, exception: ex);
return false;
}
return true;
}
public bool RenameObject(string oldpath, string newpath) {
if (String.IsNullOrEmpty(oldpath))
throw new ArgumentNullException("oldpath");
if (String.IsNullOrEmpty(newpath))
throw new ArgumentNullException("newpath");
try {
lock (_lockObject) {
File.Move(Path.Combine(Folder, oldpath), Path.Combine(Folder, newpath));
}
} catch (Exception ex) {
_resolver.GetLog().Error(ex.Message, exception: ex);
return false;
}
return true;
}
public bool DeleteObject(string path) {
if (String.IsNullOrEmpty(path))
throw new ArgumentNullException("path");
try {
File.Delete(Path.Combine(Folder, path));
} catch (Exception ex) {
_resolver.GetLog().Error(ex.Message, exception: ex);
return false;
}
return true;
}
public IEnumerable<ObjectInfo> GetObjectList(string searchPattern = null, int? limit = null, DateTime? maxCreatedDate = null) {
if (String.IsNullOrEmpty(searchPattern))
searchPattern = "*";
if (!maxCreatedDate.HasValue)
maxCreatedDate = DateTime.MaxValue;
var list = new List<ObjectInfo>();
try {
foreach (var path in Directory.EnumerateFiles(Folder, searchPattern, SearchOption.AllDirectories)) {
var info = new System.IO.FileInfo(path);
if (!info.Exists || info.CreationTime > maxCreatedDate)
continue;
list.Add(new ObjectInfo {
Path = path.Replace(Folder, String.Empty),
Created = info.CreationTime,
Modified = info.LastWriteTime
});
if (list.Count == limit)
break;
}
} catch (DirectoryNotFoundException) {
} catch (Exception ex) {
_resolver.GetLog().Error(ex.Message, exception: ex);
}
return list;
}
public void Dispose() {}
}
} | 34.641892 | 136 | 0.542618 | [
"Apache-2.0"
] | aTiKhan/Exceptionless.Net | src/Exceptionless/Storage/FolderObjectStorage.cs | 5,129 | C# |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
using System;
using System.Collections.Generic;
using Aliyun.Acs.Core.Transform;
using Aliyun.Acs.Ecs.Model.V20140526;
namespace Aliyun.Acs.Ecs.Transform.V20140526
{
public class DescribeCapacityReservationInstancesResponseUnmarshaller
{
public static DescribeCapacityReservationInstancesResponse Unmarshall(UnmarshallerContext _ctx)
{
DescribeCapacityReservationInstancesResponse describeCapacityReservationInstancesResponse = new DescribeCapacityReservationInstancesResponse();
describeCapacityReservationInstancesResponse.HttpResponse = _ctx.HttpResponse;
describeCapacityReservationInstancesResponse.NextToken = _ctx.StringValue("DescribeCapacityReservationInstances.NextToken");
describeCapacityReservationInstancesResponse.RequestId = _ctx.StringValue("DescribeCapacityReservationInstances.RequestId");
describeCapacityReservationInstancesResponse.TotalCount = _ctx.IntegerValue("DescribeCapacityReservationInstances.TotalCount");
describeCapacityReservationInstancesResponse.MaxResults = _ctx.IntegerValue("DescribeCapacityReservationInstances.MaxResults");
List<DescribeCapacityReservationInstancesResponse.DescribeCapacityReservationInstances_InstanceIdSet> describeCapacityReservationInstancesResponse_capacityReservationItem = new List<DescribeCapacityReservationInstancesResponse.DescribeCapacityReservationInstances_InstanceIdSet>();
for (int i = 0; i < _ctx.Length("DescribeCapacityReservationInstances.CapacityReservationItem.Length"); i++) {
DescribeCapacityReservationInstancesResponse.DescribeCapacityReservationInstances_InstanceIdSet instanceIdSet = new DescribeCapacityReservationInstancesResponse.DescribeCapacityReservationInstances_InstanceIdSet();
instanceIdSet.InstanceId = _ctx.StringValue("DescribeCapacityReservationInstances.CapacityReservationItem["+ i +"].InstanceId");
describeCapacityReservationInstancesResponse_capacityReservationItem.Add(instanceIdSet);
}
describeCapacityReservationInstancesResponse.CapacityReservationItem = describeCapacityReservationInstancesResponse_capacityReservationItem;
return describeCapacityReservationInstancesResponse;
}
}
}
| 57.961538 | 285 | 0.828799 | [
"Apache-2.0"
] | aliyun/aliyun-openapi-net-sdk | aliyun-net-sdk-ecs/Ecs/Transform/V20140526/DescribeCapacityReservationInstancesResponseUnmarshaller.cs | 3,014 | C# |
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
namespace Juxtapose.Test.RunningHost
{
internal class Program
{
#region Private 方法
private static async Task Main(string[] args)
{
if (!Debugger.IsAttached)
{
//Debugger.Launch();
}
//GreeterJuxtaposeContext.SharedInstance.FastSetFileLoggerFactory(LogLevel.Trace);
GreeterJuxtaposeContext.SharedInstance.UnSetConsoleLoggerFactory();
await JuxtaposeEntryPoint.AsEndpointAsync(args);
}
#endregion Private 方法
}
} | 24.884615 | 94 | 0.638331 | [
"MIT"
] | StratosBlue/Juxtapose | test/Juxtapose.Test.RunningHost/Program.cs | 657 | C# |
using System;
namespace _03_Exact_Sum_Of_Real_Numbers
{
class Program
{
static void Main(string[] args)
{
decimal sum = 0m;
int repeats = int.Parse(Console.ReadLine());
for (int i = 0; i < repeats; i++)
{
sum += decimal.Parse(Console.ReadLine());
}
Console.WriteLine(sum);
}
}
}
| 16.421053 | 47 | 0.628205 | [
"MIT"
] | alchemistbg/Software-University | 02-Tech-Module/01-Programming-Fundamentals/03-Data-Types-and-Variables/01-Lab/03_Exact_Sum_Of_Real_Numbers/Program.cs | 314 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AirTrafficControl_Sela_IG.Data;
using AirTrafficControl_Sela_IG.Models;
using AirTrafficControl_Sela_IG.RepositoryNamespace;
using AirTrafficControl_Sela_IG.Services;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using AirTrafficControl_Sela_IG.Hubs;
namespace AirTrafficControl_Sela_IG
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
services.AddTransient<IRepository, Repository>();
services.AddTransient<IDispatcher, Dispatcher>();
services.AddTransient<IBusinessLogic, BusinessLogic>();
services.AddHostedService<ConsumeScopedDispatchService>();
services.AddHostedService<ConsumeScopedMovementService>();
services.AddScoped<IScopedProcessingService, DetermineNextDispatch>();
services.AddScoped<IScopedProcessingServ, DetermineNextMovementInAirbornFlights>();
services.AddDbContext<FlightsDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
services.AddSignalR();
services.AddControllersWithViews();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
}
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
endpoints.MapHub<AirbornFlightsHub>("/flightcontroltable");
});
}
}
}
| 33.356164 | 96 | 0.637782 | [
"MIT"
] | ItaiGall/Webservice | AirTrafficControl_Sela_IG/Startup.cs | 2,435 | C# |
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.HttpsPolicy;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.OpenApi.Models;
using SeturDirectoryApp.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace SeturDirectoryApp
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers();
services.AddSwaggerGen(c =>
{
c.SwaggerDoc("v1", new OpenApiInfo { Title = "SeturDirectoryApp", Version = "v1" });
});
var ConnectionString = Configuration.GetConnectionString("con");
services.AddDbContext<mytestdbContext>(options =>
options.UseSqlServer(ConnectionString)
);
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseSwagger();
app.UseSwaggerUI(c => c.SwaggerEndpoint("/swagger/v1/swagger.json", "SeturDirectoryApp v1"));
}
app.UseHttpsRedirection();
app.UseRouting();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
}
}
| 30.969697 | 109 | 0.6409 | [
"Apache-2.0"
] | hilalyldrm/assessment-backend-net | SeturDirectoryApp/SeturDirectoryApp/Startup.cs | 2,044 | C# |
using System;
using System.Reflection;
using System.Diagnostics;
namespace Bytewizer.TinyCLR.Terminal
{
/// <summary>
/// A descriptor for an action of a command.
/// </summary>
[DebuggerDisplay("{DisplayName}")]
public class CommandActionDescriptor : ActionDescriptor
{
/// <summary>
/// The <see cref="MethodInfo"/>.
/// </summary>
public MethodInfo MethodInfo { get; set; }
/// <summary>
/// The friendly name of the command.
/// </summary>
public virtual string CommandName { get; set; }
/// <summary>
/// The friendly name of the action.
/// </summary>
public virtual string ActionName { get; set; }
/// <inheritdoc />
public override string DisplayName
{
get
{
if (base.DisplayName == null && MethodInfo != null)
{
base.DisplayName = $"{MethodInfo.Name}";
}
return base.DisplayName;
}
set
{
if (value == null)
{
throw new ArgumentNullException(nameof(value));
}
base.DisplayName = value;
}
}
}
} | 25.096154 | 67 | 0.482759 | [
"MIT"
] | bytewizer/microserver | src/Bytewizer.TinyCLR.Terminal/Commands/CommandActionDescriptor.cs | 1,307 | C# |
using EconomiKids.Domain.SeedWork;
using System;
using System.Threading.Tasks;
namespace EconomiKids.Domain.AggregatesModel.PiggyBankAggregate
{
/// <summary>
/// Repository for Piggy Bank
/// </summary>
public interface IPiggyBankRepository : IRepository<PiggyBank>
{
/// <summary>
/// Persist the new piggy bank
/// </summary>
/// <param name="piggyBank">Piggy bank instance</param>
/// <returns>Piggy bank after been persisted</returns>
Task<PiggyBank> AddAsync(PiggyBank piggyBank);
/// <summary>
/// Persist the piggy bank changes
/// </summary>
/// <param name="piggyBank">Piggy bank instance</param>
/// <returns></returns>
Task UpdateAsync(PiggyBank piggyBank);
/// <summary>
/// Get a piggy bank by identifier
/// </summary>
/// <param name="piggyBanckId">Piggy banck identifier</param>
/// <returns>Located piggy bank</returns>
Task<PiggyBank> GetAsync(Guid piggyBanckId);
}
} | 32.060606 | 69 | 0.615312 | [
"MIT"
] | rafaelbaade/EconomiKids | src/EconomiKids.Domain/AggregatesModel/PiggyBankAggregate/IPiggyBankRepository.cs | 1,060 | C# |
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Umbraco.Core.Models;
using UmbracoLinqPad.Models;
namespace UmbracoLinqPad.Gateway.Models
{
public class ContentCollection<TGeneratedContent> : ContentCollectionBase<TGeneratedContent, IContentType, IContent>
where TGeneratedContent : IGeneratedContentBase
{
public ContentCollection(UmbracoDataContext dataContext, string contentTypeAlias)
: base(dataContext, contentTypeAlias)
{
}
protected override IContentType GetContentType(string contentTypeAlias)
{
return DataContext.ApplicationContext.Services.ContentTypeService.GetContentType(contentTypeAlias);
}
protected override IEnumerable<IContent> GetContentOfContentType(int contentTypeId)
{
return DataContext.ApplicationContext.Services.ContentService.GetContentOfContentType(contentTypeId);
}
protected override T FromContent<T>(Type genType, IContent content)
{
return ModelMapper.FromIContent<T>(genType, content);
}
protected override string GetGeneratedTypeName(string contentTypeAlias)
{
return "Umbraco.Generated.Content_" + contentTypeAlias;
}
}
} | 32.707317 | 120 | 0.721104 | [
"MIT"
] | Shazwazza/UmbracoLinqPadDriver | UmbracoLinqPad.Gateway/Models/ContentCollection.cs | 1,343 | C# |
#pragma checksum "D:\CodingWork\Projects\NongMinGoProject\SimplCommerce\src\Modules\SimplCommerce.Module.PaymentBraintree\Areas\PaymentBraintree\Views\Shared\Components\BraintreeLanding\Default.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "16462cf119718d6a307f612aac65ac6a0a5f1f09"
// <auto-generated/>
#pragma warning disable 1591
[assembly: global::Microsoft.AspNetCore.Razor.Hosting.RazorCompiledItemAttribute(typeof(AspNetCore.Areas_PaymentBraintree_Views_Shared_Components_BraintreeLanding_Default), @"mvc.1.0.view", @"/Areas/PaymentBraintree/Views/Shared/Components/BraintreeLanding/Default.cshtml")]
namespace AspNetCore
{
#line hidden
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
#nullable restore
#line 1 "D:\CodingWork\Projects\NongMinGoProject\SimplCommerce\src\Modules\SimplCommerce.Module.PaymentBraintree\Areas\PaymentBraintree\Views\_ViewImports.cshtml"
using Microsoft.AspNetCore.Identity;
#line default
#line hidden
#nullable disable
#nullable restore
#line 2 "D:\CodingWork\Projects\NongMinGoProject\SimplCommerce\src\Modules\SimplCommerce.Module.PaymentBraintree\Areas\PaymentBraintree\Views\_ViewImports.cshtml"
using Microsoft.AspNetCore.Mvc.Localization;
#line default
#line hidden
#nullable disable
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"16462cf119718d6a307f612aac65ac6a0a5f1f09", @"/Areas/PaymentBraintree/Views/Shared/Components/BraintreeLanding/Default.cshtml")]
[global::Microsoft.AspNetCore.Razor.Hosting.RazorSourceChecksumAttribute(@"SHA1", @"252a5853f5646565b6d19f2f67b215e8a2ab4af3", @"/Areas/PaymentBraintree/Views/_ViewImports.cshtml")]
public class Areas_PaymentBraintree_Views_Shared_Components_BraintreeLanding_Default : global::Microsoft.AspNetCore.Mvc.Razor.RazorPage<SimplCommerce.Module.PaymentBraintree.Areas.PaymentBraintree.ViewModels.BraintreeCheckoutForm>
{
#pragma warning disable 1998
public async override global::System.Threading.Tasks.Task ExecuteAsync()
{
WriteLiteral(@"
<label>Braintree</label>
<div class=""form-group"">
<div class=""col-md-12"">
<button type=""button"" class=""btn btn-order"" data-toggle=""modal"" data-target=""#braintreeModal"">Pay with Braintree</button>
</div>
</div>
<!-- Trigger the modal with a button -->
<!-- Modal -->
<div id=""braintreeModal"" class=""modal fade"" role=""dialog"">
<div class=""modal-dialog"">
<!-- Modal content-->
<div class=""modal-content"">
<div class=""modal-body"">
<div class=""alert alert-success alert-dismissible"" style='display:none;'>
<span id=""alertBraintree""></span>
<button data-dismiss=""alert"" type=""button"" class=""close"" aria-label=""Close"">
<span aria-hidden=""true"">×</span>
</button>
</div>
<div id=""dropin-container""></div>
<button id=""braintree-submit-button"" class=""btn btn-order"">Pay</button>
</div>
");
WriteLiteral(@" <div class=""modal-footer"">
<button type=""button"" class=""btn btn-default"" data-dismiss=""modal"">Close</button>
</div>
</div>
</div>
</div>
<script src=""https://js.braintreegateway.com/web/dropin/1.14.1/js/dropin.min.js""></script>
<script>
var button = document.querySelector('#braintree-submit-button');
var client_token = """);
#nullable restore
#line 38 "D:\CodingWork\Projects\NongMinGoProject\SimplCommerce\src\Modules\SimplCommerce.Module.PaymentBraintree\Areas\PaymentBraintree\Views\Shared\Components\BraintreeLanding\Default.cshtml"
Write(Model.ClientToken);
#line default
#line hidden
#nullable disable
WriteLiteral(@""";
braintree.dropin.create({
authorization: client_token,
container: '#dropin-container'
}, function (createErr, instance) {
button.addEventListener('click', function () {
instance.requestPaymentMethod(function (requestPaymentMethodErr, payload) {
var request = $.ajax({
type: 'POST',
url: '");
#nullable restore
#line 47 "D:\CodingWork\Projects\NongMinGoProject\SimplCommerce\src\Modules\SimplCommerce.Module.PaymentBraintree\Areas\PaymentBraintree\Views\Shared\Components\BraintreeLanding\Default.cshtml"
Write(Url.Action("Charge", "Braintree", new { Area = "PaymentBraintree" }));
#line default
#line hidden
#nullable disable
WriteLiteral(@"',
data: { nonce: payload.nonce }
})
.done(function (data) {
window.location = ""/checkout/success?orderId=""+ data.orderId;
})
.fail(function (errors) {
$('#alertBraintree').html(errors.responseText);
$('.alert').toggle()
console.log(errors.responseText);
})
.always(function () { });
});
});
});
</script>
");
}
#pragma warning restore 1998
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public IViewLocalizer Localizer { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.ViewFeatures.IModelExpressionProvider ModelExpressionProvider { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.IUrlHelper Url { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.IViewComponentHelper Component { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IJsonHelper Json { get; private set; }
[global::Microsoft.AspNetCore.Mvc.Razor.Internal.RazorInjectAttribute]
public global::Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<SimplCommerce.Module.PaymentBraintree.Areas.PaymentBraintree.ViewModels.BraintreeCheckoutForm> Html { get; private set; }
}
}
#pragma warning restore 1591
| 50.022556 | 285 | 0.677288 | [
"Apache-2.0"
] | Coopathon2019/03_NongMinGo | src/Modules/SimplCommerce.Module.PaymentBraintree/obj/Debug/netcoreapp3.0/Razor/Areas/PaymentBraintree/Views/Shared/Components/BraintreeLanding/Default.cshtml.g.cs | 6,653 | C# |
using System;
using Xamarin.Forms;
namespace ScaleAndRotate
{
class RotationYDemoPage : ContentPage
{
public RotationYDemoPage ()
{
this.Title = "RotationY";
// Label to be transformed.
Label label = new Label {
Text = "ROTATIONY",
FontSize = 50,
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.CenterAndExpand
};
// Label and Slider for RotationY property.
Label rotationSliderValue = new Label {
VerticalTextAlignment = TextAlignment.Center
};
Grid.SetRow (rotationSliderValue, 0);
Grid.SetColumn (rotationSliderValue, 0);
Slider rotationSlider = new Slider {
Maximum = 360
};
Grid.SetRow (rotationSlider, 0);
Grid.SetColumn (rotationSlider, 1);
// Set Bindings.
rotationSliderValue.BindingContext = rotationSlider;
rotationSliderValue.SetBinding (Label.TextProperty,
new Binding ("Value", BindingMode.OneWay,
null, null, "RotationY = {0:F0}\u00B0"));
rotationSlider.BindingContext = label;
rotationSlider.SetBinding (Slider.ValueProperty,
new Binding ("RotationY", BindingMode.TwoWay));
// Label and Slider for AnchorX property.
Label anchorxStepperValue = new Label {
VerticalTextAlignment = TextAlignment.Center
};
Grid.SetRow (anchorxStepperValue, 1);
Grid.SetColumn (anchorxStepperValue, 0);
Stepper anchorxStepper = new Stepper {
Maximum = 2,
Minimum = -1,
Increment = 0.5
};
Grid.SetRow (anchorxStepper, 1);
Grid.SetColumn (anchorxStepper, 1);
// Set bindings.
anchorxStepperValue.BindingContext = anchorxStepper;
anchorxStepperValue.SetBinding (Label.TextProperty,
new Binding ("Value", BindingMode.OneWay,
null, null, "AnchorX = {0:F1}"));
anchorxStepper.BindingContext = label;
anchorxStepper.SetBinding (Stepper.ValueProperty,
new Binding ("AnchorX", BindingMode.TwoWay));
// Label and Slider for AnchorY property.
Label anchoryStepperValue = new Label {
VerticalTextAlignment = TextAlignment.Center
};
Grid.SetRow (anchoryStepperValue, 2);
Grid.SetColumn (anchoryStepperValue, 0);
Stepper anchoryStepper = new Stepper {
Maximum = 2,
Minimum = -1,
Increment = 0.5
};
Grid.SetRow (anchoryStepper, 2);
Grid.SetColumn (anchoryStepper, 1);
// Set bindings.
anchoryStepperValue.BindingContext = anchoryStepper;
anchoryStepperValue.SetBinding (Label.TextProperty,
new Binding ("Value", BindingMode.OneWay,
null, null, "AnchorY = {0:F1}"));
anchoryStepper.BindingContext = label;
anchoryStepper.SetBinding (Stepper.ValueProperty,
new Binding ("AnchorY", BindingMode.TwoWay));
// Assemble the page.
this.Content = new StackLayout {
Children = {
label,
new Grid {
Padding = 10,
RowDefinitions = {
new RowDefinition { Height = GridLength.Auto },
new RowDefinition { Height = GridLength.Auto },
new RowDefinition { Height = GridLength.Auto }
},
ColumnDefinitions = {
new ColumnDefinition { Width = new GridLength (0.5, GridUnitType.Star) },
new ColumnDefinition { Width = new GridLength (0.5, GridUnitType.Star) }
},
Children = {
rotationSliderValue,
rotationSlider,
anchorxStepperValue,
anchorxStepper,
anchoryStepperValue,
anchoryStepper
}
}
}
};
}
}
}
| 27.934959 | 101 | 0.672293 | [
"Apache-2.0"
] | 15217711253/xamarin-forms-samples | ScaleAndRotate/ScaleAndRotate/ScaleAndRotate/RotationYDemoPage.cs | 3,438 | C# |
using BeatThat.Rects;
using BeatThat.TransformPathExt;
using UnityEngine;
using UnityEngine.UI;
namespace BeatThat.ScrollLists
{
/// <summary>
/// Adjust scroll position of a scrolling list so that (some point between)
/// the center of two items aligns with the center of the viewport.
///
/// This can be better for smooth scrolling along with a playback function
/// because it makes it easier to accomadate for both uneven 'time' values of each row
/// as well as variable margin spaces between items.
/// </summary>
public class CenterOn : MonoBehaviour
{
[Tooltip("Avg time is should take to reach scroll target")]
public float m_smoothTime = 0.1f;
[Tooltip("When smooth scrolling, and distance to target falls below this threshold, clamp")]
public float m_clampThreshold = 0.001f;
public ScrollRect m_scrollRect;
public bool m_debug;
public void ScrollToBeginning(bool snap = false)
{
ScrollTo (Vector2.one, snap);
}
/// <summary>
/// Adjust scroll position of a scrolling list so that the given item is at the center of the viewport.
///
/// <param name="item">The RectTransform of the item to center on</param>
/// <param name="snap">If TRUE, the snaps to target position, if FALSE may smooth damp to the target positon of several frames. Default is snap=FALSE</param>
public void Center(Transform item, bool snap = false)
{
if(item == null) {
if(m_debug) {
Debug.LogWarning("[" + Time.frameCount + "][" + this.Path() + "] " + GetType() + " Center called with null");
}
return;
}
var itemRT = item as RectTransform;
if(itemRT == null) {
Debug.LogWarning("CenterOn works only on RectTransform. Call on invalid " + item.Path());
return;
}
var scRect = this.scrollRect;
var contentRect = scRect.content.rect;
var vpRectInContentSpace = scRect.content.InverseTransformRect(scRect.GetViewport());
// what distance in x and y is the scroll rect capable of scrolling...?
var totalScrollDist = new Vector2(
scRect.horizontal? contentRect.width - vpRectInContentSpace.width: 0f,
scRect.vertical ? contentRect.height - vpRectInContentSpace.height: 0f
);
// if the scroll rect can't scroll at all (content is smaller than the viewport), bail out
if(totalScrollDist.x <= 0f && totalScrollDist.y <= 0f) {
if(m_debug) {
Debug.LogWarning("[" + Time.frameCount + "][" + this.Path() + "] " + GetType() + " total scroll dist is non positive");
}
return;
}
// what is the scroll position (in content-rect space) to center the item
var tgtScrollContentSpace = CalcScrollToCenterOf(vpRectInContentSpace, itemRT);
var curScroll = scRect.normalizedPosition;
// convert the above to normalized values
ScrollTo(new Vector2(
totalScrollDist.x > 0f? Mathf.Clamp01(tgtScrollContentSpace.x / totalScrollDist.x): curScroll.x,
totalScrollDist.y > 0f? Mathf.Clamp01(tgtScrollContentSpace.y / totalScrollDist.y): curScroll.y
), snap);
}
private void ScrollTo(Vector2 tgt, bool snap = false)
{
// convert the above to normalized values
m_scrollTgt = tgt;
if(m_debug) {
Debug.LogWarning("[" + Time.frameCount + "][" + this.Path() + "] " + GetType() + " set scroll target to " + m_scrollTgt);
}
if(snap) {
this.scrollRect.normalizedPosition = m_scrollTgt;
m_scrollVelocity = Vector3.zero;
return;
}
this.enabled = true;
}
private Vector2 CalcScrollToCenterOf(Rect vpRectInContentSpace, RectTransform item)
{
var scRect = this.scrollRect;
var contentRect = scRect.content.rect;
var itemRectInContentSpace = scRect.content.InverseTransformRect(item);
var itemPos = itemRectInContentSpace.center - contentRect.min; // TODO: not sure this is right to always use bottom-left corner?
return itemPos - new Vector2((vpRectInContentSpace.width / 2f), (vpRectInContentSpace.height / 2f));
}
void Awake()
{
if(m_scrollRect == null) { m_scrollRect = GetComponent<ScrollRect>(); }
this.enabled = false;
}
void LateUpdate()
{
var scRect = this.scrollRect;
var curPos = scRect.normalizedPosition;
var newPos = Vector2.SmoothDamp(curPos, m_scrollTgt, ref m_scrollVelocity, m_smoothTime, float.MaxValue, Time.unscaledDeltaTime);
if(!scRect.horizontal) {
newPos.x = curPos.x;
}
if(!scRect.vertical) {
newPos.y = curPos.y;
}
var dist = Vector3.Distance (curPos, newPos);
if(dist > m_clampThreshold) {
this.scrollRect.normalizedPosition = newPos;
return;
}
newPos = m_scrollTgt;
m_scrollVelocity = Vector2.zero;
this.scrollRect.normalizedPosition = newPos;
this.enabled = false;
}
private ScrollRect scrollRect { get { return m_scrollRect?? (m_scrollRect = GetComponent<ScrollRect>()); } }
private Vector2 m_scrollVelocity = Vector3.zero;
private Vector2 m_scrollTgt = Vector2.zero;
}
}
| 31.987013 | 159 | 0.693869 | [
"MIT"
] | beatthat/scroll-lists | Runtime/scroll-lists/CenterOn.cs | 4,926 | C# |
using System;
using System.Collections.Generic;
using System.Linq;
using Mews.Eet.Dto.Wsdl;
namespace Mews.Eet.Dto
{
public class SendRevenueResult
{
internal SendRevenueResult(SendRevenueXmlResponse response)
{
var confirmation = response.Item as ResponseSuccess;
var rejection = response.Item as ResponseError;
var date = confirmation != null ? response.Header.Accepted : response.Header.Rejected;
Id = String.IsNullOrWhiteSpace(response.Header.MessageUuid) ? (Guid?)null : Guid.Parse(response.Header.MessageUuid);
Issued = new DateTimeWithTimeZone(date.ToUniversalTime(), TimeZoneInfo.Utc);
SecurityCode = response.Header.SecurityCode;
Success = confirmation != null ? new SendRevenueSuccess(confirmation.FiscalCode) : null;
Error = rejection != null ? new SendRevenueError(new Fault(
code: rejection.Code,
message: String.Join("\n", rejection.Text)
)) : null;
IsPlayground = confirmation != null ? confirmation.IsPlaygroundSpecified && confirmation.IsPlayground : rejection.IsPlaygroundSpecified && rejection.IsPlayground;
Warnings = GetWarnings(response.Warning);
}
public Guid? Id { get; }
public bool IsPlayground { get; }
public DateTimeWithTimeZone Issued { get; }
public string SecurityCode { get; }
public bool IsSuccess
{
get { return Success != null; }
}
public SendRevenueSuccess Success { get; }
public bool IsError
{
get { return Error != null; }
}
public SendRevenueError Error { get; }
public IEnumerable<Fault> Warnings { get; }
private static IEnumerable<Fault> GetWarnings(ResponseWarning[] warnings)
{
if (warnings == null)
{
return Enumerable.Empty<Fault>();
}
return warnings.Select(w => new Fault(w.Code, String.Join("\n", w.Text)));
}
}
}
| 33.253968 | 174 | 0.612411 | [
"MIT"
] | MewsSystems/fiscalization-czechia | src/Mews.Fiscalization.Czechia/Dto/SendRevenueResult.cs | 2,097 | C# |
using System;
using System.IO;
using LanguageExt;
using LiteDB;
using MilkBottle.Infrastructure.Interfaces;
using MilkBottle.Interfaces;
namespace MilkBottle.Database {
class DatabaseProvider : IDatabaseProvider {
private readonly IEnvironment mEnvironment;
private readonly IApplicationConstants mApplicationConstants;
private LiteDatabase mDatabase;
public DatabaseProvider( IEnvironment environment, IApplicationConstants constants ) {
mEnvironment = environment;
mApplicationConstants = constants;
}
public Either<Exception, LiteDatabase> GetDatabase() {
return Prelude.Try( () => mDatabase ?? ( mDatabase = new LiteDatabase( DatabasePath()))).ToEither();
}
private string DatabasePath() {
return Path.Combine( mEnvironment.DatabaseDirectory(), mApplicationConstants.DatabaseFileName );
}
public void Dispose() {
mDatabase?.Dispose();
mDatabase = null;
}
}
}
| 32.333333 | 112 | 0.655108 | [
"MIT"
] | bswanson58/NoiseMusicSystem | MilkBottle/Database/DatabaseProvider.cs | 1,069 | C# |
using FFImageLoading.Forms;
using System.IO;
using Xamarin.Forms;
namespace ULFG.Forms.Publications.Views
{
/// <summary>
/// <see cref="ContentPage"/> que muestra el detalle de una imagen a pantalla completa
/// </summary>
public class ImageDetail:ContentPage
{
public ImageDetail(byte[] img)
{
CachedImage content = new CachedImage()
{
Source = ImageSource.FromStream(() => { return new MemoryStream(img); }),
Aspect = Aspect.AspectFit,
HeightRequest = 600
};
Content = content;
}
}
}
| 26.375 | 90 | 0.567141 | [
"MIT"
] | DanielAlba96/ULFG | ULFGMobile/ULFG.Forms/Publications/Views/ImageDetail.cs | 635 | C# |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.